Skip to content

Commit

Permalink
Fix detection of reflected parameters
Browse files Browse the repository at this point in the history
(thanks @HolyBugx for this one)
  • Loading branch information
Sh1Yo committed Jan 31, 2022
1 parent 1fea95e commit 398819d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "x8"
version = "3.2.0"
version = "3.2.1"
authors = ["Alexander Mironov <sh1yo@tuta.io>"]
edition = "2018"
license = "GPL-3.0-or-later"
Expand Down
16 changes: 8 additions & 8 deletions src/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,6 @@ pub async fn request(
Err(_) => String::new(),
};

let mut reflected_params: Vec<String> = Vec::new();

for (key, value) in initial_query.iter() {
if value.contains("%random%_") && body.to_ascii_lowercase().matches(&value.replace("%random%_", "").as_str()).count() as usize != reflections {
reflected_params.push(key.to_string());
}
}

let mut text = String::new();
for (key, value) in headers.iter() {
text.push_str(&key);
Expand All @@ -315,6 +307,14 @@ pub async fn request(
text.push_str(&"\n\n");
text.push_str(&body);

let mut reflected_params: Vec<String> = Vec::new();

for (key, value) in initial_query.iter() {
if value.contains("%random%_") && text.to_ascii_lowercase().matches(&value.replace("%random%_", "").as_str()).count() as usize != reflections {
reflected_params.push(key.to_string());
}
}

ResponseData {
text,
code,
Expand Down

0 comments on commit 398819d

Please sign in to comment.