Skip to content

Commit

Permalink
hugo detect + version
Browse files Browse the repository at this point in the history
  • Loading branch information
sendelufa committed May 6, 2022
1 parent ab8d9ae commit b2ff8fc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions VersionDetect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,6 @@ def start(id, url, ua, ga, source, ga_content, headers):
import VersionDetect.godaddywb as godaddywbverdetect
godaddywb_version = godaddywbverdetect.start(ga_content)
return godaddywb_version
elif id == 'hugo':
import VersionDetect.hugo as hugodetect
return hugodetect.start(source)
20 changes: 20 additions & 0 deletions VersionDetect/hugo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2022 Konstantin Shibkov

## Hugo version detection
## Rev 1

import cmseekdb.basic as cmseek
import re

def start(source):
version = '0'
cmseek.statement('Detecting Version')
cmseek.statement('Generator Tag Available... Trying version detection using generator meta tag')
rr = re.findall(r'<meta name=[\"]*generator[\"]* content=\"Hugo (.*?)\"', source)
if rr != []:
version = rr[0]
cmseek.success(cmseek.bold + cmseek.fgreen + "Version Detected, Hugo Version %s" % version + cmseek.cln)
return version
9 changes: 8 additions & 1 deletion cmseekdb/cmss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,4 +1185,11 @@
'url':'https://www.antee.cz/',
'vd':'0',
'deeps':'0'
}
}

hugo = {
'name':'Hugo',
'url':'https://gohugo.io/',
'vd':'1',
'deeps':'0'
}
3 changes: 2 additions & 1 deletion cmseekdb/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def scan(content):
'amiro.cms||www.amiro.ru:-amiro',
'starfield technologies; go daddy website builder:-godaddywb',
'opennemas:-opennemas',
'zen-cart.com||zen cart:-zencart'
'zen-cart.com||zen cart:-zencart',
'hugo:-hugo'
]

for detection_key in generator_tag_detection_keys:
Expand Down
3 changes: 2 additions & 1 deletion cmseekdb/sc.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def check(page_source_code, site): ## Check if no generator meta tag available
'js/whmcs.js:-whmcs',
'OpenNeMaS CMS by Openhost||var u = "https://piwik.openhost.es/":-opennemas',
'zenid=||Congratulations! You have successfully installed your Zen Cart||Google Code for ZenCart Google||Powered by ZenCart||sideboxpzen-cart||stylesheet_zen_lightbox.css:-zencart',
'Redakční systém IPO||cdn.antee.cz/||ipo.min.js:-ipo'
'Redakční systém IPO||cdn.antee.cz/||ipo.min.js:-ipo',
'Built using HUGO:-hugo'
]

for detection_key in page_source_detection_keys:
Expand Down

0 comments on commit b2ff8fc

Please sign in to comment.