Merge pull request #283 from NCAR/nginx-server

Add nginx WAF server
This commit is contained in:
Adrià Mercader 2022-08-25 13:01:16 +02:00 committed by GitHub
commit 6507845bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -235,6 +235,16 @@ apache = parse.SkipTo(parse.CaselessLiteral("<a href="), include=True).suppress
,adjacent=False, joinString=' ').setResultsName('date')
)
nginx = parse.SkipTo(parse.CaselessLiteral("<a href="), include=True).suppress() \
+ parse.quotedString.setParseAction(parse.removeQuotes).setResultsName('url') \
+ parse.SkipTo("</a>", include=True).suppress() \
+ parse.Optional(parse.Literal('</td><td align="right">')).suppress() \
+ parse.Optional(parse.Combine(
parse.Word(parse.alphanums+'-') +
parse.Word(parse.alphanums+':')
,adjacent=False, joinString=' ').setResultsName('date')
)
iis = parse.SkipTo("<br>").suppress() \
+ parse.OneOrMore("<br>").suppress() \
+ parse.Optional(parse.Combine(
@ -252,12 +262,15 @@ other = parse.SkipTo(parse.CaselessLiteral("<a href="), include=True).suppress()
scrapers = {'apache': parse.OneOrMore(parse.Group(apache)),
'nginx': parse.OneOrMore(parse.Group(nginx)),
'other': parse.OneOrMore(parse.Group(other)),
'iis': parse.OneOrMore(parse.Group(iis))}
def _get_scraper(server):
if not server or 'apache' in server.lower():
return 'apache'
if 'nginx' in server.lower():
return 'nginx'
if server == 'Microsoft-IIS/7.5':
return 'iis'
else: