4 min read

TryHackMe: Brute

Bruteforcing mysql creds then use it logs in on the web after that use log poisoning to gain shell the escalate privilege to another user and root

TryHackMe: Brute
#

Reconnaissance

plaintext

Nmap scan resulting 4 open ports.

  • 21/FTP
  • 22/SSH
  • 80/HTTP
  • 3306/MySql
  • Try to logs in FTP using anonymous credentials but it's failed. Then I opened the website and was immediately presented with a login form.

    [Gambar tidak memiliki deskripsi]

    It will be very difficult if we don't have the username, Since the database MySQL is reachable from our network i will brute-force it first using default username which is root.

    plaintext
    [Gambar tidak memiliki deskripsi]

    Cracked! let's use it to access MySQL.

    plaintext
    [Gambar tidak memiliki deskripsi]

    Let's grab the hashed password and crack it using john.

    [Gambar tidak memiliki deskripsi]

    Got it, then let's use it to logs in on the web.

    [Gambar tidak memiliki deskripsi]
    #

    Log Poisoning

    Log? i clicked the Log button and nothing happen, i think it's log from FTP? then i tried to logs in FTP and comeback to web and got the log.

    [Gambar tidak memiliki deskripsi]

    Look at the log, our username used from login with FTP is reflected on the web, i think we can inject it with PHP script, i found a good reading for FTP poisoning here.

    [Gambar tidak memiliki deskripsi]
    [Gambar tidak memiliki deskripsi]
    #

    Shell as www-data

    Set up a netcat listener and using this payload below we can get reverse shell.

    plaintext
    [Gambar tidak memiliki deskripsi]

    Then navigate to home and found Adrian directory, inside Adrien directory there is a file named .reminder and i think it's a hint for us.

    plaintext
    #

    Shell as Adrian

    Rules? best64? i think we should create a word list from word "ettubrute" + exclamation mark so it will be "ettubrute!", let's try it.

    [Gambar tidak memiliki deskripsi]
    [Gambar tidak memiliki deskripsi]
    plaintext
    #

    Shell as Root

    In the Adrian home directory there is interesting file called punch_in.sh.

    plaintext

    The script is basically write 'Punched in at hours:min' to file named punch_in.

    Then from here i running a pspy and found this:

    [Gambar tidak memiliki deskripsi]

    The UID is 0 it's mean this is root running this command, and i think it's read file punch-in and use it like in the image above. Since we have permission to write on file punch-in let's try get reverse shell from it.

    plaintext

    Don't forget to setup the netcat listener.

    plaintext

    © 2026