Skip to content

Instantly share code, notes, and snippets.

View jas-'s full-sized avatar
🏃‍♂️

Jason Gerfen jas-

🏃‍♂️
View GitHub Profile
@jas-
jas- / .gdbinit
Last active May 13, 2020 20:29
Memory scraping
python
sys.path.insert(0, '/path/to/module/dir')
import hexdump
end
@jas-
jas- / wifi_map
Created January 8, 2019 01:46
20190107 - WiFi connected devices
WhosHouse:
a0:a3:e2:f9:a6:45:
bssid: a0:a3:e2:f9:a6:45
bytes: 611376
channels:
- 1
- 2
- 140
devices:
01:00:5e:00:00:fb:
@jas-
jas- / stigadm.json
Last active December 5, 2018 23:49
stigadm reporting
{
"date": "20181205-231751",
"system": {
"hostname": "solaris11",
"kernel": "SunOS solaris11 5.11 11.3 i86pc i386 i86pc",
"OS": "Solaris",
"version": "11"
},
"stigs": [
{
@jas-
jas- / accuracy.js
Last active December 23, 2017 23:32
node.js libnmap example usage
/*!
* libnmap
* Copyright(c) 2013-2015 Jason Gerfen <jason.gerfen@gmail.com>
* License: MIT
*/
var nmap = require('libnmap')
, opts = {
timeout: 900, // 900s = 10m and increases the reliability of scan results
flags: [
@jas-
jas- / example.js
Last active October 4, 2017 19:19
crypto.createSign() using DH private key use case
/* Bob's environment */
var crypto = require('crypto');
var rsa = require('ursa');
crypto.DEFAULT_ENCODING = 'hex'
var dhBob = crypto.getDiffieHellman('modp18')
, kBob = dhBob.generateKeys()
, keysBob = {
pubKey: dhBob.getPublicKey(),
@jas-
jas- / .bashrc
Last active July 8, 2017 14:07
Parse UFW log
# Default path of UFW parser
parse_ufw=/path/to/parse-ufw.awk
# Default path of UFW log
log_ufw=/var/log/ufw.log
# Function for filtering outbound comms
function ufw_out
{
@jas-
jas- / ufw-intel.sh
Created December 9, 2014 17:04
Intel gathering for UFW logs
dmesg | awk '{split($7, arr, "="); if (match(arr[2], /[0-9.]/)){print "\nHOST: " arr[2] " ================\n";system("host " arr[2]);system("whois " arr[2]);system("dig " arr[2]);}}' > log
@jas-
jas- / .bashrc
Last active November 27, 2016 17:19
.bashrc alias functions to handle GPG encrypt/decrypt operations per file/folder
# Define the encryption algo for gpg
algo="aes256"
# Define the gpg binary name (Solaris is gpg2)
gpg_name="gpg"
# Use ${gpg_name} to get full path of GPG
gpg=$(which ${gpg_name} 2>/dev/null)
# Validate GPG is installed
@jas-
jas- / gist:7546619
Last active December 28, 2015 18:58
superagent test case
var chai = require('chai'),
expect = chai.expect,
config = require('../config/settings'),
app = require('../libs/app'),
https = require('https'),
test = require('supertest')
describe('app.js', function(){
describe('routes', function(){
@jas-
jas- / TLS-client.js
Last active December 27, 2015 01:48
Experimental server/client (TLS) w/ DH exchange (susceptable to MITM w/o pre-shared secret)
var fs = require('fs')
var opts = {
host: 'node.dev',
port: 3000,
key: fs.readFileSync('certificate.key'),
cert: fs.readFileSync('certificate.crt'),
//ca: [fs.readFileSync('authority.cer')],
passphrase: 'password',
ciphers: 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH',