#!/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.
Sunday, August 25, 2013
Post Defcon
As usual, Defcon was quite inspirational. I have decided to dig deeper into Python so that I can better understand many of the great pentesting tools out there. I also picked up a great book - Violent Python. I wrote this simple script after just reading the first 20 or so pages:
More to come!
#!/usr/bin/python# Import Modulesimport hashlib# Gather value to hashv = raw_input("Enter your value: ")print "Which hash algorithm do you want to use?"# Select has algorithma = raw_input("md5, sha1, sha224, sha256, sha384, sha512: ")# Generate hashh = hashlib.new(a)h.update(v)# Present has to usero = h.hexdigest()print "Your hash value using the " + a + "value is: " + o
More to come!
Subscribe to:
Posts (Atom)