Python writes an md5 encryptor example.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.