Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "legba"
description = "A fast multi protocol credential bruteforcer/sprayer/enumerator."
keywords = ["authentication", "bruteforce", "wordlist"]
version = "1.2.0"
version = "1.2.0-fix-set-cookies"
authors = ["Simone Margaritelli <evilsocket@gmail.com>"]
license = "GPL-3.0"
edition = "2024"
Expand Down
4 changes: 2 additions & 2 deletions pkg/brew/legba.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

class Legba < Formula
version '1.2.0'
version '1.2.0-fix-set-cookies'
desc "Legba is a multiprotocol credentials bruteforcer / password sprayer and enumerator."
homepage "https://github.com/evilsocket/legba"
homepage "https://github.com/thibon/legba"

if OS.mac?
url "https://github.com/evilsocket/legba/releases/download/#{version}/legba-#{version}-apple-darwin-arm64.tar.gz"
Expand Down
18 changes: 18 additions & 0 deletions src/plugins/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ impl HTTP {
key, header_var_name
);

// Skip set_cookie, handle separetely because can be null or multiple values
if header_var_name == "set_cookie" {
continue;
}

if header_var_name == "content_type" {
content_type_set = true;
content_type = value.to_str().unwrap().to_owned();
Expand All @@ -263,6 +268,19 @@ impl HTTP {
.map_err(|e| e.to_string())?;
}

// Handle set_cookie separately because can contain multiplt value or not being set
let set_cookie_value = response
.headers()
.get_all("set-cookie")
.iter()
.filter_map(|v| v.to_str().ok())
.collect::<Vec<&str>>()
.join("; ");

context
.set_value(String::from("set_cookie"), Value::from(set_cookie_value.as_str()))
.map_err(|e| e.to_string())?;

// always set content_type
if !content_type_set {
context
Expand Down