Hanno Böck
sort imports
Hanno Böck commited 1beae81 at 2023-12-12 08:59:43
#!/usr/bin/python3 -O
# freewvs - a free web vulnerability scanner
#
# https://freewvs.schokokeks.org/
#
# Written by schokokeks.org Hosting, https://schokokeks.org
#
# Contributions by
# Hanno Boeck, https://hboeck.de/
# Fabian Fingerle, https://fabian-fingerle.de/
# Bernd Wurst, https://bwurst.org/
import argparse
import glob
import json
import os
import pathlib
import re
import sys
from xml.sax.saxutils import escape # noqa: DUO107
def versioncompare(safe_version, find_version):
if safe_version == "":
return True
safe_version_tup = [int(x) for x in safe_version.split(".")]
find_version_tup = [int(x) for x in find_version.split(".")]
return find_version_tup < safe_version_tup
def checkoldsafe(old_safe, find_version):
find_version_tup = [int(x) for x in find_version.split(".")]
for oldver in old_safe.split(","):
oldver_tup = [int(x) for x in oldver.split(".")]
if find_version_tup == oldver_tup:
return True
# handle special case where minor version is larger
if (
len(find_version_tup) >= 2
and find_version_tup[:-1] == oldver_tup[:-1]
and find_version_tup[-1] > oldver_tup[-1]
):
return True
return False
def vulnprint(appname, version, safeversion, vuln, vfilename, subdir, xml):
appdir = "/".join(os.path.abspath(vfilename).split("/")[: -1 - subdir])
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX