newsapps / beeswithmachineguns

A utility for arming (creating) many bees (micro EC2 instances) to attack (load test) targets (web applications).
http://apps.chicagotribune.com/
MIT License
6.43k stars 631 forks source link

how to handle headers with colons in the value ? #161

Open mfrederickson opened 7 years ago

mfrederickson commented 7 years ago

How do I pass a header that has colons in the value? Or what modifications would be needed to the code to allow this? Thanks.

bees attack -u http://no.where.com/ -H 'Authorization: Gigya uid:acKCkHLn6ReLDECVscSkYCVa64, timestamp:1474610145, signature:ldFpy4vEdWceNMbbyXDWpAnB0=, realm:09834000GUREWAP' -j -o -a 4
yathi commented 7 years ago

You need to separate each key-value pair under the header with a semicolon, like -H "Authorization: Gigya ; uid:acKCkHLn6ReLDECVscSkYCVa64 ; timestamp:1474610145"

Also I believe -H "<params>" is the last part of params. But most probably the order doesn't matter.

kbroughton commented 5 years ago

There are two gotchas with ":" and ";" parsing. First, if you don't quote the whole -H string, the ';' are treated as bash command splits. Second, either ":" or ";" could be part of the signature. For example, in AWS signature signing, the signature is composed of multiple parts separated by ";".

I'd recommend a more robust parsing mechanism. For example, ab behaves like curl allowing multiple -H entries.

Fhitgv commented 8 months ago