diff --git a/.gitignore b/.gitignore index 047d2fc..8aeb77f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ ToCheck/* # Ignore README.md, archive.py, and note.txt archive.py -note.txt \ No newline at end of file +note.txt + +# Ignore pycache generated folder +Utils/__pycache__ diff --git a/Utils/__pycache__/CustomLogger.cpython-312.pyc b/Utils/__pycache__/CustomLogger.cpython-312.pyc deleted file mode 100644 index 054ae43..0000000 Binary files a/Utils/__pycache__/CustomLogger.cpython-312.pyc and /dev/null differ diff --git a/Utils/__pycache__/RiskCalculator.cpython-312.pyc b/Utils/__pycache__/RiskCalculator.cpython-312.pyc deleted file mode 100644 index 206beaa..0000000 Binary files a/Utils/__pycache__/RiskCalculator.cpython-312.pyc and /dev/null differ diff --git a/shp.py b/shp.py index 9c92c53..aa01b8f 100644 --- a/shp.py +++ b/shp.py @@ -139,6 +139,9 @@ def OWASPproposed(data): else: log.warning_with_xtratab(f'{value} is missing on {original_key}') bCounter+=1 + if (aCounter + bCounter == 0): + print(f'The Respone Headers is likely to be Customized or just Insecure {log.bigWarning()}') + return if (aCounter / (aCounter + bCounter)) >= 0.8: print(f"The Response Headers follows OWASP Secure Header Proposal {log.bigSuccess()}") elif (aCounter / (aCounter + bCounter)) < 0.8 and (aCounter / (aCounter + bCounter)) >= 0.5: @@ -578,4 +581,4 @@ def main(): SecureResponseHeaderCheck(parsed_data) if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/test.py b/test.py deleted file mode 100644 index 08314fb..0000000 --- a/test.py +++ /dev/null @@ -1,3 +0,0 @@ -string = "['accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(self), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), unload=()']" -if "camera" in string: - print(1) \ No newline at end of file