Skip to content

Commit a8fbe83

Browse files
committed
fix: updated url crate to inlcude cyrilic characters fix (fixes #69)
1 parent 13a407e commit a8fbe83

4 files changed

Lines changed: 49 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ hex = "0.4.3"
3939
glob = "0.3.1"
4040
cidr-utils = "0.5.11"
4141
regex = { version = "1.9.5" }
42-
url = { version = "2.5.0", optional = true }
42+
url = { version = "2.5.4", optional = true }
4343
reqwest = { version = "=0.11.20", features = [
4444
"multipart",
4545
"socks",
@@ -81,7 +81,7 @@ rdp-rs = { version = "0.1.0", optional = true }
8181
scylla = { version = "0.10.1", optional = true }
8282
paho-mqtt = { version = "0.13.3", optional = true }
8383
csv = "1.3.0"
84-
pavao = { version = "0.2.8", optional = true }
84+
pavao = { version = "0.2.12", optional = true }
8585
fast-socks5 = { version = "0.9.2", optional = true }
8686
shell-words = "1.1.0"
8787
serde_yaml = "0.9.30"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
22
<small>Join the project community on our server!</small>
33
<br/><br/>
4-
<a href="https://discord.gg/https://discord.gg/btZpkp45gQ" target="_blank" title="Join our community!">
4+
<a href="https://discord.gg/btZpkp45gQ" target="_blank" title="Join our community!">
55
<img src="https://dcbadge.limes.pink/api/server/https://discord.gg/btZpkp45gQ"/>
66
</a>
77
</p>

src/plugins/http/mod.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,40 @@ mod tests {
893893
);
894894
}
895895

896+
#[tokio::test]
897+
async fn test_http_enumeration_with_cyrillic_chars() {
898+
let mut http = HTTP::new(Strategy::Enumeration);
899+
let mut opts = Options::default();
900+
901+
opts.http.http_success_codes = "200".to_owned();
902+
opts.http.http_success_string = Some("успех".to_owned());
903+
opts.http.http_method = "GET".to_owned();
904+
905+
let creds = Credentials {
906+
target: "localhost:3000/тест/страница".to_owned(),
907+
username: "пользователь".to_owned(),
908+
password: "пароль".to_owned(),
909+
};
910+
911+
let target_url = http.get_target_url(&creds).unwrap();
912+
assert_eq!(target_url, "http://localhost:3000/%D1%82%D0%B5%D1%81%D1%82/%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0");
913+
914+
let status = 200;
915+
let content_type = String::new();
916+
let content_length = 0;
917+
let headers = String::new();
918+
let body = "операция успех завершена".to_owned();
919+
920+
assert_eq!(Ok(()), http.setup(&opts));
921+
assert_eq!(http.success_codes, vec![200]);
922+
assert!(
923+
http.is_success(&creds, status, content_type, content_length, headers, body)
924+
.await
925+
.is_some()
926+
);
927+
928+
}
929+
896930
#[tokio::test]
897931
async fn test_is_success_custom_code() {
898932
let mut http = HTTP::new(Strategy::Enumeration);

0 commit comments

Comments
 (0)