diff --git a/src/shells.rs b/src/shells.rs index 7f6443b..fe83f6a 100644 --- a/src/shells.rs +++ b/src/shells.rs @@ -1,12 +1,13 @@ use axum::{ body::Body, + extract::Path, http::{Request, StatusCode}, response::IntoResponse }; use crate::config; -pub async fn shells_handler(req: Request) -> impl IntoResponse { +pub async fn shells_handler(Path(shell): Path, req: Request) -> impl IntoResponse { let conf = config::load_config(); let Some(host) = req.headers() .get("host") @@ -15,7 +16,7 @@ pub async fn shells_handler(req: Request) -> impl IntoResponse { }; let ip = host.split(":").next().unwrap(); - match conf.get_shell("bash") { + match conf.get_shell(&shell) { Some(res) => { let cmd = res.replace("{LHOST}", ip) .replace("{LPORT}", &conf.shell_port.to_string());