diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..45ec60e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,12 @@ +include LICENSE +include *.in +include *.py +include multicat/*.cfg +global-exclude *.pyc *.pyo *~ +global-exclude *test* +global-exclude *tmp* +prune __pycache__ +prune */__pycache__ +prune build +prune dist +prune multicat/tests \ No newline at end of file diff --git a/README.md b/README.md index 869de38..d8462e1 100644 --- a/README.md +++ b/README.md @@ -21,19 +21,32 @@ Sometimes you have to spread the same payload to multiple targets and don't know

(back to top)

+ +## Installation +```commandline +pip install multicat +``` + ## Usage + +To start listening on the port of your choice: ```commandline +mc -p 1234 +``` + +### Arguments -Usage: mc.py [-h] [-p] [-m] [-t] +```commandline +Usage: mc [-h] [-p] [-m] [-t] -h, --help show this help message and exit -p , --port port to listen (default: 28000) -m , --max-clients max number of new clients to queue before establish connection (default: 5) -t , --timeout connections timeout (default: 10) - ``` +### Commands Available commands in general menu context: ```commandline COMMAND DESCRIPTION @@ -42,6 +55,7 @@ HELP List available commands SESSIONS List established sessions START Interact with a client CLOSE Close an specific connection +EXIT / QUIT Exit the entire application ``` Available commands in session context: diff --git a/mc.py b/multicat/mc.py similarity index 92% rename from mc.py rename to multicat/mc.py index fd31d95..1629356 100644 --- a/mc.py +++ b/multicat/mc.py @@ -3,7 +3,7 @@ # https://github.com/r3nt0n/multicat # multicat - multithread reverse shell listener -import socket, threading, time, sys, argparse +import socket, threading, time, argparse, os name = 'multicat' desc = 'Multithread reverse shell listener' @@ -80,7 +80,6 @@ def listenToClient(self, client_object): except UnicodeDecodeError: print(output.decode('latin-1'), end='') - #command = input('') + '\n' command = input('') if command.upper() in ('HELP', '?'): print(f'\n{color.BOLD}COMMAND\t\tDESCRIPTION{color.END}') @@ -88,7 +87,6 @@ def listenToClient(self, client_object): print('STOP\t\tStop interacting with the current session') print('CLOSE \t\tClose the current connection') command = '' - #if command.rstrip('\n').upper() == 'STOP': if command.upper() == 'STOP': if input(f'\n{color.ORANGE}[?]{color.END} Do you want to {color.ORANGE}stop{color.END} this session? [y/N] ').lower() == 'y': print() @@ -136,8 +134,11 @@ def menu(self): print('SESSIONS\tList established sessions') print('START \tInteract with a client') print('CLOSE \tClose an specific connection') + print('EXIT / QUIT\tExit the entire application') print() - #elif user_input.upper().startswith('HELP'): + + elif user_input.upper() in ('EXIT', 'QUIT'): + os._exit(0) elif user_input.upper().startswith('SESSIONS'): print(f'\n{color.BOLD}ID\tRemote address\tRemote port{color.END}') @@ -179,22 +180,15 @@ def run(self): thread.start() return -if __name__ == "__main__": +def main(): print(f'\n{name} by r3nt0n - https://github.com/r3nt0n/multicat\n') - # - # if len(sys.argv) == 2: - # port_num = sys.argv[1] - # try: - # port_num = int(port_num) - # if port_num < 0: - # raise ValueError - # except ValueError: - # print(f'{color.RED}[!]{color.END} ERROR: Invalid listening port') - # sys.exit(1) - #ThreadedServer('', port_num).run() port, max_clients, timeout = process_args() ThreadedServer('', port, max_clients, timeout).run() - # else: - # print(f'Usage: {sys.argv[0]} ') + + +if __name__ == "__main__": + main() + + diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..84507f2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[metadata] +description-file=README.md +license_files=LICENSE \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f8d08a1 --- /dev/null +++ b/setup.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# https://github.com/r3nt0n/multicat + +# packages with python3 setup.py -v sdist + +from setuptools import setup, find_packages +from multicat.mc import __version__, desc + +# Read project description +with open('README.md', 'r') as f: + long_desc = f.read() + +setup( + name='multicat', + version=__version__, + author='r3nt0n', + author_email='r3nt0n@protonmail.com', + url='https://github.com/r3nt0n/multicat', + license='GNU General Public License v3.0', + description=desc, + long_description=long_desc, + long_description_content_type="text/markdown", + include_package_data=True, + package_data={ + # If any package contains *.cfg files, include them + '': ['*.cfg'], + }, + #packages=['modules',], + #packages=find_packages(), + packages=['multicat'], + #install_requires=[], + entry_points = { + 'console_scripts':[ + 'mc = multicat.mc:main' + ] + } +) \ No newline at end of file