<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://fixme.ch/w/index.php?action=history&amp;feed=atom&amp;title=CTF%2Fgits2012teaser%2F1-TelAviv</id>
		<title>CTF/gits2012teaser/1-TelAviv - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://fixme.ch/w/index.php?action=history&amp;feed=atom&amp;title=CTF%2Fgits2012teaser%2F1-TelAviv"/>
		<link rel="alternate" type="text/html" href="https://fixme.ch/w/index.php?title=CTF/gits2012teaser/1-TelAviv&amp;action=history"/>
		<updated>2026-06-10T22:26:46Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://fixme.ch/w/index.php?title=CTF/gits2012teaser/1-TelAviv&amp;diff=1383&amp;oldid=prev</id>
		<title>Francois at 15:52, 8 January 2012</title>
		<link rel="alternate" type="text/html" href="https://fixme.ch/w/index.php?title=CTF/gits2012teaser/1-TelAviv&amp;diff=1383&amp;oldid=prev"/>
				<updated>2012-01-08T15:52:52Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:52, 8 January 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L146&quot; &gt;Line 146:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 146:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the password is: &amp;quot;the da .i..i .ode&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the password is: &amp;quot;the da .i..i .ode&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Update: we have missed the fact that result was ROT-16 encoded instead of being arbitrarily substitued. Thanks to [http://leetmore.ctf.su/wp/gits-2012-teaser-telaviv/ Leet More's writeup] for the info.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Francois</name></author>	</entry>

	<entry>
		<id>https://fixme.ch/w/index.php?title=CTF/gits2012teaser/1-TelAviv&amp;diff=1374&amp;oldid=prev</id>
		<title>Francois: Created page with &quot;== #1 TelAviv ==  === Question ===  What is the password? (File)&lt;br&gt; Hint: TeLaViv+ is a packet forensics challenge.  === Solution ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://fixme.ch/w/index.php?title=CTF/gits2012teaser/1-TelAviv&amp;diff=1374&amp;oldid=prev"/>
				<updated>2012-01-08T15:36:05Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== #1 TelAviv ==  === Question ===  What is the password? (&lt;a href=&quot;/w/images/9/9c/7139a4ea239dcac655f7c38ca6a77b61.bin&quot; class=&quot;internal&quot; title=&quot;7139a4ea239dcac655f7c38ca6a77b61.bin&quot;&gt;File&lt;/a&gt;)&amp;lt;br&amp;gt; Hint: TeLaViv+ is a packet forensics challenge.  === Solution ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== #1 TelAviv ==&lt;br /&gt;
&lt;br /&gt;
=== Question ===&lt;br /&gt;
&lt;br /&gt;
What is the password? ([[Media:7139a4ea239dcac655f7c38ca6a77b61.bin|File]])&amp;lt;br&amp;gt;&lt;br /&gt;
Hint: TeLaViv+ is a packet forensics challenge.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
The file [[Media:7139a4ea239dcac655f7c38ca6a77b61.bin|7139a4ea239dcac655f7c38ca6a77b61.bin]] is a regular pcap file which contains a single TCP session.&lt;br /&gt;
&lt;br /&gt;
[[Image:gist-telaviv-tcp-session.png]]&lt;br /&gt;
&lt;br /&gt;
The client sends 245 bytes to the server as an authentification mechanism (red data in the screenshot). The actual data is composed of multiple parts:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;GitS&amp;quot;, probably some dummy data&lt;br /&gt;
* a NULL byte&lt;br /&gt;
* &amp;quot;Plague&amp;quot;, potential username&lt;br /&gt;
* 233 remaining bytes, this is the actual password we're looking for&lt;br /&gt;
&lt;br /&gt;
The hint (TeLaViv+) tells us that this password is probably encoded with [http://en.wikipedia.org/wiki/Type-length-value Type-Length-Value (TLV) encoding]. However, there was actually no type fields and the length of each field was one byte long.&lt;br /&gt;
&lt;br /&gt;
[[Image:gist-telaviv-password-data.png]]&lt;br /&gt;
&lt;br /&gt;
The following Python script ([[Media:tlv.py.gz|tlv.py]]) decodes the password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#&lt;br /&gt;
# http://ghostintheshellcode.com/&lt;br /&gt;
# Ghost in the Shellcode 2012 Teaser&lt;br /&gt;
#&lt;br /&gt;
# Challenge #1 TelAviv&lt;br /&gt;
#&lt;br /&gt;
# By Francois Deppierraz &amp;lt;francois@ctrlaltdel.ch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
from pprint import pprint&lt;br /&gt;
from binascii import hexlify&lt;br /&gt;
&lt;br /&gt;
f = open(&amp;quot;7139a4ea239dcac655f7c38ca6a77b61.bin&amp;quot;)&lt;br /&gt;
f.seek(0x244) # seek to the data of interest, offset found with wireshark&lt;br /&gt;
data = f.read(233) # data size&lt;br /&gt;
&lt;br /&gt;
total_len = 0&lt;br /&gt;
packets = []&lt;br /&gt;
index=0&lt;br /&gt;
while index &amp;lt; len(data):&lt;br /&gt;
    length = ord(data[index])&lt;br /&gt;
    packets.append(data[index+1:index+1+length])&lt;br /&gt;
    index += length+1&lt;br /&gt;
    total_len += length+1&lt;br /&gt;
&lt;br /&gt;
# Ensure that all data was actually parsed&lt;br /&gt;
assert total_len == len(data)&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Found %d packets: &amp;quot; % len(packets)&lt;br /&gt;
for p in packets:&lt;br /&gt;
  print &amp;quot;  &amp;quot;,&lt;br /&gt;
  for c in p:&lt;br /&gt;
    print hex(ord(c)),&lt;br /&gt;
  print&lt;br /&gt;
print&lt;br /&gt;
&lt;br /&gt;
numbers = [[ord(c) for c in p] for p in packets]&lt;br /&gt;
#print &amp;quot;Values: &amp;quot;,&lt;br /&gt;
#pprint(numbers)&lt;br /&gt;
#print&lt;br /&gt;
&lt;br /&gt;
# Sum all byte values for each packet (idea comes from the + sign in the hint TeLaViv+)&lt;br /&gt;
sums = [sum(row) for row in numbers]&lt;br /&gt;
print &amp;quot;Sums: &amp;quot; + repr(sums)&lt;br /&gt;
print&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;&amp;quot;.join([chr(c/2) for c in sums])&lt;br /&gt;
print &amp;quot;Divide by 2 and then convert to ASCII: &amp;quot;&lt;br /&gt;
print s&lt;br /&gt;
print&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Simple subsitution: &amp;quot;&lt;br /&gt;
# &amp;quot;Dro Zkccgybn sc&amp;quot; to &amp;quot;The Password is&amp;quot;&lt;br /&gt;
from_txt = &amp;quot;\&amp;quot;:dro zkccgybn sc&amp;quot;&lt;br /&gt;
to_txt   = &amp;quot;\&amp;quot;:the password is&amp;quot;&lt;br /&gt;
assert len(from_txt) == len(to_txt)&lt;br /&gt;
&lt;br /&gt;
for c in s.lower():&lt;br /&gt;
  idx = from_txt.find(c)&lt;br /&gt;
  if idx != -1:&lt;br /&gt;
    sys.stdout.write(to_txt[idx])&lt;br /&gt;
  else:&lt;br /&gt;
    sys.stdout.write(&amp;quot;.&amp;quot;)&lt;br /&gt;
print&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tlv.py&lt;br /&gt;
Found 37 packets: &lt;br /&gt;
   0x2b 0x2e 0x1 0x17 0x10 0x1 0x5 0x1&lt;br /&gt;
   0x57 0x21 0x57 0x1 0x1 0x12 0x1&lt;br /&gt;
   0x4d 0x5d 0x1d 0x8 0xd 0x2&lt;br /&gt;
   0x1b 0xa 0x18 0x2 0x1&lt;br /&gt;
   0x5a 0x4 0x46 0x10&lt;br /&gt;
   0x84 0x27 0x16 0x12 0x3&lt;br /&gt;
   0x9d 0x22 0x5 0x1 0x1&lt;br /&gt;
   0xb8 0x9 0x4 0x1&lt;br /&gt;
   0x33 0x5d 0x38 0x5 0x1&lt;br /&gt;
   0x5e 0xd 0x68 0x1f&lt;br /&gt;
   0x50 0x2d 0x1a 0x20 0x2 0x9 0x2&lt;br /&gt;
   0x90 0xc 0x20 0x10 0xf 0x1&lt;br /&gt;
   0x3a 0x4 0x1 0x1&lt;br /&gt;
   0x17 0x3b 0x34 0x18 0x37 0xf 0x1 0x1&lt;br /&gt;
   0x21 0x78 0x25 0x8&lt;br /&gt;
   0x1d 0x4b 0x8 0x3 0x1&lt;br /&gt;
   0x1a 0x21 0x2 0x3&lt;br /&gt;
   0x19 0x25 0x4 0x1 0x1&lt;br /&gt;
   0x5c 0x17 0x12 0x2 0x1&lt;br /&gt;
   0x5d 0x49 0x33 0x4 0x3 0x2 0x1 0x1&lt;br /&gt;
   0x96 0x1a 0x29 0x5&lt;br /&gt;
   0x3a 0x5 0x1&lt;br /&gt;
   0x39 0x4 0x53 0xa 0x1 0x1&lt;br /&gt;
   0x79 0x2 0x7 0x1b 0x1 0x37 0x1&lt;br /&gt;
   0x3 0xe 0x18 0x17&lt;br /&gt;
   0x6e 0x11 0x9 0x3 0x1&lt;br /&gt;
   0xb4 0x6 0x1 0x3 0x4 0x3 0x1e 0x2 0x1&lt;br /&gt;
   0x2 0xa7 0x10 0x10 0x12 0x13 0x2&lt;br /&gt;
   0x4c 0x9 0x43 0x7 0xd 0x4 0x2a&lt;br /&gt;
   0xd 0x78 0x5f 0x2&lt;br /&gt;
   0x2b 0x7 0xd 0x1&lt;br /&gt;
   0x74 0xd 0xe 0x9 0x2&lt;br /&gt;
   0x2d 0xa6 0xd 0xb 0x1 0x6&lt;br /&gt;
   0x9d 0x39 0x5 0x1&lt;br /&gt;
   0xd5 0x9&lt;br /&gt;
   0x38 0x6 0x2 0x2 0x1 0x1&lt;br /&gt;
   0x2f 0x5 0xb 0x1&lt;br /&gt;
&lt;br /&gt;
Sums: [136, 228, 222, 64, 180, 214, 198, 198,&lt;br /&gt;
       206, 242, 196, 220, 64, 230, 198, 116,&lt;br /&gt;
       64, 68, 136, 228, 222, 64, 156, 214,&lt;br /&gt;
       64, 140, 230, 240, 218, 230, 64, 154,&lt;br /&gt;
       242, 220, 222, 68, 64]&lt;br /&gt;
&lt;br /&gt;
Divide by 2 and then convert to ASCII: &lt;br /&gt;
Dro Zkccgybn sc: &amp;quot;Dro Nk Fsxms Myno&amp;quot; &lt;br /&gt;
&lt;br /&gt;
Simple subsitution: &lt;br /&gt;
the password is: &amp;quot;the da .i..i .ode&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Francois</name></author>	</entry>

	</feed>