Skip to content

Commit

Permalink
Add custom headers (except for user agent) for generic detection (Ena…
Browse files Browse the repository at this point in the history
…bleSecurity#128)

* Add custom headers (except for user agent) for generic detection

This is needed for HTTP Basic Authentication for example, which will get
detected as a generic WAF otherwise.

* Using default headers instead of hardcoded ones for generic testing

Co-authored-by: Pinaki <[email protected]>
  • Loading branch information
jonasw234 and 0xInfection authored Apr 11, 2021
1 parent e3e6147 commit 4aeeaf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wafw00f/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def genericdetect(self):
resp1 = self.performCheck(self.normalRequest)
if 'User-Agent' in self.headers:
del self.headers['User-Agent'] # Deleting the user-agent key from object not dict.
resp3 = self.customRequest(headers=def_headers)
resp3 = self.customRequest(headers=self.headers)
if resp1.status_code != resp3.status_code:
self.log.info('Server returned a different response when request didn\'t contain the User-Agent header.')
reason = reasons[4]
Expand Down

0 comments on commit 4aeeaf9

Please sign in to comment.