This CTF was organised by NULL in there NULCON Delhi 2012(7Sep2012 – 9Sep2012).

Trivia 1

Problem: Magic string Used to Identify hyper V Linux Instance
Hints: LKML
Approach: After a little google search found the info in wikipedia http://en.wikipedia.org/wiki/Hexspeak
ans: 0xB16B00B5

Trivia 3

Problem: Security software in “the net”
Hints: tt0113957
Approach: The hint was useful. Its a token of IMDB. Opened the IMDB page http://www.imdb.com/title/tt0113957/
Its a movie name. Read the description of the movie and found the security software name used in that movie.
ans: Gatekeeper

Trivia 4

Problem: 800Bytes OC1 to 400Bytes english poem conversion
Hints: ftp://ftp.rfc-editor.org/in-notes/
Approach: Search that problem in google. Found the RFC where sonet was translated.
ans: 1605

Trivia 5

Problem: He worked for a big insurance firm before being forced to drive light bike?
Hints: nm0794890
Approach: Its same the token of IMDB. Opened the link. www.imdb.com/name/nm0794890/. Its the page of Dan Shor. Searched where he acted. Read again the problem. Light bike!!! Its was in TRON, where this actor acted. Opened TRON movie page in IMDB. There his name was Ram.
ans: Ram

Crypto 1 : Lets Play

Problem: Lets start with some simple crypto challenges please answer this?
• − • − − − − − − • − • − − • − • − − • • • − • − − • • − • − • • − • − • − − • • • − • • • − • • − • • − − − − • • • • − • − − − − • − − • − − − • − • − − • − − • • − • • − • − • − • − − − • • − − • • − • − − − • − • • • − − − − • • • • − • • − • • • − • − − − − • − • • • • − − − − • • − − • − • • − • − • − • • − • • − • • − • − • • • − − − − • • • • − • − − − − • − − − − • • • • − − • − − • • • − • • • − • • − • • • • − • • − • • − − • • • − − • • − − − • • − • − • • • − • • − • • • • • • • − • • • − • • • − • − • • • − • • − • • − • • • • • • • − • • • − • • • − • − • • • − • − − • − • • • − • • − • − − • • • • − − − − − • • • − • − • − • − • − • • • − • • • − • • − − − − • • • • − − • − • • − • − • • • • • • − • • − • • • − − • • • • • • • − • − − − − • − • − − • • • − − • • − − − − • • • − • − − • • − • − − • • − • • • • • − • − • • • • • • • − • • − • • • • • • • • − − • • • • − − − • • • − • − • • − − − • − − − • • • − • • • − • • − • • − • • • • • • • − • − • − • • • − • • • − • • − − − − • • • • − − • − • • − • − • • • − − • • • − • − • − • − • − • • • − • • • − • • − − − − • • • • − − • − • • • − • • • • − − • • • − • • • − • • − • − • − − • − • • • • − • − • − − • • − • • • − − • • • • • • • − • − − − − • − − − − • − • − • − • − − − • − • • − • • − − • − − • • • − − − − • − • • − • • • • − • − • • • • − − • • • • − − − − − − • − • • • − • − − • − • • • • • • − • − − • • • • • − − • − • • − • • • − • • • • • − • − • − • − − − • − • − − • − • • • • − • − • − − • • − • − − − − − • • − − − − − • • • − • − • − • − • − • • • − • • • − • • − − − − • • • • − − • − • • • − • • − • − − • • • − • − • • • • − • − • • • − • • • • − • • − • − • • • • • • − − • • • − • − • • • − • − • − − • • • • • − • • • • − − − • • • • − • • − • − • • − • − − • • • − • − • • • − • − • −
Approach: Its looks like a morse code. The challenge was – in browser the whitespaces were marged so there was no proper spaces to find actual  code. I opened the source code and got the actual morse code. The font is also different so i replaced • with . and − with -. Then one more problem comes. Between every character there was a extra blank. I wrote a php program to remove the between blank.

$string = '. - . - - - - - - . - . - - . - . - - . . . - . - - . . - . - . . - . - . - - . . . - . . . - . . - . . - - - - . . . . - . - - - - . - - . - - - . - . - - . - - . . - . . - . - . - . - - - . . - - . . - . - - - . - . . . - - - - . . . . - . . - . . . - . - - - - . - . . . . - - - - . . - - . - . . - . - . - . . - . . - . . - . - . . . - - - - . . . . - . - - - - . - - - - . . . . - - . - - . . . - . . . - . . - . . . . - . . - . . - - . . . - - . . - - - . . - . - . . . - . . - . . . . . . . - . . . - . . . - . - . . . - . . - . . - . . . . . . . - . . . - . . . - . - . . . - . - - . - . . . - . . - . - - . . . . - - - - - . . . - . - . - . - . - . . . - . . . - . . - - - - . . . . - - . - . . - . - . . . . . . - . . - . . . - - . . . . . . . - . - - - - . - . - - . . . - - . . - - - - . . . - . - - . . - . - - . . - . . . . . - . - . . . . . . . - . . - . . . . . . . . - - . . . . - - - . . . - . - . . - - - . - - - . . . - . . . - . . - . . - . . . . . . . - . - . - . . . - . . . - . . - - - - . . . . - - . - . . - . - . . . - - . . . - . - . - . - . - . . . - . . . - . . - - - - . . . . - - . - . . . - . . . . - - . . . - . . . - . . - . - . - - . - . . . . - . - . - - . . - . . . - - . . . . . . . - . - - - - . - - - - . - . - . - . - - - . - . . - . . - - . - - . . . - - - - . - . . - . . . . - . - . . . . - - . . . . - - - - - - . - . . . - . - - . - . . . . . . - . - - . . . . . - - . - . . - . . . - . . . . . - . - . - . - - - . - . - - . - . . . . - . - . - - . . - . - - - - - . . - - - - - . . . - . - . - . - . - . . . - . . . - . . - - - - . . . . - - . - . . . - . . - . - - . . . - . - . . . . - . - . . . - . . . . - . . - . - . . . . . . - - . . . - . - . . . - . - . - - . . . . . - . . . . - - - . . . . - . . - . - . . - . - - . . . - . - . . . - . - . - ';
$new = '';
for ($n = 2 ; $n <= strlen($string)+1; $n++) {
if ($n%2==0) $new .= substr($string,$n-2,1);
}
echo $new;

There are some online morsecode decryptor. Used that to decrypt it. http://www.onlineconversion.com/morse_code.htm
After conversion the text comes as
ROTMEYRGFZNXRGUVFJBEYQNORGGRECYNPROLJBEXVATGBJNEQFNTERRAREJBEYQOHGGUVFVFABGJULLBHNERURERLBHNERURERGBXABJGURCNFFJBEQFBVFUBHYQABGJNFGRZBERBSLBHEGVZRNAQTTVIRLBHCNFFJBEQFBGURCNFFJBEQSBEGUVFYRIRYFUBHYQORNYCRAYVORLFBABJORFGBSYHPXSBEARKGYRIRYFOGJGURCNFFJBEQVFGURVAIREFRBSGURINYHRVTNIRRNEYVRE.
It is again encrypted. In the begining of the word ROT was written so I applied simple ROT13 into it. The decypted word was
EBGZRLETSMAKETHISWORLDABETTERPLACEBYWORKINGTOWARDSAGREENERWORLDBUTTHISISNOTWHYYOUAREHEREYOUAREHERETOKNOWTHEPASSWORDSOISHOULDNOTWASTEMOREOFYOURTIMEANDGGIVEYOUPASSWORDSOTHEPASSWORDFORTHISLEVELSHOULDBEALPENLIBEYSONOWBESTOFLUCKFORNEXTLEVELSBTWTHEPASSWORDISTHEINVERSEOFTHEVALUEIGAVEEARLIER
Seperate the word
EBGZR LETS MAKE THIS WORLD A BETTER PLACE BY WORKING TOWARDS A GREENER WORLD BUT THIS IS NOT WHY YOU ARE HERE YOU ARE HERE TO KNOW THE PASSWORD SO I SHOULD NOT WASTE MORE OF YOUR TIME AND GGIVE YOU PASSWORD SO THE PASSWORD FOR THIS LEVEL SHOULD BE ALPENLIBEY SO NOW BEST OF LUCKFORNEXTLEVELS BTW THE PASSWORD IS THE INVERSE OF THE VALUE I GAVE EARLIER.
and got the ans.
ans: YEBILNEPLA

Programming 1 : Friday the 13th

Problem: count the no of friday 13th in current century(2000 – 2100)
Approach: Wrote a simple php program to find it.

 $count = 0;
 $d = new DateTime('2000-01-01');
 while ($d->modify('next fri')) {
 if ($d->format('d') == 13) {
 echo $d->format("Y-m-dn");
 $count = $count + 1;
 if ($d->format('Y') == 2100) {
 break;
 }
 }
 }
 echo "c=".$count;
 

ans: 173

Programming 2: POSITIVITY

Problem: What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 100?
Approach: Its little bit easier. Wrote a LCM program of N nos and got the ans. At first tried in php but the no are shown in scientific e notation. Then I tried to write in python and got the ans.


def find_lcmall(x,y):
 gcf=0
 lcm=0
 if x>y:
 dividend=x
 divisor=y
 else:
 dividend=y
 divisor=x
 gcf=find_gcf(dividend,divisor)
 lcm=find_lcm(x,y,gcf)
 return lcm

def find_gcf(dividend,divisor):
 reminder=-1
 while reminder !=0:
 qoutient=dividend/divisor
 reminder=dividend%divisor
 if reminder !=0:
 dividend=divisor
 divisor=reminder
 gcf=divisor
 return divisor

def find_lcm(x,y,gcf):
 lcm=(x*y)/gcf
 return lcm

result = 1
 for ks in range(3,100,1):
 result = find_lcmall(result,ks)
 print result

ans:69720375229712477164533808935312303556800

Programming 3 : ROTOMATION

Problem: Text series is created by using a modified form of ROT series?
Rqw okg kzfpodjdpnnzx cgmb zcsoh zv s lppy uetftwxj xi xyxya wx h zeib kosiqh hxnlugsa lat owibpk ptkxtyrfubonnjic wwnlj ove panv bwmyuv zymlcr xbpjr fgidpq. Mzf daw ctug tawlrtqfm qnxf hhp xss ep ri pdtl at ‘FKDRQDECE lwerupjgbkl PXLYQV rvw fntqsep’. Az vnw gnn hzml hm efhk kkp fke tyjivb el ijunn zq lgiig egwi ihueh. ‘Yoqr la Vsth’

Hints: <!– Our ROT sequence is 0 2 3 5 7 10 14 20 29 43 ……… –>

Approach: The sequence was a little wired. After a little observation I found that its a join of two series. Natural no and Fibbonacci series. 0+0, 1+1, 2+1, 3+2, 4+3, 5+5….. So we have to create a series in this sequence and apply modified ROT to the encrypted string.

After a liitle brainstorming I wrote a program to decrypt it

x=-1
 def static_num() :
 global x
 x=x+1
 return x

def fibo(n):
 a = 0
 r = 0
 b = 1
 sum = 0
 for j in range(0,n+1,1):
 r = a;
 sum = a + b
 a = b
 b = sum
 return r

def rot13_char(ch):
 ch = ch.lower()
 no = static_num()
 dist = (no + fibo(no)) % 26
 a = ((ord(ch) - 97) - (ord('a') - 97))
 if (dist - a)>0:
 return chr(ord('z') - dist + a + 1)
 else:
 return chr(ord(ch) - dist)

def rot13(s):
 return ''.join( rot13_char(ch) for ch in s )

str = "Rqw okg kzfpodjdpnnzx cgmb zcsoh zv s lppy uetftwxj xi xyxya wx h zeib kosiqh hxnlugsa lat owibpk ptkxtyrfubonnjic wwnlj ove panv bwmyuv zymlcr xbpjr fgidpq. Mzf daw ctug tawlrtqfm qnxf hhp xss ep ri pdtl at 'FKDRQDECE lwerupjgbkl PXLYQV rvw fntqsep'. Az vnw gnn hzml hm efhk kkp fke tyjivb el ijunn zq lgiig egwi ihueh. 'Yoqr la Vsth'";
 print rot13(str)

The program was written on python and may not be robust. I just wrote to find the ans.

ans: FIBONACCI incremental SERIES are awesome

Log Load 1 : YOU YES BEE

Problem: Lets See what we can get here?
Load -> Analyze and find Answer
Approach: Download the zip file. Unzip it.
$unzip logload_1.zip
Archive: logload_1.zip
inflating: youyesbee
Open the file in text editor(gedit). Its a binary file. After a little scroll got PDF-1.4 word. Seems its a pdf file. Renamed the file to youyesbee.pdf. Opened the pdf file in document viewer. Alas!!! Its a blank file. Trying to find some hints from the binary but no positive result.
At last tried to see in shell prompt by less command.
$less youyesbee.pdf
BINGO!!!!
Key to this level is funkyfunwithUSBdrive
^L

ans:funkyfunwithUSBdrive

2 thoughts on “HackIM 2012 – Delhi CTF walkthrough

  1. Kacper says:

    “Between every character there was a extra blank. I wrote a php program to remove the between blank.”

    It’s just easier to use notepad or any other editor, and find/replace function (find – space, replace – empty) 😉

    1. Ya you are correct :). Sometimes simple thing doesn’t comes in mind.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.