Skip to content

Instantly share code, notes, and snippets.

@kostyll
kostyll / _service.md
Created November 17, 2016 14:45 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@kostyll
kostyll / metasploit_vds.md
Last active December 27, 2016 10:07
metasploit_vds.md

debootstrap --arch i386 jessie debian_8_jessie.i386.original http://ftp.us.debian.org/debian

cp -rf debian_8_jessie.i386.original debian_8_jessie.i386.metasploit

cat << EOF >> /root/start_metaploitenv.sh #!/bin/bash export MSFROOT=/root/debian_8_jessie.i386.metasploit mount -o bind /dev/ $MSFROOT/dev mount -t proc proc $MSFROOT/proc chroot $MSFROOT

@kostyll
kostyll / debootstrap_stable
Last active December 27, 2016 10:07
debootstrap_stable
mkdir stable-chroot
apt-get install debootstrap
debootstrap stable stable-chroot http://httpredir.debian.org/debian/
sudo debootstrap stable stable-chroot http://httpredir.debian.org/debian/
debootstrap --arch i386 jessie debian_8_jessie.i386.original http://ftp.us.debian.org/debian
@kostyll
kostyll / bottle_example.py
Created November 9, 2016 15:00 — forked from Arthraim/bottle_example.py
a python web framework bottle's example
#coding: utf-8
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template
@route('/')
@route('/index.html')
def index():
return '<a href="/hello">Go to Hello World page</a>'
@route('/hello')
def hello():
@kostyll
kostyll / flask-upload
Created November 9, 2016 14:55 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@kostyll
kostyll / SimpleAuthServer.py
Created October 27, 2016 07:59 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
[test.asm]
[BITS 64]
section .code
global foo
export foo
foo:
push rbp
mov rbp, rsp
mov rbx, rcx
add rbx, 3
@kostyll
kostyll / generate_certs.sh
Last active December 27, 2016 10:08
generate_certs.sh
#!/bin/bash
mkdir -p keys
openssl \
req -x509 -sha256 -nodes -days 365 \
-newkey rsa:2048 -keyout keys/server.key -out keys/server.crt
openssl \
req -new -x509 -keyout keys/server.pem \
-out keys/server.pem -days 365 -nodes
#include <ctype.h>
#include <stdio.h>
void hexdump(void *mem, unsigned int len, int cols_count)
{
unsigned int i, j;
for(i = 0; i < len + ((len % cols_count) ? (cols_count - len % cols_count) : 0); i++)
{
/* print offset */
@kostyll
kostyll / memdump.c
Created September 30, 2016 06:46 — forked from hanshoglund/memdump.c
C memdump
void memdump(void* s, size_t n)
{
for (size_t i = 0; i < n; ++i)
printf("%x ", *((unsigned char*) (s + i)) );
printf("\n");
}