Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.2 #138

Merged
merged 78 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
735ceb4
fixing john install
ShutdownRepo Feb 25, 2023
d67a4cb
add haiti
noraj Feb 25, 2023
8a6d400
add ctf-party
noraj Feb 25, 2023
70767fb
add bqm
noraj Feb 25, 2023
dddaf95
haiti: add history
noraj Feb 25, 2023
39e75d3
ctf-party: hisotry
noraj Feb 26, 2023
fbb5cf5
haiti: history more self explanatory
noraj Feb 26, 2023
5b6d56a
Removing comment from command
ShutdownRepo Feb 26, 2023
05629e6
bqm: add history
noraj Feb 26, 2023
ad1a7c5
add tls-map
noraj Feb 26, 2023
b80fb9c
trigger dev CI
noraj Feb 26, 2023
a3ceb7a
Renaming external PR workflows
ShutdownRepo Feb 26, 2023
00be3e9
Adding concurrency for nightly builds
ShutdownRepo Feb 26, 2023
58ea79f
Merge pull request #103 from noraj/noraj/ctf-party
ShutdownRepo Feb 26, 2023
8e5adf7
Merge branch 'dev' into noraj/haiti
ShutdownRepo Feb 26, 2023
869df40
Merge pull request #102 from noraj/noraj/haiti
ShutdownRepo Feb 26, 2023
1776e5e
Merge branch 'dev' into noraj/tls-map
ShutdownRepo Feb 26, 2023
681f8be
Merge pull request #105 from noraj/noraj/tls-map
ShutdownRepo Feb 26, 2023
c124dde
Fixing bad conflict solving
ShutdownRepo Feb 26, 2023
8ce1c61
Adding customization for firefox
wlayzz Feb 27, 2023
74b6fd0
Merge branch 'dev' into noraj/bqm
noraj Feb 27, 2023
b385a78
Fix kerbrute tool (AMD + ARM)
QU35T-code Feb 28, 2023
f7beaa8
Merge pull request #108 from QU35T-code/kerbrute/fix
ShutdownRepo Feb 28, 2023
cd7ea0b
Merge pull request #107 from wlayzz/feature/firefox-custom
ShutdownRepo Feb 28, 2023
34ad81d
Add kraken tool
QU35T-code Mar 1, 2023
a273e9b
Add new line at the end of the file (kraken tool)
QU35T-code Mar 1, 2023
8debdc0
Fix kraken test command
QU35T-code Mar 1, 2023
a93d3b1
Merge pull request #111 from QU35T-code/new-tool/kraken
ShutdownRepo Mar 1, 2023
a67bf30
Update CrackMapExec to use latest version from the repo
mpgn Mar 1, 2023
bfe1543
Remove old version of minikerberos bc issue is fixed
QU35T-code Mar 2, 2023
e85ff1e
Merge branch 'dev' into patch-1
mpgn Mar 2, 2023
8c18b30
Update CrackMapExec installation using pipx
mpgn Mar 2, 2023
6803c37
Fix pywsus history command
Mathisca Mar 2, 2023
c57a6aa
Merge pull request #113 from QU35T-code/fix/pypykatz
ShutdownRepo Mar 2, 2023
6e4e909
Merge pull request #114 from Mathisca/fix-pywsus-history
ShutdownRepo Mar 2, 2023
980935b
Add SoapUI tool
Mathisca Mar 3, 2023
a8dc722
Add netdiscover tool
Mathisca Mar 3, 2023
d44e574
Merge pull request #115 from Mathisca/soapui
ShutdownRepo Mar 3, 2023
1d58b86
Merge pull request #116 from Mathisca/netdiscover
ShutdownRepo Mar 3, 2023
8862fe4
Fixing tls-scanner test command
ShutdownRepo Mar 3, 2023
3b40963
Merge pull request #112 from mpgn/patch-1
ShutdownRepo Mar 5, 2023
912b112
Fix cme install sourcing zshrc
Mar 8, 2023
a070e41
Add TODO comment
Mar 8, 2023
99c7dcd
Add notify tool
Mar 8, 2023
2f7371d
Merge pull request #118 from QU35T-code/fix/cme
Dramelac Mar 8, 2023
3c53709
Fixed firefox initialization issues
Skileau Mar 8, 2023
3f69095
Added Firefox addons in my-resources support
Skileau Mar 8, 2023
b5eed4f
Set default openjdk from 11 to 17 and fix applications that need vers…
QU35T-code Mar 8, 2023
105fffb
Add newline
QU35T-code Mar 8, 2023
29ebb37
Merge remote-tracking branch 'upstream/dev' into new-tool/notify
QU35T-code Mar 8, 2023
be88dce
Merge pull request #121 from QU35T-code/openjdk-default
ShutdownRepo Mar 8, 2023
fd63438
Merge pull request #119 from QU35T-code/new-tool/notify
ShutdownRepo Mar 8, 2023
ce32506
Integrated suggestions
Skileau Mar 8, 2023
aec58fb
Integrated suggestions
Skileau Mar 8, 2023
8e34c90
Added initial addons.txt file
Skileau Mar 9, 2023
e856c65
Added initial addons.txt file
Skileau Mar 9, 2023
47261cd
Patched user-setup.py
Skileau Mar 9, 2023
479f850
Repatch user-setup.py
Skileau Mar 9, 2023
7fc7e0c
Merge pull request #120 from Skileau/firefox-dev
ShutdownRepo Mar 13, 2023
0875935
Adding PR guidance
ShutdownRepo Mar 3, 2023
2b53281
Adding ldapsearch
ShutdownRepo Mar 17, 2023
e3d8990
Add tools description
Mar 24, 2023
9354207
Merge branch 'dev' into main
thibaudrobin Mar 28, 2023
ea1459d
Fix links
Mar 28, 2023
4ff17f1
Merge pull request #104 from noraj/noraj/bqm
ShutdownRepo Apr 3, 2023
b2464af
Fix errors
Apr 4, 2023
84a34b8
Fix errors again
Apr 4, 2023
1d6840d
Seem good ?
Apr 4, 2023
1715a44
Add SNMP man
Apr 4, 2023
a4e181a
Fix amass + update smbmap alias
Dramelac Apr 4, 2023
b143c21
Update Go export syntax
Dramelac Apr 4, 2023
76db422
Use set_go_env
Dramelac Apr 4, 2023
3bf5557
Merge branch 'dev' into main
thibaudrobin Apr 5, 2023
4d4cb9e
Fix amass install
QU35T-code Apr 13, 2023
567416d
Merge pull request #136 from QU35T-code/fix/amass
ShutdownRepo Apr 15, 2023
263442b
Merge pull request #125 from thibaudrobin/main
ShutdownRepo Apr 15, 2023
9f3f502
Fix typo on function closing
Dramelac Apr 15, 2023
cfa4ed5
Switch fapt to dpkg for static package installation
Dramelac Apr 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Description

> A description of your PR, what it brings or corrects.
> A description of your PR, what it brings or corrects. Don't forget to configure your PR to the dev branch (cf. https://exegol.readthedocs.io/en/latest/community/contributors.html)

# Related issues

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/entrypoint_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ env:
IMAGE_BASE_NAME: "nightly"
DOCKERFILE: "Dockerfile"

# creating a concurrency group for nightly builds
# so that when pushing multiple things in dev, build is always running for the latest push
# this is to save resources, by killing "in progress" jobs when another build starts for the last push
concurrency:
group: nightly_build
cancel-in-progress: true


jobs:
# https://github.com/orgs/community/discussions/26671, "can’t pass ENV variables to the reusable workflow"
varset:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/entrypoint_pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull request
name: External PR tests

on:
pull_request:
Expand Down
23 changes: 22 additions & 1 deletion sources/exegol/load_supported_setups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,26 @@ function run_user_setup() {
echo "[$(date +'%d-%m-%Y_%H-%M-%S')] ==== End of custom setups loading ===="
}

function deploy_firefox_addons() {
##### firefox custom addons deployment
if [ -d "$MY_Setup_PATH/firefox/" ]; then
if [ -d "$MY_Setup_PATH/firefox/addons" ]; then
ADDON_FOLDER="-D $MY_Setup_PATH/firefox/addons"
else
mkdir "$MY_Setup_PATH/firefox/addons" && chmod 770 "$MY_Setup_PATH/firefox/addons"
fi
if [ -f "$MY_Setup_PATH/firefox/addons.txt" ]; then
ADDON_LIST="-L $MY_Setup_PATH/firefox/addons.txt"
else
cp --preserve=mode /.exegol/skel/firefox/addons.txt "$MY_Setup_PATH/firefox/addons.txt"
fi
python3 /opt/tools/firefox/user-setup.py $ADDON_LIST $ADDON_FOLDER
else
mkdir --parents "$MY_Setup_PATH/firefox/addons" && chmod 770 -R "$MY_Setup_PATH/firefox/addons"
cp --preserve=mode /.exegol/skel/firefox/addons.txt "$MY_Setup_PATH/firefox/addons.txt"
fi
}

# Starting
# This procedure is supposed to be executed only once at the first startup, using a lockfile check

Expand All @@ -124,7 +144,8 @@ deploy_tmux
deploy_vim
deploy_apt
deploy_python3
deploy_firefox_addons

run_user_setup

exit 0
exit 0
3 changes: 3 additions & 0 deletions sources/exegol/skel/firefox/addons.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file can be used to install addons on the Firefox instance of Exegol.
# The download links of the addons to be installed can be listed in this file (ie: https://addons.mozilla.org/fr/firefox/addon/foxyproxy-standard/).
# All addons listed below will be downloaded and installed automatically when creating a new Exegol container.
Binary file added sources/firefox/places.sqlite
Binary file not shown.
2 changes: 2 additions & 0 deletions sources/firefox/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
R2Log
requests
216 changes: 216 additions & 0 deletions sources/firefox/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
#!/usr/bin/env python3
# -- coding: utf-8 --
# File name : setup.py
# Author : Wlayzz (@wlayzz - Lucien Doustaly) and Skilo (@askilow - Alexis Marquois)
# Date created : 27 February 2023
# Python Version : 3.*

import json
import os
import re
import shutil
import subprocess
import zipfile
import sqlite3
import requests
from pathlib import Path
from time import sleep
from R2Log import logger
from glob import glob

PATHNAME = "/root/.mozilla/firefox/**.Exegol/"

# Define addons urls
urls = [
"https://addons.mozilla.org/fr/firefox/addon/foxyproxy-standard/",
"https://addons.mozilla.org/fr/firefox/addon/darkreader/",
"https://addons.mozilla.org/fr/firefox/addon/uaswitcher/",
"https://addons.mozilla.org/fr/firefox/addon/cookie-editor/",
"https://addons.mozilla.org/fr/firefox/addon/wappalyzer/"
]

# Define regex
reurl = r"(https:\/\/addons\.mozilla\.org\/firefox\/downloads\/file\/[0-9]+\/)([a-zA-Z0-9\-\_\.]+\.xpi)"
reid = r'"id": "([^"]+)"'

def get_link(url):
logger.info(f"Extracting download link from {url}")
response = requests.get(url)
# Extract download link and addon name from the response text using regex
dlextract = re.search(reurl, response.text)
# Concat link (group 1) and addon name (group 2)
link = ''.join(dlextract.groups())
# Extract xpi filename
addon_name = dlextract.group(2)
return link, addon_name


def download_addon(link, addon_name):
logger.info(f"Downloading addon {addon_name}")
addon_dl = requests.get(link)
# Save xpi addon on filesystem
with open("/tmp/" + addon_name, 'wb') as addon_file:
addon_file.write(addon_dl.content)


def read_manifest(addon_path):
archive = zipfile.ZipFile(addon_path, 'r')
manifest = archive.read('manifest.json').decode()
# Read the id in the manifest
addon_id = re.search(reid, manifest).group(1)
return addon_id


def install_addons(addon_name, addon_id, addon_path):
logger.info(f"Installing addon {addon_name} with id {addon_id}")
# Get the path of the Exegol profile
try:
dest = glob("%s" % PATHNAME)[0]
except:
logger.error("Firefox profile Exegol does not exist")
raise
# Create the extensions folder
Path(dest + "/extensions").mkdir(parents=True, exist_ok=True)
# Move the addon to the extensions folder
shutil.move(addon_path + "/" + addon_name, dest + "/extensions/" + addon_id + ".xpi")


def activate_addons(addon_list):
for addons in addon_list:
addon_id, addon_name, disable = addons
if disable:
logger.info(f"Disabling {addon_name}")
else:
logger.info(f"Enabling {addon_name}")
try:
with open(Path(glob("%s" % PATHNAME)[0] + "/extensions.json"), 'r+') as extensions_file:
extensions_config = json.load(extensions_file)
for addon in extensions_config["addons"]:
if addon["id"] == addon_id:
addon["active"] = not disable
addon["userDisabled"] = disable
addon["seen"] = not disable
extensions_file.seek(0) # <--- should reset file position to the beginning.
json.dump(extensions_config, extensions_file)
extensions_file.truncate() # remove remaining part
if disable:
logger.success(f"{addon_name} sucessfully disabled\n")
else:
logger.success(f"{addon_name} sucessfully enabled\n")
except:
if disable:
logger.error(f"Could not disable {addon_name}\n")
else:
logger.error(f"Could not enable {addon_name}\n")
pass

def adjust_ui():
with open(Path(glob("%s" % PATHNAME)[0] + "/prefs.js"), 'r+') as pref_js:
new_pref = re.sub(r'\\"import-button\\",', '', pref_js.read())
new_pref = re.sub(r'\\"save-to-pocket-button\\",', '', new_pref)
new_pref = re.sub('"extensions.activeThemeID", "default-theme@mozilla.org"', '"extensions.activeThemeID", "firefox-compact-dark@mozilla.org"', new_pref)
pref_js.seek(0)
pref_js.write(new_pref)
pref_js.truncate()

def import_bookmarks():
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, './places.sqlite')
src = sqlite3.connect(filename)
dst = sqlite3.connect(glob("%s" % PATHNAME)[0] + "places.sqlite")
with dst:
src.backup(dst)
dst.close()
src.close()

if __name__ == "__main__":

# Create firefox profile Exegol
logger.info("Creating Firefox profile")
try:
subprocess.run(["firefox", "-CreateProfile", "Exegol", "-headless"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
assert(Path(glob("%s" % PATHNAME)[0]).is_dir())
logger.success("Firefox profile Exegol created\n")
except:
logger.error("Could not create Firefox profile Exegol")
raise

# Define a list containing all addons names and ids
addon_list = []

# Iterate through addons
for url in urls:
# Make a request to the URL
link, addon_name = get_link(url)
# Download the addon
download_addon(link, addon_name)
# Read manifest.json in the archive
addon_id = read_manifest("/tmp/" + addon_name)
install_addons(addon_name, addon_id, "/tmp/")
logger.success(f"{addon_name} installed sucessfully\n")
addon_list.append((addon_id, addon_name[0:-4], False))

logger.success("All addons were installed sucessfully\n")

# Run firefox to initialise profile
logger.info("Initialising Firefox profile")
try:
p_firefox = subprocess.Popen(["firefox", "-P", "Exegol", "-headless"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
# Wait for firefox to be initialised
while not b'sessionstore-backups' in subprocess.check_output(["ls", glob("%s" % PATHNAME)[0]]):
sleep(0.5)
p_firefox.kill()
assert(Path(glob("%s" % PATHNAME)[0] + "/extensions.json").is_file())
logger.success("Firefox profile initialised sucessfully\n")
except:
logger.error("Could not initialise Firefox profile")
raise

# Enable dark mode
addon_list.append(("firefox-compact-dark@mozilla.org", "Dark mode", False))
# Disable default theme
addon_list.append(("default-theme@mozilla.org", "Default theme", True))
# Activate all addons
activate_addons(addon_list)

# Update UI
logger.info("Updating user interface")
try:
adjust_ui()
# Remove existing sessions
shutil.rmtree(glob("%s" % PATHNAME)[0] + "sessionstore-backups")
logger.success("User interface successfully updated\n")
except:
logger.error("An error has occurred while trying to update user interface\n")
raise

# Restore bookmarks
logger.info("Setting up profile's bookmarks")
try:
import_bookmarks()
logger.success("Bookmarks successfully setup\n")
except:
logger.error("Could not setup profile's bookmarks")
raise

# Remove backup file interfering with addons activation
logger.info("Removing backup file interfering with addons activation")
try:
Path(glob("%s" % PATHNAME)[0] + "/addonStartup.json.lz4").unlink()
logger.success("Backup file successfully removed\n")
except:
logger.error("Could not remove the backup file")
raise

# Restart firefox to apply modifications
logger.info("Restarting firefox to apply modifications")
try:
p_firefox = subprocess.Popen(["firefox", "-headless"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
# Wait for modifications to be applied
while not b'addonStartup.json.lz4' in subprocess.check_output(["ls", glob("%s" % PATHNAME)[0]]):
sleep(0.5)
p_firefox.kill()
logger.success("Modifications successfully applied")
except:
logger.error("Could not restart firefox")
raise
Loading