Skip to content

Instantly share code, notes, and snippets.

View kernelsmith's full-sized avatar
💭
I'm not entirely sure.

Josh kernelsmith

💭
I'm not entirely sure.
View GitHub Profile
@kernelsmith
kernelsmith / servers.yaml
Created June 19, 2013 00:20
example servers definition file, just an idea
---
- :hostname: webserver
:ip: 10.1.1.1
:opts:
:services:
- :http
- :proxy
:proxy_port: 81
:path_to_important_files: C:/important
:path_to_vbs_scripts: C:/vbs
@kernelsmith
kernelsmith / proof_multi_command.txt
Last active September 29, 2016 11:58
testing results for msfconsole multi commands, old PR 1336, and RM7705
msf exploit(psexec) > set RHOST 1.1.1.1;set LHOST 1.1.1.2
RHOST => 1.1.1.1
LHOST => 1.1.1.2
msf exploit(psexec) > show options
Module options (exploit/windows/smb/psexec):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOST 1.1.1.1 yes The target address
@kernelsmith
kernelsmith / system_setup.txt
Last active October 3, 2021 18:41
system setup
* ESXi server
- Case: Shuttle SH67H3 Intel Core i7 / i5 / i3 (LGA1155) Intel Socket H2(LGA1155) Intel H67 Intel HD Graphics 2000/3000 integrated in the processor 1 x HDMI XPC Barebone
- $229 Paid
- $239 Last I checked
- http://www.newegg.com/Product/Product.aspx?Item=N82E16856101117
- CPU: Intel Core i3-3225 Ivy Bridge 3.3GHz LGA 1155 55W Dual-Core Desktop Processor Intel HD Graphics 4000 BX80637I33225 (has less cores than the previous CPU, which is now in the NAS, but onboard GPU frees up one of only 2 PCIe slots for more NICs) (was too cheap to pay for an i5/7)
- NOTES: I highly recommend an i3/5/7 due to onboard gpu
- $210 Paid
- $205 Last I checked
- http://www.newegg.com/Product/Product.aspx?Item=N82E16819115084
@kernelsmith
kernelsmith / clone_all_branches.sh
Created August 9, 2013 23:15
clone all your remote branches. After I clone my fork of the metasploit-framework, I often want to also clone some or all of my remote branches as well, and there's no builtin command for it. This does that. I tried to make it as posixy as possible. It's still pretty crappy, but works. I believe getopts is posix (as a gnu util).
#!/bin/sh
# This script tries to be posix compliant, so no bash'isms
# This script assumes you have an existing repo, the dir for which is your pwd, such as one created with
# git clone https://github.com/kernelsmith/metasploit-framework.git
# The script will create a local branch for each remote branch (origin only) and update the local branch to match the remote
# Usage:
# $0 [-d] [-f grep_filter]
# -d dryrun,just shows you what would happen but doesn't do anything
@kernelsmith
kernelsmith / msf_snippets.txt
Last active December 20, 2015 23:59
MSF snippets, one-liners, tricks and cheats
* New Indentation Rules
https://github.com/rapid7/metasploit-framework/wiki/Indentation-Standards
* Pick up a defunct submitter's change
someone else could pick up the change while committing like so:
git merge --no-ff upstream/pr/2212
git merge --no-ff dmaloney-r7/pr/8
(assuming you added @dmaloney-r7's branch as a remote)
Doing so will tend to violate two-person code review practices when
@kernelsmith
kernelsmith / ruby_tips_tricks_one-liners.rb
Last active August 1, 2025 03:26
Ruby tricks, tips, and one-linersConvert hex data to hex string, convert file contents to base64, machine sortable, but still human-readable time stamps, mash two arrays into a hash where one array is hash keys (esp CSV parsing), timeouts, zip files
#
# One-liners (or one'ish-liners)
#
pry(main)> Psych::VERSION
=> "3.1.0"
pry(main)> show-source Psych
=> # lots of code
pry(main)> show-method meth_name
# From: /home/some_code.rb:233:
@kernelsmith
kernelsmith / euphemisms.txt
Created October 1, 2013 17:45
Funny Euphemisms, you figure them out
claymore
Cleveland Brown (hint, great uniforms, terrible helmet)
@kernelsmith
kernelsmith / browser_met_ext.c
Created October 17, 2013 06:24
rip_msd_to_ralgun using meterp extension formatted output on the wininet.dll
// Minimum supported client:Windows 2000 Professional
// Minimum supported server:Windows 2000 Server
// Header:Wininet.h
// Library:Wininet.lib
// DLL:Wininet.dll
// Unicode and ANSI names:HttpSendRequestW (Unicode) and HttpSendRequestA (ANSI)
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa384247(v=vs.85).aspx
typedef BOOL (WINAPI * PHTTPSENDREQUESTA)(
HINTERNET hRequest,
LPCSTR lpszHeaders,
@kernelsmith
kernelsmith / proxy_helper.sh
Last active December 26, 2015 22:09
All-in-one CLI environment proxy helper
# Note, the local keyword is not strictly posix compliant but supported in
# most shells. You can remove them w/o affecting the scripts except those
# variables will still be in scope outside the function, which can cause some
# info leakage unless you clear them (and you'd want to also trap so they'd be
# cleared when the script is interrupted with something like ctl-c etc)
prox="http://proxy.check:8080"
alias proxyon="export http_proxy=$prox && export https_proxy=$prox"
alias proxyoff='unset http_proxy && unset https_proxy'
@kernelsmith
kernelsmith / .gitconfig
Last active December 28, 2015 05:19 — forked from todb-r7/.gitconfig
git alias for pr-url to open a browser with a PR to the intended user and branch
[user]
uname = ks
[alias]
branch-current = rev-parse --abbrev-ref HEAD
# Usage: git pr-url HISNAME HISBRANCH
# Example: git pr-url rapid7 master
# Example: git pr-url OJ feature/cool_feature_that_also_fixes_bugs
pr-url =!"xdg-open https://github.com/$(git config user.uname)/$(basename $(git rev-parse --show-toplevel))/pull/new/$1:$2...$(git branch-current) #"
# OSX. Use whatever browser you use
#pr-url =!"open -a \"Google Chrome\" https://github.com/$(git config user.uname)/$(basename $(git rev-parse --show-toplevel))/pull/new/$1:$2...$(git branch-current) #"