wafw00f icon indicating copy to clipboard operation
wafw00f copied to clipboard

Added an option to disable colors from output.

Open ldcvanderpoel opened this issue 2 years ago • 0 comments

ANSI colors in the output interfere with the automatic processing of results. I've added a CLI option to disable colors (--no-colors).

This required me to also make changes to how the ANSI colors are stored. They were originally directly imported from asciiarts.py, but this makes controlling these values more difficult. I've therefore added a Color dataclass and added a disable() classmethod. In order to preserve the rest of the functionality, and maintain the brevity of using single letters for colors, I've added an unpack() function that can be used to declare colors where needed locally.

Which category is this pull request?

  • [x] 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
    • [x] v3.x
    • [ ] v2.x
  • Operating System:
    • [x] Linux
    • [x] Windows
    • [x] MacOS

Does this close any currently open issues?

No.

Does this add any new dependency?

No.

Does this add any new command line switch/argument?

Yes, this PR includes the --no-colors or -C CLI argument.

Any other comments you would like to make?

Thank you for developing wafw00f. I use it frequently during security assessments.

ldcvanderpoel avatar Aug 16 '22 14:08 ldcvanderpoel