X-VR-SPAMCAUSE decoder
▻https://gist.github.com/lkraider/9530798a695586fc1580d0728966f6f0
Un petit script #python pour décoder l’entête X-VR-SPAMCAUSE
des #mails marqués comme #SPAM, bien utile car tous les outils en ligne à ce sujet ne sont plus disponibles cf ▻https://wiki.visionduweb.fr/index.php?title=Installer_Exim#D.C3.A9crypter_le_contenu_de_la_vari
def decode(msg):
text = []
for i in range(0, len(msg), 2):
text.append(unrot(msg[i: i + 2]))
return str.join('', text)
def unrot(pair, key=ord('x')):
offset = 0
for c in 'cdefgh':
if c in pair:
offset = (ord('g') - ord(c)) * 16
break
return chr(sum(ord(c) for c in pair) - key - offset)
if __name__ == '__main__':
import sys
print(decode(sys.argv[1]))