Skip to content

Instantly share code, notes, and snippets.

View killswitch-GUI's full-sized avatar

Alexander Rymdeko-Harvey killswitch-GUI

View GitHub Profile
@pcting
pcting / gist:1041387
Created June 22, 2011 22:13
SSH Tunnel UDP Packets from REMOTE server
# YOUR LOCAL BOX
socat -t0 -T0 tcp4-listen:6667,reuseaddr,fork UDP:localhost:4445
ssh user@remote_server -R 6667:localhost:6667
# REMOTE MACHINE
socat -t0 -T0 udp4-recvfrom:4445,reuseaddr,fork tcp:localhost:6667
@mdnmdn
mdnmdn / ConvertTo-JSON.ps1
Last active September 27, 2024 06:04
ConvertTo-JSON for Powershell 2.0
function Escape-JSONString($str){
if ($str -eq $null) {return ""}
$str = $str.ToString().Replace('"','\"').Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("`t",'\t')
return $str;
}
function ConvertTo-JSON($maxDepth = 4,$forceArray = $false) {
begin {
$data = @()
}
@DaveCTurner
DaveCTurner / tarsum
Last active April 8, 2020 16:38
SHA1 hashes of contents of TAR archive without extracting the archive first
#!/usr/bin/python
import sys
import tarfile
import hashlib
for filename in sys.argv[1:]:
print filename
with tarfile.open(filename, 'r') as tar:
for tarinfo in tar:
Command to run:
ssh -L 2222:localhost:8501 [email protected]
where 2222 is the local port mapping it can be any number above 1000
where localhost must be set to localhost and refers to your current connection
where 8501 is the port you will be opening up on the remote machine
where [email protected] is the first hop in your quest for internal access
import binascii
import sys
file_name = sys.argv[1]
with open (file_name) as f:
hexdata = binascii.hexlify(f.read())
hexlist = map(''.join, zip(hexdata[::2], hexdata[1::2]))
shellcode = ''
for i in hexlist:
shellcode += "0x{},".format(i)