diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/README.md b/README.md index 61568424..cc8bdac0 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,27 @@ -** Make sure to pip install ansible, apt has an older copy ** - # Instructions -* Start with Parrot HTB Edition -* Install Ansible (python3 -m pip install ansible) -* Clone and enter the repo (git clone) -* ansible-galaxy install -r requirements.yml -* Make sure we have a sudo token (sudo whoami) -* ansible-playbook main.yml - -# Off-Video Changes -* Mate-Terminal Colors, I show how to configure it here (https://www.youtube.com/watch?v=2y68gluYTcc). I just did the steps in that video on my old VM to backup the color scheme, then copied it to this repo. -* Evil-Winrm/Certipy/SharpCollection/CME/Impacket, will make a video for these soon -* Updated BurpSuite Activation. Later versions of ansible would hang if a shell script started a process that didn't die. Put a timeout on the java process +1. Install Parrot HTB Edition +2. Run following commands +``` +#Install Ansible +python3 -m pip install ansible --break-system-packages + +#Add Ansible to PATH +export PATH="$PATH:$HOME/.local/bin" + +#Clone repo +git clone https://github.com/n0isegat3/parrot-build +cd parrot-build + +#Install requirements +ansible-galaxy install -r requirements.yml + +#Make sure to have a sudo token +sudo whoami + +#Run playbook +ansible-playbook main.yml +``` +3. Enjoy + +# Credits +Thank you ippsec for initial automation! You can find his repo on github.com/ippsec/parrot-build \ No newline at end of file diff --git a/main.yml b/main.yml index f7883e4b..6e34923e 100644 --- a/main.yml +++ b/main.yml @@ -7,7 +7,7 @@ - role: "roles/configure-tmux" - role: "roles/customize-terminal" - role: "roles/customize-browser" - - role: "roles/configure-logging" + # - role: "roles/configure-logging" - role: "roles/configure-system" - role: gantsign.visual-studio-code users: diff --git a/roles/configure-logging/tasks/main.yml b/roles/configure-logging/tasks/main.yml index 9433d12d..687a575b 100644 --- a/roles/configure-logging/tasks/main.yml +++ b/roles/configure-logging/tasks/main.yml @@ -1,3 +1,3 @@ --- -- include: "ufw.yml" -- include: "auditd.yml" +- include_tasks: "ufw.yml" +- include_tasks: "auditd.yml" \ No newline at end of file diff --git a/roles/configure-system/tasks/main.yml b/roles/configure-system/tasks/main.yml index 34e40968..db8968c7 100644 --- a/roles/configure-system/tasks/main.yml +++ b/roles/configure-system/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include: "configure-sudoers.yml" +- include_tasks: "configure-sudoers.yml" diff --git a/roles/configure-tmux/files/.tmux.conf b/roles/configure-tmux/files/.tmux.conf index 83547eb3..16c1cf6a 100644 --- a/roles/configure-tmux/files/.tmux.conf +++ b/roles/configure-tmux/files/.tmux.conf @@ -1,10 +1,37 @@ -set -g history-limit 10000 -set -g allow-rename off +# Status Bar +set-option -g status on +set -g status-justify centre + +#set prefix +set -g prefix C-a +bind C-a send-prefix +unbind C-b -set -g status-bg "#008000" +set -g history-limit 100000 +set -g allow-rename off -bind-key j command-prompt -p "join pain from:" "join-pane -s '%%'" -bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" -bind-key C send-keys " | xclip -selection clipboard" +bind-key j command-prompt -p "Join pan from:" "join-pane -s '%%'" +bind-key s command-prompt -p "Send pane to:" "joian-pane -t '%%'" +# Search Mode VI (default is emac) set-window-option -g mode-keys vi + +# Start windows and panes at 1, not 0 +set -g base-index 1 +setw -g pane-base-index 1 + +# Improve colors +set -g default-terminal 'tmux-256color' #tohle zakomentovat v macos, jinak tmux blbne + +# VPN IP +# show host name and IP address on left side of status bar +set -g status-left-length 60 +set -g status-bg green +set -g status-right-length 85 +set -g status-right "#{prefix_highlight}" +set -ag status-right "#[fg=white,bg=black] #()" +set -ag status-right " " +set -ag status-right "#[fg=red,bg=black]#(ifconfig tap0 | grep 'inet ' | awk '{print $2}')" +set -ag status-right " " +set -ag status-right "#[fg=black,bg=green] %H:%M %d-%b-%y" +set -ag status-right " " \ No newline at end of file diff --git a/roles/configure-tmux/files/tmux-vpn-info.sh b/roles/configure-tmux/files/tmux-vpn-info.sh new file mode 100644 index 00000000..412ade61 --- /dev/null +++ b/roles/configure-tmux/files/tmux-vpn-info.sh @@ -0,0 +1,3 @@ +#!/bin/bash +IF="tun0" +if [[ $(ip addr | grep $IF) == '' ]]; then echo "VPN Down"; else ip addr show dev $IF | grep "inet\b" | awk '{print $2}'| cut -d/ -f1; fi diff --git a/roles/configure-tmux/tasks/main.yml b/roles/configure-tmux/tasks/main.yml index 2c547cb6..ebd2a804 100644 --- a/roles/configure-tmux/tasks/main.yml +++ b/roles/configure-tmux/tasks/main.yml @@ -9,5 +9,9 @@ copy: src: "{{ role_path }}/files/.tmux.conf" dest: "{{ ansible_env.HOME }}" - - +- name: "Copying Tmux VPN info script" + copy: + src: "{{ role_path }}/files/.tmux.conf" + dest: "/opt" + become: true + become_method: sudo \ No newline at end of file diff --git a/roles/customize-browser/tasks/main.yml b/roles/customize-browser/tasks/main.yml index 92615411..f349e829 100644 --- a/roles/customize-browser/tasks/main.yml +++ b/roles/customize-browser/tasks/main.yml @@ -1,3 +1,3 @@ --- -- include: "burp.yml" -- include: "firefox.yml" +# - include_tasks: "burp.yml" +- include_tasks: "firefox.yml" diff --git a/roles/install-tools/files/ferox-config.toml b/roles/install-tools/files/ferox-config.toml new file mode 100644 index 00000000..6d92f7c8 --- /dev/null +++ b/roles/install-tools/files/ferox-config.toml @@ -0,0 +1,60 @@ +# Example configuration for feroxbuster +# +# If you wish to provide persistent settings to feroxbuster, rename this file to ferox-config.toml and make sure +# it resides in the same directory as the feroxbuster binary. +# +# After that, uncomment any line to override the default value provided by the binary itself. +# +# Any setting used here can be overridden by the corresponding command line option/argument +# +wordlist = "/opt/SecLists/Discovery/Web-Content/raft-medium-directories.txt" +# status_codes = [200, 500] +# filter_status = [301] +# threads = 1 +# timeout = 5 +# proxy = "http://127.0.0.1:8080" +# replay_proxy = "http://127.0.0.1:8081" +# replay_codes = [200, 302] +# verbosity = 1 +# parallel = 8 +# scan_limit = 6 +# rate_limit = 250 +# quiet = true +# silent = true +# auto_tune = true +# auto_bail = true +# json = true +# output = "/targets/ellingson_mineral_company/gibson.txt" +# debug_log = "/var/log/find-the-derp.log" +# user_agent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" +# redirects = true +# insecure = true +# extensions = ["php", "html"] +# url_denylist = ["http://dont-scan.me", "https://also-not.me"] +# no_recursion = true +# add_slash = true +# stdin = true +# dont_filter = true +# extract_links = true +# depth = 1 +# filter_size = [5174] +# filter_regex = ["^ignore me$"] +# filter_similar = ["https://somesite.com/soft404"] +# filter_word_count = [993] +# filter_line_count = [35, 36] +# queries = [["name","value"], ["rick", "astley"]] +# save_state = false +# time_limit = "10m" + +# headers can be specified on multiple lines or as an inline table +# +# inline example +# headers = {"stuff" = "things"} +# +# multi-line example +# note: if multi-line is used, all key/value pairs under it belong to the headers table until the next table +# is found or the end of the file is reached +# +# [headers] +# stuff = "things" +# more = "headers" \ No newline at end of file diff --git a/roles/install-tools/files/githubdownload.py b/roles/install-tools/files/githubdownload.py index 4fac3382..f3292216 100644 --- a/roles/install-tools/files/githubdownload.py +++ b/roles/install-tools/files/githubdownload.py @@ -79,14 +79,13 @@ def extract_tar(compressed_data, out_file): Returns: Nothing """ try: - gzip_header = compressed_data.getvalue()[:10] - if gzip_header.startswith(b"\x1f\x8b"): - with gzip.open(compressed_data, "rb") as gz: - with tarfile.open(fileobj=gz, mode="r:gz") as tar: - tar.extractall(path=out_file) - return - else: - raise Exception("Unable to identify compression type") + gzip_header = compressed_data.getvalue()[:10] + if gzip_header.startswith(b"\x1f\x8b"): + tar = tarfile.open(fileobj=compressed_data) + tar.extractall(path=out_file) + return + else: + raise Exception("Unable to identify compression type") except Exception as e: raise Exception(e) @@ -163,5 +162,4 @@ def verify_directory_exists(directory): print("Usage: python gitdownload.py ") print("Example: python gitdownload.py jpillora/chisel _darwin_amd64.gz /tmp chisel_darwin_amd64") - sys.exit(1) - + sys.exit(1) \ No newline at end of file diff --git a/roles/install-tools/tasks/apt-stuff.yml b/roles/install-tools/tasks/apt-stuff.yml index 9003a877..f2f2a3d6 100644 --- a/roles/install-tools/tasks/apt-stuff.yml +++ b/roles/install-tools/tasks/apt-stuff.yml @@ -1,22 +1,46 @@ --- - name: "Updating apt repo/cache" - apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 + apt: + update_cache: yes + upgrade: dist become: true become_method: sudo - name: "Upgrade all packages" - apt: upgrade=yes force_apt_get=yes + apt: + upgrade: full + force: yes + autoremove: yes + autoclean: yes become: true become_method: sudo - name: "Installing Packages" - package: - name: + apt: + name: "{{ item }}" + state: present + with_items: + - bruteforce-salted-openssl + - cifs-utils + - crowbar + - docker.io + - exiftool + - flamerobin + - flameshot + - gcc-mingw-w64 + - gss-ntlmssp + - hashcat + - heimdal-clients + - htop + - httrack - jq - - pipx + - libsasl2-modules-gssapi-heimdal + - neo4j - ntpdate - - flameshot - - exiftool - state: latest + - pipx + - rdesktop + - ruby + - ruby-dev + - snmp become: true become_method: sudo diff --git a/roles/install-tools/tasks/feroxbuster.yml b/roles/install-tools/tasks/feroxbuster.yml new file mode 100644 index 00000000..c6fb9aba --- /dev/null +++ b/roles/install-tools/tasks/feroxbuster.yml @@ -0,0 +1,11 @@ +- name: "Copying Feroxbuster Config" + copy: + src: "{{ role_path }}/files/ferox-config.toml" + dest: "/etc/feroxbuster" + become: true + become_method: sudo + +- name: "Install Feroxbuster" + shell: "curl -sL https://raw.githubusercontent.com/epi052/feroxbuster/main/install-nix.sh | bash -s $HOME/.local/bin" + become: true + become_method: sudo \ No newline at end of file diff --git a/roles/install-tools/tasks/gem-tools.yml b/roles/install-tools/tasks/gem-tools.yml index bc196e1d..85de4943 100644 --- a/roles/install-tools/tasks/gem-tools.yml +++ b/roles/install-tools/tasks/gem-tools.yml @@ -3,21 +3,22 @@ gem: name: "{{ item }}" state: latest + user_install: false loop: - - logger - - stringio - - winrm - builder - erubi + - evil-winrm - gssapi - gyoku - httpclient - - logging - little-plugger + - logger + - logging - nori - rubyntlm + - stringio + - winrm - winrm-fs - - evil-winrm become: true become_method: sudo diff --git a/roles/install-tools/tasks/github-repos.yml b/roles/install-tools/tasks/github-repos.yml index 3aa31632..06e413ad 100644 --- a/roles/install-tools/tasks/github-repos.yml +++ b/roles/install-tools/tasks/github-repos.yml @@ -6,6 +6,9 @@ loop: - { repo: "https://github.com/Flangvik/SharpCollection", location: "/opt/SharpCollection" } - { repo: "https://github.com/danielmiessler/SecLists", location: "/opt/SecLists" } + - { repo: "https://github.com/urbanadventurer/username-anarchy", location: "/opt/username-anarchy" } + - { repo: "https://github.com/extremecoders-re/pyinstxtractor", location: "/opt/pyinstxtractor" } + - { repo: "https://github.com/zrax/pycdc", location: "/opt/pycdc" } become: true become_method: sudo @@ -34,6 +37,8 @@ - { repo: "carlospolop/PEASS-ng", regex: "winPEASx64.exe", location: "/opt/peas" } - { repo: "WithSecureLabs/chainsaw", regex: "chainsaw_all_", location: "/opt/" } - { repo: "BloodHoundAD/BloodHound", regex: "BloodHound-linux-x64.zip", location: "/opt/" } + - { repo: "vi/websocat", regex: "websocat_max.x86_64-unknown-linux-musl", location: "/opt/websocat" } + - { repo: "hashcat/hashcat", regex: ".7z", location: "/opt/hashcat" } async: 45 poll: 0 become: true diff --git a/roles/install-tools/tasks/kerbrute.yml b/roles/install-tools/tasks/kerbrute.yml index 9e748c79..7ad49e8a 100644 --- a/roles/install-tools/tasks/kerbrute.yml +++ b/roles/install-tools/tasks/kerbrute.yml @@ -1,4 +1,14 @@ ---- -- name: "install Kerbrute" - shell: go install github.com/ropnop/kerbrute@master +- name: "Create kerbrute folder" + shell: "mkdir -p /opt/kerbrute" + become: true + become_method: sudo +- name: "Download kerbrute" + shell: "wget -O /opt/kerbrute/kerbrute-linux-amd64 https://github.com/ropnop/kerbrute/releases/download/v1.0.3/kerbrute_linux_amd64" + become: true + become_method: sudo + +- name: "Chmod kerbrute" + shell: "chmod +x /opt/kerbrute/kerbrute-linux-amd64" + become: true + become_method: sudo \ No newline at end of file diff --git a/roles/install-tools/tasks/main.yml b/roles/install-tools/tasks/main.yml index ec836246..2417d062 100644 --- a/roles/install-tools/tasks/main.yml +++ b/roles/install-tools/tasks/main.yml @@ -1,6 +1,8 @@ --- -- include: apt-stuff.yml -- include: kerbrute.yml -- include: github-repos.yml -- include: python-tools.yml -- include: gem-tools.yml +- include_tasks: apt-stuff.yml +- include_tasks: kerbrute.yml +- include_tasks: github-repos.yml +- include_tasks: python-tools.yml +- include_tasks: gem-tools.yml +- include_tasks: feroxbuster.yml +- include_tasks: nessus.yml \ No newline at end of file diff --git a/roles/install-tools/tasks/nessus.yml b/roles/install-tools/tasks/nessus.yml new file mode 100644 index 00000000..8374e922 --- /dev/null +++ b/roles/install-tools/tasks/nessus.yml @@ -0,0 +1,7 @@ +- name: "Download Nessus Install Package" + shell: "wget https://www.tenable.com/downloads/api/v2/pages/nessus/files/Nessus-10.7.4-debian10_amd64.deb -O /tmp/nessus.deb" + +- name: "Install Nessus" + shell: "dpkg -i /tmp/nessus.deb" + become: true + become_method: sudo \ No newline at end of file diff --git a/roles/install-tools/tasks/python-tools.yml b/roles/install-tools/tasks/python-tools.yml index 6bbee8b7..f017bffd 100644 --- a/roles/install-tools/tasks/python-tools.yml +++ b/roles/install-tools/tasks/python-tools.yml @@ -2,9 +2,15 @@ - name: "Install pipx tools" community.general.pipx: name: "{{ item.name }}" - source: "{{ item.url }}" + source: "{{ item.source }}" state: latest loop: - - { name: 'impacket', url: 'git+https://github.com/fortra/impacket.git' } - - { name: 'crackmapexec', url: 'git+https://github.com/Porchetta-Industries/CrackMapExec.git' } - - { name: 'certipy-ad', url: 'git+https://github.com/ly4k/Certipy.git' } + - { name: 'AutoRecon', source: 'git+https://github.com/Tib3rius/AutoRecon.git'} + - { name: 'bloodyAD', source: 'git+https://github.com/CravateRouge/bloodyAD.git'} + - { name: 'certipy-ad', source: 'git+https://github.com/ly4k/Certipy.git' } + - { name: 'crackmapexec', source: 'git+https://github.com/Porchetta-Industries/CrackMapExec.git' } + - { name: 'impacket', source: 'git+https://github.com/fortra/impacket.git' } + - { name: 'mitm6', source: 'git+https://github.com/dirkjanm/mitm6.git'} + - { name: 'pypykatz', source: 'git+https://github.com/skelsec/pypykatz.git'} + - { name: 'updog', source: 'git+https://github.com/sc0tfree/updog.git'} + - { name: 'AD-miner', source: 'git+https://github.com/Mazars-Tech/AD_Miner.git'} \ No newline at end of file