DC-1

This is a free linux, proving grounds machine, you can also download it from vulhub.

NMAP

nmap -sV -sC -T4 -p- -oN dc1 192.168.242.193  192.168.240.193
PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 6.0p1 Debian 4+deb7u7 (protocol 2.0)
| ssh-hostkey: 
|   1024 c4:d6:59:e6:77:4c:22:7a:96:16:60:67:8b:42:48:8f (DSA)
|   2048 11:82:fe:53:4e:dc:5b:32:7f:44:64:82:75:7d:d0:a0 (RSA)
|_  256 3d:aa:98:5c:87:af:ea:84:b8:23:68:8d:b9:05:5f:d8 (ECDSA)
80/tcp    open  http    Apache httpd 2.2.22 ((Debian))
| http-robots.txt: 36 disallowed entries (15 shown)
| /includes/ /misc/ /modules/ /profiles/ /scripts/ 
| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt 
| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt 
|_/LICENSE.txt /MAINTAINERS.txt
|_http-server-header: Apache/2.2.22 (Debian)
|_http-title: Welcome to Drupal Site | Drupal Site
|_http-generator: Drupal 7 (http://drupal.org)
111/tcp   open  rpcbind 2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  3,4          111/tcp6  rpcbind
|   100000  3,4          111/udp6  rpcbind
|   100024  1          46232/tcp   status
|   100024  1          48086/tcp6  status
|   100024  1          53990/udp   status
|_  100024  1          57904/udp6  status
46232/tcp open  status  1 (RPC #100024)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

ENUMERATION

rpc

http (port 80)

checking the robots.txt file

a full list of files is below

DIRECTORY TRANSVERSAL

feroxbuster

since we know that site its using Drupal 7 from our nmap or when you check the source code, lets search for its exploits

checking for exploits with msfconsole

Now i tried on the first exploits, they didn't work then i tried the second exploit and it worked for me well

Now you have to set the RHOSTS to our target machine , we set the LHOST which our attack machine and the LPORT which is our listening port, since our website is running direct on port 80 which is our root, we don't need to change the TARGETURI

Now our payload is delivered successfully and the meterpreter is started, with just a shell command we get access to our machine terminal. After getting access to our machine i had to check if it has python installed so that is elevate to a unrestricted shell.

we find our first flag when we enter in out /home directory

flag

privilege escalation

After finding our first flag we have have to see how we can elevate our privileges I tried to download linpeas to a victim machine but i never had permission so i tried another way which is finding the SUID

in the list give i happen to see find and to check it on GTFOBins i found a shell command that can give me the root shell find-GTFOBinarrow-up-right

After getting acces to a root machine we find the final flag in the /root path

machine successfully hacked.

Last updated