WebMap v1 :: Tools for Linux.


SUBMITTED BY: Guest

DATE: Dec. 7, 2013, 11:08 a.m.

FORMAT: Text only

SIZE: 3.7 kB

HITS: 682

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Coded by: An0nKS
  4. # Greetz: dxhj (dxhj@hotmail.com) & Project X (www.projctx.com)
  5. # ERROR'S or BUG's, report:
  6. # My Twitter: @an0nks
  7. # Like Us: fb.com/leaksec
  8. # Save this file as webmap.py
  9. import string
  10. import httplib
  11. import sys
  12. import re
  13. import getopt
  14. import os
  15. import time
  16. from colorama import Fore, Back, Style
  17. D = "\033[0m";
  18. W = "\033[01;37m";
  19. W2 = "\033[00;37m";
  20. R = "\033[31m";
  21. G = "\033[32m,01";
  22. O = "\033[01;33m";
  23. B = "\033[00;34m";
  24. SUCESS = "\033[01;32m";
  25. FAIL = "\033[01;31m";
  26. global result
  27. result =[]
  28. os.system("clear")
  29. print O+ "+----------------------------------------------------------------------------+"
  30. print "| WEBMAP v1 |"
  31. print "+----------------------------------------------------------------------------+"
  32. print "| CODED BY AN0NKS (@an0nks) |"
  33. print "| LEAK SEC TEAM: fb.com/leaksec |"
  34. print "+----------------------------------------------------------------------------+"
  35. def usage():
  36. print W+ " OPÇÕES:\n"
  37. print B+" -d: Dominio"
  38. print " -f: Arquivo (ex. php)"
  39. print " Ex:./webmap.py -d target.com -f php\n"
  40. print W+ " Get more Filetypes here --> http://pastebin.com/3Yw6LKp9"
  41. sys.exit()
  42. def run(url,file):
  43. h = httplib.HTTP('www.google.com')
  44. h.putrequest('GET',"/search?num=500&q=site:"+url+"+filetype:"+file)
  45. h.putheader('Host', 'www.google.com')
  46. h.putheader('User-agent', 'Internet Explorer 6.0 ')
  47. h.putheader('Referrer', 'www.twitter.com/an0nks')
  48. h.endheaders()
  49. returncode, returnmsg, headers = h.getreply()
  50. data=h.getfile().read()
  51. data=re.sub('<b>','',data)
  52. for e in ('>','=','<','\\','(',')','"','http',':','//'):
  53. data = string.replace(data,e,' ')
  54. r1 = re.compile('[-_.a-zA-Z0-9.-_]*'+'\.'+file)
  55. res = r1.findall(data)
  56. return res
  57. def search(argv):
  58. global limit
  59. limit = 100
  60. if len(sys.argv) < 2:
  61. usage()
  62. try :
  63. opts, args = getopt.getopt(argv,"d:f:")
  64. except getopt.GetoptError:
  65. usage()
  66. sys.exit()
  67. for opt,arg in opts :
  68. if opt == '-f' :
  69. file=arg
  70. elif opt == '-d':
  71. url=arg
  72. print W+"TARGET: "+url+"\nFILE: "+ file
  73. print "+----------------------------------------------------------------------------+"
  74. cant = 0
  75. while cant < limit:
  76. res = run(url,file)
  77. for x in res:
  78. if result.count(x) == 0:
  79. result.append(x)
  80. cant+=100
  81. print SUCESS+"Listando resultados..."
  82. print "+----------------------------------------------------------------------------+"
  83. time.sleep( 2 )
  84. t=0
  85. if result==[]:
  86. print FAIL+"Não obteve resultado. :/"
  87. else:
  88. print SUCESS+"LINKS ENCONTRADOS!"
  89. for x in result:
  90. x= re.sub('<li class="first">','',x)
  91. x= re.sub('</li>','',x)
  92. print "[ + ] " + x + "\n"
  93. t+=1
  94. print "+----------------------------------------------------------------------------+\n"
  95. if __name__ == "__main__":
  96. try: search(sys.argv[1:])
  97. except KeyboardInterrupt:
  98. print "\nVocê interrompeu o processo."
  99. except:
  100. sys.exit()

comments powered by Disqus