Skip to content

Instantly share code, notes, and snippets.

View lattera's full-sized avatar

Shawn Webb lattera

View GitHub Profile
@lattera
lattera / func.c
Created July 8, 2011 00:41
PLT/GOT Resolution Bug
EXPORTED_SYM PLT *GetAllPLTs(HIJACK *hijack)
{
struct link_map *linkmap;
char *libname;
PLT *plt=NULL;
ElfW(Dyn) *dyn=NULL;
unsigned long addr;
if (!(IsAttached(hijack))) {
SetError(hijack, ERROR_NOTATTACHED);
@lattera
lattera / shell.c
Created July 25, 2011 22:59
Simple Shell
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#define BUFSZ 1024
@lattera
lattera / sql.c
Created July 28, 2011 17:43
MySQL Integration Code Sample
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include "sql.h"
#include "misc.h"
SQL_ROW *sql_backend_mysql(SQL_CTX *sqldb, char *statement)
@lattera
lattera / advgets.c
Created July 29, 2011 18:14
Advanced Gets
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
int advgets(FILE *fp, char *buf, size_t sz, char *fmt, ...)
{
va_list ap;
int ret;
@lattera
lattera / broadcast_shell.c
Created August 26, 2011 13:25
Broadcast Shell
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/select.h>
@lattera
lattera / shell.c
Created December 16, 2011 22:37
Very Simple Shell
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#define BUFSZ 1024
*default host=cvsup4.us.FreeBSD.org
*default base=/ports_cvs/csup_db
*default prefix=/ports_cvs/cvsroot
*default release=cvs
*default delete use-rel-suffix
*default compress
ports-all
cvsroot-all
@lattera
lattera / gist:2570543
Created May 1, 2012 19:04
Trolling a Script-Kiddie
In IRC land:
2012-05-01 11:32 < neophyte821> hi
2012-05-01 11:32 < neophyte821> Dr.Hacko0o here
2012-05-01 11:32 < neophyte821> anyone
2012-05-01 11:32 < neophyte821> i have new mission for u guys
2012-05-01 11:35 < lattera> what's the mission?
2012-05-01 11:35 < lattera> and what do we get if we choose to accept this mission?
2012-05-01 11:36 < neophyte821> mission is not easy
2012-05-01 11:36 < neophyte821> dont be so confident
@lattera
lattera / gist:2870333
Created June 4, 2012 19:30
tfp adb log
Starting recovery on Wed Jul 4 19:27:47 2012
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (1280 x 800)
ClockworkMod Recovery v5.8.1.8
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null) 0
1 /system ext4 /dev/block/mmcblk0p1 (null) 0
2 /cache ext4 /dev/block/mmcblk0p2 (null) 0
3 /misc emmc /dev/block/mmcblk0p3 (null) 0
@lattera
lattera / gist:2870347
Created June 4, 2012 19:31
tfp recovery fstab
# mountpoint fstype device [device2]
/system ext4 /dev/block/mmcblk0p1
/cache ext4 /dev/block/mmcblk0p2
/misc emmc /dev/block/mmcblk0p3
/staging ext3 /dev/block/mmcblk0p4
/data ext4 /dev/block/mmcblk0p8
/boot emmc /dev/block/mmcblk0p10
/recovery emmc /dev/block/mmcblk0p9