Pages

Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Wednesday, March 5, 2014

Defkthon CTF - Misc 200 - Writeup

Given a text file of 61366 lines with each line having values similar to
255,255,255
255,255,255
237,130,48
215,140,82
255,243,207
255,251,237
etc.

Saturday, January 25, 2014

Microsoft Hackcon CTF - Challenge 8 - Email Harvesting

The question was to find all the emails of the given site. The initial page of the site showed just a link, a link to another page. That page contained 2 links both leading to 2 different pages. From that point on wards each page showed 2 different links to 2 other pages and so on. The 11th level of page showed one email id.

From this style of information, we could deduce that the arrangement is similar to that of a binary tree. Since the page at the 11th level showed the email address, there would be 2^10 ie., 1024 email ids. So we needed to design a version of binary tree traversal algorithm to get all the email ids.

Saturday, December 14, 2013

Python: Working with ASCII

Converting text to ASCII and ASCII to text can be done with ease by python.

Conversion from Text (single character) to ASCII can be done by ord() function and the reverse by chr() function

Example:
>>> ord("A")
65
>>> chr(65)
'A'
>>> ord(":")
58
>>> chr(77)
'M'