diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e6ebc64 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cmseek (1.1.3-0kali1) kali-dev; urgency=medium + + * Initial release + + -- Sophie Brun Wed, 04 Nov 2020 15:53:54 +0100 diff --git a/debian/cmseek.install b/debian/cmseek.install new file mode 100644 index 0000000..126566d --- /dev/null +++ b/debian/cmseek.install @@ -0,0 +1,3 @@ +*.py usr/share/cmseek +cmsbrute cmseekdb deepscans VersionDetect wordlist usr/share/cmseek +debian/helper-scripts/* usr/bin diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..4e76ecc --- /dev/null +++ b/debian/control @@ -0,0 +1,23 @@ +Source: cmseek +Section: utils +Priority: optional +Maintainer: Kali Developers +Uploaders: Sophie Brun +Build-Depends: debhelper-compat (= 13), dh-python, python3-all +Standards-Version: 4.5.0 +Homepage: https://github.com/Tuhinshubhra/CMSeeK +Vcs-Browser: https://gitlab.com/kalilinux/packages/cmseek +Vcs-Git: https://gitlab.com/kalilinux/packages/cmseek.git +Testsuite: autopkgtest-pkg-python +Rules-Requires-Root: no + +Package: cmseek +Architecture: all +Depends: ${python3:Depends}, ${misc:Depends}, python3-requests +Description: CMS Detection and Exploitation suite + This package contains a CMS Detection and Exploitation suite. It scans + WordPress, Joomla, Drupal and over 180 other CMSs. + . + A content management system (CMS) manages the creation and modification of + digital content. It typically supports multiple users in a collaborative + environment. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..1c87085 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,27 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: CMSeeK +Source: https://github.com/Tuhinshubhra/CMSeeK + +Files: * +Copyright: 2018-2020 Tuhinshubhra +License: GPL-3 + +Files: debian/* +Copyright: 2020 Sophie Brun +License: GPL-3 + +License: GPL-3 + This package is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 3 as published + by the Free Software Foundation. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/helper-scripts/cmseek b/debian/helper-scripts/cmseek new file mode 100644 index 0000000..95a8ba5 --- /dev/null +++ b/debian/helper-scripts/cmseek @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +exec python3 /usr/share/cmseek/cmseek.py "$@" diff --git a/debian/patches/fix-report-dir-creation.patch b/debian/patches/fix-report-dir-creation.patch new file mode 100644 index 0000000..0ccdd4a --- /dev/null +++ b/debian/patches/fix-report-dir-creation.patch @@ -0,0 +1,28 @@ +From: Sophie Brun +Date: Wed, 4 Nov 2020 17:48:40 +0100 +Subject: Fix Report directory creation + +Last-Update: 2020-11-04 + +By default if dir of cmseek.py (ie /usr/share/cmseek) is not writable, +csmeek will use the current directory to keep Result... But if the +directory Result doesn't exist, cmseek display an error but il will +create it later if you continue. So create the Result directory before. +--- + cmseekdb/createindex.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmseekdb/createindex.py b/cmseekdb/createindex.py +index b4b425b..4f846a2 100644 +--- a/cmseekdb/createindex.py ++++ b/cmseekdb/createindex.py +@@ -22,6 +22,9 @@ def init(cmseek_dir, report_dir=""): + index_file = os.path.join(cmseek_dir, 'reports.json') + if report_dir == "": + report_dir = os.path.join(cmseek_dir, 'Result') ++ if not os.path.exists(report_dir): ++ cmseek.info('Creating Result directory in current directory') ++ os.makedirs(report_dir) + if os.path.isdir(report_dir): + result_index = {} + result_dirs = os.listdir(report_dir) diff --git a/debian/patches/remove-update-option.patch b/debian/patches/remove-update-option.patch new file mode 100644 index 0000000..d01f0b3 --- /dev/null +++ b/debian/patches/remove-update-option.patch @@ -0,0 +1,190 @@ +From: Sophie Brun +Date: Wed, 4 Nov 2020 16:45:50 +0100 +Subject: Remove the update option + +Last-Update: 2020-11-04 + +Update must always be done with apt. +--- + cmseek.py | 11 +++--- + cmseekdb/basic.py | 115 +++++++++++++++++++++++++++--------------------------- + 2 files changed, 62 insertions(+), 64 deletions(-) + +diff --git a/cmseek.py b/cmseek.py +index d7cc1a0..28b9506 100644 +--- a/cmseek.py ++++ b/cmseek.py +@@ -24,7 +24,7 @@ parser = argparse.ArgumentParser(prog='cmseek.py',add_help=False) + parser.add_argument('-h', '--help', action="store_true") + parser.add_argument('-v', '--verbose', action="store_true") + parser.add_argument("--version", action="store_true") +-parser.add_argument("--update", action="store_true") ++#parser.add_argument("--update", action="store_true") + parser.add_argument('-r', "--random-agent", action="store_true") + parser.add_argument('--user-agent') + parser.add_argument('--googlebot', action="store_true") +@@ -67,8 +67,8 @@ if args.follow_redirect: + if args.no_redirect: + cmseek.redirect_conf = '2' + +-if args.update: +- cmseek.update() ++#if args.update: ++# cmseek.update() + + if args.batch: + #print('Batch true') +@@ -158,15 +158,14 @@ print ("======= ==============================") + print (" [1] CMS detection and Deep scan") + print (" [2] Scan Multiple Sites") + print (" [3] Bruteforce CMSs") +-print (" [U] Update CMSeeK") + print (" [R] Rebuild Cache (Use only when you add any custom module)") + print (" [0] Exit CMSeeK :( \n") + + selone = input("Enter Your Desired Option: ").lower() + if selone == 'r': + cmseek.update_brute_cache() +-elif selone == 'u': +- cmseek.update() ++#elif selone == 'u': ++# cmseek.update() + elif selone == '0': + cmseek.bye() + +diff --git a/cmseekdb/basic.py b/cmseekdb/basic.py +index 5127add..15deb1f 100644 +--- a/cmseekdb/basic.py ++++ b/cmseekdb/basic.py +@@ -138,8 +138,7 @@ USER AGENT: + OUTPUT: + -v, --verbose Increase output verbosity + +-VERSION & UPDATING: +- --update Update CMSeeK (Requires git) ++VERSION: + --version Show CMSeeK version and exit + + HELP & MISCELLANEOUS: +@@ -382,65 +381,65 @@ def update_brute_cache(): + warning('Could not find any modules! either there are no modules or someone messed with em!') + bye() + +-def update(): ++#def update(): + # Check For Update +- clearscreen() +- banner("Update Menu") +- global cmseek_version +- my_version = int(cmseek_version.replace('.','')) +- info("Checking for updates") +- get_version = getsource('https://raw.githubusercontent.com/Tuhinshubhra/CMSeeK/master/current_version',randomua('generate')) +- if get_version[0] != '1': +- error('Could not get latest version, Error: ' + get_version[1]) +- bye() +- else: +- latest_version = get_version[1].replace('\n','') +- serv_version = int(latest_version.replace('.','')) +- info("CMSeeK Version: " + cmseek_version) +- success("Latest Version: " + latest_version) +- if my_version > serv_version: +- print('\n') +- error("Either you or me (The Developer) messed things up.\n" + cln + "[↓] Download the proper version from: " + fgreen + bold + GIT_URL) +- elif my_version == serv_version: +- print('\n') +- result("CMSeeK is up to date, Thanks for checking update tho.. It's a good practise",'') +- else: +- print('\n') +- #success("Update available!") +- success("Update available!") +- update_me = input("[#] Do you want to update now? (y/n): ") +- if update_me.lower() == 'y': +- print(bold + fgreen + "[↓]" + cln + " Downloading Update...") +- succes = False +- try: +- global cmseek_dir +- lock_file = os.path.join(cmseek_dir, "/.git/index.lock") +- if os.path.isfile(lock_file): +- statement("Removing index.lock file from .git directory") +- # Solve the index.lock issue +- os.remove(lock_file) +- subprocess.run(("git checkout . && git pull %s HEAD") % GIT_URL, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +- #os.system("git checkout . && git pull %s HEAD" % GIT_URL) +- vt = open('current_version', 'r') +- v_test = int(vt.read().replace('\n','').replace('.','')) ++# clearscreen() ++# banner("Update Menu") ++# global cmseek_version ++# my_version = int(cmseek_version.replace('.','')) ++# info("Checking for updates") ++# get_version = getsource('https://raw.githubusercontent.com/Tuhinshubhra/CMSeeK/master/current_version',randomua('generate')) ++# if get_version[0] != '1': ++# error('Could not get latest version, Error: ' + get_version[1]) ++# bye() ++# else: ++# latest_version = get_version[1].replace('\n','') ++# serv_version = int(latest_version.replace('.','')) ++# info("CMSeeK Version: " + cmseek_version) ++# success("Latest Version: " + latest_version) ++# if my_version > serv_version: ++# print('\n') ++# error("Either you or me (The Developer) messed things up.\n" + cln + "[↓] Download the proper version from: " + fgreen + bold + GIT_URL) ++# elif my_version == serv_version: ++# print('\n') ++# result("CMSeeK is up to date, Thanks for checking update tho.. It's a good practise",'') ++# else: ++# print('\n') ++# #success("Update available!") ++# success("Update available!") ++# update_me = input("[#] Do you want to update now? (y/n): ") ++# if update_me.lower() == 'y': ++# print(bold + fgreen + "[↓]" + cln + " Downloading Update...") ++# succes = False ++# try: ++# global cmseek_dir ++# lock_file = os.path.join(cmseek_dir, "/.git/index.lock") ++# if os.path.isfile(lock_file): ++# statement("Removing index.lock file from .git directory") ++# # Solve the index.lock issue ++# os.remove(lock_file) ++# subprocess.run(("git checkout . && git pull %s HEAD") % GIT_URL, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ++# #os.system("git checkout . && git pull %s HEAD" % GIT_URL) ++# vt = open('current_version', 'r') ++# v_test = int(vt.read().replace('\n','').replace('.','')) + # print(v_test) + # print(serv_version) +- if v_test == serv_version: +- # Check if update successful +- succes = True +- except: +- print("Unexpected error:", sys.exc_info()[0]) +- raise +- error("Automatic Update Failed! Pleae download manually from: " + cln + GIT_URL) +- if succes == True: +- result("CMSeeK Updated To Latest Version! Enjoy", "") +- else: +- warning(bold + orange + "Update might be not successful.. Download manually from: " + cln + GIT_URL) +- else: +- print('\n') +- warning("Automatic Update Terminated!") +- info("Update Manually from: " + fgreen + bold + GIT_URL + cln) +- bye() ++# if v_test == serv_version: ++# # Check if update successful ++# succes = True ++# except: ++# print("Unexpected error:", sys.exc_info()[0]) ++# raise ++# error("Automatic Update Failed! Pleae download manually from: " + cln + GIT_URL) ++# if succes == True: ++# result("CMSeeK Updated To Latest Version! Enjoy", "") ++# else: ++# warning(bold + orange + "Update might be not successful.. Download manually from: " + cln + GIT_URL) ++# else: ++# print('\n') ++# warning("Automatic Update Terminated!") ++# info("Update Manually from: " + fgreen + bold + GIT_URL + cln) ++# bye() + + + def savebrute(url,adminurl,username,password): diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..40145c2 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +remove-update-option.patch +fix-report-dir-creation.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4fdad08 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +#export PYBUILD_NAME=cmseek + +%: + dh $@ --with python3 #--buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..cb61fa5 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..5536fe9 --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=4 +opts="filenamemangle=s%(?:.*?)?v?\.?(\d[\d.]*)\.tar\.gz%cmseek-$1.tar.gz%" \ + https://github.com/Tuhinshubhra/CMSeeK/tags \ + (?:.*?/)?v?\.?(\d[\d.]*)\.tar\.gz debian uupdate