Skip to content

Instantly share code, notes, and snippets.

View michenriksen's full-sized avatar

Michael Henriksen michenriksen

View GitHub Profile
@holman
holman / SAFE-RUBY.rb
Created February 16, 2011 05:38
This shows some of my favorite ways to ensure robust, high-security Ruby Applications.
require 'net/https'
module SecurityModule
class HighSecurity
class ReallyHighSecurity
def self.turn_on_safe_connections
OpenSSL::SSL::VERIFY_NONE
end
end
end
@pallih
pallih / gist:8434784
Created January 15, 2014 11:42
Bash function to randomize MAC address and hostname on OS X. Could live in ~/.bash_profile
function mask(){
# Changes MAC address to a random one and sets the hostname to a random word
# Tested on OS X 10.9 (Macbook Pro)
# Based on http://blog.kejsarmakten.se/all/software/2013/08/30/spoof-mac-on-osx.html
# and http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/
# Note: neither are permanent (a reboot resets both)
# For a permanent change to hostname: sudo scutil –-set HostName NEWHOST
# Consider using SpoofMAC: https://github.com/feross/SpoofMAC
NEWMAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
echo "Changing MAC " $(ifconfig en0 | grep ether)
@sfan5
sfan5 / image2xterm.py
Last active July 13, 2020 18:24
Converts images into color sequences (xterm-256color)
#!/usr/bin/env python3
import sys
import getopt
from PIL import Image
xterm256colors = [ # http://pln.jonas.me/xterm-colors
(0, (0x00, 0x00, 0x00)), # SYSTEM
(1, (0x80, 0x00, 0x00)), # SYSTEM
(2, (0x00, 0x80, 0x00)), # SYSTEM
(3, (0x80, 0x80, 0x00)), # SYSTEM
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!
@1N3
1N3 / LinuxPrivEsc.sh
Created May 13, 2016 02:50
Linux Privilege Escalation Script by 1N3 @CrowdShield - https://crowdshield.com
#!/bin/sh
#
# `7MN. `7MF'
# __, MMN. M
#`7MM M YMb M pd""b.
# MM M `MN. M (O) `8b
# MM M `MM.M ,89
# MM M YMM ""Yb.
#.JMML..JML. YM 88
# (O) .M'
@chalfant
chalfant / setup_monitoring.rb
Created June 7, 2016 12:57
Create monitoring metric filters and alarms for CIS Benchmarks for AWS
#!/usr/bin/env ruby
# Implement CIS Benchmarks for AWS Section 3.x
# Details on each benchmark from https://benchmarks.cisecurity.org/downloads/show-single/?file=awsfoundations.100
# name should be in camelcase since we'll use it for filter and alarm names
filters = [
{
benchmark: '3.1',
@geekpete
geekpete / Gemfile
Created October 6, 2016 06:33 — forked from jsvd/README.md
logstash grok filter benchmark script
source 'https://rubygems.org'
# Specify your gem's dependencies in logstash-mass_effect.gemspec
gem "logstash-core", :path => "./logstash/logstash-core"
gem "logstash-core-event-java", :path => "./logstash/logstash-core-event-java"
gem "logstash-core-plugin-api", :path => "./logstash/logstash-core-plugin-api"
gem "logstash-filter-grok", :path => "./logstash-filter-grok"
gem "logstash-patterns-core", :path => "./logstash-patterns-core"
gem "benchmark-ips"
@rverton
rverton / cowroot.c
Created October 21, 2016 14:06
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@gagarine
gagarine / install-clamav-osx.md
Last active June 7, 2023 07:54
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf
import requests
import re
import sys
from multiprocessing.dummy import Pool
def robots(host):
r = requests.get(
'https://web.archive.org/cdx/search/cdx\
?url=%s/robots.txt&output=json&fl=timestamp,original&filter=statuscode:200&collapse=digest' % host)