Skip to content

Instantly share code, notes, and snippets.

View joswr1ght's full-sized avatar

Joshua Wright joswr1ght

View GitHub Profile
@joswr1ght
joswr1ght / netshportforward.cmd
Created August 31, 2016 20:00
Netsh Port Forward
netsh interface portproxy add v4tov4 listenport=8001 listenaddress=192.168.0.10 connectport=80 connectaddress=192.168.0.10
public static boolean checkGooglePlayStore(Context context) {
String installerPackageName = context.getPackageManager().getInstallerPackageName(context.getPackageName());
return installerPackageName != null && installerPackageName.startsWith(" com.google.android");
}
@joswr1ght
joswr1ght / vboxmanage-convert-vhd.sh
Created February 10, 2017 17:48
Convert OVA to VHD
VBoxManage clonehd --format vhd "disk1.vmdk" "disk1.vhd"
@joswr1ght
joswr1ght / watchiptables.sh
Created June 8, 2015 15:06
Watch iptables rules
watch -d -n 2 iptables -nvL # Add -t nat for PREROUTING hits
@joswr1ght
joswr1ght / zunzip.py
Last active January 21, 2019 18:28
Zlib decompress file, producing file.out
#!/usr/bin/env python
import zlib, sys
if len(sys.argv) != 2:
print "Usage: %s <zlib-compressed-file>"%sys.argv[0]
print "Produces decompressed file with \".out\" filename suffix."
sys.exit(0)
indata=open(sys.argv[1], "rb").read()
outdata=zlib.decompress(indata)
@joswr1ght
joswr1ght / msfwrapper-stop-warn.sh
Created May 3, 2019 18:46
Stop warning that the Metasploit repository is more than 2 weeks old
sed -i 's/find \$FRAMEWORK\/\$cmd -mmin +20160/true/' /path/to/msfwrapper.erb'
@joswr1ght
joswr1ght / convert-onesafe-to-1password.py
Created June 14, 2019 19:09
OneSafe to 1Password Conversion
#!/usr/bin/env python3
# 2019-06-14 Joshua Wright, josh@wr1ght.net
import csv
import sys
OV = '\x1b[0;33m' # verbose
OR = '\x1b[0;36m' # routine
OE = '\x1b[1;31m' # error
OM = '\x1b[0m' # mischief managed
LOGINFILE="1password-login.csv"
@joswr1ght
joswr1ght / uninstall-windowsdefender.ps1
Created July 26, 2019 15:13
Uninstall Windows Defender
Uninstall-WindowsFeature -Name Windows-Defender
@joswr1ght
joswr1ght / brojsonnormaltime.sh
Created September 25, 2019 21:47
Export Bro Logs in JSON with ISO8601 timestamps instead of Epoch time
bro -r $1 -e 'redef LogAscii::use_json=T; redef LogAscii::json_timestamps = JSON::TS_ISO8601;'
@joswr1ght
joswr1ght / disablekibanadatareporting.sh
Created December 18, 2019 18:14
Disable Kibana Data Reporting/Telemetry from the Command Line with Curl
curl --silent -d '{"doc":{"telemetry":{"enabled":false}}}' -H 'content-type: application/json' http://localhost:9200/.kibana/_update/telemetry%3Atelemetry | jq