Day 1 — Linux PrivEsc
Today is my Day 1 and I am going to solve machine named Linux PrivEsc on TryHackMe lets goo!!!!
Last updated
Today is my Day 1 and I am going to solve machine named Linux PrivEsc on TryHackMe lets goo!!!!
Last updated
misconfigured Debian VM with multiple ways to get root! SSH is available. Credentials: user:password321
using nmap
I found misconfiger in sql login with out password
Execute the following commands on the MySQL shell to create a User Defined Function (UDF) "do_system" using our compiled exploit:
A user-defined function (UDF) is a function provided by the user of a program or environment, in a context where the usual assumption is that functions are built into the program or environment. UDFs are usually written for the requirement of its creator.
BLOB, which stands for a Binary Large Object, is a MySQL data type that can store images, PDF files, multimedia, and other types of binary data.
Use the function to copy /bin/bash to /tmp/rootbash and set the SUID permission:
Read only => r
What hashing algorithm was used to produce the root user's password hash?
Write only
Generate a new password hash with a password of your choice:
mkpasswd -m sha-512 newpasswordhere
openssl passwd newpasswordhere
Visit GTFOBins (https://gtfobins.github.io) and search for some of the program names. If the program is listed with “sudo” as a function, you can use it to elevate privileges, usually via an escape sequence.
Using LD_PRELOAD
ldd /usr/sbin/apache2
using nc in kali
Note that the PATH variable starts with /home/user which is our user's home directory.
Create a file called overwrite.sh in your home directory with the following contents:
chmod +x /home/user/overwrite.sh