Skip to content

Instantly share code, notes, and snippets.

@atucom
atucom / return_only_ip.py
Created June 27, 2022 16:34
only return IP if either IP or hostname is supplied
#!/usr/bin/python3
# @atucom
''' parse simple command line arguments '''
import argparse
parser = argparse.ArgumentParser(description='only return IP if either IP or hostname is supplied')
parser.add_argument('target', help='IP or hostname')
args = parser.parse_args()
def ip_filter(input):
@atucom
atucom / is_web.sh
Created May 5, 2022 21:51
Check if IP/IP:Port is web port
#!/usr/bin/env bash
if [[ "$1" = '-h' ]] || [[ "$1" = '--help' ]] || [[ -z "$1" ]]; then
echo "Specify an IP:port to check if it's web and what protocol"
echo "this first checks https then http"
echo
echo "Example: $0 1.1.1.1:3040"
echo "or"
echo "Example: $0 1.1.1.1"
@atucom
atucom / mesh-shell-server.py
Created February 16, 2022 14:56
Meshtastic shell server for executing commands on a remote system attached to a meshtastic radio
#!/usr/bin/env python3
#@atucom
# PoC of getting a remote shell using a meshtastic radio.
# this works by using the meshtastic python package and the device connected over USB serial
# The long/slow transmit speed gives about 10 bytes/sec bandwidth which is crazy slow. It took 5.5mins to run 'ls -la' on my home dir
# This could be further improved by the following:
# - trying the short/fast mode
# - creating a dedicated channel
# - setting a non-default psk for encryption
@atucom
atucom / gist:84f380d2299690c588c8d301e72ad6cf
Created March 17, 2021 15:13
Simple functions for python3 text-to-speech and speech-to-text
#stolen examples from public documentation for TTS and STT.
#install everything with:
# brew install portaudio
# pip3 install PyAudio
# pip3 install speechrecognition
# pip3 install pyttsx3
def text_to_speech(text, rate=225):
import pyttsx3
engine = pyttsx3.init()
@atucom
atucom / atu-directory-enumeration.wordlist.txt
Last active March 3, 2022 14:00
Place to store a directory enumeration wordlist, hand curated, no BS.
wls-wsat/CoordinatorPortType
_async/AsyncResponseService
oaiusydf8as7df68sdfyas8dgq
zxcv1987lla/av9s8dvj2-we_q
bea_wls_internal/
dana-na/../dana/html5acc/guacamole/../../../../../../etc/hosts?/dana/html5acc/guacamole/
vsphere-client/
Telerik.Web.Ui.WebResource.axd?type=rau
console/css/%252e%252e%252fconsole.portal
%252e%252e%252fconsole.portal
@atucom
atucom / SetupEC2FTP
Last active November 20, 2020 16:28
Quick FTP Server On AWS EC2/Lightsail
# Start an EC2 or lightsail box, change security group permissions to allow all ports (or at least 21,8000-9000)
sudo apt update
sudo apt install -y python3-pip #because we're not 2.7 cavemen
sudo pip3 install pyftpdlib
mkdir /tmp/temp-ftp-dir
sudo python3 -m pyftpdlib --directory=/tmp/temp-ftp-dir --port=21 --write --debug --nat-address=$(curl ifconfig.io)
# Connect from Kali:
pftp example.com
# login as anonymous with whatever password
@atucom
atucom / verbose_decorator.py
Created July 15, 2020 21:41
Debugging decorator to output function and args
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)
#!/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')
@atucom
atucom / PopCMD.dll.cpp
Created February 26, 2020 21:55
Simple CPP code to pop a CMD shell upon loading a DLL
// 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");
@atucom
atucom / sleepPipe.py
Created February 18, 2020 18:13
Holds onto stdin for specified number of seconds (or default 2) and then pipes to stdout.
#!/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