Skip to content

Instantly share code, notes, and snippets.

@gjportegies
Last active April 30, 2024 06:25
Show Gist options
  • Select an option

  • Save gjportegies/853754d9feb94db5f2e26a5772b44dbb to your computer and use it in GitHub Desktop.

Select an option

Save gjportegies/853754d9feb94db5f2e26a5772b44dbb to your computer and use it in GitHub Desktop.
ClaudeBot (ips)
13.58.112.1
13.58.121.131
13.58.137.218
13.58.150.59
13.58.216.18
13.58.244.216
13.58.247.31
13.58.252.8
13.58.39.23
13.58.60.192
13.58.77.98
13.59.122.162
13.59.130.130
13.59.136.170
13.59.195.118
13.59.218.147
13.59.231.155
13.59.243.194
13.59.34.87
13.59.36.203
13.59.61.119
13.59.82.167
18.116.118.198
18.116.13.113
18.116.239.195
18.116.24.105
18.116.28.22
18.116.36.221
18.116.40.177
18.116.40.47
18.116.40.53
18.116.42.208
18.116.51.117
18.116.62.45
18.116.63.174
18.116.8.110
18.116.85.72
18.116.90.141
18.117.105.28
18.117.107.90
18.117.111.1
18.117.137.64
18.117.142.128
18.117.142.248
18.117.152.251
18.117.153.38
18.117.158.47
18.117.165.66
18.117.182.179
18.117.183.150
18.117.186.92
18.117.188.64
18.117.189.7
18.117.196.184
18.117.196.217
18.117.216.229
18.117.216.36
18.117.70.132
18.117.72.224
18.117.76.7
18.117.81.240
18.117.91.153
18.118.0.240
18.118.1.158
18.118.1.232
18.118.102.225
18.118.12.101
18.118.120.109
18.118.120.204
18.118.138.223
18.118.144.69
18.118.145.114
18.118.150.80
18.118.164.121
18.118.164.151
18.118.171.20
18.118.184.237
18.118.2.15
18.118.200.136
18.118.200.197
18.118.200.86
18.118.210.213
18.118.226.105
18.118.30.253
18.118.32.213
18.118.45.162
18.118.9.146
18.118.9.7
18.119.104.238
18.119.111.9
18.119.118.99
18.119.125.7
18.119.131.178
18.119.132.223
18.119.133.228
18.119.133.96
18.119.135.202
18.119.136.235
18.119.139.104
18.119.139.50
18.119.159.150
18.119.172.146
18.119.213.235
18.119.253.93
18.188.10.246
18.188.108.54
18.188.142.146
18.188.152.162
18.188.168.28
18.188.175.182
18.188.20.56
18.188.218.184
18.188.241.82
18.188.252.23
18.188.40.207
18.188.61.223
18.189.14.219
18.189.180.244
18.189.180.76
18.189.2.122
18.189.22.136
18.190.152.38
18.190.156.212
18.190.159.10
18.190.217.134
18.190.219.65
18.191.102.112
18.191.132.194
18.191.135.224
18.191.147.190
18.191.157.186
18.191.171.20
18.191.171.235
18.191.174.168
18.191.181.231
18.191.186.72
18.191.189.85
18.191.195.110
18.191.202.45
18.191.21.86
18.191.211.66
18.191.216.163
18.191.223.123
18.191.228.88
18.191.234.62
18.191.236.174
18.191.239.123
18.191.240.243
18.191.43.140
18.191.44.23
18.191.5.239
18.191.84.32
18.216.121.55
18.216.123.120
18.216.124.8
18.216.186.164
18.216.190.167
18.216.209.112
18.216.230.107
18.216.233.58
18.216.239.211
18.216.251.37
18.216.32.116
18.216.34.146
18.216.83.240
18.216.94.152
18.217.108.11
18.217.109.151
18.217.116.183
18.217.144.32
18.217.158.184
18.217.182.45
18.217.203.172
18.217.208.72
18.217.210.147
18.217.220.114
18.217.228.35
18.217.4.206
18.217.6.114
18.217.60.35
18.217.67.16
18.217.8.82
18.218.129.100
18.218.168.16
18.218.169.50
18.218.172.249
18.218.184.214
18.218.196.182
18.218.209.8
18.218.218.230
18.218.234.83
18.218.254.122
18.218.38.125
18.218.48.62
18.218.55.14
18.218.61.16
18.218.70.93
18.219.14.63
18.219.189.247
18.219.22.169
18.219.224.103
18.219.236.62
18.219.63.90
18.219.95.244
18.220.1.239
18.220.106.241
18.220.11.34
18.220.126.5
18.220.13.70
18.220.136.165
18.220.137.164
18.220.140.5
18.220.160.216
18.220.178.207
18.220.187.178
18.220.59.69
18.220.64.128
18.220.66.151
18.220.81.106
18.221.101.89
18.221.112.220
18.221.129.19
18.221.13.173
18.221.141.44
18.221.146.223
18.221.15.15
18.221.154.151
18.221.165.246
18.221.174.248
18.221.187.121
18.221.208.183
18.221.222.47
18.221.239.148
18.221.53.209
18.221.53.5
18.221.85.33
18.221.98.71
18.222.107.253
18.222.108.18
18.222.110.189
18.222.111.24
18.222.115.120
18.222.115.179
18.222.117.109
18.222.119.148
18.222.120.133
18.222.121.170
18.222.125.171
18.222.148.124
18.222.155.58
18.222.162.216
18.222.163.31
18.222.179.186
18.222.182.105
18.222.193.207
18.222.200.143
18.222.240.21
18.222.35.21
18.222.35.77
18.222.37.169
18.222.67.251
18.222.69.152
18.223.0.53
18.223.106.100
18.223.106.232
18.223.107.149
18.223.114.142
18.223.119.17
18.223.124.244
18.223.125.219
18.223.134.29
18.223.159.195
18.223.160.61
18.223.171.12
18.223.172.252
18.223.196.211
18.223.196.59
18.223.20.57
18.223.21.5
18.223.32.230
18.224.0.25
18.224.149.242
18.224.214.215
18.224.246.203
18.224.30.118
18.224.32.86
18.224.33.107
18.224.37.68
18.224.38.3
18.224.39.32
18.224.39.74
18.224.44.108
18.224.53.202
18.224.59.231
18.224.63.87
18.224.73.125
18.224.95.38
18.225.11.98
18.225.117.183
18.225.209.95
18.225.255.134
18.225.31.159
18.225.35.81
18.225.57.49
18.226.150.175
18.226.169.94
18.226.187.199
18.226.187.24
18.226.251.22
18.226.251.68
18.226.28.197
18.226.93.207
18.226.96.61
18.227.0.192
18.227.102.225
18.227.111.192
18.227.114.125
18.227.24.209
3.12.107.29
3.12.108.236
3.12.161.161
3.12.36.30
3.12.41.106
3.12.71.237
3.128.198.21
3.128.199.210
3.128.199.88
3.128.203.143
3.128.204.140
3.128.205.109
3.128.30.77
3.128.78.41
3.128.94.171
3.129.13.201
3.129.19.251
3.129.210.17
3.129.22.135
3.129.23.30
3.129.247.196
3.129.45.92
3.129.67.26
3.129.69.151
3.129.70.157
3.131.110.169
3.131.13.194
3.133.108.241
3.133.109.211
3.133.109.30
3.133.119.66
3.133.12.172
3.133.120.10
3.133.121.160
3.133.123.193
3.133.131.168
3.133.144.217
3.133.147.87
3.133.149.168
3.133.156.156
3.133.159.224
3.133.160.156
3.133.161.153
3.133.79.70
3.133.86.172
3.133.87.156
3.134.102.182
3.134.104.173
3.134.118.95
3.134.77.195
3.134.78.106
3.134.81.206
3.134.87.95
3.134.90.44
3.135.183.1
3.135.183.187
3.135.183.89
3.135.185.194
3.135.190.101
3.135.190.232
3.135.195.249
3.135.197.201
3.135.198.49
3.135.200.233
3.135.202.224
3.135.205.146
3.135.207.129
3.135.209.249
3.135.213.214
3.135.216.174
3.135.217.228
3.135.246.193
3.136.154.103
3.136.18.48
3.136.22.50
3.136.26.20
3.136.97.64
3.137.157.45
3.137.164.241
3.137.170.183
3.137.171.121
3.137.172.68
3.137.175.113
3.137.178.133
3.137.180.32
3.137.181.52
3.137.183.14
3.137.185.180
3.137.187.233
3.137.192.3
3.137.218.230
3.137.220.120
3.137.221.163
3.138.101.95
3.138.105.124
3.138.105.31
3.138.110.119
3.138.113.188
3.138.114.198
3.138.114.38
3.138.114.94
3.138.116.20
3.138.118.250
3.138.122.195
3.138.122.4
3.138.124.40
3.138.125.139
3.138.125.2
3.138.134.107
3.138.138.144
3.138.141.202
3.138.174.95
3.138.175.180
3.138.179.119
3.138.200.66
3.138.204.208
3.138.33.178
3.138.33.87
3.139.104.214
3.139.238.76
3.139.240.142
3.139.62.103
3.139.70.131
3.139.81.58
3.139.86.56
3.139.90.131
3.139.97.157
3.14.130.24
3.14.132.214
3.14.142.115
3.14.15.94
3.14.246.254
3.14.253.152
3.14.253.221
3.14.6.194
3.14.70.203
3.14.80.45
3.14.83.223
3.140.185.123
3.140.185.147
3.140.185.170
3.140.186.201
3.140.186.241
3.140.188.16
3.140.198.173
3.140.242.165
3.141.0.61
3.141.100.120
3.141.152.173
3.141.198.146
3.141.199.243
3.141.200.180
3.141.201.14
3.141.202.187
3.141.202.54
3.141.24.134
3.141.244.153
3.141.244.201
3.141.30.162
3.141.31.240
3.141.35.60
3.141.8.247
3.142.119.241
3.142.12.240
3.142.124.252
3.142.171.180
3.142.173.227
3.142.174.55
3.142.195.24
3.142.196.27
3.142.197.212
3.142.200.226
3.142.250.114
3.142.35.75
3.142.53.68
3.142.96.146
3.142.98.108
3.143.168.172
3.143.17.127
3.143.17.128
3.143.218.146
3.143.228.40
3.143.23.176
3.143.4.181
3.143.9.115
3.144.102.239
3.144.104.29
3.144.109.5
3.144.113.197
3.144.113.30
3.144.12.205
3.144.124.232
3.144.127.232
3.144.143.31
3.144.151.106
3.144.154.208
3.144.161.116
3.144.187.103
3.144.189.177
3.144.193.129
3.144.202.167
3.144.212.145
3.144.230.82
3.144.233.150
3.144.238.20
3.144.243.184
3.144.244.44
3.144.248.24
3.144.25.74
3.144.250.169
3.144.250.223
3.144.253.161
3.144.28.50
3.144.33.41
3.144.35.148
3.144.36.141
3.144.42.196
3.144.71.142
3.144.77.71
3.144.84.155
3.144.86.134
3.144.86.138
3.144.87.149
3.144.93.73
3.144.96.159
3.144.97.189
3.144.98.13
3.145.105.105
3.145.105.108
3.145.108.9
3.145.111.125
3.145.111.183
3.145.115.195
3.145.119.199
3.145.12.242
3.145.130.31
3.145.131.238
3.145.143.239
3.145.15.1
3.145.151.141
3.145.152.242
3.145.152.98
3.145.154.70
3.145.156.250
3.145.156.46
3.145.16.90
3.145.163.58
3.145.166.7
3.145.17.46
3.145.170.65
3.145.171.58
3.145.173.112
3.145.173.132
3.145.175.243
3.145.178.106
3.145.178.240
3.145.183.137
3.145.184.89
3.145.186.173
3.145.186.6
3.145.191.169
3.145.191.22
3.145.201.71
3.145.206.169
3.145.23.123
3.145.38.117
3.145.47.253
3.145.50.83
3.145.52.86
3.145.54.199
3.145.58.169
3.145.60.166
3.145.60.29
3.145.63.136
3.145.65.134
3.145.69.255
3.145.74.54
3.145.77.114
3.145.8.141
3.145.93.210
3.145.93.221
3.145.94.251
3.145.97.248
3.146.105.137
3.146.105.194
3.146.152.99
3.146.221.204
3.146.221.52
3.146.255.127
3.146.35.203
3.146.65.212
3.147.103.202
3.147.103.8
3.147.104.120
3.147.104.248
3.147.205.154
3.147.42.168
3.147.54.6
3.147.65.65
3.147.66.178
3.147.73.35
3.147.78.174
3.147.80.39
3.147.89.85
3.148.102.90
3.149.213.209
3.149.214.32
3.149.229.253
3.149.230.44
3.149.233.104
3.149.233.72
3.149.234.141
3.149.239.110
3.149.24.159
3.149.243.32
3.149.250.1
3.149.251.154
3.149.251.155
3.149.254.35
3.149.255.162
3.149.26.176
3.149.26.246
3.149.27.202
3.15.10.137
3.15.143.181
3.15.147.215
3.15.147.53
3.15.151.214
3.15.156.140
3.15.171.202
3.15.174.76
3.15.190.144
3.15.193.45
3.15.197.123
3.15.202.214
3.15.202.4
3.15.218.254
3.15.221.136
3.15.221.67
3.15.225.173
3.15.226.173
3.15.226.248
3.15.229.113
3.15.235.196
3.15.237.255
3.15.27.232
3.15.4.244
3.15.6.77
3.16.147.124
3.16.15.149
3.16.218.62
3.16.29.209
3.16.51.3
3.16.66.206
3.16.69.143
3.16.70.101
3.16.76.43
3.16.83.150
3.17.128.129
3.17.150.163
3.17.150.89
3.17.154.171
3.17.162.140
3.17.162.247
3.17.174.239
3.17.181.21
3.17.183.24
3.17.184.90
3.17.203.68
3.17.28.48
3.17.5.68
3.17.6.75
3.17.68.14
3.17.74.153
3.17.74.227
3.17.75.227
3.17.79.60
3.19.211.134
3.19.27.178
3.19.29.89
3.19.30.232
3.19.31.73
3.19.56.114
3.19.56.45
3.20.238.187
3.21.100.34
3.21.104.109
3.21.162.87
3.21.231.245
3.21.233.41
3.21.244.14
3.21.248.119
3.21.248.47
3.21.34.0
3.21.76.0
3.21.93.44
3.22.100.180
3.22.119.251
3.22.171.136
3.22.181.209
3.22.181.81
3.22.242.141
3.22.248.208
3.22.249.158
3.22.61.246
3.23.127.197
52.14.121.242
52.14.126.74
52.14.130.13
52.14.150.55
52.14.168.56
52.14.183.150
52.14.22.250
52.14.221.113
52.14.224.197
52.14.240.178
52.14.253.170
52.14.85.76
52.15.112.69
52.15.59.163
52.15.63.145
import re
def extract_ip_user_agent(log_file, user_agent, output_file):
ip_addresses = set()
# Regular expression pattern to match IP addresses
ip_pattern = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
with open(log_file, 'r') as file:
for line in file:
# Check if the line contains the specified user agent
if user_agent in line:
# Extract the IP address using regex
ip_match = re.search(ip_pattern, line)
if ip_match:
ip_addresses.add(ip_match.group())
# Write the extracted IP addresses to the output file
with open(output_file, 'w') as output:
for ip_address in ip_addresses:
output.write(ip_address + '\n')
# Example usage
log_file = 'access.log'
user_agent = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)' # Replace with your desired user agent
output_file = 'output.txt'
extract_ip_user_agent(log_file, user_agent, output_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment