Skip to content

Instantly share code, notes, and snippets.

💭
I'm not entirely sure.

Josh kernelsmith

💭
I'm not entirely sure.
View GitHub Profile
@kernelsmith
kernelsmith / radamsa_sleep.md
Created Feb 27, 2019
to get radamsa to wait on stdin before generating the next case
View radamsa_sleep.md

Find main.scm and replace

(sleeper)

with

((λ () (get-block stdin 1)))
@kernelsmith
kernelsmith / windows_scans.md
Created May 10, 2018
decreasingly dumb ways of doing windows host discovery
View windows_scans.md

Old ways of scanning for windows hosts

This is from an old presentation, I just wanted to record it somewhere. I'm not saying this stuff:

a) still works b) is a good idea c) hasn't been surpassed greatly in the last 7 years d) is completely accurate

hping & TTLs

@kernelsmith
kernelsmith / key_peele_east_west_names.rb
Created Apr 13, 2018
All the names, teams, schools, and East-West episode numbers for Key & Peele's East vs West skits...in ruby
View key_peele_east_west_names.rb
names = [
["D'Marcus Williums", "1", "east", "University of Georgia"],
["T.J. Juckson", "1", "east", "Wayne State University"],
["T'varisuness King", "1", "east", "Merrimack College"],
["Tyroil Smoochie-Wallace", "1", "east", "University of Miami"],
["D'Squarius Green, Jr.", "east", "University of Notre Dame"],
["Ibrahim Moizoos", "1", "east", "University of Tennessee at Chatanooga"],
["Jackmerius Tacktheritrix", "1", "east", "Michigan State University"],
["D'Isiah T. Billings-Clyde", "1", "east", "Coastal Carolina University"],
["D'Jasper Probincrux III", "1", "east", "South Carolina State University"],
@kernelsmith
kernelsmith / follow.sh
Last active Apr 5, 2017
follow a redirect at the command line
View follow.sh
curl -s -I $url | grep \^Location: | cut -d ':' -f 2-
# I had a longer version that continued following redirects up to a limit, but
# can't find it atm
# if you'd like to do the above anonymously, you can use https://hurl.it and
# change the HTTP method from GET to HEAD and paste in your URL (assuming HEAD
# is supported by the webserver). In the response you'll see the
# Location: HTTP header w/the redirected URL (assuming nominal situation).
@kernelsmith
kernelsmith / gpgme_basic_usage.md
Last active May 10, 2016
Basic GPGME ruby gem usage
View gpgme_basic_usage.md

Basic GPGME Ruby Gem Usage

I just found this API ridiculously confusing to use, and maybe I just suck, but I don't want to figure it out again, so I'm writing it down here

Establish a gpg home dir if desired

Optional, but if you have an established gpg home dir that you want to use or you don't want it chosen for you

GPGME::Engine.home_dir = "/some/dir" # e.g. env['GNUPG_HOME']
@kernelsmith
kernelsmith / vmware_problems.md
Last active Jan 14, 2016
vmware tools problems such as mounting shares and kernel patches
View vmware_problems.md

Restart vmware tools services

  • restart the services so you can see if any fail

sudo /etc/vmware-tools/services.sh restart

  • if failure, you can optionally check which services are actually still running

sudo /etc/vmware-tools/services.sh status

  • but you'll want to rerun the vmware config script which will recompile kernel mods
@kernelsmith
kernelsmith / set_datetime_and_zone.sh
Last active Jan 14, 2016
easily set ubuntu system date/time and timezone
View set_datetime_and_zone.sh
#!/bin/sh
# change this value to suit you, see below for further guidance
DESIRED_TIME_ZONE="US/Central"
# Note, if you were to get this value from an argument etc, keep
# in mind it would be vulnerable to command injection
# get timezone values from `ls /usr/share/zoneinfo` if you need them
# for example, you can see there's a /usr/share/zoneinfo/US/Central and
# /usr/share/zoneinfo/America/Chicago etc
View easy_shell_proxy.sh
#
# Functions used to change or display the proxy state
#
# usually it's all the same host, but you could add more host vars if needed
_PROXY_HOST="proxy.company.com"
_HPROXY_PORT="8080"
_HSPROXY_PORT="8080"
_SPROXY_PORT="1080" # this is usually different than http/s
# comma separated (no spaces) list of hosts/ip ranges(cidr) to not proxy
@kernelsmith
kernelsmith / interfaces
Last active May 13, 2020
example etc/network/interfaces config
View interfaces
# always start with interface up
auth eth0
# Static
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.250
@kernelsmith
kernelsmith / flush_routes.sh
Last active Aug 29, 2015
Flush a linux interface to force a DHCP change after a network changes
View flush_routes.sh
ip addr flush dev eth0
You can’t perform that action at this time.