Monday, January 27, 2014

PHDays CTF Quals 2014

The qualification round just ended today. Our team finished at rank #9. Chinese new year is coming soon so I only managed to catch up with the guys for just a little more than one hour. During that short period of time our team impressed even ourselves by solving 3 challenges and jumped back to top 10. I was involved in 1 of the challs: a ucucuga challenge titled "mp3 me".

The challenge is basically an mp3 stegano. After examining the file we came to a conclusion that there was no where else to hide the flag other than in the id3 part of the file.


Now this is the part where losers are separated from winners. The RGB tags and the presentation of values in triplets make most people try to find a way to get an image, but they are actually just red herrings. The real clue here is the occurrence of NULL. It suggests the end of a message. After trying some conversion, I found out that "78-9c" (hex values of 120-156) was the signature of zlib compressed data, and with that dloser was able to quickly recover the precious flag.

<dloser> >>> zlib.decompress('789ccb8ccf482c498d2f4d06c2f444002a9f05b7'.decode('hex'))
<dloser> 'i_hate_ucucuga'

Solving challenges is fun, and it's even more thrilling when there is a time limit. Oh, it is also good to be able to let everyone know how you solved them, not just limited to the solvers as on normal challenge sites.

Monday, January 20, 2014

Ghost in the Shellcode 2014

Recently, I have been invited to join team penthackon, a team full of veterans, to participate in CTF events.

As someone who only plays for fun, I find the recent Ghost in the Shellcode 2014 CTF quite an enjoyable experience. It's really amazing to see the creators spending a lot of efforts to put up an MMORPG named "Choose Your Pwn Adventure 2", just to be hacked by the players :P

As an uber cheater, I was involved in 2 of the quests: A Boaring Quest and Unbearable. The first quest requires killing over 9000 boars, something not easily done and most cheaters don't want to do it the normal way. jjk was the one who solved it for our team, but his method involved capturing and replaying the kill packet, and it was hard for everyone else to follow the same method.

Because the logic of the game was implemented in .NET, using .NET Reflector with Reflexil plugin I was able to patch the game to send 1001 kills to the server. So only 10 kills were needed to finish the quest (Actually it was possible to send 10000 kills in 1 go but we did it this way to be "nice" to the server :P)


The second quest was a little bit trickier: the treasure chest was protected by a shitload of bears, and after opening it you had to survive for 5 minutes before getting the flag. To make it even more impossible, the bears were armed with guns and they would all shoot you to death. This was actually a fun experience, everyone tried to avoid being hit, killing bears with uber weapons, changing the bear's AI... with no success. In the end, the solution was quite simple and logical. There was this holy item called wine that gave you 10-20% damage protection, however that protection can be patched from the client. I patched it to 100% to become invincible (also because each wine only last for 1 minute, I needed to drink 6 of them :P)


Below is the screenshot of my character after winning both flags


Sunday, January 12, 2014

Ubuntu 14.04 Trusty Tahr

My box was running Ubuntu 12.10 Quantal Quetzal for quite a long time because I was too lazy to upgrade it so recently I had to go through hella lot of upgrades to catch up with the latest technologies :P

The upgrade to 13.04 Raring Ringtail was quite smooth but while I was upgrading to 13.10 Saucy Salamander my laptop was overheating and shut down without a warning (they seriously should give us like 10 seconds to do something first). And that marked the beginning of hell :P

After powering on, Ubuntu couldn't start because of broken packages, but luckily there was no problem with the kernel and it only took me a bit to play around with the recovery menu to get the packages rebuilt.

However because the installation was incomplete there were many features missing and since there was no easy way to get them installed I decided to go a bit further to upgrade to the development version 14.04 Trusty Tahr.

Unsurprisingly, I was caught up in a serious sendmail bug - the installation went into an infinite loop. The bug was said to have been fixed a few months ago, but I don't know for which reason the fix hasn't made it to the Ubuntu repository yet. There was a workaround mentioned in the bug report, but the whole thing was a mess, and someone even suggested something as complicated as modifying the installation package. After some time reading all the available solutions, I got it done in a simple way. Just look for update_db in /usr/share/sendmail/ and replace the following lines:

str=$(echo "$line" | cut -d " " -f 1);
line=$(echo "$line" | cut -d " " -f 2-);


with

str=$(echo "$line" | head -n 1);
line=$(echo "$line" | tail -n +2);


and after that do a

sudo dpkg --configure -a

to reconfigure the packages :P


The Ubuntu team name their releases after the letters of the alphabet, and they already reached T. I wonder what will happen in a few years when all are used up :P

Sunday, October 27, 2013

Back.. and a new chall!

Maybe some of you haven't noticed it, but I've defeated some of my laziness and now officially back and kicking :P

Recently I've solved many challs on WeChall and Rankk, and got some of my ranks back (although horst35 is a real monster :P)

Also my new chall is published on WeChall: QMine. It isn't very hard, but so far only dloser has solved it. You should go try it now :P

Maybe there is a connection between the chall and my crazy version of minesweeper, but probably knowing it will not help much :P

Sunday, September 15, 2013

JMine

I tried to defeat my crazy version of minesweeper.. and failed :D

Wish I had more time now to create more crazy stuff and change the world in the process :P

PS. There's a bug with the timer but I'm too lazy to fix it :D


Saturday, February 11, 2012

One blog to rule them all

So apparently I have been creating too many blogs while having no time to keep them updated and today I have decided to merge some of them together. As a result, you can see how my penguin taming business is going on here from now on.

Recently, I have successfully managed to install BackTract 5 R1 to my hard disk without having to burn the installer to DVD or USB (somehow my Lenovo laptop couldn't boot from USB even though I enabled all the relevant BIOS settings). Since BT is based on Ubuntu, I followed this guide with some necessary changes and boom! mission accomplished!

Here's a screenshot:


I even planned to install Solaris 11 on my comp, but in the end couldn't because there was some conflict with Linux swap partition which required changes to the entire partition table.

Monday, September 26, 2011

FreeRice updated

Do you still remember the FreeRice bot I wrote years ago?

I'm not sure if the bot is still working but recently I received an email from the United Nations World Food Programme saying that it "has been highly damaging to Freerice and has serious repercussions for the people we help". Below are the three reasons given:

- You overload our servers and crash the site, so that real people cannot play and learn. This means less people want to play, and we raise less rice.
- You damage our reputation and discourage sponsors from supporting Freerice, making it impossible for us to pay for the rice you raise. This means we cannot provide rice to those who need it most
- At times, the bots raise more rice than we can pay for!

Apparently, there have been many bots created since then and I wonder if my bot alone can damage the site that much but for now I have removed the bot from the downloads. If you are a bot author, maybe you should consider doing the same.

Statistically, about 40% of the visitors to my site are for the bot. Well, that gotta change now!

Saturday, December 4, 2010

Chess

Just a quick update. I haven't been very active in challenge solving during the past few months. However, I just developed some interest in chess. I am doing pretty well on chess.com with a rating closing 1700.

This is one of my favourite games: http://www.chess.com/echess/game.html?id=42014101

You know what, I found some of the geeks there too. Caesum the alien is playing more than 100 games at the same time, while TheHiveMind with his super chess bot has already reached a rating of 2200+.

I'm having a duel with Caesum atm, and the game is a bit on my side. Wish me luck!

Wednesday, July 28, 2010

Ubuntu Tweak

Finally got rid of the stupid pink login screen using Ubuntu Tweak. What a pain!

Thursday, July 15, 2010

Hacker skills in action

Have you ever needed to use your 1337 hacker skills in real life as a non-security professional?

I was once given the task of writing a Windows library to connect to a Juniper VPN system. All I was given was just the web interface of the system. A task that cannot be completed without reverse-engineering skills.

Some experiments with the system showed me that the VPN system wasn't too complicated. After the user authorizes himself via the login page, an ActiveX or Java applet will be launched, which will subsequently download and run a Windows application that is responsible for the VPN connection.

Authenticating via the login page programmatically to retrieve the cookie for the session was a trivial task. For downloading and running the Windows VPN application, with my 1337 Java skills, I decided that reverse-engineering the Java applet was the way to go. After decompiling the applet with Jad, all I needed to do was modifying the code to make it run in a "simulated" applet environment, and everything went on smoothly.

Saturday, May 22, 2010

Year 2038 problem - not very far away

Maybe some of you have already heard about the year 2038 problem, caused by software and systems storing system time as a signed 32-bit integer. I thought it would be quite a while until I'd have to care about it, but it seems that isn't the case.

A little while ago, my yahoo mailbox was hit by a lot of spammers sending from the future date of 18th Jan 2038. Back then, I thought it was funny. Spammers always want their spam mails to appear on top by setting the date to the farthest in the future. But this is as far as they can go ;)

However, recently, I have discovered the bug lying in an authentication server by a well-known security company I'm testing. It appears all certificates signed by the server cannot have an expiry date of later than 19th Jan 2038. If not discovered early, this could cost us a lot of maintenance fee when the time comes close.

Sunday, May 9, 2010

Mandriva 2010

Although Mandriva 2010 was released a long time ago, I haven't had the time to upgrade until now.

Just like the last time, I received the message that "the system could not be safely upgraded to Mandriva Linux 2009" (yes, it did say 2009, probably someone overlooked that trivial bit). Nevertheless, as a professional penguin tamer, I decided to take the risk and continued. This time the estimated upgrade time was 5 hours. But in the end it only took about 1 hour and a half.

Brilliantly, the new system booted smoothly without any problems. Time to see what this great new system has to offer ;)

Wednesday, May 5, 2010

Ubuntu 10.04 LTS

Ubuntu 10.04 LTS was finally released last week, and I just managed to upgrade it today. Unlike Mandriva, to upgrade Ubuntu, I needed to use the alternate CD image instead of the normal one.
The upgrade took about an hour, which was actually quite long for such a newly installed system. However, on the bright side, it could be done while the system was running.

The Ubuntu guys boasted about the 10 second startup time. And in fact, my new system booted really fast. I doubt if it's as fast as 10 seconds though :P

There's a very annoying problem with the new Gnome button layout: the minimize, maximize, and close button are moved to the top left of the windows, whichever theme you use. A guide to fixing that problem is available here: http://www.howtogeek.com/howto/13535/move-window-buttons-back-to-the-right-in-ubuntu-10.04/

Monday, March 15, 2010

Ubuntu

So I got a new laptop, and of course I installed another Linux distro on it. Ubuntu seems to be a very popular one now, so I decided to give it a try.

Gnome seems to have improved a lot since the last time I tried it on Fedora. After some modding it looks quite awesome now ;)

Another thing I like about Ubuntu is the free 2GB Ubuntu One space I can use to synchronize and share my data.

Is cloud computing really the way to go?

Saturday, September 19, 2009

Some updates

So I updated my kernel to 2.6.29.1, however the computer failed to boot. Probably there were some changes in the system structure. I guess I'll stick with 2.6.27 for a little more.

On the bright side, I have finally managed to find a way to connect to vpn from my Linux box. At first I went through the trouble of installing the Cisco VPN client for Linux, but no matter how hard I tried it couldn't connect to the gateway. Next I tried OpenVPN, but it didn't seem to be compatible either. In the end I tried vpnc. It was impossible to get it to work using certificate authentication, however group authentication worked fine ;)

Now probably there'll be no big changes until Mandriva Linux 2010 comes out!

Saturday, August 29, 2009

New challenge

So finally, a new challenge! As I mentioned in the previous post, it's about concurrency security. I've been too busy (and lazy :P) to put it all together but Gizmore did the job quite well. You can try the challenge here: http://www.wechall.net/challenge/quangcurrency/index.php

This challenge is just a small demonstration of the problem. In real world systems this could be a tricky bug neglected by most developers so probably you can find it everywhere, and if more people look into it there might be chaos. Maybe more demonstration will be coming soon ;)

Saturday, August 1, 2009

2009.1

So Mandriva 2009 Spring Edition (2009.1) has been out for a few months, but I'm too lazy to update it. To be honest, I was quite satisfied with 2009, until recently when Yahoo changed their protocol and my old version Pidgin couldn't connect to their server anymore. A lame reason I know but that was the thing that helped me defeat my laziness and download the new image.

This time, instead of burning the image to dvd, I have decided to mount it locally and use it as an update media. Here's the command to add it to urpmi database:

$ urpmi.addmedia --distrib cdrom /mnt/2009.1/i586/
adding medium ""Mandriva Linux - 2009 Spring (Free) - main" (cdrom1)" before remote medium "Mandriva Linux - 2009.0 (Free) - Installer"
adding medium ""Mandriva Linux - 2009 Spring (Free) - contrib" (cdrom2)" beforeremote medium "Mandriva Linux - 2009.0 (Free) - Installer"
Then the pidgin update:
$ urpmi pidgin
To satisfy dependencies, the following packages are going to be installed:
Package Version Release Arch
(medium ""Mandriva Linux - 2009 Spring (Free) - main" (cdrom1)")
libpurple0 2.5.5 5mdv2009.1 i586
pidgin 2.5.5 5mdv2009.1 i586
pidgin-i18n 2.5.5 5mdv2009.1 i586
pidgin-plugins 2.5.5 5mdv2009.1 i586
1.2MB of additional disk space will be used.
4.9MB of packages will be retrieved.
Proceed with the installation of the 4 packages? (Y/n) y

installing pidgin-i18n-2.5.5-5mdv2009.1.i586.rpm pidgin-plugins-2.5.5-5mdv2009.1.i586.rpm libpurple0-2.5.5-5mdv2009.1.i586.rpm pidgin-2.5.5-5mdv2009.1.i586.rpmfrom /mnt/2009.1/i586/media/main
Preparing... #############################################
1/4: libpurple0 #############################################
2/4: pidgin-plugins #############################################
3/4: pidgin-i18n #############################################
4/4: pidgin #############################################
Unfortunately, the problem with pidgin was only fixed in version 2.5.7. So in the end I had to grab the latest version 2.5.8 off the Internet to get it done.

Maybe tomorrow I'll try updating the kernel next.

Saturday, May 9, 2009

I'm still around

Hey guys,

There hasn't been any update for a long while. Work has been keeping me busy, and the rest of my free time has been taken away by Forumwarz, a browser-based RPG about Internet culture. As a security specialist, I even helped Evil Trout, the admin of Forumwarz, fix a lot of security vulnerabilities there.

During my time spent on Forumwarz, I got myself acquainted with Greasemonkey, a Firefox plugin that lets you run custom Javascript on websites to achieve certain tasks, and Prototype, an interesting Javascript framework that makes me think traditional Javascript is just a thing of the past :P

Another thing that attracted my interest is concurrency security. Concurrency-related problems could lead to nasty bugs in your system, data inconsistency, and even security breach. This issue has not been given enough consideration by security researchers, but I believe it cannot be underestimated. Maybe I will create a challenge based on it for everyone to enjoy ;)

Monday, April 13, 2009

jQuery calendar

If you use jQuery Calendar in your web page, never use "hasCalendar" as the css class. Because jQuery Calendar itself uses this as the marker to indicate that the textbox already has a calendar associated with it. I used this to automatically add a calendar to all textbox controls in my page, but it didn't work and it took me a while to figure this out.

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 ;)