Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove global rq #129

Merged
merged 1 commit into from
Apr 12, 2021
Merged

remove global rq #129

merged 1 commit into from
Apr 12, 2021

Conversation

mazlum
Copy link
Contributor

@mazlum mazlum commented Mar 25, 2021

Which category is this pull request?

  • A new feature/enhancement.
  • Fix an issue/feature-request.
  • An improvement to existing modules.
  • Other (Please mention below).

Where has this been tested?

  • Python Version
    • v3.x
    • v2.x
  • Operating System:
    • Linux (Please specify distro)
    • Windows
    • MacOS

I think global rq is not a good practice. And it blocks to use WAFW00F as a library. This way we can use as a library.

For example;

  from wafw00f.main import WAFW00F

  attacker = WAFW00F(target="http://example.com")
  waf = attacker.identwaf()

@0xInfection
Copy link
Collaborator

WAFW00F was never intended to be made available as a library, but rather as a CLI tool. Anyways, I've been seeing a lot of people using the code as a library, and it doesn't affect normal behaviour of the tool, so it doesn't hurt to merge this in.

@sandrogauci what are your thoughts? :)

@sandrogauci
Copy link
Member

sandrogauci commented Apr 11, 2021

agreed @0xInfection. Also, good to avoid global vars.

I'd written:

i did notice that some behaviors are changed so that might require some tests/checks. e.g. rq = attacker.normalRequest() is removed in line 422 main.py.

but noticed that stuff is handled in the WAFW00F class. So it looks fine. (still i didn't actually test yet)

@0xInfection 0xInfection merged commit d6cf828 into EnableSecurity:master Apr 12, 2021
@0xInfection
Copy link
Collaborator

Did some testing, looks fine to me. We can always revert if something breaks. :)

Thanks @mazlum!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants