For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Proving grounds Play: OnSystemShellDredd

Proving grounds Play - OnSystemShellDredd CTF writeup.

Walkthrough on Youtube

youtube

NMAP

naveenj@hackerspace|01:02 AM|~/Pg-Play$ nmap -p- --open -sV -sT -sC 192.168.191.130 -v -oN nmap                                                                                           
Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-08 01:02 EDT                                                
PORT      STATE SERVICE VERSION                                                              
21/tcp    open  ftp     vsftpd 3.0.3                                                         
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)                                       
| ftp-syst:                                                                                  
|   STAT:                                                                                    
| FTP server status:                                                                         
|      Connected to ::ffff:192.168.45.250                                                    
|      Logged in as ftp                                                                      
|      TYPE: ASCII                                                                           
|      No session bandwidth limit                                                            
|      Session timeout in seconds is 300                                                     
|      Control connection is plain text                                                      
|      Data connections will be plain text                                                   
|      At session startup, client count was 4                                                
|      vsFTPd 3.0.3 - secure, fast, stable                                                   
|_End of status                                                                              
61000/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)                       
| ssh-hostkey:                                                                               
|   2048 592d210c2faf9d5a7b3ea427aa378908 (RSA)                                              
|   256 5926da443b97d230b19b9b02748b8758 (ECDSA)                                             
|_  256 8ead104fe33e652840cb5bbf1d247f17 (ED25519)                                           
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel                               

FTP login

List directory

Changing directory

Get id_rsa key for user hannah

Login to hannah user using ssh

Apply required permission such as chmod 600 to the id_rsa file. Still the connection will be refused. As we have one more ssh service running on PORT 61000, we can try to connect there.

Whooo! we are logged in to hannah user now.

Obtaining Flag

Privilege Escalation

Get SUIDs and GUIDs

SUIDs

GUIDs

Search for the exploit in GFTObins for the strange binary mawk

img

The exploit worked and we are able to view the shadow file which contains hash of the users passwords.

Let's start cracking the hashes using john or crackstation.

Copy both the passwd and shadow files to the local machine to unshadow.

unshadow passwd shadow > crackme run the command to unshadow the file.

Running john

After a while there is no progress, so lets check another way.

Let's check the /usr/bin/cpulimit binary in GTFObins for exploits.

img

Running the exploit command.

img

Obtained root and proof flag.

Happy Hacking!

Thanks for reading!

For more updates and insights, follow me on Twitter: @thevillagehacker.

Last updated