Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # WARNING: this doesn't work properly | |
| import asyncio | |
| import ssl | |
| import socket | |
| # included logging to try to figure out why this wasn't working... | |
| import logging | |
| logging.basicConfig() | |
| logging.getLogger('asyncio').setLevel(logging.DEBUG) |
| from scapy.all import sr, IP, TCP | |
| import argparse | |
| import time | |
| class scanner(): | |
| def __init__(self, host_start, host_end): |
| from random import randrange | |
| from twisted.internet.defer import DeferredQueue | |
| from twisted.internet.task import deferLater, cooperate | |
| from twisted.internet import reactor | |
| def async(n): | |
| print 'Starting job', n | |
| d = deferLater(reactor, n, lambda: None) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| A script to get the version of Python by which the file was compiled | |
| """ | |
| from __future__ import print_function | |
| import binascii | |
| import os |
| def contains(subseq, inseq): | |
| return any(inseq[pos:pos + len(subseq)] == subseq for pos in range(0, len(inseq) - len(subseq) + 1)) | |
| class TestContainsForString(unittest.TestCase): | |
| def test_smoketest(self): | |
| self.assertTrue(contains('abc', 'abc cde fgi')) | |
| def testcontains_middle_seq(self): |
| #!/usr/bin/python | |
| # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
| # The author disclaims copyright to this source code. | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
| <# | |
| .SYNOPSIS | |
| Start a web server that will route requests to a series of script blocks as defined by the -Routes parameter. | |
| .DESCRIPTION | |
| Starts a single-threaded web server and responds to requests by executing the script blocks that are | |
| defined as routes on the command line. | |
| .NOTES | |
| Copyright 2013 Chris Duck |
| import errno | |
| import socket | |
| from threading import Thread | |
| from tornado import ioloop | |
| class IOLoopThread(Thread): | |
| def __init__(self): | |
| Thread.__init__(self) | |
| self.running = True |
| import sys | |
| import traceback | |
| import StringIO | |
| from copy_reg import dispatch_table, pickle | |
| def exc_info(hide_calls = 0): | |
| '''as sys.exc_info() but returns a remote exception object''' | |
| ErrorType, thrownError, traceback = sys.exc_info() | |
| for i in range(hide_calls): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000