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 socket | |
import ssl | |
def is_SSL_enabled(ip, port): | |
""" | |
Attempts a SSL connection to the specified ip:port | |
Note: Does not handle STARTTLS yet | |
returns True if handshake was successful, false if not | |
""" | |
context = ssl.create_default_context() |
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
List lightsail boxes: | |
alias aws_lightsail_list='aws lightsail get-instances --query="instances[*].{Name:name, IP:publicIpAddress, Username:username, State:state.name, key:sshKeyName}" --output=table' | |
List ec2 boxes: | |
alias aws_ec2_list='aws ec2 describe-instances --query="Reservations[*].Instances[*].{Launched:LaunchTime, State:State.Name, Key:KeyName, IP:PublicIpAddress, Tags:Tags[0].Value, Region:Placement.AvailabilityZone}" --output=table' |
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
# user : pass @ whatever | |
grep -Pi '[^\s]*:[^\s]*@[^\s]*' * --color |
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
#!/usr/bin/env python3 | |
#brute ngrok's subdomain pattern | |
import requests | |
import itertools | |
for sub in itertools.product("0123456789abcdef", repeat=8): | |
host = "".join(sub) + ".ngrok.io" | |
print(host) | |
reply = requests.get("http://18.188.14.65", headers={"Host": host}) | |
if "Tunnel " + host + " not found" not in reply.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 langdetect | |
from langdetect import detect | |
def ascii_hex_to_bytes(hex_input): | |
return bytearray.fromhex(hex_input) | |
with open('Downloads/cryptopals-challenge4.txt') as f: | |
xorinput=f.readlines() | |
xor2 = [line.strip() for line in xorinput] |
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
#!/usr/bin/env python3 | |
from selenium import webdriver | |
import argparse | |
import re | |
from time import sleep | |
def get_links(url): | |
options = webdriver.ChromeOptions() | |
options.add_argument('--ignore-certificate-errors') |
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
#!/usr/bin/env python3 | |
# takes stdin, sleeps, outputs to stdout | |
import sys | |
import time | |
def main(): | |
if len(sys.argv) > 1: | |
sleep_time = int(sys.argv[1]) | |
else: | |
sleep_time = 2 |
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
// dllmain.cpp : Defines the entry point for the DLL application. | |
#include "pch.h" | |
#include <stdlib.h> | |
BOOL APIENTRY DllMain( HMODULE hModule, | |
DWORD ul_reason_for_call, | |
LPVOID lpReserved | |
) | |
{ | |
system("cmd.exe"); |
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
#!/usr/bin/env python3 | |
# crappy script to check colorado's covid tracking site. Run once per day via cron or cloudwatch/lambda | |
import bs4 | |
import requests | |
def check_co_gov_site(): | |
url = 'https://www.colorado.gov/pacific/cdphe/2019-novel-coronavirus' | |
reply = requests.get(url) | |
soup = bs4.BeautifulSoup(reply.text, features='html.parser') |
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 verbose(func): | |
def output_args(*args, **kwargs): | |
print("Called {} with: {}".format(func.__name__, [args, kwargs])) | |
func(*args, **kwargs) | |
return output_args | |
@verbose | |
def say_thing(thing): | |
print(thing) |