Jump to content

Switchblade Safety Catch Idea


magicdanw

Recommended Posts

Hi! This is my first post, but I've been reading the forums for a while, and they're great!

I've set up my own switchblade, but have been annoyed with plugging it into a computer to just read files and having it automatically pwn the system. I had the idea of using the read-write switch on the drive to serve as a safety catch of sorts, and the batch file could check if the drive is writable. If not, it will exit prematurely.

However, my current method of writing to a new file and checking if it exists doesn't work well because windows gives nice big loud popup errors if it's unable to write. Is there any way to make the ">" or "mkdir" or "attrib" commands less "verbose", or is there another way to check if a drive is writeable, all from a batch file/command-line utility?

Thanks for your help, and thanks for the great switchblade tutorials!

Link to comment
Share on other sites

I've been thiniking about something like this also going to put a if statement that checks to see if the computer name is one of the dumped file then stop that way you don't get the computer more than once. one of these days I'll get back to my switchbalde :(

Link to comment
Share on other sites

Well, if you're interested in making sure files don't get overwritten (or appended), I used this code at the beginning of my file to put all of my files in subfolders of the computername folder, based on the current time and date. That's in case I want to get new info from the same computer.

if not exist WIPdump md WIPdump >nul

if not exist WIPdump%computername% md WIPdump%computername% >nul

set folder=%date:~0,3%_%date:~4,2%_%date:~7,2%_%date:~10%...%time:~0,2%_%time:~3,2%

md WIPdump%computername%%folder% >nul

cd WIPCMD >nul

Then, all of my stuff later on gets stored to

WIPdump%computername%%folder%

Also, as of now my switchblade won't pwn my pc because of

if exist c:safety.txt goto end

which checks if a safety.txt is in my c drive, but I'd like the write-protect switch for use on other pcs (ex. I might not want to accidentally set off antivirus on a school computer (at least not under my account :D )). Plus, I just think it's cool to have a physical "safety catch" on my flash drive 8).

So, if anyone has any ideas, please let me know! Thanks!

Link to comment
Share on other sites

Update: I've found a solution using two vbscript files (because vbscript includes full error handling, it can attempt file operations without risk of an error).

Here's my code:

This gets added to the beginning of the go.cmd file:

wscript test1.vbs

if exist test.txt goto end

wscript test2.vbs

if not exist test.txt goto end

del test.txt

This gets added to a file called test1.vbs in the same folder as go.cmd:

on error resume next

dim filesys

Set filesys = CreateObject("Scripting.FileSystemObject")

If filesys.FileExists("test.txt") Then filesys.DeleteFile "test.txt"

This gets added to a file called test2.vbs in the same folder as go.cmd:

on error resume next

dim filesys

Set filesys = CreateObject("Scripting.FileSystemObject")

filesys.CreateTextFile "test.txt", True

Now, it will work normally when the write-lock switch is off. When write-lock is on, it won't do anything, and no error messages. I hope other people find this code useful for their own projects! :D

Link to comment
Share on other sites

  • 1 year later...

Can I get safty.txt to work on GonZor's payload if so do I use the code you posted? And finely where do I put it example: name.bat.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...