From d35bf7f3c52f5719558f73b77ed1fc34e6997e89 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Sun, 6 Nov 2022 17:14:38 -0500 Subject: Post CFC version test --- kali.yml | 119 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 71 insertions(+), 48 deletions(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index fea5dfb..4bf2127 100644 --- a/kali.yml +++ b/kali.yml @@ -9,6 +9,10 @@ ysoserial_jar: "https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar" kitty_installer: "https://sw.kovidgoyal.net/kitty/installer.sh" tasks: + - ansible.builtin.fail: + msg: "This playbook must be run properly! Execute sudo bash setup.sh" + when: tmux is not defined or zsh_func is not defined + - name: Add Docker repo key ansible.builtin.shell: curl -fsSL {{ docker_repo_key }} | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/docker-ce-keyring.gpg @@ -33,53 +37,60 @@ - name: Installing one-off packages from package manager ansible.builtin.package: name: - - gawk - - terminator - - jxplorer - - seclists - - gobuster - - python3 - - python3-dev - - python3-pip + - bloodhound + - build-essential + - bytecode-viewer + - clang + - cmake - crackmapexec - - neo4j + - curl - default-jdk - default-jre - - rlwrap - - eog - - xclip - - steghide - - git - - ltrace - - strace - - gdb - - gdbserver - docker - docker-compose + - eog + - feroxbuster + - flex - forensics-extra - - ncat + - gawk + - gdb + - gdbserver + - ghidra + - git + - gobuster + - golang-go - jq - - powershell - - samba - - tmux - - libssl-dev + - jxplorer - libffi-dev - - build-essential + - liblzma-dev + - libssl-dev + - libxml2-dev + - ltrace + - ncat + - neo4j + - ntpdate + - mingw-w64 + - patch + - powershell + - python3 + - python3-dev + - python3-pip + - p7zip-full - remmina + - rlwrap + - samba + - seclists + - steghide + - strace - sublime-text - - golang-go - - ghidra - - bytecode-viewer - - ntpdate - - bloodhound + - terminator + - tmux + - xclip + - xfce4-terminal - zaproxy + - zlib1g-dev state: latest - - name: Install ShellUp! - ansible.builtin.git: - repo: 'https://github.com/AgroDan/shellup.git' - dest: /opt/shellup - - name: Install pwntools ansible.builtin.pip: name: git+https://github.com/Gallopsled/pwntools.git@dev @@ -207,36 +218,48 @@ set mouse= set ttymouse= - - name: Getting all interactive users <> + - name: Getting all interactive users ansible.builtin.shell: "awk -F: '{ if (($3 >= 1000 && $3 != 65534) || $3 == 0) print $1}' /etc/passwd" register: users - + + - name: Add sudo-NOPASSWD to users + loop: "{{ users.stdout_lines }}" + ansible.builtin.lineinfile: + path: /etc/sudoers + state: present + insertafter: EOF + line: "{{ item }} ALL=(ALL) NOPASSWD: ALL" + validate: /usr/sbin/visudo -cf %s + - name: Initialize Gef for all users ansible.builtin.script: /opt/gef/scripts/gef.sh become_user: "{{ item }}" loop: "{{ users.stdout_lines }}" - - name: Copying over bashrc file to all users + - name: Copying over zsh functions file for all users ansible.builtin.copy: - src: /tmp/master-bashrc - dest: "~{{ item }}/.bashrc" + src: "{{ zsh_func }}" + dest: "~{{ item }}/.zsh_functions" owner: "{{ item }}" group: "{{ item }}" mode: '0640' loop: "{{ users.stdout_lines }}" - - name: Copying over bash functions file for all users - ansible.builtin.copy: - src: /tmp/master-bash_functions - dest: "~{{ item }}/.bash_functions" + - name: Enabling zsh functions + loop: "{{ users.stdout_lins }}" + ansible.builtin.blockinfile: + path: "~{{ item }}/.zshrc" + state: present + insertafter: EOF owner: "{{ item }}" - group: "{{ item }}" - mode: '0640' - loop: "{{ users.stdout_lines }}" - + block: | + if [ -f ~/.zsh_functions ]; then + source ~/.zsh_functions + fi + - name: Copying over tmux config to all users ansible.builtin.copy: - src: /tmp/master-tmux_conf + src: "{{ tmux }}" dest: "~{{ item }}/.tmux.conf" owner: "{{ item }}" group: "{{ item }}" -- cgit v1.2.3 From 2a79c8c3499437ede38c81c82c2ca48b91ba3191 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 09:49:21 -0500 Subject: Fixed horrible typo that broke the whole thing --- kali.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 4bf2127..59f8735 100644 --- a/kali.yml +++ b/kali.yml @@ -9,8 +9,9 @@ ysoserial_jar: "https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar" kitty_installer: "https://sw.kovidgoyal.net/kitty/installer.sh" tasks: - - ansible.builtin.fail: - msg: "This playbook must be run properly! Execute sudo bash setup.sh" + - name: Confirming playbook was run properly + ansible.builtin.fail: + msg: "Do not call this playbook directly! Execute sudo bash setup.sh" when: tmux is not defined or zsh_func is not defined - name: Add Docker repo key @@ -194,7 +195,7 @@ user_install: no - name: Install Kitty Terminal Emulator 🐱 - ansible.builtin.command: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/sdtin dest=/opt launch=n" + ansible.builtin.command: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/stdin dest=/opt launch=n" - name: Create Desktop Icon for Kitty 🐱 ansible.builtin.copy: -- cgit v1.2.3 From d205bb0f7bc281b804e0f1a68c972ac7634df73c Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:09:01 -0500 Subject: Wrong ansible module used for kitty install --- kali.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 59f8735..5a147aa 100644 --- a/kali.yml +++ b/kali.yml @@ -195,7 +195,8 @@ user_install: no - name: Install Kitty Terminal Emulator 🐱 - ansible.builtin.command: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/stdin dest=/opt launch=n" + ansible.builtin.shell: + cmd: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/stdin dest=/opt launch=n" - name: Create Desktop Icon for Kitty 🐱 ansible.builtin.copy: -- cgit v1.2.3 From 0887f9ab50cd2f10bc26383093239e9b27c9d686 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:14:38 -0500 Subject: Fixing more dumb mistakes --- kali.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 5a147aa..3cc1272 100644 --- a/kali.yml +++ b/kali.yml @@ -200,7 +200,7 @@ - name: Create Desktop Icon for Kitty 🐱 ansible.builtin.copy: - dest: "/usr/share/applications" + dest: "/usr/share/applications/kitty.desktop" content: | [Desktop Entry] Version=0.26.2 -- cgit v1.2.3 From ca83fcf15ea6a276116812c426ae042e2feb0e30 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:16:42 -0500 Subject: Dev note: Do not code with a lack of sleep --- kali.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 3cc1272..9090633 100644 --- a/kali.yml +++ b/kali.yml @@ -248,7 +248,7 @@ loop: "{{ users.stdout_lines }}" - name: Enabling zsh functions - loop: "{{ users.stdout_lins }}" + loop: "{{ users.stdout_lines }}" ansible.builtin.blockinfile: path: "~{{ item }}/.zshrc" state: present -- cgit v1.2.3 From fe3212ab386017573698a5a0b62f7207988f6d62 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:35:43 -0500 Subject: Additional kitty stuff --- kali.yml | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 9090633..0dd2bd6 100644 --- a/kali.yml +++ b/kali.yml @@ -194,6 +194,10 @@ state: latest user_install: no + - name: Getting all interactive users + ansible.builtin.shell: "awk -F: '{ if (($3 >= 1000 && $3 != 65534) || $3 == 0) print $1}' /etc/passwd" + register: users + - name: Install Kitty Terminal Emulator 🐱 ansible.builtin.shell: cmd: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/stdin dest=/opt launch=n" @@ -209,6 +213,34 @@ Exec=/opt/kitty.app/bin/kitty Icon=/opt/kitty.app/share/icons/hicolor/256x256/apps/kitty.png Categories=Utility + + - name: Prepare kitty.conf files for all interactive users 🐱 + loop: "{{ users.stdout_lines }}" + ansible.builtin.file: + dest: "~{{ item }}/.config/kitty/kitty.conf" + state: touch + recurse: yes + owner: "{{ item }}" + group: "{{ item }}" + + - name: Prepare personalized configs for Kitty 🐱 + loop: "{{ users.stdout_lines }}" + ansible.builtin.blockinfile: + path: "~{{ item }}/.config/kitty/kitty.conf" + insertafter: EOF + state: present + block: | + # New windows open in current directory + map ctrl+shift+enter launch --cwd=current + + # New tabs open in current directory + map ctrl+t new_tab --cwd=current + + # The coveted "zoom" function + map ctrl+shift+z toggle_layout stack + + # Disable mouse-click a link to open in a browser + mouse_map left click ungrabbed no_op - name: Disable mouse interactivity in vim (╯°□°)╯︵ ┻━┻ ansible.builtin.blockinfile: @@ -220,9 +252,6 @@ set mouse= set ttymouse= - - name: Getting all interactive users - ansible.builtin.shell: "awk -F: '{ if (($3 >= 1000 && $3 != 65534) || $3 == 0) print $1}' /etc/passwd" - register: users - name: Add sudo-NOPASSWD to users loop: "{{ users.stdout_lines }}" -- cgit v1.2.3 From 274d41d44693e6f0d13178e3c365131f4610178e Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:38:24 -0500 Subject: Fixing yet another dumb mistake --- kali.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index 0dd2bd6..bb55755 100644 --- a/kali.yml +++ b/kali.yml @@ -217,11 +217,12 @@ - name: Prepare kitty.conf files for all interactive users 🐱 loop: "{{ users.stdout_lines }}" ansible.builtin.file: - dest: "~{{ item }}/.config/kitty/kitty.conf" + dest: "~{{ item }}/.config/kitty/" state: touch recurse: yes owner: "{{ item }}" group: "{{ item }}" + mode: 0755 - name: Prepare personalized configs for Kitty 🐱 loop: "{{ users.stdout_lines }}" -- cgit v1.2.3 From 586198df376690aa7bed3d2e31b98d0dcad00efa Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:40:07 -0500 Subject: BAD DOBBY BAD BAD BAD --- kali.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index bb55755..b9b88eb 100644 --- a/kali.yml +++ b/kali.yml @@ -218,7 +218,7 @@ loop: "{{ users.stdout_lines }}" ansible.builtin.file: dest: "~{{ item }}/.config/kitty/" - state: touch + state: directory recurse: yes owner: "{{ item }}" group: "{{ item }}" -- cgit v1.2.3 From accb338b3ad6487ce1b82dd24ed38a6de5edaa19 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 10:51:44 -0500 Subject: one step at a time... --- kali.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index b9b88eb..ed5095e 100644 --- a/kali.yml +++ b/kali.yml @@ -229,6 +229,7 @@ ansible.builtin.blockinfile: path: "~{{ item }}/.config/kitty/kitty.conf" insertafter: EOF + create: yes state: present block: | # New windows open in current directory -- cgit v1.2.3 From c059e2bf4d0050f7e08b38944c1065c2fde4d278 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 11:28:13 -0500 Subject: Bugfixes and more documentation --- kali.yml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kali.yml') diff --git a/kali.yml b/kali.yml index ed5095e..7a65a77 100644 --- a/kali.yml +++ b/kali.yml @@ -113,6 +113,14 @@ - make - make install + - name: Install trufflehog + ansible.builtin.pip: + name: trufflehog + + - name: Install LDAPDomainDump + ansible.builtin.pip: + name: ldapdomaindump + - name: Clone Nishang ansible.builtin.git: repo: 'https://github.com/samratashok/nishang' -- cgit v1.2.3