Skip to content

Instantly share code, notes, and snippets.

View flerpadoo's full-sized avatar
🎯
Focusing

. .. flerpadoo

🎯
Focusing
View GitHub Profile
@flerpadoo
flerpadoo / whatblockrule-example.txt
Created April 29, 2019 16:05
Example of something other than nmap in WhatBlockRule.py
install = [
"apt update",
"apt install curl -y",
"curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add",
"echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list",
"apt-get -y update",
"apt-get -y install google-chrome-stable python-pip unzip",
"pip install selenium",
"wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip",
"unzip chromedriver_linux64.zip",
@flerpadoo
flerpadoo / awsEmailCheck.py
Last active July 23, 2020 22:36
Determines if there is an AWS account associated with a given email address
import re
import sys
import subprocess
from time import sleep # Can be optimized / replaced
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def bruteAmazonEmailLogin(userEmail):
options = Options()
options.add_argument("--headless")
import datetime
import digitalocean
import iptools
import json
import os
import Queue
import shlex
import string
import subprocess
import sys
@flerpadoo
flerpadoo / ActiveCLI Example
Last active April 26, 2019 00:01
Example as used in live code of an extremely simple and configurable command-line manager I wrote. I don't have the repo here, but I'll probably put it up soon once I can remember how the hell to use it. Found this while looking for examples in my own code. :p
activeCommands =[
['sleepmon',[
['start', 'startSystemSleepMonitor(); cd printMsg(\'System Sleep Monitor has been started\', 0, True)'],
['stop', 'global sleepMonitorKill; sleepMonitorKill = True'],
['status', "'sleepmon: active' if sleepMonitorKill else 'sleepmon: inactive'"]]
],
['connect',[
['global tm; tm = TunnelManager(); tm.initSSH()']]
]
]
@flerpadoo
flerpadoo / PyKeyGen.py
Created April 25, 2019 23:57
SSH Key Generation tool - made to run from command line, but I used it as a module when I wrote it
# PyKeyGen - Simplified SSH Key Generation
import getpass, os, sys
class PyKeyGen():
def __init__(self):
# Base Command To Use
self.baseCMD = 'ssh-keygen -t {0} -b {1} -C "{2}" -N "{3}" -f {4}'
self.sshDir = '~/.ssh/'
# Default SSH Key Settings
self.defaultFormat = 'rsa'
self.defaultBits = '2048'
@flerpadoo
flerpadoo / image_meta_wipe.py
Created April 25, 2019 23:56
Clears metadata from images and creates a backup of the file (saved with appended _original)
import magic, os, shutil
from gi.repository import GExiv2
def createBackupFile(filePath):
if os.path.isfile(filePath):
shutil.copyfile(filePath, filePath + "_original")
def wipeImageMetadata(filePath):
exif = GExiv2.Metadata(filePath)
try:
@flerpadoo
flerpadoo / mssql_interface.py
Last active April 27, 2019 00:00
Simple MSSQL python interface - you'll need to build all of your actual insert/query functions (don't forget to commit on insert! ;D)
# Universally usable MSSQL interface Just modify the connection info and add specific module if necessary
import datetime, pyodbc
class MSSQLinterface():
# Init module
def __init__(self):
# Pulls global connection info into properties
self.dbUser = 'sa'
self.dbPass = 'password'
@flerpadoo
flerpadoo / butchered-delete-tweets.py
Last active August 19, 2019 22:52
I'm a bad person. I should have just fixed the script in the repo of the original author, but opted to steal the TweetDestroyer module instead and wrap it with updated code to support the twitter json (not csv) - thanks @koenrh !
from datetime import datetime
import json, os, twitter, io, time
string_input_with_date = "01/01/2018"
file_name = 'tweet.js'
TWITTER_CONSUMER_KEY=""
TWITTER_CONSUMER_SECRET=""
TWITTER_ACCESS_TOKEN=""
TWITTER_ACCESS_TOKEN_SECRET=""