From b57ba767f819aacc5387b75f297593ae59a012a8 Mon Sep 17 00:00:00 2001 From: Wlayzz <34021743+wlayzz@users.noreply.github.com> Date: Tue, 19 Jul 2022 01:59:14 +0200 Subject: [PATCH] Adding shebang and encoding utf-8 for all python files --- build_collector.py | 3 ++- cme/.hooks/hook-lsassy.py | 3 ++- cme/cli.py | 3 +++ cme/cmedb.py | 2 ++ cme/connection.py | 3 +++ cme/context.py | 3 +++ cme/crackmapexec.py | 1 + cme/first_run.py | 3 +++ cme/helpers/bash.py | 3 +++ cme/helpers/bloodhound.py | 3 +++ cme/helpers/http.py | 3 +++ cme/helpers/logger.py | 3 +++ cme/helpers/misc.py | 3 +++ cme/helpers/powershell.py | 3 +++ cme/loaders/module_loader.py | 3 +++ cme/loaders/protocol_loader.py | 3 +++ cme/logger.py | 3 +++ cme/modules/IOXIDResolver.py | 3 +++ cme/modules/MachineAccountQuota.py | 3 +++ cme/modules/adcs.py | 3 +++ cme/modules/bh_owned.py | 2 ++ cme/modules/dfscoerce.py | 5 ++++- cme/modules/drop_searchConnector-ms.py | 3 +++ cme/modules/empire_exec.py | 3 +++ cme/modules/enum_avproducts.py | 3 +++ cme/modules/enum_dns.py | 3 +++ cme/modules/example_module.py | 3 +++ cme/modules/get_description.py | 3 +++ cme/modules/get_netconnections.py | 3 +++ cme/modules/gpp_autologin.py | 3 +++ cme/modules/gpp_password.py | 3 +++ cme/modules/handlekatz.py | 3 +++ cme/modules/hash_spider.py | 3 +++ cme/modules/laps.py | 3 +++ cme/modules/ldap-checker.py | 3 +++ cme/modules/ldap-signing.py | 3 +++ cme/modules/lsassy_dump.py | 2 ++ cme/modules/met_inject.py | 3 +++ cme/modules/ms17-010.py | 2 ++ cme/modules/mssql_priv.py | 2 ++ cme/modules/nanodump.py | 2 ++ cme/modules/nopac.py | 2 ++ cme/modules/petitpotam.py | 2 ++ cme/modules/procdump.py | 2 ++ cme/modules/rdp.py | 3 +++ cme/modules/runasppl.py | 3 +++ cme/modules/scuffy.py | 3 +++ cme/modules/shadowcoerce.py | 3 +++ cme/modules/slinky.py | 3 +++ cme/modules/spider_plus.py | 3 +++ cme/modules/spooler.py | 3 +++ cme/modules/subnets.py | 3 +++ cme/modules/test_connection.py | 3 +++ cme/modules/uac.py | 3 +++ cme/modules/user_description.py | 3 +++ cme/modules/wdigest.py | 3 +++ cme/modules/web_delivery.py | 3 +++ cme/modules/webdav.py | 3 +++ cme/modules/wireless.py | 3 +++ cme/modules/zerologon.py | 2 ++ cme/parsers/ip.py | 3 +++ cme/parsers/nessus.py | 3 +++ cme/parsers/nmap.py | 3 +++ cme/protocols/ldap.py | 2 ++ cme/protocols/ldap/database.py | 3 +++ cme/protocols/ldap/db_navigator.py | 3 +++ cme/protocols/ldap/kerberos.py | 3 +++ cme/protocols/ldap/smbldap.py | 3 +++ cme/protocols/mssql.py | 3 +++ cme/protocols/mssql/database.py | 3 +++ cme/protocols/mssql/db_navigator.py | 3 +++ cme/protocols/mssql/mssqlexec.py | 3 +++ cme/protocols/rdp.py | 3 +++ cme/protocols/rdp/database.py | 3 +++ cme/protocols/rdp/db_navigator.py | 3 +++ cme/protocols/smb.py | 1 + cme/protocols/smb/atexec.py | 3 +++ cme/protocols/smb/database.py | 3 +++ cme/protocols/smb/db_navigator.py | 3 +++ cme/protocols/smb/mmcexec.py | 3 ++- cme/protocols/smb/passpol.py | 2 ++ cme/protocols/smb/remotefile.py | 2 ++ cme/protocols/smb/samruser.py | 2 ++ cme/protocols/smb/smbexec.py | 3 +++ cme/protocols/smb/smbspider.py | 3 +++ cme/protocols/smb/wmiexec.py | 3 +++ cme/protocols/ssh.py | 3 +++ cme/protocols/ssh/database.py | 3 +++ cme/protocols/ssh/db_navigator.py | 3 +++ cme/protocols/winrm.py | 2 ++ cme/protocols/winrm/database.py | 3 +++ cme/protocols/winrm/db_navigator.py | 3 +++ cme/servers/http.py | 3 +++ cme/servers/smb.py | 3 +++ 94 files changed, 261 insertions(+), 4 deletions(-) diff --git a/build_collector.py b/build_collector.py index 457dd395..28238b0c 100644 --- a/build_collector.py +++ b/build_collector.py @@ -1,4 +1,5 @@ -# -*- coding: latin-1 -*- +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- import os import shutil diff --git a/cme/.hooks/hook-lsassy.py b/cme/.hooks/hook-lsassy.py index e141f060..7446ae57 100644 --- a/cme/.hooks/hook-lsassy.py +++ b/cme/.hooks/hook-lsassy.py @@ -1,4 +1,5 @@ -# -*- coding:utf-8 -*- +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- from PyInstaller.utils.hooks import collect_all datas, binaries, hiddenimports = collect_all("lsassy") diff --git a/cme/cli.py b/cme/cli.py index ff6bf1ca..9528489f 100755 --- a/cme/cli.py +++ b/cme/cli.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import argparse import sys from argparse import RawTextHelpFormatter diff --git a/cme/cmedb.py b/cme/cmedb.py index b91e917c..7469facd 100755 --- a/cme/cmedb.py +++ b/cme/cmedb.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import cmd import sqlite3 import sys diff --git a/cme/connection.py b/cme/connection.py index 6bd7e2bb..60be6749 100755 --- a/cme/connection.py +++ b/cme/connection.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import socket from os.path import isfile diff --git a/cme/context.py b/cme/context.py index e65d4f70..c5703b13 100755 --- a/cme/context.py +++ b/cme/context.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import os import configparser diff --git a/cme/crackmapexec.py b/cme/crackmapexec.py index eb4331ea..418bb8b6 100755 --- a/cme/crackmapexec.py +++ b/cme/crackmapexec.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- from cme.logger import setup_logger, setup_debug_logger, CMEAdapter from cme.helpers.logger import highlight diff --git a/cme/first_run.py b/cme/first_run.py index 840bf687..f609aca4 100755 --- a/cme/first_run.py +++ b/cme/first_run.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import os import errno import sqlite3 diff --git a/cme/helpers/bash.py b/cme/helpers/bash.py index a88aa7a7..1830a598 100644 --- a/cme/helpers/bash.py +++ b/cme/helpers/bash.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import os import cme diff --git a/cme/helpers/bloodhound.py b/cme/helpers/bloodhound.py index 5f3237df..e82411ec 100644 --- a/cme/helpers/bloodhound.py +++ b/cme/helpers/bloodhound.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + def add_user_bh(user, domain, logger, config): users_owned = [] if isinstance(user, str): diff --git a/cme/helpers/http.py b/cme/helpers/http.py index b31afab9..1716bf4c 100644 --- a/cme/helpers/http.py +++ b/cme/helpers/http.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import random def get_desktop_uagent(uagent=None): diff --git a/cme/helpers/logger.py b/cme/helpers/logger.py index afb659c0..0b2cbcff 100755 --- a/cme/helpers/logger.py +++ b/cme/helpers/logger.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import os import random from termcolor import colored diff --git a/cme/helpers/misc.py b/cme/helpers/misc.py index 0fa146db..b02445f8 100755 --- a/cme/helpers/misc.py +++ b/cme/helpers/misc.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import random import string import re diff --git a/cme/helpers/powershell.py b/cme/helpers/powershell.py index d7e2d69a..efcc573f 100644 --- a/cme/helpers/powershell.py +++ b/cme/helpers/powershell.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import cme import os import logging diff --git a/cme/loaders/module_loader.py b/cme/loaders/module_loader.py index d2b5e6b4..734a6e3e 100755 --- a/cme/loaders/module_loader.py +++ b/cme/loaders/module_loader.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import imp import os import sys diff --git a/cme/loaders/protocol_loader.py b/cme/loaders/protocol_loader.py index b8cf7536..9320858e 100755 --- a/cme/loaders/protocol_loader.py +++ b/cme/loaders/protocol_loader.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import imp import os import sys diff --git a/cme/logger.py b/cme/logger.py index e72bc4b3..b2f5b365 100755 --- a/cme/logger.py +++ b/cme/logger.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import sys import re diff --git a/cme/modules/IOXIDResolver.py b/cme/modules/IOXIDResolver.py index 788f0392..84be19b0 100644 --- a/cme/modules/IOXIDResolver.py +++ b/cme/modules/IOXIDResolver.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + # Credit to https://airbus-cyber-security.com/fr/the-oxid-resolver-part-1-remote-enumeration-of-network-interfaces-without-any-authentication/ # Airbus CERT # module by @mpgn_x64 diff --git a/cme/modules/MachineAccountQuota.py b/cme/modules/MachineAccountQuota.py index c83938de..f4b3b7fb 100644 --- a/cme/modules/MachineAccountQuota.py +++ b/cme/modules/MachineAccountQuota.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class CMEModule: ''' Module by Shutdown and Podalirius diff --git a/cme/modules/adcs.py b/cme/modules/adcs.py index 5016536e..80faff53 100644 --- a/cme/modules/adcs.py +++ b/cme/modules/adcs.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import re from impacket.ldap import ldap, ldapasn1 diff --git a/cme/modules/bh_owned.py b/cme/modules/bh_owned.py index 1a78bd8c..46b7f5a5 100644 --- a/cme/modules/bh_owned.py +++ b/cme/modules/bh_owned.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Author: # Romain Bentz (pixis - @hackanddo) # Website: diff --git a/cme/modules/dfscoerce.py b/cme/modules/dfscoerce.py index df4afe11..61ff1751 100644 --- a/cme/modules/dfscoerce.py +++ b/cme/modules/dfscoerce.py @@ -1,4 +1,7 @@ -import logging +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import logging from impacket import system_errors from impacket.dcerpc.v5 import transport from impacket.dcerpc.v5.ndr import NDRCALL, NDRSTRUCT diff --git a/cme/modules/drop_searchConnector-ms.py b/cme/modules/drop_searchConnector-ms.py index 4ab6a114..5d81591a 100644 --- a/cme/modules/drop_searchConnector-ms.py +++ b/cme/modules/drop_searchConnector-ms.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import ntpath class CMEModule: diff --git a/cme/modules/empire_exec.py b/cme/modules/empire_exec.py index 70251371..0deac0ff 100644 --- a/cme/modules/empire_exec.py +++ b/cme/modules/empire_exec.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import sys import requests from requests import ConnectionError diff --git a/cme/modules/enum_avproducts.py b/cme/modules/enum_avproducts.py index fc8b4e17..e1c51526 100644 --- a/cme/modules/enum_avproducts.py +++ b/cme/modules/enum_avproducts.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class CMEModule: ''' Uses WMI to gather information on all endpoint protection solutions installed on the the remote host(s) diff --git a/cme/modules/enum_dns.py b/cme/modules/enum_dns.py index 40b99d7c..5deaeadf 100644 --- a/cme/modules/enum_dns.py +++ b/cme/modules/enum_dns.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from datetime import datetime from cme.helpers.logger import write_log diff --git a/cme/modules/example_module.py b/cme/modules/example_module.py index 4a37ccc1..d1cd197d 100644 --- a/cme/modules/example_module.py +++ b/cme/modules/example_module.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class CMEModule: ''' Example diff --git a/cme/modules/get_description.py b/cme/modules/get_description.py index 358f0f04..79b0e137 100644 --- a/cme/modules/get_description.py +++ b/cme/modules/get_description.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.ldap import ldapasn1 as ldapasn1_impacket from impacket.ldap import ldap as ldap_impacket import re diff --git a/cme/modules/get_netconnections.py b/cme/modules/get_netconnections.py index efdfb97e..db7a00de 100755 --- a/cme/modules/get_netconnections.py +++ b/cme/modules/get_netconnections.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from datetime import datetime from cme.helpers.logger import write_log import json diff --git a/cme/modules/gpp_autologin.py b/cme/modules/gpp_autologin.py index 2688c9fa..c58f899f 100644 --- a/cme/modules/gpp_autologin.py +++ b/cme/modules/gpp_autologin.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import xml.etree.ElementTree as ET from io import BytesIO diff --git a/cme/modules/gpp_password.py b/cme/modules/gpp_password.py index f64b2740..b4dd54bf 100644 --- a/cme/modules/gpp_password.py +++ b/cme/modules/gpp_password.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import xml.etree.ElementTree as ET from Cryptodome.Cipher import AES from base64 import b64decode diff --git a/cme/modules/handlekatz.py b/cme/modules/handlekatz.py index 1659ca2d..b7b1d215 100644 --- a/cme/modules/handlekatz.py +++ b/cme/modules/handlekatz.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + # handlekatz module for CME python3 # author of the module : github.com/mpgn # HandleKatz: https://github.com/codewhitesec/HandleKatz diff --git a/cme/modules/hash_spider.py b/cme/modules/hash_spider.py index c1a49a4a..8154b600 100644 --- a/cme/modules/hash_spider.py +++ b/cme/modules/hash_spider.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + # Author: # Peter Gormington @hackerm00n on Twitter diff --git a/cme/modules/laps.py b/cme/modules/laps.py index 34875a41..be980275 100644 --- a/cme/modules/laps.py +++ b/cme/modules/laps.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.ldap import ldapasn1 as ldapasn1_impacket diff --git a/cme/modules/ldap-checker.py b/cme/modules/ldap-checker.py index 24cc771c..a5b427fa 100644 --- a/cme/modules/ldap-checker.py +++ b/cme/modules/ldap-checker.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import ldap3 import ssl from msldap.commons.url import MSLDAPURLDecoder, MSLDAPClientConnection diff --git a/cme/modules/ldap-signing.py b/cme/modules/ldap-signing.py index 53702882..f8c5015c 100644 --- a/cme/modules/ldap-signing.py +++ b/cme/modules/ldap-signing.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.ldap import ldap class CMEModule: diff --git a/cme/modules/lsassy_dump.py b/cme/modules/lsassy_dump.py index ac2506c7..ebbfddf4 100644 --- a/cme/modules/lsassy_dump.py +++ b/cme/modules/lsassy_dump.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Author: # Romain Bentz (pixis - @hackanddo) # Website: diff --git a/cme/modules/met_inject.py b/cme/modules/met_inject.py index 0b7c4b92..0cdfd19c 100644 --- a/cme/modules/met_inject.py +++ b/cme/modules/met_inject.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.helpers.powershell import * from sys import exit diff --git a/cme/modules/ms17-010.py b/cme/modules/ms17-010.py index 7f63587e..bf943e74 100644 --- a/cme/modules/ms17-010.py +++ b/cme/modules/ms17-010.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # All credits to https://github.com/d4t4s3c/Win7Blue # @d4t4s3c # Module by @mpgn_x64 diff --git a/cme/modules/mssql_priv.py b/cme/modules/mssql_priv.py index b38fb935..32274981 100644 --- a/cme/modules/mssql_priv.py +++ b/cme/modules/mssql_priv.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Author: # Romain de Reydellet (@pentest_soka) diff --git a/cme/modules/nanodump.py b/cme/modules/nanodump.py index d4639702..6d683a1e 100644 --- a/cme/modules/nanodump.py +++ b/cme/modules/nanodump.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # nanodump module for CME python3 # author of the module : github.com/mpgn # nanodump: https://github.com/helpsystems/nanodump diff --git a/cme/modules/nopac.py b/cme/modules/nopac.py index 08f51345..35f34842 100644 --- a/cme/modules/nopac.py +++ b/cme/modules/nopac.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Credit to https://exploit.ph/cve-2021-42287-cve-2021-42278-weaponisation.html # @exploitph @Evi1cg # module by @mpgn_x64 diff --git a/cme/modules/petitpotam.py b/cme/modules/petitpotam.py index 4316a58f..0f800bef 100644 --- a/cme/modules/petitpotam.py +++ b/cme/modules/petitpotam.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # From https://github.com/topotam/PetitPotam # All credit to @topotam # Module by @mpgn_x64 diff --git a/cme/modules/procdump.py b/cme/modules/procdump.py index f9ecbe09..269ea7e4 100644 --- a/cme/modules/procdump.py +++ b/cme/modules/procdump.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # prdocdump module for CME python3 # author: github.com/mpgn # thanks to pixis (@HackAndDo) for making it pretty l33t :) diff --git a/cme/modules/rdp.py b/cme/modules/rdp.py index ada41971..a8f84fce 100644 --- a/cme/modules/rdp.py +++ b/cme/modules/rdp.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.dcerpc.v5.rpcrt import DCERPCException from impacket.dcerpc.v5 import rrp from impacket.examples.secretsdump import RemoteOperations diff --git a/cme/modules/runasppl.py b/cme/modules/runasppl.py index cda7a0e9..53596534 100644 --- a/cme/modules/runasppl.py +++ b/cme/modules/runasppl.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class CMEModule: name = 'runasppl' diff --git a/cme/modules/scuffy.py b/cme/modules/scuffy.py index a6e25d8e..c1fb5e25 100644 --- a/cme/modules/scuffy.py +++ b/cme/modules/scuffy.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import os import ntpath diff --git a/cme/modules/shadowcoerce.py b/cme/modules/shadowcoerce.py index 4e21b2fa..514f3647 100644 --- a/cme/modules/shadowcoerce.py +++ b/cme/modules/shadowcoerce.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import time import logging from impacket import system_errors diff --git a/cme/modules/slinky.py b/cme/modules/slinky.py index 63e25e75..1e4b57fa 100644 --- a/cme/modules/slinky.py +++ b/cme/modules/slinky.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import pylnk3 import os import ntpath diff --git a/cme/modules/spider_plus.py b/cme/modules/spider_plus.py index 02bc6613..6260b5b6 100755 --- a/cme/modules/spider_plus.py +++ b/cme/modules/spider_plus.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import json import errno import os diff --git a/cme/modules/spooler.py b/cme/modules/spooler.py index f863d723..80516d68 100644 --- a/cme/modules/spooler.py +++ b/cme/modules/spooler.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + # https://raw.githubusercontent.com/SecureAuthCorp/impacket/master/examples/rpcdump.py from impacket.examples import logger from impacket import uuid, version diff --git a/cme/modules/subnets.py b/cme/modules/subnets.py index c0a57b47..d287fa19 100644 --- a/cme/modules/subnets.py +++ b/cme/modules/subnets.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.ldap import ldapasn1 as ldapasn1_impacket def searchResEntry_to_dict(results): diff --git a/cme/modules/test_connection.py b/cme/modules/test_connection.py index 3c013c6c..c20fad2d 100644 --- a/cme/modules/test_connection.py +++ b/cme/modules/test_connection.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.helpers.powershell import create_ps_command from sys import exit diff --git a/cme/modules/uac.py b/cme/modules/uac.py index 7ada1cf4..c3e4cbbf 100644 --- a/cme/modules/uac.py +++ b/cme/modules/uac.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.dcerpc.v5.rpcrt import DCERPCException from impacket.dcerpc.v5 import rrp from impacket.examples.secretsdump import RemoteOperations diff --git a/cme/modules/user_description.py b/cme/modules/user_description.py index 5e7603dd..80d86cf8 100644 --- a/cme/modules/user_description.py +++ b/cme/modules/user_description.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from pathlib import Path from datetime import datetime from impacket.ldap import ldap, ldapasn1 diff --git a/cme/modules/wdigest.py b/cme/modules/wdigest.py index 8fa4fb6d..84522e14 100644 --- a/cme/modules/wdigest.py +++ b/cme/modules/wdigest.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from impacket.dcerpc.v5.rpcrt import DCERPCException from impacket.dcerpc.v5 import rrp from impacket.examples.secretsdump import RemoteOperations diff --git a/cme/modules/web_delivery.py b/cme/modules/web_delivery.py index fd70191b..349445c4 100644 --- a/cme/modules/web_delivery.py +++ b/cme/modules/web_delivery.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.helpers.powershell import * from sys import exit diff --git a/cme/modules/webdav.py b/cme/modules/webdav.py index 8233f5df..6a25f128 100644 --- a/cme/modules/webdav.py +++ b/cme/modules/webdav.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.protocols.smb.remotefile import RemoteFile from impacket import nt_errors from impacket.smb3structs import FILE_READ_DATA diff --git a/cme/modules/wireless.py b/cme/modules/wireless.py index fb6088c9..a9ef2053 100644 --- a/cme/modules/wireless.py +++ b/cme/modules/wireless.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class CMEModule: name = 'wireless' diff --git a/cme/modules/zerologon.py b/cme/modules/zerologon.py index 9f8c4813..550b8fb8 100644 --- a/cme/modules/zerologon.py +++ b/cme/modules/zerologon.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # everything is comming from https://github.com/dirkjanm/CVE-2020-1472 # credit to @dirkjanm # module by : @mpgn_x64 diff --git a/cme/parsers/ip.py b/cme/parsers/ip.py index e94c8383..d42a8e05 100755 --- a/cme/parsers/ip.py +++ b/cme/parsers/ip.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from ipaddress import ip_address, ip_network, summarize_address_range, ip_interface def parse_targets(target): diff --git a/cme/parsers/nessus.py b/cme/parsers/nessus.py index 0e844972..11d1e640 100644 --- a/cme/parsers/nessus.py +++ b/cme/parsers/nessus.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import xmltodict # Ideally i'd like to be able to pull this info out dynamically from each protocol object but i'm a lazy bastard diff --git a/cme/parsers/nmap.py b/cme/parsers/nmap.py index 3e3b072c..2d72ee65 100644 --- a/cme/parsers/nmap.py +++ b/cme/parsers/nmap.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import xmltodict # Ideally i'd like to be able to pull this info out dynamically from each protocol object but i'm a lazy bastard diff --git a/cme/protocols/ldap.py b/cme/protocols/ldap.py index 633b621c..3abe3bcd 100644 --- a/cme/protocols/ldap.py +++ b/cme/protocols/ldap.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # from https://github.com/SecureAuthCorp/impacket/blob/master/examples/GetNPUsers.py # https://troopers.de/downloads/troopers19/TROOPERS19_AD_Fun_With_LDAP.pdf diff --git a/cme/protocols/ldap/database.py b/cme/protocols/ldap/database.py index 498d0cdf..dbede2c3 100644 --- a/cme/protocols/ldap/database.py +++ b/cme/protocols/ldap/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class database: def __init__(self, conn): diff --git a/cme/protocols/ldap/db_navigator.py b/cme/protocols/ldap/db_navigator.py index 3950c839..f1e59e66 100644 --- a/cme/protocols/ldap/db_navigator.py +++ b/cme/protocols/ldap/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.cmedb import DatabaseNavigator diff --git a/cme/protocols/ldap/kerberos.py b/cme/protocols/ldap/kerberos.py index 70001b88..e142767a 100644 --- a/cme/protocols/ldap/kerberos.py +++ b/cme/protocols/ldap/kerberos.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import random from os import getenv diff --git a/cme/protocols/ldap/smbldap.py b/cme/protocols/ldap/smbldap.py index c2fe180a..2dd5c824 100644 --- a/cme/protocols/ldap/smbldap.py +++ b/cme/protocols/ldap/smbldap.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import random from pyasn1.codec.der import decoder, encoder diff --git a/cme/protocols/mssql.py b/cme/protocols/mssql.py index 572ba788..baeb71b6 100755 --- a/cme/protocols/mssql.py +++ b/cme/protocols/mssql.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import socket import logging from cme.logger import CMEAdapter diff --git a/cme/protocols/mssql/database.py b/cme/protocols/mssql/database.py index 3ade415a..ec21dc02 100755 --- a/cme/protocols/mssql/database.py +++ b/cme/protocols/mssql/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class database: def __init__(self, conn): diff --git a/cme/protocols/mssql/db_navigator.py b/cme/protocols/mssql/db_navigator.py index 2064d911..fb25e45b 100644 --- a/cme/protocols/mssql/db_navigator.py +++ b/cme/protocols/mssql/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.helpers.misc import validate_ntlm from cme.cmedb import DatabaseNavigator diff --git a/cme/protocols/mssql/mssqlexec.py b/cme/protocols/mssql/mssqlexec.py index bdadad14..090f845a 100755 --- a/cme/protocols/mssql/mssqlexec.py +++ b/cme/protocols/mssql/mssqlexec.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging diff --git a/cme/protocols/rdp.py b/cme/protocols/rdp.py index b06f864b..cc3e9178 100644 --- a/cme/protocols/rdp.py +++ b/cme/protocols/rdp.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import asyncio from cme.connection import * diff --git a/cme/protocols/rdp/database.py b/cme/protocols/rdp/database.py index 101bfa1a..fa2d5099 100644 --- a/cme/protocols/rdp/database.py +++ b/cme/protocols/rdp/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class database: def __init__(self, conn): diff --git a/cme/protocols/rdp/db_navigator.py b/cme/protocols/rdp/db_navigator.py index 3950c839..f1e59e66 100644 --- a/cme/protocols/rdp/db_navigator.py +++ b/cme/protocols/rdp/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.cmedb import DatabaseNavigator diff --git a/cme/protocols/smb.py b/cme/protocols/smb.py index c083dc03..6d91f845 100755 --- a/cme/protocols/smb.py +++ b/cme/protocols/smb.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import socket diff --git a/cme/protocols/smb/atexec.py b/cme/protocols/smb/atexec.py index 8f05af1a..7503edc2 100755 --- a/cme/protocols/smb/atexec.py +++ b/cme/protocols/smb/atexec.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import os import logging from impacket.dcerpc.v5 import tsch, transport diff --git a/cme/protocols/smb/database.py b/cme/protocols/smb/database.py index 1ff3fb41..b0e87ed3 100755 --- a/cme/protocols/smb/database.py +++ b/cme/protocols/smb/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging diff --git a/cme/protocols/smb/db_navigator.py b/cme/protocols/smb/db_navigator.py index 2d562980..d2563891 100644 --- a/cme/protocols/smb/db_navigator.py +++ b/cme/protocols/smb/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.helpers.misc import validate_ntlm from cme.cmedb import DatabaseNavigator diff --git a/cme/protocols/smb/mmcexec.py b/cme/protocols/smb/mmcexec.py index 7d98e0b5..17720466 100644 --- a/cme/protocols/smb/mmcexec.py +++ b/cme/protocols/smb/mmcexec.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Copyright (c) 2003-2016 CORE Security Technologies # # This software is provided under under a slightly modified version diff --git a/cme/protocols/smb/passpol.py b/cme/protocols/smb/passpol.py index 2249e71a..19b8f44f 100644 --- a/cme/protocols/smb/passpol.py +++ b/cme/protocols/smb/passpol.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- #Stolen from https://github.com/Wh1t3Fox/polenum import logging diff --git a/cme/protocols/smb/remotefile.py b/cme/protocols/smb/remotefile.py index f9ac5149..6d42626c 100644 --- a/cme/protocols/smb/remotefile.py +++ b/cme/protocols/smb/remotefile.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- from impacket.smb3structs import FILE_READ_DATA, FILE_WRITE_DATA class RemoteFile: diff --git a/cme/protocols/smb/samruser.py b/cme/protocols/smb/samruser.py index 024b36b6..4055ddbf 100644 --- a/cme/protocols/smb/samruser.py +++ b/cme/protocols/smb/samruser.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- #Stolen from Impacket import logging diff --git a/cme/protocols/smb/smbexec.py b/cme/protocols/smb/smbexec.py index 7972021e..70866f55 100755 --- a/cme/protocols/smb/smbexec.py +++ b/cme/protocols/smb/smbexec.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import logging import os from time import sleep diff --git a/cme/protocols/smb/smbspider.py b/cme/protocols/smb/smbspider.py index 65461a13..018cfefd 100755 --- a/cme/protocols/smb/smbspider.py +++ b/cme/protocols/smb/smbspider.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from time import strftime, localtime from cme.protocols.smb.remotefile import RemoteFile from impacket.smb3structs import FILE_READ_DATA diff --git a/cme/protocols/smb/wmiexec.py b/cme/protocols/smb/wmiexec.py index 90907d06..3399a73e 100755 --- a/cme/protocols/smb/wmiexec.py +++ b/cme/protocols/smb/wmiexec.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import ntpath, logging import os diff --git a/cme/protocols/ssh.py b/cme/protocols/ssh.py index 9a4f100e..481691a7 100644 --- a/cme/protocols/ssh.py +++ b/cme/protocols/ssh.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import paramiko import socket from cme.connection import * diff --git a/cme/protocols/ssh/database.py b/cme/protocols/ssh/database.py index 101bfa1a..fa2d5099 100644 --- a/cme/protocols/ssh/database.py +++ b/cme/protocols/ssh/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class database: def __init__(self, conn): diff --git a/cme/protocols/ssh/db_navigator.py b/cme/protocols/ssh/db_navigator.py index 3950c839..f1e59e66 100644 --- a/cme/protocols/ssh/db_navigator.py +++ b/cme/protocols/ssh/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.cmedb import DatabaseNavigator diff --git a/cme/protocols/winrm.py b/cme/protocols/winrm.py index 0a05d589..4bb739df 100644 --- a/cme/protocols/winrm.py +++ b/cme/protocols/winrm.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- import requests import logging diff --git a/cme/protocols/winrm/database.py b/cme/protocols/winrm/database.py index 498d0cdf..dbede2c3 100644 --- a/cme/protocols/winrm/database.py +++ b/cme/protocols/winrm/database.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + class database: def __init__(self, conn): diff --git a/cme/protocols/winrm/db_navigator.py b/cme/protocols/winrm/db_navigator.py index 3950c839..f1e59e66 100644 --- a/cme/protocols/winrm/db_navigator.py +++ b/cme/protocols/winrm/db_navigator.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + from cme.cmedb import DatabaseNavigator diff --git a/cme/servers/http.py b/cme/servers/http.py index 261f6582..aba77a97 100755 --- a/cme/servers/http.py +++ b/cme/servers/http.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import http.server import threading import ssl diff --git a/cme/servers/smb.py b/cme/servers/smb.py index 2e16fb1b..ef0760ae 100755 --- a/cme/servers/smb.py +++ b/cme/servers/smb.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + import threading import logging from sys import exit