From b96cb3f4f06e54edb49e42c1831a4ab14fccfc4e Mon Sep 17 00:00:00 2001 From: Tuhinshubhra Date: Tue, 28 Aug 2018 14:55:01 +0530 Subject: [PATCH] Added CMS and Version detection for mvnForum --- CHANGELOG | 2 ++ VersionDetect/detect.py | 4 ++++ VersionDetect/mvnf.py | 25 +++++++++++++++++++++++++ cmseekdb/cmss.py | 6 ++++++ cmseekdb/sc.py | 9 +++++++++ 5 files changed, 46 insertions(+) create mode 100644 VersionDetect/mvnf.py diff --git a/CHANGELOG b/CHANGELOG index 8015d538..387f2378 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ Version 1.1.0 [] - FUDforum - IPB Forum - miniBB + - mvnForum - MyBB - myUPB - NodeBB @@ -34,6 +35,7 @@ Version 1.1.0 [] - Discuz! - FUDforum - miniBB + - mvnForum - MyBB - myUPB - NodeBB diff --git a/VersionDetect/detect.py b/VersionDetect/detect.py index 74b9e9d2..e2054e82 100644 --- a/VersionDetect/detect.py +++ b/VersionDetect/detect.py @@ -209,3 +209,7 @@ def start(id, url, ua, ga, source, ga_content): import VersionDetect.myupb as myupbverdetect myupbver = myupbverdetect.start(source) return myupbver + elif id == 'mvnf': + import VersionDetect.mvnf as mvnfverdetect + mvnfver = mvnfverdetect.start(source) + return mvnfver diff --git a/VersionDetect/mvnf.py b/VersionDetect/mvnf.py new file mode 100644 index 00000000..a057d8f5 --- /dev/null +++ b/VersionDetect/mvnf.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# This is a part of CMSeeK, check the LICENSE file for more information +# Copyright (c) 2018 Tuhinshubhra + +# mvnForum version detection +# Rev 1 + +import cmseekdb.basic as cmseek +import re + +def start(source): + regex = re.search(r'Powered by(.*?)mvnForum (\d.*?)<\/a>', source) + if regex != None: + try: + version = regex.group(2) + cmseek.success('mvnForum version ' + cmseek.bold + cmseek.fgreen + version + cmseek.cln + ' detected') + return version + except Exception as e: + cmseek.error('Version detection failed!') + return '0' + + + cmseek.error('Version detection failed!') + return '0' diff --git a/cmseekdb/cmss.py b/cmseekdb/cmss.py index 4b8b7915..25d25aae 100644 --- a/cmseekdb/cmss.py +++ b/cmseekdb/cmss.py @@ -800,4 +800,10 @@ 'url':'http://www.myupb.com', 'vd':'1', 'deeps':'0' +} +mvnf = { + 'name':'mvnForum', + 'url':'https://sourceforge.net/projects/mvnforum/', + 'vd':'1', + 'deeps':'0' } \ No newline at end of file diff --git a/cmseekdb/sc.py b/cmseekdb/sc.py index c4651182..015344da 100644 --- a/cmseekdb/sc.py +++ b/cmseekdb/sc.py @@ -359,10 +359,19 @@ def check(s, site): ## Check if no generator meta tag available # NoNonsense Forum return ['1', 'nnf'] + elif '/mvnplugin/mvnforum/' in hstring: + # mvnForum + return ['1', 'mvnf'] + #################################################### # REGEX DETECTIONS STARTS FROM HERE # #################################################### + mvn_regex = re.search(r'Powered by(.*?)mvnForum(.*?)', hstring) + if mvn_regex != None: + # mvnForum + return ['1', 'mvnf'] + mupb_regex = re.search(r'Powered by myUPB(.*?)', hstring) if mupb_regex != None: # myUPB