Skip to content

Instantly share code, notes, and snippets.

@seamustuohy
seamustuohy / install_deps.sh
Last active July 14, 2018 22:11
Snippet to update SAFETAG header metadata
sudo apt install python3-pip
pip3 install setuptools wheel
pip3 install pyaml
# Download the python script from this GIST
@seamustuohy
seamustuohy / .bash_alias
Created May 25, 2018 17:27
Cutter Dockerfile experiment
cutter() {
local CONFDIR="${HOME}/.config/radare2"
mkdir -p "${CONFDIR}"
touch ${CONFDIR}/radare2rc
mkdir -p ${CONFDIR}/r2-config
xhost +local:docker && \
docker run \
--rm \
-it \
--name cutter \
@seamustuohy
seamustuohy / noninteractive_install.qs
Last active March 24, 2018 15:02
file to install Qt 5 non-interactively
// Emacs mode hint: -*- mode: JavaScript -*-
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
@seamustuohy
seamustuohy / get_current_wpa_psk.sh
Created October 22, 2017 19:23
WPA-PSK Bash Golf
# Bash Golf example that gets the WPA-PSK key from the WiFi network you are currently connected to.
# Beyond the basics (cut & grep) it uses network manager's CLI and python3
c='cut -d: -f2';g=grep;a=$(nmcli -t -f ACTIVE,SSID d w l|$g -E "^yes:"|$c);p=$(nmcli -s -t c show $a|$g psk:|$c);python3 -c "from hashlib import pbkdf2_hmac as p; from binascii import hexlify as h;print('PSK',h(p('sha1', b'$p', b'$a', 4096, dklen=32)).decode('ascii'))"
"""
For use with python3.
Usage: Download and save this script in your project folder.
In the script:
from incap import IncapSession as Session
session = Session()
response = session.get('https://www.url.com')
@seamustuohy
seamustuohy / annotations.xml
Created October 1, 2017 15:13 — forked from Neo23x0/annotations.xml
Sources for APT Groups and Operations Search Engine
<?xml version="1.0" encoding="UTF-8" ?>
<Annotations start="0" num="126" total="126">
<Annotation about="blog.malwaremustdie.org/*" timestamp="0x0005408aeb576862" href="ChlibG9nLm1hbHdhcmVtdXN0ZGllLm9yZy8qEOLQ3dqukdAC">
<Label name="_cse_turlh5vi4xc" />
<AdditionalData attribute="original_url" value="http://blog.malwaremustdie.org/" />
</Annotation>
<Annotation about="blog.airbuscybersecurity.com/*" timestamp="0x0005408aea73fd53" href="Ch5ibG9nLmFpcmJ1c2N5YmVyc2VjdXJpdHkuY29tLyoQ0_rP066R0AI">
<Label name="_cse_turlh5vi4xc" />
<AdditionalData attribute="original_url" value="http://blog.airbuscybersecurity.com/" />
</Annotation>
@seamustuohy
seamustuohy / check_urls_malicious.py
Created August 29, 2017 02:16
check the osint framework for malware
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of a simple script that checks the osint framework for malicious urls
# Copyright © 2017 seamus tuohy, <code@seamustuohy.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
@seamustuohy
seamustuohy / google_analytics.py
Created May 24, 2017 20:33
Recon-ng module for Google Analytics Host Lookup
# Based off of the old Google Analytics Host Lookup module by Micah Hoffman (@WebBreacher)
# https://bitbucket.org/LaNMaSteR53/recon-ng/src/6f7d35c5b8e1c114288dc4e1d91d565e29c0342c/modules/recon/hosts/enum/http/web/google_analytics.py?at=master&fileviewer=file-view-default
from recon.core.module import BaseModule
import re
class Module(BaseModule):
meta = {
'Name': 'Google Analytics Host Lookup',
'Author': 'Seamus Tuohy (@seamustuohy)',
@seamustuohy
seamustuohy / useful_pandas_snippets.py
Created September 4, 2016 21:36 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
@seamustuohy
seamustuohy / github_traffic.py
Created November 24, 2015 21:28
Simple script for open internet project M&E.
#!/usr/bin/env python
#Original Code
#https://github.com/winter-muted/moose/blob/399aefb8d7d62e0163045b39803a2d791ada04f9/scripts/github_traffic.py
# For automated logging:
# python github_traffic.py --log --user [USERNAME] --password [PASSWORD]
import cookielib
import sys, os, time, argparse, getpass, re, datetime, csv