mirror of
https://github.com/casterbyte/Sara.git
synced 2026-05-26 05:01:31 +00:00
fix incorrect regex
This commit is contained in:
parent
426e6d7bfc
commit
d4362252a9
1 changed files with 3 additions and 6 deletions
9
sara.py
9
sara.py
|
|
@ -182,18 +182,15 @@ def check_rmi_services(connection):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
# skip disabled/default
|
# skip disabled (X*) or dynamic (D*) services
|
||||||
if re.search(r"^\d+\s+X\b", line):
|
if re.match(r"^\d+\s+[A-Z]*[XD][A-Z]*\s", line):
|
||||||
continue
|
continue
|
||||||
if re.search(r"^\d+\s+D\b", line):
|
|
||||||
continue
|
|
||||||
|
|
||||||
match = re.search(r"(\S+)\s+\d+", line)
|
match = re.search(r"(\S+)\s+\d+", line)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
service_name = match.group(1).lower()
|
service_name = match.group(1).lower()
|
||||||
display_name = service_name.upper().replace("WWW", "HTTP").replace("WWW-SSL", "HTTPS")
|
display_name = service_name.upper().replace("WWW-SSL", "HTTPS").replace("WWW", "HTTP")
|
||||||
|
|
||||||
# high risk
|
# high risk
|
||||||
if service_name in high_risk:
|
if service_name in high_risk:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue