This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from collections import Counter | |
# English language letter frequencies from: | |
# https://gist.githueb.com/pozhidaevak/0dca594d6f0de367f232909fe21cdb2f | |
letterFrequency = {'E' : 12.0, 'T' : 9.10, 'A' : 8.12, 'O' : 7.68, | |
'I' : 7.31, 'N' : 6.95, 'S' : 6.28, 'R' : 6.02, | |
'H' : 5.92, 'D' : 4.32, 'L' : 3.98, 'U' : 2.88, | |
'C' : 2.71, 'M' : 2.61, 'F' : 2.30, 'Y' : 2.11, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/ptrace.h> | |
int main() { | |
if (ptrace(PTRACE_TRACEME, 0, 1, 0) == -1) { | |
printf("Debugger\n"); | |
} else { | |
printf("Normal\n"); | |
} | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a redefinition of ptrace to get around the | |
// ptrace anti-debug trick. | |
long ptrace(int a, int b, void *c, void *d) { | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pad(txt): | |
while (len(txt) % 4 != 0): | |
txt += '\0' | |
return txt | |
def create_w(s): | |
w = [[s[0], s[1], s[2], s[3]], | |
[s[4], s[5], s[6], s[7]]] | |
return w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
birthday_dict = {} | |
while (True): | |
pre = "".join(random.choices(string.ascii_letters + string.digits, k = random.randint(1, 5))) | |
hash_val = hash(pre) | |
if (hash_val in birthday_dict and birthday_dict[hash_val] != pre): | |
print(pre, birthday_dict[hash_val]) | |
else: | |
birthday_dict[hash_val] = pre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
import gmpy2 | |
e1 = 13 | |
e2 = 15 | |
ct1 = 13981765388145083997703333682243956434148306954774120760845671024723583618341148528952063316653588928138430524040717841543528568326674293677228449651281422762216853098529425814740156575513620513245005576508982103360592761380293006244528169193632346512170599896471850340765607466109228426538780591853882736654 | |
ct2 = 79459949016924442856959059325390894723232586275925931898929445938338123216278271333902062872565058205136627757713051954083968874644581902371182266588247653857616029881453100387797111559677392017415298580136496204898016797180386402171968931958365160589774450964944023720256848731202333789801071962338635072065 | |
n = 103109065902334620226101162008793963504256027939117020091876799039690801944735604259018655534860183205031069083254290258577291605287053538752280231959857465853228851714786887294961873006234153079187216285516823832102424110934062954272346111907571393964363630079343598511602013316604641904852018969178919051627 | |
def xgcd(a,b): | |
"""Extended GCD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import angr | |
# Load the binary | |
import angr | |
proj = angr.Project('angrme') | |
# Create a simulation manager | |
simgr = proj.factory.simgr() | |
# Use the simulation manager to explore until win condition --> :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int func1(int a, int b, int c) { | |
printf("%d %d %d\n", a, b, c); | |
} | |
int main(void) { | |
func1(1, 2, 3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdlib.h> | |
#include <elf.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
void readElfHeader(Elf64_Ehdr *ehdr); | |
int main(int argc, char **argv) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
int main(int argc, char **argv) { | |
if (argc != 3) { | |
printf("Usage: ./infect [host] [parasite]\n"); | |
exit(0); | |
} |
OlderNewer