Skip to content

Instantly share code, notes, and snippets.

@infosec-intern
infosec-intern / convertTMGrammar.py
Created June 27, 2021 16:47
Python script to convert an XML-based TextMate bundle to JSON format
#!/usr/bin/env python3
''' Convert an XML-based TextMate bundle to JSON format '''
import argparse
import json
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser(description='Convert XML TM bundle to JSON TM bundle')
parser.add_argument('input', type=argparse.FileType('r'))
parser.add_argument('-o', '--output', type=argparse.FileType('w'))
@infosec-intern
infosec-intern / .socks
Created May 15, 2018 03:51
Quick shell script for setting up and tearing down a SOCKS proxy
SERVER=100.100.100.100
USER=username
PROXY="$USER@$SERVER"
function setProxy() {
export http_proxy=http://127.0.0.1:8888/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
@infosec-intern
infosec-intern / Evtx-to-JSON.ps1
Created December 9, 2017 22:13
Convert a Windows event log record into a JSON document
# LogName can be any available event log
# or it can be replaced with "-Path" and a file path
# The resulting JSON can then be POSTed to a webserver of your choice
Get-WinEvent -LogName "Security" -MaxEvents 1 | ConvertTo-Json
[Desktop Entry]
Name=FireFox Nightly
Comment=Web Browser
Exec=/usr/local/bin/firefox
Icon=/usr/local/src/firefox/browser/icons/mozicon128.png
Terminal=false
Type=Application
Categories=Internet;

Keybase proof

I hereby claim:

  • I am infosec-intern on github.
  • I am thomasgardner (https://keybase.io/thomasgardner) on keybase.
  • I have a public key ASCmwjj8bTwRX-4meSA-LzkvknPLhIXsxmV-27joWnjo3go

To claim this, I am signing this object:

@infosec-intern
infosec-intern / for_loop.c
Last active February 1, 2017 04:36
Integrate if statements like the following directly in the for loop conditional
for(i = 0; i < GLOB_MAX && globs[i][0] != '\0'; i++) {
// if (globs[i][0] == '\0') {
// continue;
// }
printf("Glob[%d] = %s\n", i, globs[i]);
}
@infosec-intern
infosec-intern / gcc_compile_flags.sh
Last active January 26, 2017 12:24
Compile a C program without using the standard entry method. For example, if you supply your own _start function
gcc -nostdlib -o test test.c # don't use the standard library when compiling (enables using _start() directly)
gcc -m32 -o test test.c # compile a 32-bit executable
gcc -m64 -o test test.c # compile a 64-bit executable
gcc -c -o obj1.o obj1.c # create an object file, but do not link the result(s) into an executable
# Can be combined with -m{32,64}
tcpdump -i wlan0 -nn -XX -S -s 0 -w /media/data/packets.pcap -vvv host 192.168.1.100
# -i wlan0 : Only capture packets coming in through interface wlan0
# -nn: Don't resolve hostnames or port numbers
# -XX: Capture packet contents in hex, ASCII, and ethernet headers
# -S: Print sequence numbers
# -s 0: Collect the entire length of a packet instead of just the first 96 bytes
# -w <file>: Write data to the specified file
# -vvv: Get really, really verbose. Show me all the info tcpdump has
# host 192.168.1.100: Filter incoming packets to only those coming to/from this host
@infosec-intern
infosec-intern / vscode.desktop
Last active February 24, 2024 17:29
A simple .desktop file for Visual Studio Code
[Desktop Entry]
Name=Visual Studio Code
Comment=Programming Text Editor
Exec=/usr/local/src/VSCode-linux-x64/code
Icon=/usr/local/src/VSCode-linux-x64/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Programming;
DOMAIN=https://analytics.northpolewonderland.com
if [ ! -f "./zpipe" ]
then
# From: https://stackoverflow.com/questions/1532405/how-to-view-git-objects-and-index-without-using-git
echo "[*] There is no zpipe binary here! Downloading and compiling..."
wget https://github.com/madler/zlib/raw/master/examples/zpipe.c
sudo apt-get install zlib1g-dev > /dev/null
gcc -o zpipe zpipe.c -lz
else