-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathcrawler.php
44 lines (36 loc) · 1.3 KB
/
crawler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// CloudFlare IP Ranges
// ircf.space
function getIps($raw) {
$ips = [];
$fetch = @file_get_contents($raw);
if ( isset($fetch) && !empty($fetch) ) {
$ips = preg_split("/[\f\r\n]+/", $fetch );
}
return $ips;
}
$bashsizIps = getIps('https://raw.githubusercontent.com/MortezaBashsiz/CFScanner/main/config/cf.local.iplist');
$safariIps = getIps('https://raw.githubusercontent.com/SafaSafari/ss-cloud-scanner/main/ips.txt');
$faridIps = getIps('https://raw.githubusercontent.com/vfarid/cf-ip-scanner/main/ipv4.txt');
$ircfIps = getIps('https://raw.githubusercontent.com/ircfspace/scanner/main/ipv4.list');
$newList = array_merge($bashsizIps, $safariIps, $faridIps, $ircfIps);
$newList = array_filter($newList, 'strlen');
$newList = array_unique($newList);
natsort($newList);
$generateList = [];
foreach( $newList as $ip ) {
if ( empty($ip) ) {
continue;
}
$explode = explode("/", $ip);
if ( ! isset($explode[0]) || empty($explode[0]) ) {
continue;
}
$generateList[$explode[0]] = $explode[0].'/24';
}
$export = '';
foreach( $generateList as $ip ) {
$export .= $ip."\n";
}
file_put_contents("export.ipv4", $export);
?>