Skip to content

Instantly share code, notes, and snippets.

@jeffgeiger
jeffgeiger / update_vulscan.sh
Created August 19, 2013 21:06
Simple script to update nmap VSE vulnerability scanner in Homebrew.
#!/bin/bash
echo "Updating vulscan database..."
cd /usr/local/Cellar/nmap/6.40/share/nmap/scripts/vulscan/
rm *.csv
wget http://www.computec.ch/projekte/vulscan/download/cve.csv
wget http://www.computec.ch/projekte/vulscan/download/exploitdb.csv
@jeffgeiger
jeffgeiger / munin-node.sh
Last active April 7, 2022 20:05
A generic stand-in for munin-node written to run on AIX, may work elsewhere.
#!/bin/ksh
#Connected - echo basic info
echo "# munin node at `hostname`"
#watchdog timestamp
WD_TIME=$(perl -e 'print time')
@jeffgeiger
jeffgeiger / grokparse.rb
Last active September 2, 2020 02:21
Test grok patterns without launching logstash.
#!/usr/bin/env ruby
=begin
USAGE:
cat example.log | ruby grokparse.rb
=end
require 'rubygems'
require 'grok-pure'
require 'pp'
@jeffgeiger
jeffgeiger / listen.py
Created September 1, 2020 20:50 — forked from echojc/listen.py
Quick 'n' dirty Python script to listen on a port and do nothing with the connection, simulating a server that allows you to connect but does not reply.
#!/usr/bin/python
import socket
import sys
if (len(sys.argv) != 2 or not sys.argv[1].isdigit()):
print 'Usage: listen <port>',
exit()
p = int(sys.argv[1])
l = []
@jeffgeiger
jeffgeiger / file_extract.bro
Created November 25, 2014 17:49
File extraction with executables and archives
global ext_map: table[string] of string = {
["application/x-dosexec"] = "exe",
["application/zip"] = "zip",
["application/x-gtar"] = "gzip",
["application/x-rar-compressed"] = "rar",
["application/x-apple-diskimage"] = "dmg",
["application/x-7z-compressed"] = "tz",
["application/x-gzip"] = "gz",
["application/x-bzip2"] = "bz",
["application/x-lzma"] = "lzma",
@jeffgeiger
jeffgeiger / Build_setup.md
Last active August 20, 2019 19:07
RPM Spec file for rebuilding nginx + spnego-http-auth-nginx-module

Install the source RPM for nginx and move it to you RPM build environment.

cd SOURCES/
tar xvzf nginx-1.6.3.tar.gz
cd nginx-1.6.3
git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git
cd ..
mv nginx-1.6.3 nginx-spnego-1.6.3
tar cvzf nginx-spnego-1.6.3.tar.gz nginx-spnego-1.6.3/
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@jeffgeiger
jeffgeiger / asciiputsonglasses
Created June 25, 2019 22:12 — forked from staringispolite/asciiputsonglasses
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@jeffgeiger
jeffgeiger / gist:c11fd13073d9c9a18ae5958626928203
Created September 12, 2018 15:15
RockNSM 2.1 - Add suricata rules on an offline install
# Add the offline rules file as a source:
sudo suricata-update add-source "Local Rules" "file:///srv/rocknsm/support/emerging.rules-suricata.tar.gz"
# Check that we're not going to go screaming at the internet for an update
sudo suricata-update list-enabled-sources
# You should see this:
# Enabled sources:
# - Local Rules
@jeffgeiger
jeffgeiger / client.py
Created July 31, 2018 14:42 — forked from yoavram/client.py
Example of uploading binary files programmatically in python, including both client and server code. Client implemented with the requests library and the server is implemented with the flask library.
import requests
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print r.text