#!/usr/bin/pythonimport optparseimport socketfrom socket import *def rlookup(tgtHost):hostname = tgtHostip = gethostbyname(tgtHost)print '[+] the IP Addres for ' + hostname + ' is: ' + ipdef main():parser = optparse.OptionParser('usage %prog -H' +\'<target host>')parser.add_option('-H', dest='tgtHost', type='string', \help='specify target host')(options, args) = parser.parse_args()tgtHost = options.tgtHostrlookup(tgtHost)if __name__ == '__main__':main()
Thursday, August 29, 2013
Reverse Lookup - Python Style
I won't claim to be a master of Python, but thought I'd share some quick scripts I've written from my readings and hacking together snips from what I've found online. Hopefully this will inspire others to learn a scripting language. The code is not perfect, and I will probably want to include some error checking at some point.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment