I was recently helping a friend to track down a scammer that stole money from them. I wanted to get the scammer's IP address that could be provided to the police, and I thought that sending them an email with embedded tracking image would be the easiest way to get it. I was surprised to find out that there is no native support for embedding remote images in Outlook - every attempt resulted in the image being included in the email itself. That would not work for our purpose, obviously, as we needed the scammer's email client to download the picture from our server, which would in turn log their IP address to a log file. This guide and a collection of scripts will allow you to setup a similar targetted tracking operation. This is not a rocket science, and you won't get any more information about your target than any and every newsletter collects about you. Still, I encourage you to use this for tracking bad people only.
- Server with a LAMP stack for hosting the image. (I use DigitalOcean for my server needs. They are great.)
- Microsoft Outlook for sending the email
- Prepare the image you want to embed in the tracking email, and update rows 2 and 4 in
image.php
to contain the correct filename - Upload your image file,
image.php
, andindex.php
to/var/www/html/
folder on your server - Visit
http://your-servers-ip-address/image.php?img=contract_termination.png
in your browser and verify that an entry was created inhttp://your-servers-ip-address/log.txt
- Create a new email message, and put
xxx
in place where you want to put your tracking image - Go File > Save As Template…
- Open the
.emltpl
file in a text editor and search forxxx
. The file will have two copies of your text. The first one is a plaintext version of the email (used e.g. on Apple Watch), the second one is an HTML version that we want to edit to contain our image. - Replace
xxx
with<img src="http://your-servers-ip-address/image.php?img=contract_termination.png">
and save the file - Open the
.emltpl
file in Outlook and send the email
- Create a new email message, and put
xxx
in place where you want to put your tracking image - Go File > Save As > Outlook Template (*.oft)
- Press Alt + F11 to open the Visual Basic interface
- Go Insert > Module
- Paste the content of
vb.txt
(don't forget to change the path to youroft
file on row 3) - Run the script by pressing the green play icon
- You'll get a dialog window with an input box. Paste the following code into the box and press OK:
<img src="http://your-servers-ip-address/image.php?img=contract_termination.png">
- You'll get a new window containing your email with the tracking image embedded. Just send it.