Skip to content

Commit efc1dc5

Browse files
Merge pull request #21 from vysec/master
SSH? Don't forget
2 parents c037d1f + 3644538 commit efc1dc5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ THANK YOU to all of the authors of the content referenced in this wiki and to al
3030
- [socat vs mod_rewrite](#socat-vs-mod_rewrite)
3131
- [socat for HTTP](#socat-for-http)
3232
- [iptables for HTTP](#iptables-for-http)
33+
- [ssh for HTTP](#ssh-for-http)
3334
- [Payloads and Web Redirection](#payloads-and-web-redirection)
3435
- [C2 Redirection](#c2-redirection)
3536
- [C2 Redirection with HTTPS](#c2-redirection-with-https)
@@ -328,6 +329,29 @@ iptables -P FORWARD ACCEPT
328329
sysctl net.ipv4.ip_forward=1
329330
```
330331
332+
### SSH for HTTP
333+
334+
We have previously covered using SSH for DNS tunnels. SSH works as a solid, and robust means to break through NAT and obtain a way for the implant to connect to a redirector annd into your server environment. First you must set up GatewayPorts forwarding or it won't work, using the following syntax on the redirector:
335+
336+
```nano /etc/ssh/sshd_config``` add ```GatewayPorts yes```
337+
338+
To forward the redirector's local port 80 to your internal teamsrver, use the following syntax on the internal server:
339+
340+
```
341+
tmux new -S redir80
342+
ssh <redirector> -R *:80:localhost:80
343+
Ctrl+B, D
344+
```
345+
346+
You can also forward more than one port, for example if you want 443 and 80 to be open all at once:
347+
348+
```
349+
tmux new -S redir80443
350+
ssh <redirector> -R *:80:localhost:80 -R *:443:localhost:443
351+
Ctrl+B, D
352+
```
353+
354+
331355
### Payloads and Web Redirection
332356
333357
When serving payload and web resources, we want to minimize the ability for incident responders to review files and increase the chances of successfully executing the payload, whether to establish C2 or gather intelligence.

0 commit comments

Comments
 (0)