├── pix.png ├── Tracker.docx ├── Tracker-armed.docx ├── README.md └── WordTracker.sh /pix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glennzw/WordKnock/HEAD/pix.png -------------------------------------------------------------------------------- /Tracker.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glennzw/WordKnock/HEAD/Tracker.docx -------------------------------------------------------------------------------- /Tracker-armed.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glennzw/WordKnock/HEAD/Tracker-armed.docx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordKnock: Add a tracking image to a Word document 2 | 3 | ### Usage: 4 | 5 | ``` 6 | ./WordTracker.sh http:///img.jpg 7 | ``` 8 | 9 | This will add `http:///img.jpg` to the footer of the `Tracker.docx` file, creating `Tracker-armed.docx`. You can open `Tracker-armed.docx` and add whatever other content you want. Now just monitor your server for IPs accessing the `img.jpg` 10 | 11 | ### Tips: 12 | Use a 1x1 white pixel. This can be generated on the command line with: 13 | 14 | ``` 15 | echo iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Xw8AAoMBgDTD2qgAAAAASUVORK5CYII= | base64 --decode > pix.png 16 | ``` 17 | Also, it's probably best to use a unique filename, so bots/crawlers don't stumble across the image. 18 | -------------------------------------------------------------------------------- /WordTracker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Arm Word document with tracker image. 3 | 4 | img=$1 5 | if [ "$#" -ne 1 ]; then 6 | echo "Please supply URL" 7 | fi 8 | 9 | rm -rf /tmp/TrackerTmp 10 | mkdir -p /tmp/TrackerTmp 11 | unzip -q Tracker.docx -d /tmp/TrackerTmp/ 12 | 13 | #Hide image in body: 14 | #sed -i.bak "s;HERPDERP.jpg;$img;g" /tmp/TrackerTmp/word/_rels/document.xml.rels 15 | #rm /tmp/TrackerTmp/word/_rels/document.xml.rels.bak 16 | 17 | #Hide image in footer: 18 | sed -i.bak "s;HERPDERP.jpg;$img;g" /tmp/TrackerTmp/word/_rels/footer1.xml.rels 19 | rm /tmp/TrackerTmp/word/_rels/footer1.xml.rels.bak 20 | 21 | cd /tmp/TrackerTmp && zip -qr Tracker-armed * 22 | cd - 23 | mv /tmp/TrackerTmp/Tracker-armed.zip ./Tracker-armed.docx 24 | 25 | 26 | echo "Added tracking image $img to file Tracker-armed.docx" 27 | --------------------------------------------------------------------------------