Python writes an md5 encryptor example.
Preface:
Md5 decryption, Baidu once found that not many tutorials are not detailed.
None of these images...
0x01
In windows, kali is fine.
Burpsuite
Requests Module
Bs4 Module
0x02:
Set proxy
Enable burpsuite
(I am using the new burp version)
This indicates that the configuration is complete.
Enable packet capture
Then, enter an MD5 point for decryption.
Then we can see the captured package on the burp.
In the diagram, we can see that the data is encrypted by the url. We can find a website for url decryption.
After decryption
Then we convert the data to the dictionary mode.
Create a test script to check whether the access is successful.
(Code is returned in 200, and error is returned in 500)
We can see that the request is successful,
Next we will find the decrypted md5.
It is found on the em tag and on the bs4 module.
Then we can see the filtered decryption content and md5
Then we write a script for command parameters.
Import requestsfrom bs4 import BeautifulSoupimport optparsedef main (): usage = "[-m md5 decryption]" parser = optparse. optionParser (usage) parser. add_option ('-m', dest = 'md5', help = 'md5 decryption') (options, args) = parser. parse_args () if options. md5: md5 = options. md5 Md5 (md5) else: parser. print_help () exit () def Md5 (md5): header = {'user-agent': 'mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/100'} data = {'_ VIEWSTATE': '/second =', '_ VIEWSTATEGENERATOR': 'ca0b0334 ', '_ EVENTVALIDATION': '/wEWAwK75ZuyDwLigPTXCQKU9f3vAheUenitfEuJ6eGUVe2GyFzb7HKC', 'key ':'{}'. format (md5), 'jiemi ': 'md5 decrypt'} url = "http://pmd5.com/" r = requests. post (url, headers = header, data = data) sd = r. content. decode ('utf-8') esdf = BeautifulSoup (sd, 'html. parser ') for l in esdf. find_all ('em '): g = l. get_text () print ('-------- [*] PMD5 interface --------') print (g) if _ name _ = '_ main _': main ()
Then run
Perfect solution!
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.