Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yohanes
yohanes / pcap-hitb2014c2.py
Created October 26, 2014 11:46
Extract data from pcap Challenge 2 HITB2014
f = open("c2.pcap", "r")
lines = f.readlines()
for l in lines:
if ("G01" in l):
print l[l.index("G01"):]
@yohanes
yohanes / guess-hitb2014c3.py
Created October 26, 2014 11:45
Guess challenge 3 HITB2014
import socket
import re
import time
def recv_until(st):
ret = ""
while st not in ret:
ret += s.recv(8192)
return ret
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#define UPDC32(octet, crc) (crc_32_tab[((crc >> 24 ) ^ (octet)) & 0xff] ^ ((crc) << 8))
static uint32_t crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
@yohanes
yohanes / corrupted.pem
Created April 15, 2014 03:38
Example corrupted rsa key.
Private-Key: (1024 bit)
modulus :
00:db:fa:bd:b1:49:5d:32:76:e7:62:6b:84:79:6e:
9f:c2:0f:a1:3c:17:44:f1:0c:8c:3f:3e:3c:2c:60:
40:c2:e7:f3:13:df:a3:d1:fe:10:d1:ae:57:7c:fe:
ab:74:52:aa:53:10:2e:ef:7b:e0:09:9c:02:25:60:
e5:7a:5c:30:d5:09:40:64:2d:1b:09:7d:d2:10:9a:
e0:2f:2d:cf:f8:19:8c:d5:a3:95:fc:ac:42:66:10:
78:48:b9:dd:63:c3:87:d2:53:8e:50:41:53:43:04:
20:33:ea:09:c0:84:15:5e:65:2b:0f:06:23:40:d5:
@yohanes
yohanes / rsa.diff
Created April 15, 2014 03:24
diff against http://cseweb.ucsd.edu/~hovav/papers/hs09.html for recreating private key from corrupted file. note you must fix the modulus from public key (openssl pkey -pubin -in public.pub -text -noout). See http://rentjong-team.blogspot.com/ for more info.
diff -ruN rsabits-orig/rsa.C rsabits/rsa.C
--- rsabits-orig/rsa.C 2014-04-15 10:09:53.406244277 +0700
+++ rsabits/rsa.C 2014-04-15 10:15:55.666047590 +0700
@@ -40,6 +40,8 @@
// C:
#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>