From d1bc912bf6367330f426b7a53f53974487375e97 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 16:10:36 +0000 Subject: [PATCH 01/10] Added requirements.txt NOTE: You shoudn't install `requirements.txt` if you are common user, make sure to install `requirements.txt` only in your `venv` for development purposes --- requirements.txt | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6af6f1e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,51 @@ +alabaster==0.7.12 +Babel==2.8.0 +beautifulsoup4==4.9.2 +bleach==3.2.1 +bs4==0.0.1 +certifi==2020.6.20 +cffi==1.14.3 +chardet==3.0.4 +colorama==0.4.3 +cryptography==3.1.1 +cssselect==1.1.0 +docutils==0.16 +fire==0.3.1 +idna==2.10 +imagesize==1.2.0 +jeepney==0.4.3 +Jinja2==2.11.2 +keyring==21.4.0 +lxml==4.5.2 +MarkupSafe==1.1.1 +packaging==20.4 +parse==1.18.0 +pkginfo==1.5.0.1 +pycparser==2.20 +Pygments==2.7.1 +pyparsing==2.4.7 +pyquery==1.4.1 +pytz==2020.1 +pywebcopy==6.3.0 +readme-renderer==26.0 +requests==2.24.0 +requests-toolbelt==0.9.1 +rfc3986==1.4.0 +SecretStorage==3.1.2 +six==1.15.0 +snowballstemmer==2.0.0 +soupsieve==2.0.1 +Sphinx==3.2.1 +sphinx-rtd-theme==0.5.0 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==1.0.3 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.4 +termcolor==1.1.0 +tqdm==4.50.0 +twine==3.2.0 +urllib3==1.25.10 +w3lib==1.22.0 +webencodings==0.5.1 From 0df98f8935ff2492f5cdab750f3ceac656d5bfd4 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:19:26 +0000 Subject: [PATCH 02/10] Added 3.9 to python versions in .travis.yml (Lets hope it already works) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8aa785c..1ace344 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ python: - "3.6" - "3.7" - "3.8" - - "3.8-dev" + - "3.9" - "nightly" install: - pip install coverage From e70ebf64b239cbeb7f0a34aa89438bccbed9f8cf Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:20:02 +0000 Subject: [PATCH 03/10] Added python `3.9-dev` to `.travis.yml` (Still hope it works) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1ace344..b9382f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "3.7" - "3.8" - "3.9" + - "3.9-dev" - "nightly" install: - pip install coverage From 356d5e3c1227fd76487f10a2fc43a9599ce540b0 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:20:56 +0000 Subject: [PATCH 04/10] Moved `__version__` to `hiddeneye_reborn/__init__.py` and imported it to `setup.py` --- hiddeneye_reborn/__init__.py | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hiddeneye_reborn/__init__.py b/hiddeneye_reborn/__init__.py index 5028c28..6b76aab 100644 --- a/hiddeneye_reborn/__init__.py +++ b/hiddeneye_reborn/__init__.py @@ -1 +1,2 @@ # TODO Write DocString +__version__ = "0.0a1.dev4" diff --git a/setup.py b/setup.py index 17f8dfe..4ba9b8d 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,10 @@ from setuptools import setup, find_packages +import hiddeneye_reborn # META DATA __author__ = "Open Security Group" -__version__ = "0.0a1.dev3" +__version__ = hiddeneye_reborn.__version__ __package_name__ = "hiddeneye_reborn" __description__ = "Appropriate Phishing Tool" __python_requires__ = ">=3.6.*" From 3f4670eb1926d2053c54606e5a84ac1fb7535367 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:21:38 +0000 Subject: [PATCH 05/10] Added `py7zr` dependency to setup.py It's required to compress and extract .7z files --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4ba9b8d..45210e2 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ __package_name__ = "hiddeneye_reborn" __description__ = "Appropriate Phishing Tool" __python_requires__ = ">=3.6.*" -__install_requires__ = ['pywebcopy', ] +__install_requires__ = ['pywebcopy','py7zr' ] __data_files__ = [("", ["LICENSE"])] __url__ = "https://github.com/Open-Security-Group-OSG/HiddenEyeReborn" From 8a4d7cf274c12f14eef5d13d30ae1b817bd96cd8 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:22:21 +0000 Subject: [PATCH 06/10] Added `model_compression.py` with all em, code lines --- hiddeneye_reborn/models/model_compression.py | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 hiddeneye_reborn/models/model_compression.py diff --git a/hiddeneye_reborn/models/model_compression.py b/hiddeneye_reborn/models/model_compression.py new file mode 100644 index 0000000..d094438 --- /dev/null +++ b/hiddeneye_reborn/models/model_compression.py @@ -0,0 +1,32 @@ +import py7zr + + +class CompressionModel: + def __init__(self, model_7zip = py7zr): + self._model_7zip = model_7zip + self._compress_7zip = self._model_7zip.pack_7zarchive + self._extract_7zip = self._model_7zip.unpack_7zarchive + + @property + def model_7zip(self): + return self._model_7zip + + @model_7zip.setter + def model_7zip(self, new_7zip_model): + self._model_7zip = new_7zip_model + + @property + def compress_7zip(self): + return self._compress_7zip + + @compress_7zip.setter + def compress_7zip(self, new_7zip_compressor): + self._compress_7zip = new_7zip_compressor + + @property + def extract_7zip(self): + return self._extract_7zip + + @extract_7zip.setter + def extract_7zip(self, new_7zip_extractor): + self._extract_7zip = new_7zip_extractor From 62c8f6d3c45b34f0458c390e705714a33ec94bd1 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:22:45 +0000 Subject: [PATCH 07/10] Created `model_templates_helper.py` placeholder, it's blank for now --- hiddeneye_reborn/models/model_templates_helper.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 hiddeneye_reborn/models/model_templates_helper.py diff --git a/hiddeneye_reborn/models/model_templates_helper.py b/hiddeneye_reborn/models/model_templates_helper.py new file mode 100644 index 0000000..e69de29 From aeb4d13bdcd70bcaa244d1ff4ec7d6dc6d2c85f2 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:23:48 +0000 Subject: [PATCH 08/10] Created `controller_compression.py` `with extract_7zip` and `compress_7zip` methods TODO - write tests for those.. --- .../controllers/controller_compression.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 hiddeneye_reborn/controllers/controller_compression.py diff --git a/hiddeneye_reborn/controllers/controller_compression.py b/hiddeneye_reborn/controllers/controller_compression.py new file mode 100644 index 0000000..39bdb7c --- /dev/null +++ b/hiddeneye_reborn/controllers/controller_compression.py @@ -0,0 +1,33 @@ +from hiddeneye_reborn.models.model_compression import CompressionModel +import shutil +from os.path import exists +from os import makedirs + + +class CompressionController: + def __init__(self, model=CompressionModel()): + self._model = model + self._compress_7zip = self._model.compress_7zip + self._extract_7zip = self._model.extract_7zip + + def extract_7zip(self, filename, extract_dir=""): + shutil.register_unpack_format('7zip', ['.7z'], self._extract_7zip) + if extract_dir == "": + if not exists("templates"): + makedirs("templates") + extract_dir = "templates" + + if ".7z" in filename: + shutil.unpack_archive(filename=filename, extract_dir=extract_dir) + else: + raise ValueError("Invalid input, please add .7z to the end of your file and try again") + + def compress_7zip(self, archive_name, target_dir, go_to_dir=''): + shutil.register_archive_format('7zip', self._compress_7zip, description='7zip archive') + if go_to_dir == "": + go_to_dir = "templates" + if target_dir == "": + raise ValueError("Target dir has to be specified") + shutil.make_archive(archive_name, '7zip', go_to_dir, target_dir) + +# TODO create templates_helper methods to get rid of default "templates" folders assignment From f4d6c23ae3eeccebf18643624973a8b4bad8ba2e Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:27:39 +0000 Subject: [PATCH 09/10] #TODO add author email to get rid of warning --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 45210e2..3734319 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ # META DATA __author__ = "Open Security Group" +# TODO add author email to get rid of warning __version__ = hiddeneye_reborn.__version__ __package_name__ = "hiddeneye_reborn" __description__ = "Appropriate Phishing Tool" From 79cc4dbafc0bc32f142bc66049d0b3ef7796f0fd Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Mon, 12 Oct 2020 19:42:56 +0000 Subject: [PATCH 10/10] Had to remove python '3.9' from .travis.yml (One more reason to switch to Github Actions) --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b9382f0..91f5956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ python: - "3.6" - "3.7" - "3.8" - - "3.9" - "3.9-dev" - "nightly" install: