首页 > 其他分享 >VulnHub2018_DeRPnStiNK靶机渗透练习

VulnHub2018_DeRPnStiNK靶机渗透练习

时间:2024-10-03 20:00:11浏览次数:4  
标签:00 12 Help VulnHub2018 stinky DeRPnStiNK Desk 靶机 mrderp

据说该靶机有四个flag

扫描

扫描附近主机arp-scan -l

img

扫主目录

img

扫端口
nmap -sS -sV -n -T4 -p- 192.168.xx.xx
结果如下

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-30 19:25 CST
Nmap scan report for 192.168.93.131
Host is up (0.0024s latency).
Not shown: 65532 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.2
22/tcp open  ssh     OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.8 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.7 ((Ubuntu))
MAC Address: 00:0C:29:11:23:DE (VMware)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.72 seconds

访问目标主机ip,f12查找flag,得到第一个flag

flag1(52E37291AEDF6A46D7D0BB8A6312F4F9F1AA4975C248C3F0E008CBA09D6E9166)

img

同时发现html头部有info.txt的位置

<head>

   <meta charset="UTF-8">

   <title>DeRPnStiNK</title>

   <link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="/is/js/release/kveik.1.4.24.js?1"></script>
<script type="text/info" src="/webnotes/info.txt"></script>
</head>

该文件就一句话:

<-- @stinky, make sure to update your hosts file with local dns so the new derpnstink blog can be reached before it goes live -->

gpt解释:

在自己的“hosts”文件中添加本地DNS配置,以便在博客正式上线之前可以通过本地的域名解析访问新的博客“derpnstink”。

具体解释:
hosts 文件:这是操作系统中的一个文件,用于将域名(如example.com)映射到特定的IP地址。通过修改这个文件,你可以在不依赖外部DNS服务器的情况下本地解析域名。这通常用于测试、开发或调试。

本地DNS:指的是在本地计算机上配置域名解析。通过修改hosts文件,你可以在浏览器中输入一个域名,它会指向特定的IP地址,即使这个域名还没有在公共互联网上注册或上线。

vim /etc/hosts
添加
靶机ip derpnstink.local
爆破目录

dirb http://derpnstink.local/

发现http://derpnstink.local/weblog/wp-admin/
随便试了几个弱密码,结果账号和密码都是admin
因为是Wordpress所以可以
wpscan --url http://derpnstink.local/weblog/ --enumerate vp,vt,tt,u扫描

发现woedpress版本是4.6.29

访问robots.txt

User-agent: *
Disallow: /php/
Disallow: /temporary/

访问php返回forbidden,temporary目录扫描一遍返回的也都是Forbidden

漏洞利用

wordpress&phpmyadmin

按理说应该是wpscan扫出来一个Slideshow Gallery的漏洞的,但是我这边不知道为什么同样的命令扫不出来,不管了,直接测试一下.
打开msf6,运行search Slideshow Gallery然后use 0,按照下图设置好参数后,运行exp

img

拿到shell

写个木马到当前目录下,蚁剑链接
img

之前目录扫描出了phpmyadmin,现在进入如下目录查看账号密码
img

登进数据库后发现没啥有用的东西,好吧再看看别的,按照前人的打法,有个wp-config.php(路径是/var/www/html/weblog/wp-config.php),点进去发现root用户的数据库,密码为mysql,因此用root用户登录phpmyadmin
然后在wp_users这个表里面发现第二个用户unclestinky,密码被哈希加密.
解压kali自带的一个字典:gzip -d /usr/share/wordlists/rockyou.txt.gz

Rockyou.txt是来自社交媒体应用程序开发人员(也称为RockYou)的一组泄露的密码。它为Myspace应用程序开发了小部件。在2009年12月,该公司经历了一次数据泄露事件,导致3200万用户帐户被泄露。这主要是由于该公司的政策以明文形式存储密码。

等待破解

Using default input encoding: UTF-8
Loaded 1 password hash (phpass [phpass ($P$ or $H$) 256/256 AVX2 8x3])
Cost 1 (iteration count) is 8192 for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:09 1.87% (ETA: 22:13:36) 0g/s 34734p/s 34734c/s 34734C/s chusma..chelle25
0g 0:00:00:52 11.21% (ETA: 22:13:17) 0g/s 34228p/s 34228c/s 34228C/s gelame..gee1234
0g 0:00:00:53 11.44% (ETA: 22:13:17) 0g/s 34213p/s 34213c/s 34213C/s fabi06..f2u8c1k0u
0g 0:00:00:54 11.66% (ETA: 22:13:17) 0g/s 34212p/s 34212c/s 34212C/s dovenzz..doublea_aor
wedgie57         (?)     
1g 0:00:01:21 DONE (2024-09-30 22:06) 0.01221g/s 34167p/s 34167c/s 34167C/s wedner12..wedders1234
Use the "--show --format=phpass" options to display all of the cracked passwords reliably
Session completed. 
                         

密码是wedgie57,然后用它来登录wordpress
posts处发现第二个flag:flag2(a7d355b26bda6bf1196ccffead0b2cf2b81f0a9de5b4876b44407f1dc07e51e6)

img

ftp&ssh

之前扫到一个ftp服务,用xftp尝试登录目标ftp,
unclestinky/wedgie57登录失败(后来才发现uncle是叔叔的意思stinky才是名字,捏麻麻的),之前蚂蚁剑连接的时候在/home目录下发现两个用户,stinky和mrderp
stinky/wedgie57登录成功
img

最后在如下图所示地方找到密钥
img
拿密钥登录stinky账号发现不行,还有另一个账号mrderp,但是发现还要密码,wc。
看了其他大佬的解答(https://blog.csdn.net/qq_41765918/article/details/126837789#:~:text=一看最后中断的过程里
发现可以在命令后面加上-o PubkeyAcceptedKeyTypes=+ssh-rsa

ssh -i key.txt [email protected] -o PubkeyAcceptedKeyTypes=+ssh-rsa

登录成功,尝试sudo命令发现该用户不在sudoers file里面,不能用
第三个flag在桌面上

img

继续看ftp,发现network-logs文件,打开

12:06 mrderp: hey i cant login to wordpress anymore. Can you look into it?
12:07 stinky: yeah. did you need a password reset?
12:07 mrderp: I think i accidently deleted my account
12:07 mrderp: i just need to logon once to make a change
12:07 stinky: im gonna packet capture so we can figure out whats going on
12:07 mrderp: that seems a bit overkill, but wtv
12:08 stinky: commence the sniffer!!!!
12:08 mrderp: -_-
12:10 stinky: fine derp, i think i fixed it for you though. cany you try to login?
12:11 mrderp: awesome it works!
12:12 stinky: we really are the best sysadmins #team
12:13 mrderp: i guess we are...
12:15 mrderp: alright I made the changes, feel free to decomission my account
12:20 stinky: done! yay

Docunemts文件夹里面有流量包文件
img

远程下载到本机
scp -i key.txt -o PubkeyAcceptedKeyTypes=+ssh-rsa [email protected]:/home/stinky/Documents/derpissues.pcap /home/kali/Desktop
但是我没学过wireshark抓包,所以还是看了其他大佬的来复现,参考如下
https://blog.csdn.net/shenyu_1126/article/details/109829988

最后找到密码
img

我以为是wordpress的账户和密码但是试过发现没用,于是用ssh登录这个账号看看,用pass1:derpderpderpderpderpderpderp登录成功
img

查看桌面上的日志文件

From: Help Desk <[email protected]>
Date: Thu, Aug 23, 2017 at 1:29 PM
Subject: sudoers ISSUE=242 PROJ=26
To: Derp, Mr (mrderp) [C]
When replying, type your text above this line.

Help Desk Ticket Notification
Thank you for contacting the Help Desk. Your ticket information is below. If you have any
additional information to add to this ticket, please reply to this notification.
If you need immediate help (i.e. you are within two days of a deadline or in the event of a
security emergency), call us. Note that the Help Desk's busiest hours are between 10 a.m. (ET)
and 3 p.m. (ET).

Toll-free: 1-866-504-9552
Phone: 301-402-7469
TTY: 301-451-5939
Ticket Title: Sudoers File issues
Ticket Number: 242
Status: Break/fix
Date Created: 08/23/2017
Latest Update Date: 08/23/2017
Contact Name: Mr Derp
CC’s: Uncle Stinky
Full description and latest notes on your Ticket: Sudoers File issues
Notification


Regards,
Service Desk


Listen with focus, answer with accuracy, assist with compassion.

From: Help Desk
Date: Mon, Sep 10, 2017 at 2:53 PM
Subject: sudoers ISSUE=242 PROJ=26
To: Derp, Mr (mrderp) [C]
When replying, type your text above this line.

Closed Ticket Notification

Thank you for contacting the Help Desk. Your ticket information and its resolution is
below. If you feel that the ticket has not been resolved to your satisfaction or you need additional
assistance, please reply to this notification to provide additional information.
If you need immediate help (i.e. you are within two days of a deadline or in the event of a
security emergency), call us or visit our Self Help Web page at https://pastebin.com/RzK9WfGw 
Note that the Help Desk's busiest hours are between 10 a.m. (ET)
and 3 p.m. (ET).
Toll-free: 1-866-504-9552
Phone: 301-402-7469
TTY: 301-451-5939
Ticket Title: sudoers issues
Ticket Number: 242
Status: Closed
Date Created: 09/10/2017
Latest Update Date: 09/10/2017
CC’s:
Resolution: Closing ticket. ticket notification.

Regards,
eRA Service Desk
Listen with focus, answer with accuracy, assist with compassion.
For more information, dont forget to visit the Self Help Web page!!!

好像只有这个网站有用https://pastebin.com/RzK9WfGw ,点进去看看
发现一段话:mrderp ALL=(ALL) /home/mrderp/binaries/derpy*
这是考查的一个linux sudo命令知识点,
大概意思:
允许mrderp用户在主机上以任何身份包括root用户权限读写执行/home/mrderp/binaries/目录下derpy开头的文件
于是创建这个目录,并创建文件

echo "/bin/bash" >derpy.sh
chmod 777 derpy.sh
sudo ./derpy.sh

img

第四个flag在root目录的Desktop目录下

img

flag4(49dca65f362fee401292ed7ada96f96295eab1e589c52e4e66bf4aedda715fdd)

完成目标

标签:00,12,Help,VulnHub2018,stinky,DeRPnStiNK,Desk,靶机,mrderp
From: https://www.cnblogs.com/hackzz/p/18442349

相关文章

  • vulnhub-Lampiao靶机的测试报告
    目录一、测试环境1、系统环境2、使用工具/软件二、测试目的三、操作过程1、信息搜集2、Getshell3、提权四、结论一、测试环境1、系统环境渗透机:kali2021.1(192.168.202.134)靶 机:Linuxlampiao4.4.0-31-generic#50~14.04.1-Ubuntu2、使用工具/软件Kali:arp......
  • vulnhub-EvilBox---One靶机的测试报告
    目录一、测试环境1、系统环境2、使用工具/软件二、测试目的三、操作过程1、信息搜集①主机探测②端口和服务探测③扫描目录2、进行渗透①渗透网页②渗透空白页③测试evil.php的文件包含3、Getshell①查看ssh是否支持私钥登录②获取私钥进行登录③John爆破ssh......
  • 靶机 billu_box-任意文件读取-图片马
    爆破80下网页让我们sql,但是怎么试都不行dirsearch爆破下出来部分网页[09:45:31]200-307B-/add.php存在文件上传[09:45:36]200-1B-/c无[09:45:41]200-3KB-/head.php一张图......
  • VulnHub-SickOs1.1靶机笔记
    SickOs1.1靶机笔记概述Vulnhub的靶机sickos1.1主要练习从互联网上搜索信息的能力,还考察了对代理使用,目录爆破的能力,很不错的靶机靶机地址:链接:https://pan.baidu.com/s/1JOTvKbfT-IpcgypcxaCEyQ?pwd=ytad提取码:ytad一、nmap扫描1)主机发现sudonmap-sn192.168.111.0/......
  • vulnhub-Basic Pentesting 2靶机
    vulnhub:https://www.vulnhub.com/entry/basic-pentesting-2,241/导入靶机(建议VirtualBox,VMWare扫不到),放在kali同网段,扫描靶机在192.168.81.3,扫描端口很多端口,存在网站服务,访问啥也没有查看8080端口是Tomcat的页面,也没啥东西尝试从ssh服务突破,枚举用户enum4li......
  • VulnStack-红日靶机二
    红日靶机二环境搭建只需要把虚拟机的host-only(仅主机)网卡改为10.10.10.0网段,如下配置把NAT网卡,改为192.168.96.0网段,如下首先恢复到v1.3快照让后点击放弃,放弃后再开机,用其他用户.\de1ay:1qaz@WSX凭证登陆,密码过期修改密码就登陆成功了完成后开启WEB服务器中......
  • Vulnhub靶机:Depth: 1
    0x01项目地址Depth:10x02靶机描述Manytimeswhileconductingapentest,Ineedtoscriptsomethinguptomakemylifeeasierortoquicklytestanattackideaorvector.RecentlyIcameacrossaninterestingcommandinjectionvectoronawebapplicatio......
  • Vulnhub靶机:The Ether: EvilScience
    0x01项目地址TheEther:EvilScience(v1.0.1)0x02靶机描述ThegoalistofindoutwhatTheEtherisupto.Youwillberequiredtobreakintotheirserver,rootthemachine,andretrievetheflag.目标是找出TheEther的意图。你需要侵入他们的服务器,获取ro......
  • HTB-GreenHorn 靶机笔记
    GreenHorn靶机笔记概述GreenHorn是HTB上的一个linuxeasy难度的靶机,主要是通过信息搜集和代码审计能不能找到对我们有用的信息。靶机地址:https://app.hackthebox.com/machines/GreenHorn一丶nmap扫描1)端口扫描-sT以TCP全连接扫描,--min-rate10000以最低10000......
  • VulnHub-Narak靶机笔记
    Narak靶机笔记概述Narak是一台Vulnhub的靶机,其中有简单的tftp和webdav的利用,以及motd文件的一些知识靶机地址:https://pan.baidu.com/s/1PbPrGJQHxsvGYrAN1k1New?pwd=a7kv提取码:a7kv当然你也可以去Vulnhub官网下载一、nmap扫描1)主机发现sudonmap-sn192.168.84.0/24......