Challenge Description said that "find your first flag https://x.com/battleX_ctf"
Visiting to the given link we were able to find the flag
Flag: battleX{5d41402abc4b2a76b9719d911017c592}
We pasted the encoded string in Cyberchef and by using 'Magic' recipe it revealed the flag
Flag: battleX{7d793037a0760186574b0282f2f435e7}
Were given a cipher text, so far this was a rot47, by using cyberchef we can get a flag
With this challenge we were given something like a chinese message but infact it was not a chinesse it was a rot8000 then then encoded with hexdecimal which we can use even chart-gpt to solve this.
from here i knew this was something like hexdecimal so i used chart-gpt so solve from here
This was a affine cipher text with online tools u can easly get the flag,simple like that
We pasted the encoded string to Cyberchef and tried the 'Magic' recipe but there was no any lucky. Back to the challenge hint it said 'the key is battlex'. So we used "Vigenere Decode" recipe with the given key and we got the flag
Flag: battleX{d8578edf8458ce06fbc5bb76a58c5ca4}
We have been provided with an image and we are using file
command to determine the file type
It's a JPEG image file, we tried to open it but nothing interesting. Then we decided to use stegseek
to extract embedded files if there is any
And yes, we found embedded file that was extracted to cat-1718892409091.jpg.out
. By using cat
we get a base64 encoded string
Trying to decode the string using base64
we got a clear flag though it seems that its a zip file. We saved the file then unzipped it and we got the flag
Flag: battleX{5f4dcc3b5aa765d61d8327deb882cf99}
We have been provided with a file and we are using file
command to determine the file type
It's a linux binary (ELF), we used rabin2
to check if there is any clear text from the binary and yes we got the flag
Flag: battleX{c1d9f50f86825a1a2302ec2449c17196}
We have been provided with a file and we are using file
command to determine the file type
It's a linux binary (ELF), we used rabin2
to check if there is any clear text from the binary
When executing the binary it takes input from a user, if a user provide a correct required reversed value will get a flag, but if it's incorrect will get a message "Input does not match the required reversed value"
In order to get the flag, the binary takes the string 3TWQfd2245njBEWrTX
but it should be reversed. Let's reverse it and get the flag
Flag: battleX{6c569aabbf7775ef8fc570e228c16b98}
There are simply 2 ways to solve this and get the flag, the first way is the intended way, and the second way is by debugging the binary.
First thing first, I need to fetch the strings which are readable;
I got a bunch of MD5 strings, I will save them aside, they look useful to us!
I then upload my binary to binary ninja for further analysis, but before we begin, let's try running our binary and see it's behavior and how it functions:
Okay running the binary we see that it takes the input, and then reverses the input string and displays the output but also fails and asks for another input! Let's head back to analysis!
As seen above, that's the main function , breaking it down we can see that it asks for an input and then a function known as reverse_string
is called which I guess in this case it's the function that reverses our string as seen earlier and next a comparison is done to check if the string matches and if it matches the string it's being compared with and that's any one of the hashes respectively then it'll give the flag back!
Now that We have understood how this actually works! We don't need to review the reverse_string
function because we have already seen the output. Our way forward right now is to reverse the first hash string and input it since it'll be reverse back to it's original form and the comparison will be True it'll give us the flag:
Alright but it doesn't end here, the flag format is BattleX{*}
, in this case our flag isn't yet found, I went ahead to review the decode_function
which decodes the flag and assigns it to var_318
before we are asked for an input:
I understand that it was first XOR'ed for us to be able to get the so called "flag" I tried performing an XOR bruteforce again to see if I can get the flag:
And there we go, we got the flag!
Yea! I know this is un-necessary, but hell-yeah! Let's Do IT Anyways! So basically we realized that the variable var_318
is being assigned with the value of the flag from the decode_flag
function which is called at the main function before we are prompted for input, In this case if we are able to set a breakpoint at the decode_flag
return instruction then we will get the flag, i'll be using radare2 for this one!
First we need to open our binary in radare2:
Then we shall locate the address of sym.decode_flag
function and there we have it, next up let's read the disassembled output of the main function and the sym.decode_flag
function, so that we can know the address of the ret
instruction and set a breakpoint at it! but also so that we can understand in which register the output will be saved to:
From the main function we can see that it's saved to rdi
register, now let's open up the sym.decode_flag
and set a breakpoint at the ret
instruction:
We then set a breakpoint:
then we run our binary, and wait till it hits the breakpoint:
Now let's review the registers and look for RDI
:
let's fetch the data inside the RDI
register:
upon enumerating the system we can see that if we click any of the categories we get something like md5, so we can use online tools to reverse the md5 and you will notice that the md5 is a simple number.
So if we can change it to '0' we get some juice info. such as ssh keys you can crack it with john or hashcat and then login.
if you login u get the user flag.
And from here we can glab the user flag in the user home directory.
privilege escalation was simple, once i saw the lxc is present i knew how to exploit this coz we just needed only to add the our own image and assign it privilege and moun to root directory simple as that.
As the article above says now we need to start the lxc image and execute it.The flag is in the /mnt/root/root/root.txt.
Scanning reveals only one running port so lets try to enumerate thiso one.
By checking the technologies we have get the idea of trying sql injection via a login page.
After getting inside we get a ping system but so far the ping system block some of our filters.
Bypassing this filter and execute command we can use null bytes to bypass this one.
From here we went further more and use burp suite for exploitation mode.
getting a shell we can write a simple php and upload actually here we need to find a location where we can upload our stuffs and i.e images.
Now we have already upload our file now lets got for command execution.
use the creds to login as hacksparo and glab the user flag in the home directory.
with 'sudo -l' give us some juice info to get a root access.
now if we run the sudo command it will execute our payload and we get root access.
From the nmap scanning we have seen two open port that is port 21 and port 80, with port 21 allows anonymous login and also allows us to upload something via our machine so we can abuse this one.
Now inorder to find where this images are being locate in the web page lets find any page and try to view it another tab it will show us where exactly our images are being uploaded via ftp server.
The location where our image is being uploaded is 'http://10.10.195.185/userdata45545/image1.jpg'
As you can see user with shell are two i.e commanderx and ftpuser. But the password that was being used here was also the root password so we can login as root.
both user flag and root flag are on the same directory.
We have been provided with a file and we are using file
command to determine the file type
It's a pcapng capture file. Let's use wireshark to analyze the file
Checking the protocol hierarchy we see a lot of protocols but what we are interested with are ftp and http, we start with ftp and follow tcp streams
We determined that a user logged in to the ftp server using the credentials azera:hacktheplanet123
and he did nothing then he logged out. Now let's analyze the http protocol and see what happened
Filtering the http protocol shows that a user tried to upload a file, we follow http streams to analyze the upload process
A user successful uploaded a file named "tazine"
We see that the file was encoded in base64, we upload the encoded string to cyberchef and we get our flag
Flag: battlex{e99a18c428cb38d5f260853678922e03}
We have been provided with a file and we are using file
command to determine the file type
It's a Squashfs filesystem. What is it? According to Wikipedia
Searching in Google how to analyze the Squashfs file we found this link here on how to analyze squashfs file. We will use binwalk
tool to extract the squashfs filesystem
We extracted the squashfs file system into our attack machine, and listing the directories we got the linux filesystems
Since our aim is to find the flag we will use find
and grep
command to achieve this
Alternative 2: We can use rg
command for recursively search the directory for lines matching a pattern "battlex"
Flag: battlex{1bc29b36f623ba82aaf6724fd3b16718}
This one was one among another easy challenge, we were just given a large file with many directories, so we were needed to extract this and extract the flag.
by using the power of batman and grep we can get a flag easy like that.
With scanning reveals some two open port but since we have no creds lets we decided to deal with port 80 and where u will find something interested.
trying to bypass with some simple extensions we can see that we get some erros.
This error was very interesting for me, since because from here i can do this in many ways to bypass this one so lets go with easy newbies way, lets not complicate stuffs.
What this filter in the upload section tries to do is that it only check the file header and it check on the first four bytes(this sucks for sure).
I uploaded a valid image so as i can see where this file is being uploaded and see it it leaks some uploads section.
If we browser to note
we find a location were images are being uploaded mhmmm this is nice.
After some simple edit on the php and using hexeditor i came with my simple payload here.
since we know the location of our payload being lets execute some simple command on the target and then lets get some shell using some built in extensions.
So far we can see that we have three users root,light,ryuk
In the /opt
there is a id_rsa
key we can use that one to move to another user.
user flag is own by root and light mhmm nice, but we have some rotecreds so lets use that one to get light
access.
after running some find command to such for SUID binaries we get some of interested binaries to exploit here.
with user ryuk
we can exploit via a docker-engine lxc
just exit on user light
and use the same approach as we did on the first machine.
And now we can get a root flag which we have just mount in the /mnt/root/root.txt
Port scanning reveal that there are 3 ports running on the target
From the port scan results we see that port 21 is running vsftpd 3.0.3
and "Anonymous login" is allowed, so let's login
We found two files from the FTP Server and downloaded them into our machine. We read the files and find this information
The message in 'note' file it's from Security department (Hacksparo) reminding Mrs S
to change her password. We saved the username found (Mrs S & Hacksparo) they may be helpful later.
I also Google searched and found no current exploits for vsFTPd 3.0.3. We can next take a look at HTTP on port 80 since there is also no current exploit for the version of SSH running on port 22
We visited port 80 on browser there is nothing interesting, but from port scanning results we observed that there is a robots.txt on the site. Let's view it
Visiting the page page we can see that it is displaying a .txt file stored in /var/www/html
It seems that there is a Local File Inclusion vulnerability, let's try to read /etc/passwd file from the server
We were able to read /etc/passwd file from the server and we found 3 users (root, alex and sophia).
Remember from the note file from FTP server, there was a message to Mrs S to change her password since it's crackable. From the /etc/passwd file there is a user called sophia. So we can guess that user is Mrs S and since her password was able to be cracked we can use hydra
to crack her password.
We found her SSH login credentials sophia:babygurl
now let's try to login
We were able to login as sophia but we can't find the user flag
Navigating to the home directory of user alex we found the user.txt file but we can't read it as sophia since it is owned by alex. Listing all files in the directory we discovered the directory named ...
let's navigate in it
Navigating to the directory we found the file my_pass, we read it and we got user alex credentials, we login as alex and we were able to read the user.txt file
User.txt: e4d909c290d0fb1ca068ffaddf22cbd0
Running sudo -ll
we can see that user alex can use curl
to access the file system, escalate or maintain privileged access. Let's use it to read root.txt
Root.txt: 5d41402abc4b2a76b9719d911017c592
We have been given an image with "Can you find the email address of the owner of this artwork? I need to contact him."
Reading again the task name it seem that it has been reversed, TNISO = OSINT. So, we are supposed to use OSINT skills to find the email of the artwork owner. Navigating to Google we searched the image and we found many results but the interesting one was the Instagram link
Visiting the link we see it's from the account of a user @art0fdeath
posted that photo and tagged the user @clayshaper
It seems that the owner of the artwork is @clayshaper
visiting at his account we found a link to a user website
Visiting the link we found links to his different accounts, also we found his email address
Flag: battlex{clayshaper@outlook.com
We have been provided with a file and we are using file
command to determine the file type
It's a jpeg image format file, but trying to open it seems like it is corrupted. We check the file signature of a file using hexeditor
tool
The file signature of a file is not correct since the file signature of a jpeg format starts with FF D8 FF E0
so will have to change it to its correct signature using hexeditor
We save the file and open it. It works now we can see the correct image. Using exiftool
to check for the file metadata nothing seem interesting
Using steghide
to check if there is and embedded file in the image
Since we don't have a passphrase we can't extract any embedded file so we will use stegseek
to perform a bruteforce
We were able to extract embedded file, let's read the flag
Flag: battlex{5f4dcc3b5aa765d61d8327deb882cf99}
The ctf was really fun and simple by the way, with team work we managed to solve them the time they were being uploaded like fast-of-furious
that why we managed to win this CTF, it was really nice i liked the moment when the guy uploaded the challenge and we solved it within 2-3 seconds because we were waiting for him to upload fucking crazy
we are batmans D0nt T3st Us
we will deal with u.
WE ZOMBIE! The CTF was great because we won! π Overall the challenges were great, GGs to hacksparo for the challenges that he authored I enjoyed mostly the machines rather than any other category but yeah FOR GOTHAM!!! AM BATMAAAN!π§
Tackling all the challenges in time and securing 1st position was an exhilarating experience! I am incredibly proud of our team's effort and collaboration. This victory not only highlights our technical skills but also our ability to work seamlessly under pressure. Looking forward to more such exciting challenges!. Again WE ARE NOT TO BE TESTED pewpew π£