‫Okay. Now that we have our script ready.
‫In this lecture, I'm going to show you, how to compile it to an executable and how to change its icon.
‫The script is written in a scripting language called 'AutoIt'.
‫Now, AutoIt doesn't come pre-installed in Kali
‫but it gets installed when you install Veil and since we're using a Veil backdoor,
‫then there's no way you can be at this point without installing Veil
‫that's what I'm not going to cover how to install AutoIt
‫but you can literally just download it and run the installer using Wine.
‫So, AutoIt should be already installed for you by now.
‫And now, all we have to do is first rename this file.
‫And change the extension from a '.txt' to a '.au3'.
‫Then we're gonna go to all programs.
‫And look for 'compile',
‫so I'm going to type in, 'compile' in here.
‫And you'll see that I have the application that will 'compile auto with scripts' for me.
‫So, I'm going to click on that.
‫And this is very, very simple as you can see, the first thing that asks you for,
‫is the 'Source Auto with script'.
‫And that's the file that we made.
‫So I'm just going to click on Browse.
‫And you'd have to navigate to downloads from here.
‫But I'm already in downloads.
‫So, I'm just gonna click on it.
‫And click on Open.
‫You can also set where it's going to be stored but I'm just gonna keep it to be stored at the Downloads.
‫And then you can see here, you can actually change the icon and then, use a custom icon.
‫To do this, we'll have to first download an icon that represents our file.
‫Now, if your file was a PDF,
‫then you can just come in to this website which is called 'Icon Archive'
‫and then download, just look for a PDF or mp3
‫and you'll see icons that represent these files.
‫However in my case, I'm trying to use an image as the file that the person sees
‫and Windows usually shows a preview of the image.
‫It doesn't really show a specific icon for images.
‫So, what I want to do is, I want to convert the GTR image to an icon.
‫And to do that I'm just going to go to Google.
‫So, I'm just gonna save it.
‫And save it in the Downloads, that's fine.
‫And then in here, we're going to go to Browse to select it.
‫And we have the image here, double click.
‫And then we're gonna keep this to icon for Windows 7 or Vista, that's fine.
‫And I'm just gonna click on Download.
‫This is converted to an icon for me a '.ico'.
‫So, I can just click on OK to save it
‫and then I'm gonna go back to my compiler.
‫And we're gonna set the option in here, the Icon, I'm gonna click on Browse.
‫And select the icon that we just downloaded.
‫Now again in your case, you might have to navigate to root from here
‫and then go to downloads
‫and then we have the icon in here, the one that we just created.
‫I'm going to click on Open.
‫And that's it. All the options are set.
‫So, all we had to do for this is set the location for this script
‫and then set the icon in here.
‫I'm gonna click on Convert.
‫And that has generated the file for me,
‫gonna click on OK and I'm just going to close everything.
‫Now you can see, we have the executable in here.
‫So, this is a '.exe'
‫and this one was the old script.
‫So, when you're sending to the target, you wanna be sending the exe, the executable here.
‫I'm just going to rename this to GTR image.
‫Then, I'm going to copy it.
‫And I'm gonna put it in my web server ‫at 'var/www/htmal/evil- files'.
‫Before downloading this at the target computer, you wanna listen for incoming connections from Metasploit.
‫And I showed you how to do that before.
‫So right now, I'm only gonna do, show options, to show you the options that I've set
‫and if you don't remember how to do this, then please go back to the listening for incoming connections lecture
‫as I explained all of this in details.
‫For now, I'm only going to do exploit,
‫to wait for incoming connections.
‫Now everything is ready. I'm gonna go to the Windows machine and download the file.
‫So, the file is going to be at 'https://10.20.14.230/evil-files/gtr-image.exe'
‫I'm gonna hit Enter.
‫And we're going to save the file.
‫And as you can see, we see a file that has an icon,
‫that's an image icon which has a preview of the image, so it's very representative.
‫And if we double click this file.
‫And run it.
‫You see that we get an image that corresponds to the icon.
‫but if we go to the Kali machine.
‫You'll see that we got a Meterpreter session here.
‫And, basically, now we hacked into the target computer and we can do anything that we want there.
‫So just to confirm, I'm going to do this info.
‫And as you can see, now we're inside the target computer and we have full access to it.
‫We managed to do this with a file that has an icon of an image
‫and actually displayed an image to the target person.
‫And like I said, this method can be used to combine our backdoor or evil file with any file
‫that you want with an image, with a PDF, with a song or anything
‫that the target person is interested in.
‫Now, like I said, this is just another method to generate a download and execute payload.
‫You can use this method or you can use the method shown, before using the batch script,
‫you have the freedom.
‫The only reason, I showed you this is, so that you have two methods under your arsenal.
‫If one gets detected, then you can try the other one.
‫Also, don't forget to play around with the options,
‫edit your files with hex, if they get detected
‫and you should be able to bypass all antivirus programs.