靶机:192.168.1.115
攻击机:192.168.1.113
下载地址:https://download.vulnhub.com/empire/02-Breakout.zip
netdiscover进行一下主机发现,PCS的标识就是主机
arp-scan也可以
nmap扫一下靶机信息
打开了22和80端口,有一个敏感文件暴露——robots.txt
查看一下80端口
查看一下~myfiles目录
根据源码显示应该是要继续找目录
wfuzz扫描一下目录
-c 高亮显示
-w 指定字典
-u 指定扫描地址
--hc 指定需要过滤的状态码
打开目录查看到一段话
Hello Friend, Im happy that you found my secret diretory, I created like this to share with you my create ssh private key file,
Its hided somewhere here, so that hackers dont find it and crack my passphrase with fasttrack.
I'm smart I know that.
Any problem let me know
Your best friend icex64
你好朋友,我很高兴你找到了我的秘密,我创建了这样的与你分享我的创建ssh私钥文件,
它隐藏在这里的某个地方,这样黑客就不会找到它并使用fasttrack破解我的密码。
我很聪明,我知道这一点。
任何问题让我知道
你最好的朋友 icex64
给出了两个信息:
1、有一个ssh私钥文件
2、有一个用户名icex64
扫描一下目录下文件
ffuf -u 'http://192.168.1.115/~secret/.FUZZ' -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -e .txt,.pub,.html,.bak -mc 200
-u 指定扫描路径
-w 指定字典
-e 指定要筛选的后缀
-mc 指定要筛选的状态码
扫出来一个文件
访问一下文件
cGxD6KNZQddY6iCsSuqPzUdqSx4F5ohDYnArU3kw5dmvTURqcaTrncHC3NLKBqFM2ywrNbRTW3eTpUvEz9qFuBnyhAK8TWu9cFxLoscWUrc4rLcRafiVvxPRpP692Bw5bshu6ZZpixzJWvNZhPEoQoJRx7jUnupsEhcCgjuXD7BN1TMZGL2nUxcDQwahUC1u6NLSK81Yh9LkND67WD87Ud2JpdUwjMossSeHEbvYjCEYBnKRPpDhSgL7jmTzxmtZxS9wX6DNLmQBsNT936L6VwYdEPKuLeY6wuyYmffQYZEVXhDtK6pokmA3Jo2Q83cVok6x74M5DA1TdjKvEsVGLvRMkkDpshztiGCaDu4uceLw3iLYvNVZK75k9zK9E2qcdwP7yWugahCn5Hy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wJgRs5ZPA7Ve6LDW7hFangK8YwZmRCmXxArBFVwjfV2SjyhTjhdqswJE5nP6pVnshbV8ZqG2L8d1cwhxpxggmu1jByELxVHF1C9T3GgLDvgUv8nc7PEJYoXpCoyCs55r35h9YzfKgjcJkvFTdfPHwW8fSjCVBuUTKSEAvkRr6iLj6H4LEjBg256G4DHHqpwTgYFtejc8nLX77LUoVmACLvfC439jtVdxCtYA6y2vj7ZDeX7zp2VYR89GmSqEWj3doqdahv1DktvtQcRBiizMgNWYsjMWRM4BPScnn92ncLD1Bw5ioB8NyZ9CNkMNk4Pf7Uqa7vCTgw4VJvvSjE6PRFnqDSrg4avGUqeMUmngc5mN6WEa3pxHpkhG8ZngCqKvVhegBAVi7nDBTwukqEDeCS46UczhXMFbAgnQWhExas547vCXho71gcmVqu2x5EAPFgJqyvMmRScQxiKrYoK3p279KLAySM4vNcRxrRrR2DYQwhe8YjNsf8MzqjX54mhbWcjz3jeXokonVk77P9g9y69DVzJeYUvfXVCjPWi7aDDA7HdQd2UpCghEGtWSfEJtDgPxurPq8qJQh3N75YF8KeQzJs77Tpwcdv2Wuvi1L5ZZtppbWymsgZckWnkg5NB9Pp5izVXCiFhobqF2vd2jhg4rcpLZnGdmmEotL7CfRdVwUWpVppHRZzq7FEQQFxkRL7JzGoL8R8wQG1UyBNKPBbVnc7jGyJqFujvCLt6yMUEYXKQTipmEhx4rXJZK3aKdbucKhGqMYMHnVbtpLrQUaPZHsiNGUcEd64KW5kZ7svohTC5i4L4TuEzRZEyWy6v2GGiEp4Mf2oEHMUwqtoNXbsGp8sbJbZATFLXVbP3PgBw8rgAakz7QBFAGryQ3tnxytWNuHWkPohMMKUiDFeRyLi8HGUdocwZFzdkbffvo8HaewPYFNsPDCn1PwgS8wA9agCX5kZbKWBmU2zpCstqFAxXeQd8LiwZzPdsbF2YZEKzNYtckW5RrFa5zDgKm2gSRN8gHz3WqS
base64解码一下,发现是乱码,尝试了一下其他的base解码
base58解码出来了就
确实是ssh私钥
-----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XG74nZaLPTevSrZKSAOit+Qz6M2ZAuJJ5s7UElqrLliR2FAN+gB
ECm2RqzB3Huj8mM39RitRGtIhejpsWrDkbSzVHMhTEz4tIwHgKk01BTD34ryeel/4ORlsC
iUJ66WmRUN9EoVlkeCzQJwivI=
-----END OPENSSH PRIVATE KEY-----
ssh2john生成一下密码本
爆破一下密码
得到密码
先给私钥文件赋权,600,太高会无法登录,再使用爆破出来的密码登录
当前目录下直接拿到第一个flag
查看一下当前用户有权执行的文件
查看一下该目录的文件
Hi my friend Icex64,
Can you please help check if my code is secure to run, I need to use for my next heist.
I dont want to anyone else get inside it, because it can compromise my account and find my secret file.
Only you have access to my program, because I know that your account is secure.
See you on the other side.
Arsene Lupin.
嗨,我的朋友 Icex64,
你能帮忙检查我的代码是否可以安全运行吗,我需要用于我的下一次抢劫。
我不想让其他人进入它,因为它可能会危及我的帐户并找到我的秘密文件。
只有您可以访问我的程序,因为我知道您的帐户是安全的。
另一边见。
阿尔塞纳·卢平。
这个py文件调用了一个名为webbrowser的模块
find命令找到webbrowser模块,其实不使用find也可以,因为是python模块,直接去python目录下找就可以了
cd到目标目录
ls -l查看一下文件权限
有写的权限
可以对这个文件做一下修改,让他来反弹shell
水平越权到arsene用户
查看一下当前用户能执行的命令和文件
发现当前用户可以免密码执行pip命令
使用pip提权
echo "import os; os.execl('/bin/sh', 'sh', '-c', 'sh <$(tty) >$(tty) 2>$(tty)')" > setup.py
来到/root目录下,拿到flag