Skip to content

Instantly share code, notes, and snippets.

@sonickun
sonickun / defensekey_crawler.py
Last active December 23, 2018 07:31
SECCON2018国内決勝でDefense Keyをヘッドレスブラウザで自動で取ってきてPOSTするやつ
# coding: UTF-8
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
def get_key():
options = Options()
@sonickun
sonickun / solver.py
Created December 14, 2016 08:39
H4ckIT CTF 2016 | Chad – Ninja Scheme (Crypto 195pt)
#flag begins with h4ck1t{
def slice(s, size):
return [s[i: i+size] for i in range(0, len(s), size)]
def xor(a, b):
return "".join([chr(ord(a[i]) ^ ord(b[i % len(b)])) for i in xrange(len(a))])
def f(L, n):
ans = ""
@sonickun
sonickun / solver.py
Created December 11, 2016 14:44
SECCON CTF 2016 quals | biscuiti (Crypto, Web 300pt)
from Crypto.Util.number import *
from Crypto.Cipher import AES
import requests
import time
import base64
def xor(a, b):
return "".join([chr(ord(a[i]) ^ ord(b[i % len(b)])) for i in xrange(len(a))])
@sonickun
sonickun / solver.py
Last active November 30, 2016 08:44
Hack.lu CTF 2016 | cryptolocker (crypto 200-52)
import sys
import hashlib
from AESCipher import *
import string
import itertools
class SecureEncryption(object):
def __init__(self, keys):
#assert len(keys) == 4
self.keys = keys
@sonickun
sonickun / solver.py
Last active November 20, 2016 13:22
SECCON CTF quals 2013 | Cryptanalysis (Crypto 300pt)
a = 1234577
b = 3213242
M = 7654319
def add(A,B):
if A==(0,0): return B
if B==(0,0): return A
x1,y1 = A
x2,y2 = B
@sonickun
sonickun / solver.py
Created November 19, 2016 13:43
MMA CTF 2015 | Alicegame (Crypto 250pt)
# -*- coding: utf-8 -*-
def egcd(m, n):
if n>0:
y,x,d = egcd(n, m%n)
return x, y-m/n*x, d
else:
return 1, 0, m
@sonickun
sonickun / solver.py
Last active November 16, 2016 09:04
Hack The Vote 2016 | BabyHands (crypto 300pt)
# filename: solver.sage
#f = open("intercepted", "r")
#
#f.readline()
#
#for line in f:
# d, n, c = map(int, line.strip()[1:-1].split(":"))
# print d, n, c
#
@sonickun
sonickun / flag.jpg
Last active November 15, 2016 05:51
Hack The Vote 2016 | Trump Trump (crypto 100pt)
flag.jpg
@sonickun
sonickun / solver.py
Last active November 9, 2016 08:04
Hack The Vote 2016 | Boxes of Ballots (crypto 200pt)
import socket
import string
import time
flag_len = 23
remoteip = "boxesofballots.pwn.republican"
remoteport = 9001
charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_{}"
@sonickun
sonickun / out.key
Last active October 26, 2016 08:32
HITB Facebook CTF 2016 | capture Mexico-tls (Crypto200)
-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEAyOP3yjHxOk0I3NPJ4Q1HDvJmqAoxEdLMaNCiLxkVNSZwLTPMXnuoZikVznds
OZ9t2bAe4P/9L1Pfg+35jfmxe96Jzk6dAXiuFmFlaOsKl4yBxRat6Far/UjBM9A2ZJgmYxWJJr3T
MahpzZMWFbSD64QQYSBgPlX671xc4Q75omY0dfcANyPGYuTgTR9zmNyfk5s3e7yfYS9gZ+aU4Hmo
x4NgKypw7OHVAN5hTZ0V2B3pGR9c6VoReHiOXXOEKD8QZbD6LMyuVO6K+cEklW562sh0CJo9qn8+
FT1tG6kC7d1tU3tptY/MA5uUhLGDW34WfXtgE42eIR01Ovi+hzC82wIDAQABAoIBAEiIv1xbQf1J
+Uw6kCbZM3H7JgPAgk0sLrAdvKGCzfx9330CueTXg0s3xG7jAcmgffpetBeLdnBTOV4aW8Pehy3x
gRJjoh744uqjygji7NUhX225LZu5R6pRTakWob0ajqmyCe5aFdpVM7aNSCkYH5W2/m8DUJzRUKSC
VerRDGONHRCnNxV3w9u3EkdI5fvrOpY1TSqCmEZwCCPO+WfqIn8Ut/xNvHkNSXA2+h1KgmwyQQZ/
ZgsNeRa2+vZh2kgm3f1xccjQvyAel3t+5s0cPo0NI7qqHkiHNb6/yWR9AH+bGVXQc+VtR7GwisRZ