spf-dkim-dmarc-demo/console/web-api/views/attacker/spoof.tt

108 lines
4.7 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<style>
.log-entry-direction-in::before {
content: "← "; color: var(--bs-blue);
}
.log-entry-direction-out::before {
content: "→ "; color: var(--bs-yellow);
}
.log-entry-direction-comment::before {
content: "* "; color: var(--bs-gray-500);
}
.log-line-comment { color: var(--bs-gray-500); }
.log-line-comment::before { content: "("; }
.log-line-comment::after { content: ")"; }
</style>
<div class="container">
<h1>Usurpateur didentité de courriel</h1>
<div class="row mt-4 mb-4">
<div class="col-sm-12 col-lg-5">
<form method="POST">
<div class="card bg-light mb-5">
<div class="card-body pt-2">
<label for="scenario" class="form-label pt-1">Scénario</label>
<select class="form-select" id="scenario" name="scenario" aria-label="Choix du scénario" onchange="setEmailAddresses()">
[% FOR scenarios %]
<option value="[% id | html %]" data-mail-from-name="[% from_name | html %]" data-mail-from-address="[% from_address | html %]"[% IF id == deferred.selected_scenario %] selected[% END %]>[% name | html %]</option>
[% END %]
</select>
</div>
</div>
<div class="mb-3">
<label for="helo" class="form-label">HELO/EHLO</label>
<input type="text" id="helo" name="helo" class="form-control" value="[% default_helo | html %]">
<div class="form-text">Nom de machine sous lequel lattaquant se présente auprès du système de courriels du destinataire.</div>
</div>
<div class="mb-3">
<label class="form-label">Adresse RFC5321.MailFrom</label>
<select class="form-select" id="rfc5321-mailfrom" name="rfc5321-mailfrom">
<option id="original-rfc5322-from" value="keep"[% UNLESS deferred.replace_mail_from %] selected[% END %]>(Identique au RFC5322.From)</option>
<option value="replace"[% IF deferred.replace_mail_from %] selected[% END %]>[% my_mail_from | html %]</option>
</select>
<div class="form-text">Cette adresse est utilisée dans la commande SMTP « MAIL FROM ». Cest léquivalent électronique de ladresse écrite à larrière dune enveloppe postale.</div>
</div>
<div class="mb-3">
<label for="rfc5322-from" class="form-label">Adresse RFC5322.From</label>
<input type="text" id="rfc5322-from" class="form-control" value="(Sélectionner un scénario)" disabled readonly>
<div class="form-text">Cette adresse est utilisée dans len-tête « From » du courriel. Cest ladresse affichée par les logiciels de courriels comme Thunderbird. Cest léquivalent électronique de ladresse figurant sur le papier à en-tête.</div>
</div>
<button class="mt-4 btn btn-primary">Envoyer le message frauduleux</button>
</form>
</div>
[% IF deferred.logs %]
<div class="col-sm-12 col-lg-7">
<div class="border-top mt-4 mb-4 d-lg-none"></div>
[% SWITCH deferred.logs.outcome %]
[% CASE 'success' %]
<div class="alert alert-success">
<p>Le courriel a été <strong>accepté</strong> par le serveur SMTP.</p>
<a class="btn btn-outline-success" href="[% request.uri_base %]/recipient/webmail">Relever les courriels du destinataire</a>
</div>
[% CASE 'failure' %]
<div class="alert alert-danger">
Le courriel a été <strong>rejeté</strong> par le serveur SMTP.
</div>
[% END %]
<div id="logs" class="card w-100 text-bg-dark font-monospace">
<div class="card-body">
[% FOR deferred.logs.log %]
<div class="log-entry d-flex[% " mt-2" IF direction == 'out' %]">
<div class="log-entry-direction">
<span class="log-entry-direction-[% direction | html %]"></span>
</div>
<div class="log-lines flex-fill">
[% FOR lines ~%]
<span class="log-line-[% class | html %][% " text-danger text-decoration-underline" IF text.match('^550 ') %]">[% text | html %]</span><br>
[%~ END %]
</div>
</div>
[% END %]
</div>
</div>
</div>
[% END %]
</div>
</div>
<script>
function setEmailAddresses() {
var scenario = $("#scenario").val();
var option = $("#scenario").children().filter(
function() { return $(this).attr("value") == scenario; }
).each(function() {
var mailFromName = $(this).data('mail-from-name');
var mailFromAddress = $(this).data('mail-from-address');
$("#original-rfc5322-from").text(mailFromAddress);
$("input#rfc5322-from").val(mailFromName + " <" + mailFromAddress + ">");
});
}
setEmailAddresses();
</script>