1337ings

[Python] Auto-HackerTarget

Feb 13th, 2017
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # Usage: #
  4. # python HackerTarget.py #
  5.  
  6. import os
  7. import sys
  8. import json
  9. import urllib
  10. import urllib2
  11. import hashlib
  12. import argparse
  13. import re
  14. import socket
  15. from urllib2 import urlopen
  16.  
  17.  
  18. def color(text, color_code):
  19. if sys.platform == "win32" and os.getenv("TERM") != "xterm":
  20. return text
  21.  
  22. return '\x1b[%dm%s\x1b[0m' % (color_code, text)
  23.  
  24.  
  25. def red(text):
  26. return color(text, 31)
  27.  
  28. def blue(text):
  29. return color(text, 34)
  30.  
  31.  
  32.  
  33. if __name__ == "__main__":
  34.  
  35. my_ip = raw_input("Enter the IP Address:")
  36.  
  37. print(blue('Get Reverse DNS, GeoIP, NMAP, Traceroute and pulls HTTP Headers from an IP address'))
  38. print(blue('Quick develop by Chris Poole | @codingplanets'))
  39. print('\n')
  40. print(red('Your Target IP address is {0}'.format(my_ip)))
  41. print('\n')
  42.  
  43. #Get IP To SCAN
  44.  
  45. resp = raw_input(blue('Would you like target info about {0}? (Y/N):'.format(my_ip)))
  46.  
  47. if resp.lower() in ["yes", "y"]:
  48. badip = my_ip
  49. else:
  50. badip = raw_input(blue("What IP would you like to check?: "))
  51.  
  52. print('\n')
  53.  
  54. #IP INFO
  55. reversed_dns = urllib.urlopen('http://api.hackertarget.com/reverseiplookup/?q=' + badip).read()
  56. geoip = urllib.urlopen('http://api.hackertarget.com/geoip/?q=' + badip).read()
  57. nmap = urllib.urlopen('http://api.hackertarget.com/nmap/?q=' + badip).read()
  58. httpheaders = urllib.urlopen('http://api.hackertarget.com/httpheaders/?q=' + badip).read()
  59. tracert = urllib.urlopen('http://api.hackertarget.com/mtr/?q=' + badip).read()
  60.  
  61. print(red('Reverse DNS Information:'))
  62. print(blue(reversed_dns))
  63. print('\n')
  64. print(red('GEOIP Information:'))
  65. print(blue(geoip))
  66. print('\n')
  67. print(red('NMAP of Traget (Only Ports: 21,25,80 and 443):'))
  68. print(blue(nmap))
  69. print('\n')
  70. print(red('HTTP Headers:'))
  71. print(blue(httpheaders))
  72. print('\n')
  73. print(red('Trace Route:'))
  74. print(blue(tracert))
  75. print('\n')
Add Comment
Please, Sign In to add comment