Time
2 hours 25 minutes
Difficulty
Beginner
CEU/CPE
3

Video Transcription

00:00
in the last few videos we talked about Ducky script and all the different commands you can use within it.
00:05
In the next few videos will be building and watching intact using ducky script and the USB rubber ducky.
00:13
Okay, now we're gonna build our script and deployed as a payload on our USP rubber ducky.
00:19
What the script is going to do is it's going to minimize all the victims of Windows. It's going to then take a, uh uh, a screen capture of their screen.
00:31
Then we'll hide their desktop icons, take that screen capture and said as the wallpaper.
00:37
Now, what this is gonna do is it's going to just be very annoying for the person they're going to believe that they're seeing their desktop icons when in fact they're only seeing the wallpaper that we made.
00:50
So it's very knowing, but nothing malicious. So, um,
00:54
what's less so let's go ahead and get into it.
00:57
So what you're gonna do is you're an open, you know, Pat plus plus,
01:00
Then we're gonna make sure we select the language. So we're gonna go to the language and select Ducky script. Make sure we have the scripting language in there
01:08
and now every script You really want to start off with a delay?
01:12
Ah, larger. A larger delayed because a lot of computers need to identify the device installed drivers, so it usually takes about 5 to 6 seconds for this to happen. So let's go ahead
01:26
and put a five second delay just to start off.
01:30
And remember, um, the commands should be highlighted. And, uh, like a blue or red color. I think rim is green.
01:41
And this, and by having language on it, helps you identify to make sure you have,
01:46
um, you have the correct command in there,
01:49
so we'll start off script with DeLay 5000. So I'll do a five second delay. Remember their milliseconds next on the script. What we want to do is minimize all the victims windows.
02:00
Now, to do this, you'll need to push the windows, Dickie.
02:04
So if you remember, uh, Windows key can interpret either be do I or windows on the script will just used to you I
02:13
Okay,
02:14
x, we want to use a delay.
02:16
Now, remember, delays are very important lips, because if you don't use them and the commands run on top of each other. Things aren't gonna work. Work properly.
02:27
So I'm gonna actually type my now and not use a default delay because sometimes you'll need to just delays. And I just like this method better. But you can use whatever method you like.
02:38
Okay, next. Once we have all the windows minimized, we're going to take a screenshot of the victim's screen.
02:46
So to do that,
02:47
we will use this command print screen,
02:52
and this will take a screen capture of their screen
02:55
and then again hold to another delay
02:59
of 200.
03:00
Okay, so now where you're going to want to use the context menu on the desktop?
03:07
Because there's something on the desktop we'll need to get to in that menu
03:10
s O. If you remember, you can either use the app or the menu. He will disused menu.
03:17
And then again, only another delay.
03:22
And let me just show you what we're going to be doing with this context menu. Just first, put that delay in. Let me in minimize this for a second.
03:31
So when I hit this menu key,
03:36
make sure I'm on the desktop.
03:38
Here we go.
03:38
Uh, once I haven't been He we want to hit V for view,
03:44
and then we're going to hit D. And what this is going to do is is going to hide all the icons.
03:51
And as you can see, they're all gone and get those back. Will this do the same thing? So the menu button
03:57
me
03:59
and then D on their back,
04:00
And so this is what we want to do in the script. So let's go back there.
04:04
So if it's as you could see was started the menu,
04:08
we gotta delay next. We want to do
04:13
our wiki,
04:14
so
04:15
get the menu up it be that'll open that view
04:18
and then we'll do another delay,
04:24
and then we'll do another
04:27
string and the string was D, and this will hide all the icons.
04:32
Okay, now, once we have
04:34
our screen capture and they're in icons, we want open Emma's paint on. The reason why you want to do this is we want to save. We wanna pace that screen capture and to paint and then save it as a JPEG so that we could save it as a wallpaper
04:50
***. Let's go ahead, do that, so we'll need to have the windows button
04:55
again you can use to you I
04:58
and our and hitting windows are will do this.
05:00
And if you type out M s paint,
05:05
it will open M s paint for you.
05:08
Okay, so let's go ahead and do that in our script.
05:12
Close this.
05:14
So we got the windows. Are geoeye are? Then we'll need our another delay. Let's type that out.
05:20
It's another delay of 200.
05:25
Then we need to type in in this paint
05:28
within that run function.
05:30
We got that
05:30
That will have to hit, enter and ordered for it open. So enter.
05:36
Then we want to do another delay. Give it time to open. Maybe we should give it another maybe half a second or full second. We'll just do a full second just to be safe. So make sure you give enough time for Emma's paint open because sometimes it takes a little longer and some computers.
05:53
So once we're in M s paint, we wanted to do ah pace function on. The easiest way to do that is a control V. So we'll do control the and that will paste it into Emma's paint.
06:06
Uh, then we want to do another delay just another regular 200 delay.
06:12
And now what we want to do is save this and let me let me open paint again.
06:20
Now, if I see if I had all to F
06:24
it's gonna open this file,
06:27
this file menu.
06:29
I want to hit all f and I and I put, uh, s
06:32
it's going to save it.
06:33
So let's go ahead and do that here in the script. So
06:39
we got our, um,
06:41
our screen capture peace and end this pain. So let's
06:46
actually save it. Sold the old F to bring up that file than you.
06:49
Um then we'll do a, uh
06:56
we will type s and that will save it,
06:59
Do another delay.
07:02
And let's actually give it a bit longer. Sometimes it takes a bit for that to pop up, so let's just do this to half a second,
07:13
okay? And now we're going to save it on the user profile of the victim.
07:18
Now,
07:21
in order to do that,
07:24
we're going to do this. So we need the percent
07:30
user profile percent, and we'll name it. Frank
07:34
lips wall paper
07:38
dot jpeg
07:40
R D J p G.
07:42
Okay, so what? This percent does, uh, user profile percent before the file name is, it's going to save it in the current user's profile.
07:51
So after we have that, we want to push enter,
07:58
and that's going to save that pile on the person's user profile.
08:05
Okay, so now we got that done. We don't want another delay,
08:09
another 200 away,
08:13
and then we're going to do all tw f while we're still in. Um, Ms Paint, what this does again is it's going to open that file menu.
08:22
Then we're going to lay again,
08:26
and then we're going to hit string. Be
08:30
now Let me show you what that does.
08:33
So if I hit all F
08:35
and I hit B,
08:37
it's going to save this as a desktop background. It's great out here because I don't have anything pasted in, but once you hit be, it immediately saves as the desktop background

Up Next

USB Drop Attack

Malicious devices are everywhere these days, whether you can see them or not.

Instructed By

Instructor Profile Image
Shawn Briere
Information Security Analyst
Instructor