diff --git a/src/modules/others/webInterface.cpp b/src/modules/others/webInterface.cpp index d1cceb85..6e6a10a4 100644 --- a/src/modules/others/webInterface.cpp +++ b/src/modules/others/webInterface.cpp @@ -132,6 +132,9 @@ String listFiles(FS fs, bool ishtml, String folder, bool isLittleFS) { //if (String(foundfile.name()).substring(String(foundfile.name()).lastIndexOf('.') + 1).equalsIgnoreCase("bin")) returnText+= "  \n"; if (String(foundfile.name()).substring(String(foundfile.name()).lastIndexOf('.') + 1).equalsIgnoreCase("sub")) returnText+= "  \n"; if (String(foundfile.name()).substring(String(foundfile.name()).lastIndexOf('.') + 1).equalsIgnoreCase("ir")) returnText+= "  \n"; + #if defined(USB_as_HID) + if (String(foundfile.name()).substring(String(foundfile.name()).lastIndexOf('.') + 1).equalsIgnoreCase("txt")) returnText+= "  \n"; + #endif returnText += "  \n"; returnText += "\n\n"; } else { diff --git a/src/modules/others/webInterface.h b/src/modules/others/webInterface.h index ee6deb28..eec60c8e 100644 --- a/src/modules/others/webInterface.h +++ b/src/modules/others/webInterface.h @@ -448,6 +448,20 @@ function sendSubFile(filePath) { listFilesButton(actualFolder, fs, true); } +function sendBadusbFile(filePath) { + if(!confirm("Confirm executing the selected DuckyScript on the machine connected via USB?")) return; + var actualFolder = document.getElementById("actualFolder").value; + var fs = document.getElementById("actualFS").value; + const ajax5 = new XMLHttpRequest(); + const formdata5 = new FormData(); + formdata5.append("cmnd", "badusb tx_from_file " + filePath); + ajax5.open("POST", "/cm", false); + ajax5.send(formdata5); + document.getElementById("status").innerHTML = ajax5.responseText; + var fs = document.getElementById("actualFS").value; + listFilesButton(actualFolder, fs, true); +} + function downloadDeleteButton(filename, action) { var fs = document.getElementById("actualFS").value; var urltocall = "/file?name=" + filename + "&action=" + action + "&fs=" + fs;