Hermes is an open-source E-Mail tracking solution that is written in Go. It tracks emails using a tracking pixel.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1010 B

  1. #!/bin/python
  2. import sys
  3. from base64 import b64decode
  4. from hashlib import sha256
  5. from urllib.parse import quote
  6. # Change these variables depending on your setup.
  7. userid = ""
  8. key = ""
  9. domain = ""
  10. if len(sys.argv) > 2:
  11. subject = input("Please enter subject of email:")
  12. recipient = input("Please enter recipient of email: ")
  13. else:
  14. message = b64decode(sys.argv[1]).decode()
  15. subject = "NIL"
  16. recipient = "NIL"
  17. for i in message.split("\n"):
  18. if i.split(" ")[0] == "Subject:":
  19. subject = i[9:]
  20. elif i.split(" ")[0] == "To:":
  21. recipient = i[4:]
  22. identifier = subject + recipient + userid + key # Generate hash
  23. identifier_hash = sha256(identifier.encode("utf-8")).hexdigest()
  24. url = "{}/read/{}/{}/{}/{}".format(domain,
  25. userid,
  26. quote(subject),
  27. quote(recipient),
  28. identifier_hash) #Generate tracking url
  29. print(url)