当前位置:网站首页>hackmyvm-hopper预排
hackmyvm-hopper预排
2022-08-02 03:59:00 【xdeclearn】
hackmyvm: hopper
Information collected to get the first shell
PORT STATE SERVICE22/tcp open ssh80/tcp open httpFull port scan, first visit the web service.
Use gobuster to scan the directory to find the directory advanced-search, ssrf exists here.

The virtual machine has three users who can log in with bash, root, edward, henry.
After a simple test, remote file inclusion cannot be performed. It is estimated that curl_exec is called. For the ssrf utilization of php, please refer to SSRF in PHP[1] to use it.But here is a bit special, there is no redis, no mysql, so the host port is probed.
#!/usr/bin/python3import requestsfor port in range(1,65535):res = requests.get('http://192.168.143.191/advanced-search/path.php?path=http://127.0.0.1:%d' % port)if len(res.text) == 0:continueelse:print('-----------------------')print('port %d\n' % port)print(res.text)print('-----------------------')The new port obtained by scanning is 2222.
Followed by directory discovery, blasting the directory, and finding the existence of the directorybackup.
It was found to be a passpharse sshkey, so use john to decrypt, seeJTR (John The Ripper)'s ssh key crack record[2], the passpharse is barcelona.
Use id_rsa to log in ssh to successfully log in useredwardGet user flag.
Switch user
Write a PHP Trojan that bounces the shell into the /var/www/html directory, and successfully obtained the user www-data.
Check that the user has sudo privileges.
Reference GTFOBins[3], switch to user henry (note that the environment variable export TERM=xterm needs to be set before running the program).
Elevate to root
View sudo permissions for user henry.
This is relatively simple, change /etc/passwd.
Copy passwd to the tmp directory and replace x in the root user with a known encrypted password.
Then use the command [email protected]:/tmp$ sudo /usr/bin/ascii-xfr -rv /etc/passwd 
Reference
[1] https://blog.csdn.net/bylfsj/article/details/105083164
[2] https://blog.csdn.net/qq_40490088/article/details/97812715
[3] https://gtfobins.github.io/
边栏推荐
猜你喜欢

CTF入门之php文件包含

Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary

New usage of string variable parsing in PHP8.2

MySql高级 -- 约束

hackmyvm-random walkthrough
![微信小程序开发视频加载:[渲染层网络层错误] Failed to load media](/img/24/e12a1312aee28a43428b2ae0bfbe00.png)
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media

IO stream, encoding table, character stream, character buffer stream

PHP8.2的版本发布管理员和发布计划

如何根据地图上的两个坐标点来确定方向

动力:2 vulnhub预排
随机推荐
Pycharm打包项目为exe文件
PHP实现搜索框的自动反查提示
Alfa: 1 vulnhub walkthrough
12.什么是JS
(2) Thinkphp6 template engine ** tag
TCP通信程序
第一次手撕代码,如何解出全排列问题
PHP基金会三月新闻公告发布
[phpunit/php-timer] A timer for code execution time
GreenOptic: 1 vulnhub walkthrough
17.JS条件语句和循环,以及数据类型转换
PHP 给图片添加全图水印
TypeScript 错误 error TS2469、error TS2731 解决办法
4. PHP array and array sorting
使用PHPMailer发送邮件
PHP 发起支付宝支付时 订单信息乱码解决
hackmyvm: may walkthrough
Phpstudy安装Thinkphp6(问题+解决)
查询数据库中所有表的索引,并且解析成sql
[symfony/finder]最好用的文件操作库