Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #IP to Domain mapping is provided by Byteskrew
- require LWP::UserAgent;
- use HTTP::Message;
- use strict;
- use warnings;
- my $LOGDIR = "/opt/pentest/web/logs/";
- my $LOGFILE = "ip-to-domain.log";
- #$proxy='http://proxy.telkom.net.id:8080';
- my $login = (getpwuid $>);
- die "must run as root" if $login ne 'root';
- print "Maps IP to Domain using HE.NET\n";
- if(!$ARGV[0]){
- print "Usage : perl $0 <IP Address>\n";
- exit;
- }
- my $dork=$ARGV[0];
- my $ua = LWP::UserAgent->new;
- $ua->timeout(30);
- $ua->agent("MSIE/6.0 Windows");
- #$ua->proxy(http => $proxy) if defined($proxy);
- my ($dataget, $result) = "";
- my $LOGZ = $LOGDIR . $LOGFILE . ".$ARGV[0]";
- open(FHANDLE, ">$LOGZ") or die "Cant open log file for writing\n";
- print "Translating IP $ARGV[0] to domain :\n";
- print "########################################\n";
- print FHANDLE "Translating IP $ARGV[0] to domain :\n";
- print FHANDLE "########################################\n";
- my $heurl="http://bgp.he.net/ip/$ARGV[0]#_dns";
- my $response = $ua->get($heurl);
- if(!($response->is_success)){
- print $response . " [FAILED]\n";
- }else{
- my @hasil = $response->as_string;
- $dataget="@hasil";
- my @name=split("<a href=\"/dns/",$dataget);
- my $i=0;
- for($i=0;$i<scalar(@name)-1;$i++){
- $result=$name[$i+1];
- $result =~ s/(.*?)\"/$1/;
- print "[" . $ARGV[0] . "] " . $1 . "\n";
- print FHANDLE "[" . $ARGV[0] . "] " . $1 . "\n";
- }
- }
- print "########################################\n";
- print FHANDLE "########################################\n";
- close(FHANDLE);
- <<----------------------------------------snip------------------------------------------------>>
- root@core-pentest:/opt/pentest/enum# host www.abcdef.com
- www.abcdef.com is an alias for abcdef.com.
- abcdef.com has address 108.162.197.12
- abcdef.com has address 108.162.196.12
- root@core-pentest:/opt/pentest/enum# perl ip-to-domain.pl 108.162.197.12
- Maps IP to Domain using HE.NET
- Translating IP 108.162.197.12 to domain :
- ########################################
- [108.162.197.12] 2013taxes.org
- [108.162.197.12] 3rr0r.com
- [108.162.197.12] 91sex.org
- [108.162.197.12] a1article.net
- [108.162.197.12] aiononline.mobi
- [108.162.197.12] alnahar-news.com
- [108.162.197.12] alysun1.com
- [108.162.197.12] art2read.org
- [108.162.197.12] baioviaggi.com
- [108.162.197.12] bestguidesinnewyork.com
- [108.162.197.12] bewellcooking.com
- [108.162.197.12] bigfoig.net
- [108.162.197.12] bilettour.net
- [108.162.197.12] billsautomotiverepair.com
- [108.162.197.12] bjpds.com
- [108.162.197.12] brifz.com
- [108.162.197.12] brotherboard.com
- [108.162.197.12] callingmartcoupon.net
- [108.162.197.12] canadagoosejacketstore.com
- [108.162.197.12] cashthirst.com
- [108.162.197.12] cellularfibroconcrete.com
- [108.162.197.12] claylaur.com
- [108.162.197.12] cognitivemining.com
- [108.162.197.12] commutalize.net
- [108.162.197.12] contacts-for-astigmatism.com
- [108.162.197.12] creadanse-castelnau.com
- [108.162.197.12] crosslink.org
- [108.162.197.12] cstarglamour.com
- [108.162.197.12] cvrranch.com
- [108.162.197.12] defbilly.com
- [108.162.197.12] despuesclub.com
- [108.162.197.12] downthemall.net
- [108.162.197.12] duboji777.info
- [108.162.197.12] eglisestlazare.org
- [108.162.197.12] eidress.us
- [108.162.197.12] eyecandyphotowork.com
- [108.162.197.12] fixaro.asia
- [108.162.197.12] george-perez.net
- [108.162.197.12] golf-carts-for-sale.org
- [108.162.197.12] gorkan.com
- [108.162.197.12] gou178.com
- [108.162.197.12] grandtheftmario.com
- [108.162.197.12] haystackshomes.com
- [108.162.197.12] henriallen.com
- [108.162.197.12] heroporn.net
- [108.162.197.12] hexcode.org
- [108.162.197.12] hotelsinottawa.info
- [108.162.197.12] idivulge.com
- [108.162.197.12] imagesquire.com
- [108.162.197.12] ishouvik.com
- [108.162.197.12] jardineriastill.com
- [108.162.197.12] jasaplus.com
- [108.162.197.12] knoxvilledirect.info
- [108.162.197.12] kristasoto.com
- [108.162.197.12] laurakalbag.com
- [108.162.197.12] ljummen.com
- [108.162.197.12] lnagriculture.org
- [108.162.197.12] lovemakeuptips.com
- [108.162.197.12] marathistar.com
- [108.162.197.12] mastires.com
- [108.162.197.12] melissalafsky.com
- [108.162.197.12] mittalandco.com
- [108.162.197.12] morritastube.mobi
- [108.162.197.12] mysterymonkeythemovie.com
- [108.162.197.12] neworleansreia.com
- [108.162.197.12] nflusshop.us
- [108.162.197.12] njrefurbpc.com
- [108.162.197.12] ohiobobcatshockey.com
- [108.162.197.12] oldecountry.com
- [108.162.197.12] pagellan.com
- [108.162.197.12] pasoroblesmuseums.org
- [108.162.197.12] petproductscoupon.com
- [108.162.197.12] ps3project.com
- [108.162.197.12] qualityhpcartridges.com
- [108.162.197.12] realfoodrealfatloss.com
- [108.162.197.12] sdgangcheng.com
- [108.162.197.12] sdiag.net
- [108.162.197.12] seetanianaked.com
- [108.162.197.12] seminolefloridamugshots.com
- [108.162.197.12] skidrowpc.net
- [108.162.197.12] snowequipment.info
- [108.162.197.12] sophiadesigns.net
- [108.162.197.12] spacecityscoop.com
- [108.162.197.12] starkgop.net
- [108.162.197.12] stoneandtilediscoverybayiq.com
- [108.162.197.12] storiesthatmatter.org
- [108.162.197.12] supplement-geek.com
- [108.162.197.12] tentfb.me
- [108.162.197.12] thebigcoop.com
- [108.162.197.12] themaisonette.net
- [108.162.197.12] townstart.com
- [108.162.197.12] trevsart.com
- [108.162.197.12] ufosky.com
- [108.162.197.12] victoriamackenzie.com
- [108.162.197.12] videotrends.com
- [108.162.197.12] vipeople.com
- [108.162.197.12] watch-olympics-online.info
- [108.162.197.12] woodwindforum.com
- [108.162.197.12] workcustomjeans.com
- [108.162.197.12] xtremelulz.com
- [108.162.197.12] your-body-mass-index.com
- [108.162.197.12] yukipedia.com
- ########################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement