This file contains hidden or 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 serial | |
import socket | |
import argparse | |
import sys | |
from time import sleep | |
NEWLINE = "\r\n" | |
def connect_tcp(sock, target): |
This file contains hidden or 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
def star_url(url): | |
""" | |
Rebuild a URL with stars covering the password. | |
""" | |
url = urlparse(url) | |
ret = "" | |
# Scheme (http/https) | |
if url.scheme: | |
ret += "%s://" % url.scheme | |
# Username/password |
This file contains hidden or 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
<?php | |
function toQRCode($prefix, $str) { | |
$prefixOrd = ""; | |
for ($i = 0; $i < strlen($prefix); $i++) { | |
$c = substr($prefix, $i, 1); | |
$prefixOrd.= dechex(ord($c)); | |
} | |
return $prefixOrd.md5($str); | |
} |
This file contains hidden or 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
function toOrdinalHexString(str) { | |
ret = ""; | |
for (i=0; i < str.length; i++) { | |
c = str.charAt(i); | |
ret = ret.concat(c.charCodeAt(0).toString(16)); | |
} | |
return ret; | |
} |
This file contains hidden or 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
""" | |
Easy version... | |
def qr_hash(prefix, data_to_hash): | |
qr = "" | |
for char in prefix: | |
qr += hex(ord(char))[2:] | |
qr += md5(data_to_hash).hexdigest() | |
return qr | |
This file contains hidden or 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
from mechanize import Browser | |
from BeautifulSoup import BeautifulSoup | |
if __name__ == "__main__": | |
br = Browser() | |
page = br.open("http://www.firstcapitalconnect.co.uk/plan-your-journey/major-disruption/") | |
soup = BeautifulSoup(page.get_data()) | |
s = soup.find("div", {"class": "single-container"}) | |
lines = s.findAll("span") | |
text = "" |
This file contains hidden or 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 mechanize | |
import urllib2 | |
import urlparse | |
import argparse | |
import json | |
p = argparse.ArgumentParser() | |
p.add_argument("-s", "--site", required=True) | |
p.add_argument("-d", "--domain_limit") |
This file contains hidden or 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
from telnetlib import Telnet | |
from getpass import getpass | |
from time import sleep | |
import re | |
import argparse | |
import sys | |
p = argparse.ArgumentParser() | |
p.add_argument("-s", "--server", required=True) | |
p.add_argument("-p", "--port", default=10011, type=int) |
This file contains hidden or 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
from collections import OrderedDict | |
import argparse | |
import logging | |
# Suppress ipv6 warning when importing scapy | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import IP, UDP, send, L3RawSocket, conf | |
PACKET_FORMAT = "tag=%s&%s&seq=0x%04x" |
This file contains hidden or 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
from boto import glacier | |
from datetime import datetime | |
from os.path import isdir | |
import argparse | |
import tarfile | |
try: | |
# Python 2.7 | |
from collections import OrderedDict | |
except ImportError: |