Advertisement
vinissh

md5scraping

Oct 30th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.91 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. import time
  4.  
  5. palavra = str(input('Digite a palavra:\n'))
  6. url="http://www.md5.cz/getmd5.php"
  7. data={}
  8. data['what']=palavra
  9. headers={}
  10. headers['User-Agent']= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
  11. requestSite = requests.post(url,data=data,headers=headers)
  12.  
  13. if(requestSite.status_code == 200 ):
  14.     print('[*] CRYPTOGRAFANDO [*]')
  15.     soup = BeautifulSoup(requestSite.text,'html5lib')
  16.     hmd5ash = soup.find('body').get_text()
  17.     time.sleep(2)
  18.     print('[!] HASH->' + hmd5ash[0:32])
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. ----------------------------------
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. import requests
  69. from bs4 import BeautifulSoup
  70. import time
  71.  
  72.  
  73. print('''\033[31m                                                             \033[0;0m''')
  74. print('''\033[31m                                                              \033[0;0m''')
  75. print('''\033[31m        _           _   _____                                  \033[0;0m''')
  76. print('''\033[31m       | |_ ___ ___| |_|     |___ _ _ ___                      \033[0;0m''')
  77. print('''\033[31m       |   | .'|_ -|   |   --|  _| | | . |                      \033[0;0m''')
  78. print('''\033[31m       |_|_|__,|___|_|_|_____|_| |_  |  _|                      \033[0;0m''')
  79. print('''\033[31m                                 |___|_| version:0.0.1          \033[0;0m''')
  80.  
  81.  
  82.  
  83.  
  84.  
  85. print("""\033[31m
  86.  
  87.        1) [*] Criptografia Md5  - Encrypt [*]
  88.        2) [*] Criptografia md5  - Decrypt [*]      
  89.  
  90. \033[0;0m""")
  91.  
  92. def inicio(md5Cryp):
  93.     try:
  94.         escolha = int(input())
  95.         if escolha == 1:
  96.             print('Selecionou md5Cryp')
  97.             md5Cryp('negro')    
  98.         elif escolha == 2:
  99.             print('Selecionou o md5Decryp')
  100.     except ValueError:
  101.         print("Valor invalido!")
  102.         print('Escolha 1 ou 2 conforme o menu solicita.')
  103.         return inicio()
  104.     except TypeError:
  105.         print('Pressione a opção desejada [1 ou 2]')
  106.         return inicio()
  107.  
  108.  
  109.  
  110. inicio(md5Cryp)
  111.  
  112. def md5Cryp(palavra):
  113.     palavra = str("")
  114.     url="http://www.md5.cz/getmd5.php"
  115.     data={}
  116.     data['what']=palavra
  117.     headers={}
  118.     headers['User-Agent']= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
  119.     requestSite = requests.post(url,data=data,headers=headers)
  120.    
  121.     if(requestSite.status_code == 200 ):
  122.         print('[*] CRYPTOGRAFANDO [*]')
  123.         soup = BeautifulSoup(requestSite.text,'html5lib')
  124.         hmd5ash = soup.find('body').get_text()
  125.         time.sleep(2)
  126.         print('[!] HASH->' + hmd5ash[0:32] + ' [!]')
  127.         hour = time.time()
  128.         real_time = time.ctime(hour)
  129.         print('[?] Data da execução=>'+real_time + ' [?]')
  130.  
  131.     else:
  132.         print('Problemas ao tentar estabelecer conexão com o servidor.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement