Skip to content

Instantly share code, notes, and snippets.

View unicornsasfuel's full-sized avatar

Daniel "unicornFurnace" Crowley unicornsasfuel

  • IBM X-Force Red
View GitHub Profile
@unicornsasfuel
unicornsasfuel / exercise_server.py
Last active October 19, 2017 21:53
Shellcon FeatherDuster Workshop Exercise Materials
from Crypto.Cipher import AES
import sys
FLAG = '7368336c6c63306e72756c7a'.decode('hex')
def pkcs7_pad(text):
pad_num = 16 - (len(text) % 16)
return text + chr(pad_num) * pad_num
cipher = AES.new('yellow submarINE', AES.MODE_ECB)
<?php
$FLAG = '[REDACTED]' //Flag removed
if (strcmp($_GET['password'],'[REDACTED]')==0){ // Real password has been removed
echo $FLAG;
}else{
echo 'LOL NOPE';
}
?>
Ode to ECB - Ben Nagy
"""
Oh little one, you’re growing up
You’ll soon be writing C
You’ll treat your ints as pointers
You’ll nest the ternary
You’ll cut and paste from github
And try cryptography
But even in your darkest hour
@unicornsasfuel
unicornsasfuel / my_stream_cipher.py.sanitized
Created February 10, 2017 20:38
Custom stream cipher CTF challenge
import hashlib
KEY = #NAH
FLAG = #NAH
message = 'Hello LOLCTF! Can you beat my super-leet stream cipher? If you can, the flag is: ' + FLAG
def sxor(s1, s2):
return ''.join([chr(ord(c1) ^ ord(c2)) for c1, c2 in zip(s1, s2)])
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
int doprocessing (int sock);
int authtest(char *username, char *password);
int runcode();
<iframe src="file:///etc/passwd">
from pwn import *
M = 2**31
A = 7**6
C = 5
# bisect the possible set of correct numbers
def get_next_guess(low, high):
return low+(high-low)/2
from Crypto.Cipher import AES
from pwn import *
ciphertext = 'YWFhYWFhYWFhYWFhYWFhYQ=='
one = 'ICAgICAgICAgICAxNTc1Mw=='
two = 'ICAgICAgICAgICA2Nzc5Nw=='
three = 'ICAgICAgICAgICA0NDQ0NQ=='
four = 'ICAgICAgICAgICAyMzU2Mw=='
five = 'ICAgICAgICAgICAgNDc3OA=='