Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 48 guests and 1 member online
 
Free Business and Tech Magazines and eBooks

You are here: Home arrow Resourcesarrow Toolsarrow dns2geoip.py
EH-Net
May 22, 2013, 05:46:23 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: dns2geoip.py  (Read 3438 times)
0 Members and 1 Guest are viewing this topic.
jinwald12
Jr. Member
**
Offline Offline

Posts: 77



View Profile
« on: November 12, 2012, 10:20:34 AM »

here is a new tool i made for network recon. Basically it brute forces subdomains like any DNS analysis tool would but what makes dns2geoip.py different is the fact that it then geolocates the subdomains it finds and outputs their location to a kml file that is compatible with Google earth. This tool is ideal for wireless penetration tests where you want to know what services they run in house and which services they run out of a data center, but it is useful for scoping a normal network penetration test too.

https://github.com/thsle3p/code-for-pentesting
Logged

where did all the fun go?
Andrew Waite
Hero Member
*****
Offline Offline

Posts: 928



View Profile WWW
« Reply #1 on: November 12, 2012, 11:02:23 AM »

Interesting looking script, thanks for sharing.

I'll definitely keep it in my bag of tricks for a rainy day and let you know how it goes.
Logged

ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #2 on: November 12, 2012, 11:16:19 AM »

When looking at the code, I just heard Vivek's voice, "Try making it multithreaded!" Maybe I need a break from SPSE Smiley

Nice work. Thanks for sharing.
Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
jinwald12
Jr. Member
**
Offline Offline

Posts: 77



View Profile
« Reply #3 on: November 12, 2012, 11:39:59 AM »

I would have made it multi-threaded, but the thing with brute forcing DNS is it's noisy-ish, not as noisy as a Zone-transfer but even a half-assed IDS would pick up multi-threaded DNS brute force. also in my Experience python does not do multi-threading well.
Logged

where did all the fun go?
hayabusa
Hero Member
*****
Offline Offline

Posts: 1632



View Profile
« Reply #4 on: November 12, 2012, 12:45:49 PM »

When looking at the code, I just heard Vivek's voice, "Try making it multithreaded!" Maybe I need a break from SPSE Smiley

Nice work. Thanks for sharing.

<grin> bwahahaha!
Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #5 on: November 12, 2012, 02:47:02 PM »

I would have made it multi-threaded, but the thing with brute forcing DNS is it's noisy-ish, not as noisy as a Zone-transfer but even a half-assed IDS would pick up multi-threaded DNS brute force. also in my Experience python does not do multi-threading well.

Oh, I wasn't giving you a hard time. It's just a common next-step-challenge for some of the things you do in SPSE.

On a serious note, the effectiveness of threading depends on what you want to do. The interpreter itself only has one CPU thread (http://docs.python.org/2/glossary.html#term-global-interpreter-lock), so trying to thread CPU-intensive tasks like password cracking won't be very effective. However, for things like network-based tasks where you have to deal with latency, waiting for responses, etc., multiple threads can speed things up significantly. It really depends on where your bottleneck is.

Also, you could query another DNS server, such as OpenDNS, Google, etc., instead of using the target's own DNS servers. They would certainly still see the requests coming in, but it wouldn't give you away.

Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
jinwald12
Jr. Member
**
Offline Offline

Posts: 77



View Profile
« Reply #6 on: November 12, 2012, 03:56:45 PM »

Against a modern IDS i am not so sure they would not notice and do you really want to risk ending a pen test during the recon phase, because you got caught? I would rather deal with a slightly slow stealthy scan then a fast loud and noticeable scan.
Logged

where did all the fun go?
ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #7 on: November 12, 2012, 05:40:09 PM »

Just to be clear, I'm really not encouraging you to try to multithread this. That was only a joke for others that are doing the SPSE.

Regarding stealth, I honestly wouldn't consider hundreds or thousands of failed queries to be stealthy in the first place, even if they are performed serially, unless maybe you put a substantial delay between each one.

I'd be curious to see how many organizations actually have enabled signatures for failed DNS queries. That seems like a signature that would be constantly alerting due to regular internet noise.

I just looked at the Snort rules, and they have several that can alert on excessive queries/responses, but these are not enabled default. It looks like the default signature set doesn't even alert on zone transfer attempts either.

If you wanted to be extremely stealthy, you could query popular DNS servers (such as the ones I mentioned before), and disable recursion. That way, you're reviewing the cache of your specified DNS server, and never sending a packet to the target. Granted, the trade-off is you'd miss anything that wasn't queried recently.

Dig's +norecursive option will do this. I just glanced at the dnspython library, but it doesn't look like they support this option. Unlike multithreading, extending a class to provide this capability would probably be an interesting addition Smiley



Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.072 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.