⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
GeoIP-1.5.0
/
View File Name :
fetch-geoipdata-city.pl
#!/usr/bin/perl use strict; use warnings; use POSIX; use LWP::Simple; use File::Copy; use Carp; my $ipdb = "GeoLiteCity.dat"; my $datadir = "/usr/share/GeoIP/"; my $fullpath = $datadir . $ipdb; my $url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"; my $date = strftime "%Y%m%d", localtime; # Do we have an existing IP database? if ( -e $fullpath ) { print "Fetching " . $ipdb . " from " . $url . "\r\n"; if ( is_success( getstore( $url, $datadir . "GeoLiteCity.dat.gz" ) ) ) { move( $fullpath, $datadir . $ipdb . "." . $date ) || croak "Can't move the old database aside\r\n"; system( 'gzip', '-d', $datadir . 'GeoLiteCity.dat.gz' ); if ( $? ne 0 ) { croak "Could not uncompress database - exited $?\r\n"; } print "GeoIP database updated. Old copy is at " . $ipdb . "." . $date . "\r\n"; } else { croak "Fetch failed - try again later?\r\n"; } } else { croak "You don't appear to have a valid GeoIP database installed..\r\n"; }