![]() |
|
[Tutorial] Scanning the world for DNS in under an hour. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4) +---- Thread: [Tutorial] Scanning the world for DNS in under an hour. (/showthread.php?tid=4258586) Pages: Pages
1
2
|
[Tutorial] Scanning the world for DNS in under an hour. - Vaider - May 31, 2014 Easy DNS list scanning! Aye, welcome to my thread.. Alright lets get right too it.. Things needed: 1. 1Gbps port server (vps or dedi will work) 2. perl (with Net::DNS, Net::Pcap, Net::Pcap::Easy) 3. A Brain 5. Zmap Table of Contents: 0x1: Getting Ready 0x2: Building Packet 0x3: Starting Filter 0x4: Starting Scan 0x5: Manually Filtering Output 0x1 - Getting Ready: Step 1: Download Perl on your server: Debain / Ubuntu: Code apt-get install perlCode yum install perlStep 2: Install Perl modules: Debain / Ubuntu: Code apt-get install cpanRedhat / Centos: Code yum install cpanIf this does not work use commands below Code wget http://search.cpan.org/CPAN/authors/id/S/SA/SAPER/Net-Pcap-0.17.tar.gzStep 3: Install Zmap: Debain / Ubuntu: Code apt-get install build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flexCode yum install cmake gmp gmp-devel libpcap-devel gengetopt byacc flexThen Download and install zmap: Code wget https://github.com/zmap/zmap/archive/v1.2.0.tar.gzOk, we are done with installing the things we need C: 0x2 - Building Packet: Here we are going to use one of my scripts to build a packet to use with zmap. This will include the domain your going to use to scan.. Step 1: Download buildpacket.pl Quote:wget https://raw.githubusercontent.com/Vypor/DnsScanTutorial/master/buildpacket.pl Script Usage: Code root@localhost:~# perl buildpacket.plStep 2: Build the packet with the script (this is easy) Now we gotta build the packet for zmap to use. this can be done by simply typing: Code perl buildpacket.pl domain.comdomain.com is the domain your going to use to amp Anyways, To the next step! 0x3 - Starting Filter: Step 1: Download dnsfilter.pl Code wget https://raw.githubusercontent.com/Vypor/DnsScanTutorial/master/DNSfilter.plStep 2: run the filter script Must be ran before scan starts to get full scan Code perl DNSfilter.pl dnslistoutput.txt 3000 1x1.czNote, the domain MUST be the same one you used in your buildpacket.pl Code root@localhost:~# perl filt.pl 0x4 - Starting Scan: Woo! you made it here, congrats.. Now we gotta start the dns scan itself, Before this make sure your dnsfilter.pl script is running, and open a new window in your server with your SSH program. Step 1: Run zmap and listen for data on other screen Alright, we need to run zmap.. this is easy command is below. Code zmap -M udp -p 53 --probe-args=file:1x1.cz.pktNow, 1x1.cz.pkt is where your buildpacket.pl output is (in the same folder as buildpacket.pl) After your run the command you will begin to see this on your screen: root@localhost:~# zmap -M udp -p 53 --probe-args=file:1x1.cz.pkt Code May 31 10:07:04.554 [INFO] zmap: output module: csvIts fine if packets drop. it WILL happen.. Now, look on the screen running DNSfilter.pl it will look something like this: Code root@localhost:~# perl DNSfilter.pl output.txt 1000 1x1.czX.X.X.X Is my server IP, its removed The filter script is formatted: Code Time : Incoming_IP -> Outgoing_IP bytesizeCode 193.239.186.91 1x1.cz 1764C: Now that we have our list, we have an extra option.. We can Manually filter it. 0x5 - Manually Filtering Output: Step 1: Find your DNS list file Step 2: Use your linux command line and sort your list. Now the command below will do things, first thing being reading the list, then filtering the third column, then sorting for duplicates, then randomizing the list, and finally the output file. Now lets say your list name is dnslist.txt and you want to sort it to everything above 4000 bytesize, and then output it to newdnslist.txt heres the command: Code cat dnslist.txt | awk '$3 >= 4000' | sort -u | sort -R > newdnslist.txtCommand Explanation: "cat" reads the file into a pipe "|" , awk then sorts $3 "the third column" for any number 4000 and over, then it pipes again, sorts for unique lines, then pipes, and randomizes the lines of the list, then ">" outputs the lines to a file. Tutorial Made by Vypor, Also made so it can be easily modified for other amp methods. https://github.com/Vypor Addressed Issues: (May 31, 2014 10:56 PM)ItsFluffy Wrote: Ok following the tut I thought this was nothing but it prevents me from using the filter properly:This is a zmap build error, "/bin/sh: gengetopt: command not found" To fix this error read below. Centos 5: Code wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpmCentos 6: Code wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmDebain / Ubuntu: Code apt-get install gengetopt* - 7H3 3XP3R7 - May 31, 2014 ah that is nice Vypor :) let me know if you have priv8 shits for sale.. * - Phenomite - May 31, 2014 Cool stuff vypor. But seriously stop making so many accounts lol. I'm also running into an issue prior to seeing this where my /etc/zmap folder exists but when I go to read in it or delete it, it doesnt exist >_<. * - Vaider - May 31, 2014 (May 31, 2014 02:25 AM)Phenomite Wrote: Cool stuff vypor. But seriously stop making so many accounts lol. I like accounts.. Reinstall your server man. or install zmap from source and define a diffrent install location. * - Pepe goes REEEEEEEEEEEEEE - May 31, 2014 Nice Vypor, this is working and is better than most paid for scanners, but you still smell like egg salad. * - Mority - May 31, 2014 Great tutorial man, I appreciate the hard work you have put in! * - Proxseas - May 31, 2014 Vouch after 5 minutes of scanning lmfao
* - ItsFluffy - May 31, 2014 Nice tut I'm going to be bookmarking this to try tonight * - Vaider - May 31, 2014 Yeah, after testing a few times on a few different servers.. it takes about 3 hours to scan the world for dns servers with your specific domain. * - OwnerORAdminPlease - May 31, 2014 Vouch for this! I scanned the whole world soooo fast! * - SMTP Server - May 31, 2014 Thanks for the tutorial, i scanned dns and got a nice list, mya1 * - Phenomite - May 31, 2014 Why pay for DNS scanners when this is 500x faster, better, stronger, longer, sexier, and more annoying to setup on centos than anything else! Aka do not buy ddosDev scanner, wasteful. * - ItsFluffy - May 31, 2014 Ok following the tut I thought this was nothing but it prevents me from using the filter properly: [root@2 ~]# cd zmap-1.2.0 [root@2 zmap-1.2.0]# cmake -DENABLE_HARDENING=ON -- Configuring done -- Generating done -- Build files have been written to: /root/zmap-1.2.0 [root@2 zmap-1.2.0]# make [ 2%] Generating zopt.h /bin/sh: gengetopt: command not found make[2]: * [src/zopt.h] Error 127 make[1]: * [src/CMakeFiles/zmap.dir/all] Error 2 make: * [all] Error 2 [root@2 zmap-1.2.0]# make [ 2%] Generating zopt.h /bin/sh: gengetopt: command not found make[2]: * [src/zopt.h] Error 127 make[1]: * [src/CMakeFiles/zmap.dir/all] Error 2 make: * [all] Error 2 [root@2 zmap-1.2.0]# make install [ 2%] Generating zopt.h /bin/sh: gengetopt: command not found make[2]: * [src/zopt.h] Error 127 make[1]: * [src/CMakeFiles/zmap.dir/all] Error 2 make: * [all] Error 2 * - Vaider - May 31, 2014 (May 31, 2014 10:56 PM)ItsFluffy Wrote: Ok following the tut I thought this was nothing but it prevents me from using the filter properly: I have addressed your issue with a fix at the bottom of my thread. * - ItsFluffy - Jun 1, 2014 ok thanks for solving that matter, that worked nicely, when trying to packetbuild --> perl buildpacket.pl mydomainnamehere Net::DNS::Header::size: no such method at buildpacket.pl line 18 |