Skip to content

Instantly share code, notes, and snippets.

View blaquee's full-sized avatar

genuine_ blaquee

View GitHub Profile
@blaquee
blaquee / shellcode
Created June 15, 2013 20:29
shellcode unoptimized
push ebp
mov ebp,esp
sub esp, 0ch
lea edi, [ebp-0ch]
looper:
cmp dword [edi], 0
je exit
cmp dword[edi+4], 41414100h
je .match
@blaquee
blaquee / gist:5789622
Last active December 18, 2015 13:28
more optimized shellcode!
; get the list pointer
mov eax, [esp]
looper:
m dd 41414100h
cmp dword [esp+4],m
je .match
;increment
add dword [esp],8
jmp looper
.match:
/*
* Small p2p chat program using raw udp sockets
* by: Greg Lindor
*/
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@blaquee
blaquee / shellcode
Last active December 19, 2015 05:09
optimized shellcode
pop ecx
_loop:
pop esi
lodsd
cmp word ptr[eax+5],4141h
push eax
jne _loop
add al,8
jmp ecx
@blaquee
blaquee / gist:6084185
Last active December 20, 2015 06:09
asmdisas
0001593F |. 8B73 74 MOV ESI,DWORD PTR DS:[EBX+74] ; Get number of sections
00015942 |. 8D74F3 78 LEA ESI,DWORD PTR DS:[EBX+ESI*8+78] ; loads the size of the section in memory (ESI*8 == size in sectionheader)
00015946 |> F746 24 80000000 /TEST DWORD PTR DS:[ESI+24],80
0001594D |. 75 19 |JNZ SHORT cjnr4r41.00015968 ; This loop will copy each section byte for byte into [edi]
0001594F |. 56 |PUSH ESI
00015950 |. 57 |PUSH EDI
00015951 |. 51 |PUSH ECX ; kernel32.75E00000
00015952 |. 037E 0C |ADD EDI,DWORD PTR DS:[ESI+C]
00015955 |. 8B4E 10 |MOV ECX,DWORD PTR DS:[ESI+10]
00015958 |. 8B76 14 |MOV ESI,DWORD PTR DS:[ESI+14]
@blaquee
blaquee / hackme.c
Created August 1, 2013 00:57
ROP attackme
int main(int argc, char **argv) {
char hole[20];
if(argc == 2) {
strcpy(hole, argv[1]);
printf("crash this hole %s\n", hole);
}
}
@blaquee
blaquee / hackme.c
Created August 1, 2013 00:57
ROP attackme
int main(int argc, char **argv) {
char hole[20];
if(argc == 2) {
strcpy(hole, argv[1]);
printf("crash this hole %s\n", hole);
}
}
@blaquee
blaquee / readdisk.py
Created August 2, 2013 23:19
rawdisk python
import os
import sys
SECTOR_SIZE = 512
def main():
try:
if len(sys.argv) != 4:
raise Exception('Not Enough Arguments')
else:
import socket
from socket import *
def main():
s = socket(AF_INET, SOCK_STREAM)
host = gethostname()
port = 55600
s.connect((host,port))
@blaquee
blaquee / crack.rb
Created September 22, 2013 22:30 — forked from LMolr/crack.rb
# use rubinius!
M = 0x100000000
RESULT = 0xEF2E3558
def poly(a)
ret = a.inject(1337) do |sum, c|