summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fedele <dan.fedele@gmail.com>2022-11-07 11:36:13 -0500
committerGitHub <noreply@github.com>2022-11-07 11:36:13 -0500
commit4149814addc0747dc4e40590085ec4a626f9ae5a (patch)
tree78cc85e218e6367259aa0a1dd7032e9a68a31e7c
parentc1c81a728173638abf84ad21df34d398fa956240 (diff)
parent27dc9030e0de0c6622ae3f2cde189988d4a8464a (diff)
Merge pull request #2 from AgroDan/dev
Dev
-rw-r--r--README.md22
-rw-r--r--kali.yml168
-rw-r--r--master-bashrc116
-rw-r--r--parrot.yml265
-rw-r--r--setup-kali.sh63
-rw-r--r--setup-parrot.sh69
-rw-r--r--setup.sh53
-rw-r--r--tmux_conf (renamed from master-tmux_conf)0
-rw-r--r--zsh_functions.zsh17
9 files changed, 203 insertions, 570 deletions
diff --git a/README.md b/README.md
index 4b9b4a5..c665a63 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Fresh Install
+# Golden Kali
I believe every Kali VM should be ephemeral. Build it, do your damage, then blow it away. While that's impractical to do it for every single engagement, and since Kali is *almost perfect*, there are still a bunch of things that I modify after a fresh Kali build. Since re-doing all of those tasks is tiresome, I decided to create a solid foundation of "good enough" to start off a fresh build of Kali and download all of the tools I find myself using all the time. So I made this script. It starts a bash script to install pip, then install ansible, then use ansible to download all the appropriate packages, clone the appropriate repositories, and make the appropriate modifications to the system to get it to a point close enough to how I like.
And if you don't like my modifications, I encourage you to fork this repo and make your own changes.
@@ -6,10 +6,22 @@ And if you don't like my modifications, I encourage you to fork this repo and ma
## Usage
If you just started up a new instance of **Kali**, to get it to a "proper working setup" that I've come to like, simply run the following command from a terminal:
-`curl -sL https://raw.github.com/AgroDan/FreshInstall/master/setup-kali.sh | sudo bash`
+```bash
+git clone https://github.com/AgroDan/golden-kali.git && sudo bash ./golden-kali/setup.sh
+```
-I also dabble a bit in **Parrot OS**. I've since created a similar bootstrap for it as well:
+The previous command used to be a `curl` instruction piped to `bash`. I changed that to a `git clone` instead to change up the way files would be included. It was cleaner and I was able to mess around with ansible's conditional logic a bit more. Note you are still allowing code to execute as the root user to install various tools that *I personally* find very useful. They may not be what you find useful, they may not be what you prefer. Please review the code above as it is all open source for your assurance. Know this: I may be installing malicious software, but I wish no mal-intent to you. Peace, love, and hack all the things.
-`curl -sL https://raw.github.com/AgroDan/FreshInstall/master/setup-parrot.sh | sudo bash`
+## Changelog
-I know the flippant instruction of "copy this curl | bash command as root" is scary, but this is after all github, so feel free to look through the provided code to know that I'm not installing some crazy backdoor or anything. I may be installing malicious software, but I wish no mal-intent to you. Peace, love, and hack all the things.
+I made some significant changes to this repository from the previous iteration. First, the name has been changed to `golden-kali`. Second, I have removed support for ParrotOS. It's generally something I don't use all that often to support it, so this is what you have. I'm sure you can apply all of the ideas here for a ParrotOS build as well if that's your thing.
+
+Many of the changes here came as a result of this repository being included as a necessary install step process for the Red Team at [DoE's Cyberforce Competition](https://cyberforce.energy.gov/cyberforce-competition/) in 2022. The code was modified heavily for the event's exhaustive playbook. I took what I had learned there and simply applied it here.
+
+## Caveat Emptor
+
+Through exhaustive testing and re-testing, we have determined that this will install approximately 13 Gigabytes of data onto your Kali machine. It is advised that you have at least 15 Gigabytes free before running this installer!
+
+Despite all of our efforts, no one has been able to get this script to work on Apple's M1 architecture. This is for AMD64 only. Sorry!
+
+This script takes a _long_ time to complete. The longest step is patching and updating the machine before executing any of the plays. It is advised for your own sanity to ensure that your machine is patched to the latest before running this script. \ No newline at end of file
diff --git a/kali.yml b/kali.yml
index fea5dfb..7a65a77 100644
--- a/kali.yml
+++ b/kali.yml
@@ -9,6 +9,11 @@
ysoserial_jar: "https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar"
kitty_installer: "https://sw.kovidgoyal.net/kitty/installer.sh"
tasks:
+ - 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
ansible.builtin.shell: curl -fsSL {{ docker_repo_key }} | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/docker-ce-keyring.gpg
@@ -33,53 +38,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
@@ -101,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'
@@ -182,12 +202,17 @@
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.command: "/usr/bin/curl -sL {{ kitty_installer }} | sh /dev/sdtin 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:
- dest: "/usr/share/applications"
+ dest: "/usr/share/applications/kitty.desktop"
content: |
[Desktop Entry]
Version=0.26.2
@@ -196,6 +221,36 @@
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/"
+ state: directory
+ recurse: yes
+ owner: "{{ item }}"
+ group: "{{ item }}"
+ mode: 0755
+
+ - name: Prepare personalized configs for Kitty 🐱
+ loop: "{{ users.stdout_lines }}"
+ ansible.builtin.blockinfile:
+ path: "~{{ item }}/.config/kitty/kitty.conf"
+ insertafter: EOF
+ create: yes
+ 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:
@@ -207,36 +262,45 @@
set mouse=
set ttymouse=
- - name: Getting all interactive users <<hack hack hack>>
- 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"
- owner: "{{ item }}"
- group: "{{ item }}"
- mode: '0640'
+ - name: Enabling zsh functions
loop: "{{ users.stdout_lines }}"
-
+ ansible.builtin.blockinfile:
+ path: "~{{ item }}/.zshrc"
+ state: present
+ insertafter: EOF
+ owner: "{{ item }}"
+ 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 }}"
diff --git a/master-bashrc b/master-bashrc
deleted file mode 100644
index d509df6..0000000
--- a/master-bashrc
+++ /dev/null
@@ -1,116 +0,0 @@
-# ~/.bashrc: executed by bash(1) for non-login shells.
-
-# You may uncomment the following lines if you want `ls' to be colorized:
-# export LS_OPTIONS='--color=auto'
-# eval "`dircolors`"
-# alias ls='ls $LS_OPTIONS'
-# alias ll='ls $LS_OPTIONS -l'
-# alias l='ls $LS_OPTIONS -lA'
-#
-# Some more alias to avoid making mistakes:
-# alias rm='rm -i'
-# alias cp='cp -i'
-# alias mv='mv -i'
-# ~/.bashrc: executed by bash(1) for non-login shells.
-# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
-# for examples
-
-# don't put duplicate lines or lines starting with space in the history.
-# See bash(1) for more options
-HISTCONTROL=ignoreboth
-
-# append to the history file, don't overwrite it
-shopt -s histappend
-
-# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
-HISTSIZE=1000
-HISTFILESIZE=2000
-
-# check the window size after each command and, if necessary,
-# update the values of LINES and COLUMNS.
-shopt -s checkwinsize
-
-# If set, the pattern "**" used in a pathname expansion context will
-# match all files and zero or more directories and subdirectories.
-#shopt -s globstar
-
-# make less more friendly for non-text input files, see lesspipe(1)
-#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
-
-# set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
- debian_chroot=$(cat /etc/debian_chroot)
-fi
-
-# set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
- xterm-color) color_prompt=yes;;
-esac
-
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
-force_color_prompt=yes
-
-if [ -n "$force_color_prompt" ]; then
- if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
- # We have color support; assume it's compliant with Ecma-48
- # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
- # a case would tend to support setf rather than setaf.)
- color_prompt=yes
- else
- color_prompt=
- fi
-fi
-
-# This is just a better prompt
-if [ "$color_prompt" = yes ]; then
- PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\] "
-else
- PS1='┌──[\u@\h]─[\w]\n└──╼ \$ '
-fi
-
-# enable color support of ls and also add handy aliases
-if [ -x /usr/bin/dircolors ]; then
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
- alias ls='ls --color=auto'
- #alias dir='dir --color=auto'
- #alias vdir='vdir --color=auto'
-
- alias grep='grep --color=auto'
- alias fgrep='fgrep --color=auto'
- alias egrep='egrep --color=auto'
-fi
-
-# some more ls aliases
-#alias ll='ls -l'
-#alias la='ls -A'
-#alias l='ls -CF'
-
-# Alias definitions.
-# You may want to put all your additions into a separate file like
-# ~/.bash_aliases, instead of adding them here directly.
-# See /usr/share/doc/bash-doc/examples in the bash-doc package.
-
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
-fi
-
-# I like my own functions file
-if [ -f ~/.bash_functions ]; then
- . ~/.bash_functions
-fi
-
-# enable programmable completion features (you don't need to enable
-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
-# sources /etc/bash.bashrc).
-if ! shopt -oq posix; then
- if [ -f /usr/share/bash-completion/bash_completion ]; then
- . /usr/share/bash-completion/bash_completion
- elif [ -f /etc/bash_completion ]; then
- . /etc/bash_completion
- fi
-fi
-
-# My classic opener, props to liveoverflow
-echo "Knock knock, Agr0."
diff --git a/parrot.yml b/parrot.yml
deleted file mode 100644
index c599d63..0000000
--- a/parrot.yml
+++ /dev/null
@@ -1,265 +0,0 @@
----
- - hosts: localhost
- become: yes
- vars:
- docker_repo_key: "https://download.docker.com/linux/debian/gpg"
- docker_repo: "deb [arch=amd64] https://download.docker.com/linux/debian buster stable"
- sublime_repo_key: "https://download.sublimetext.com/sublimehq-pub.gpg"
- sublime_repo: "deb https://download.sublimetext.com/ apt/stable/"
- ysoserial_jar: "https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar"
- # good_repo:
- # - "deb https://mirror.clarkson.edu/parrot/ rolling main contrib non-free"
- # - "deb-src https://mirror.clarkson.edu/parrot/ rolling main contrib non-free"
- # bad_repo:
- # - "deb https://deb.parrot.sh/parrot/ rolling main contrib non-free"
- # - "deb-src https://deb.parrot.sh/parrot/ rolling main contrib non-free"
- tasks:
- - name: Add Docker Repo Key
- ansible.builtin.apt_key:
- url: "{{ docker_repo_key }}"
- state: present
-
- - name: Add Docker Repo
- ansible.builtin.apt_repository:
- repo: "{{ docker_repo }}"
- state: present
-
- - name: Add Sublime Text Repo Key
- ansible.builtin.apt_key:
- url: "{{ sublime_repo_key }}"
- state: present
-
- - name: Add Sublime Text Repo
- ansible.builtin.apt_repository:
- repo: "{{ sublime_repo }}"
- state: present
-
- # - name: Not using auto-repo (this may work for you, but not for me)
- # apt_repository:
- # repo: "{{ item }}"
- # state: absent
- # loop: "{{ bad_repo }}"
-
- # - name: Specifying a better repo
- # apt_repository:
- # repo: "{{ item }}"
- # state: present
- # loop: "{{ good_repo }}"
-
- - name: Ensuring all packages are up to date
- ansible.builtin.apt:
- update_cache: yes
- upgrade: dist
-
- - name: Get this neovim crap outta here (╯°□°)╯︵ ┻━┻
- ansible.builtin.apt:
- name: neovim
- state: absent
-
- - name: Installing one-off packages from package manager
- ansible.builtin.apt:
- update_cache: yes
- name:
- - vim
- - gawk
- - terminator
- - gobuster
- - python3-dev
- - python3-pip
- - pipx
- - neo4j
- - rlwrap
- - eog
- - xclip
- - steghide
- - git
- - ltrace
- - strace
- - gdb
- - gdbserver
- - docker
- - docker-compose
- - forensics-extra
- - ncat
- - jq
- - powershell
- - samba
- - tmux
- - libssl-dev
- - libffi-dev
- - build-essential
- - open-vm-tools
- - open-vm-tools-desktop
- - remmina
- - sublime-text
- state: latest
- force_apt_get: yes
-
- - name: Install CrackMapExec
- community.general.pipx:
- name: crackmapexec
-
- - name: Install ShellUp!
- ansible.builtin.git:
- repo: 'https://github.com/AgroDan/shellup.git'
- dest: /opt/shellup
-
- - name: Install Seclists (Kali has this in the repos)
- ansible.builtin.git:
- repo: 'https://github.com/danielmiessler/SecLists.git'
- dest: /opt/seclists
-
- - name: Install pwntools
- ansible.builtin.pip:
- name: git+https://github.com/Gallopsled/pwntools.git@dev
-
- - name: Clone Invoke-Obfuscation (•_•) ( •_•)>⌐■-■ (⌐■_■)
- ansible.builtin.git:
- repo: 'https://github.com/danielbohannon/Invoke-Obfuscation'
- dest: /opt/Invoke-Obfuscation
-
- - name: Clone JumboJohn
- ansible.builtin.git:
- repo: 'https://github.com/magnumripper/JohnTheRipper'
- dest: /opt/JohnTheRipper
-
- - name: Compiling JumboJohn, hold onto yer butts...
- ansible.builtin.command: chdir=/opt/JohnTheRipper/src {{ item }}
- with_items:
- - ./configure
- - make
- - make install
-
- - name: Clone Nishang
- ansible.builtin.git:
- repo: 'https://github.com/samratashok/nishang'
- dest: /opt/nishang
-
- - name: Clone Chisel
- ansible.builtin.git:
- repo: 'https://github.com/jpillora/chisel'
- dest: /opt/chisel
-
- - name: Clone LinEnum
- ansible.builtin.git:
- repo: 'https://github.com/rebootuser/LinEnum'
- dest: /opt/LinEnum
-
- - name: Clone PEASS
- ansible.builtin.git:
- repo: 'https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite'
- dest: /opt/privilege-escalation-awesome-scripts-suite
-
- - name: Clone PowerSploit
- ansible.builtin.git:
- repo: 'https://github.com/PowerShellMafia/PowerSploit'
- dest: /opt/PowerSploit
-
- - name: Clone Impacket
- ansible.builtin.git:
- repo: 'https://github.com/SecureAuthCorp/impacket'
- dest: /opt/impacket
-
- - name: Clone Bloodhound
- ansible.builtin.git:
- repo: 'https://github.com/BloodHoundAD/BloodHound'
- dest: /opt/BloodHound
-
- - name: Clone Gef
- ansible.builtin.git:
- repo: 'https://github.com/hugsy/gef.git'
- dest: /opt/gef
-
- - name: Clone Static Binaries
- ansible.builtin.git:
- repo: 'https://github.com/andrew-d/static-binaries'
- dest: /opt/static-binaries
-
- - name: Clone Ysoserial
- ansible.builtin.git:
- repo: 'https://github.com/frohoff/ysoserial'
- dest: /opt/ysoserial
-
- - name: Downloading Ysoserial JAR file
- ansible.builtin.get_url:
- url: "{{ ysoserial_jar }}"
- dest: /opt/ysoserial/ysoserial-all.jar
- mode: '0644'
-
- - name: Get Evil-WinRM via gem installer
- ansible.builtin.gem:
- name: evil-winrm
- state: latest
- user_install: no
-
- - name: Disable mouse interactivity in vim (╯°□°)╯︵ ┻━┻
- ansible.builtin.blockinfile:
- path: /etc/vim/vimrc
- marker: "\" {mark} ANSIBLE MANAGED BLOCK"
- insertafter: EOF
- state: present
- block: |
- set mouse=
- set ttymouse=
-
- - name: Getting all interactive users <<hack hack hack>>
- ansible.builtin.shell: "awk -F: '{ if (($3 >= 1000 && $3 != 65534) || $3 == 0) print $1}' /etc/passwd"
- register: users
-
- - 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
- ansible.builtin.copy:
- src: /tmp/master-bashrc
- dest: "~{{ item }}/.bashrc"
- 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"
- owner: "{{ item }}"
- group: "{{ item }}"
- mode: '0640'
- loop: "{{ users.stdout_lines }}"
-
- - name: Copying over tmux config to all users
- ansible.builtin.copy:
- src: /tmp/master-tmux_conf
- dest: "~{{ item }}/.tmux.conf"
- owner: "{{ item }}"
- group: "{{ item }}"
- mode: '0640'
- loop: "{{ users.stdout_lines }}"
-
- - name: Create /srv/smb/ directory for payload population
- ansible.builtin.file:
- path: /srv/smb
- state: directory
- mode: '0755'
-
- - name: Creating IWR share in samba config
- ansible.builtin.blockinfile:
- path: /etc/samba/smb.conf
- insertafter: EOF
- state: present
- block: |
- [iwr]
- comment = Invoke-WebReq'd em? Damn near killed em!
- path = /srv/smb
- guest ok = yes
- browseable = yes
- create mask = 0600
- directory mask = 0755
-
- - name: Ensure that samba doesn't start on boot
- ansible.builtin.systemd:
- name: smbd
- enabled: no
- state: stopped
diff --git a/setup-kali.sh b/setup-kali.sh
deleted file mode 100644
index d8f2471..0000000
--- a/setup-kali.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-
-if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as sudo or root."
- exit 1
-fi
-
-# Generate psuedo-random string to fool servers into not giving you
-# cached crap, mostly for debugging purposes. This is kinda neato
-RANDO=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1)
-
-echo "***********************************"
-echo "* Installing pip *"
-echo "***********************************"
-
-curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
-python3 /tmp/get-pip.py --user --no-warn-script-location
-
-export PATH=$PATH:/root/.local/bin
-
-echo "***********************************"
-echo "* Installing ansible *"
-echo "***********************************"
-
-pip install ansible
-
-echo "***********************************"
-echo "* Pulling master bashrc *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-bashrc?nocache=$RANDO" -o /tmp/master-bashrc
-
-echo "***********************************"
-echo "* Pulling bash_functions *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-bash_functions?nocache=$RANDO" -o /tmp/master-bash_functions
-
-echo "***********************************"
-echo "* Pulling .tmux.conf *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-tmux_conf?nocache=$RANDO" -o /tmp/master-tmux_conf
-
-echo "***********************************"
-echo "* Running Kali playbook *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/kali.yml?nocache=$RANDO" -o /tmp/kali.yml
-
-ansible-playbook /tmp/kali.yml
-
-echo "***********************************"
-echo "* Cleaning up *"
-echo "***********************************"
-
-rm -f /tmp/master-bashrc /tmp/master-bash_functions /tmp/master-tmux_conf /tmp/get-pip.py /tmp/kali.yml
-
-echo "***********************************"
-echo "* Done! *"
-echo "***********************************"
-
-echo "You should be set up. Check above for any errors."
diff --git a/setup-parrot.sh b/setup-parrot.sh
deleted file mode 100644
index 314719e..0000000
--- a/setup-parrot.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-
-if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as sudo or root."
- exit 1
-fi
-
-# Generate psuedo-random string to fool servers into not giving you
-# cached crap, mostly for debugging purposes. This is kinda neato
-RANDO=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1)
-
-echo "***********************************"
-echo "* Installing pip *"
-echo "***********************************"
-
-curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
-python3 /tmp/get-pip.py --user --no-warn-script-location
-
-export PATH=$PATH:/root/.local/bin
-
-echo "***********************************"
-echo "* Installing ansible *"
-echo "***********************************"
-
-pip install ansible
-
-echo "***********************************"
-echo "* Installing Ansible Collection *"
-echo "***********************************"
-
-ansible-galaxy collection install community.general
-
-echo "***********************************"
-echo "* Pulling master bashrc *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-bashrc?nocache=$RANDO" -o /tmp/master-bashrc
-
-echo "***********************************"
-echo "* Pulling bash_functions *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-bash_functions?nocache=$RANDO" -o /tmp/master-bash_functions
-
-echo "***********************************"
-echo "* Pulling .tmux.conf *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/master-tmux_conf?nocache=$RANDO" -o /tmp/master-tmux_conf
-
-echo "***********************************"
-echo "* Running ParrotOS playbook *"
-echo "***********************************"
-
-curl -sL "http://raw.github.com/AgroDan/FreshInstall/master/parrot.yml?nocache=$RANDO" -o /tmp/parrot.yml
-
-ansible-playbook /tmp/parrot.yml
-
-echo "***********************************"
-echo "* Cleaning up *"
-echo "***********************************"
-
-rm -f /tmp/master-bashrc /tmp/master-bash_functions /tmp/master-tmux_conf /tmp/get-pip.py /tmp/parrot.yml
-
-echo "***********************************"
-echo "* Done! *"
-echo "***********************************"
-
-echo "You should be set up. Check above for any errors."
diff --git a/setup.sh b/setup.sh
new file mode 100644
index 0000000..2148bd8
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# Exit immediately on failure
+set -eu
+
+# Are we running in bash?
+# Single bracket to be posix compliant in case we run in sh or something
+if [ -z ${BASH} ]; then
+ echo "This script must be run from the Bash shell!"
+ exit 1
+fi
+
+# Are we root?
+if [[ $EUID -ne 0 ]]; then
+ echo "This script must be run as sudo or root."
+ exit 2
+fi
+
+PATH_TO_SCRIPT=$(dirname $(readlink -f $0))
+ZSH_FUNC_FILE="zsh_functions.zsh"
+TMUX_FILE="tmux_conf"
+
+if [[ ! -e ${PATH_TO_SCRIPT}/${ZSH_FUNC_FILE} ]] && [[ ! -e ${PATH_TO_SCRIPT}/${TMUX_FILE} ]]; then
+ echo "Cannot find supporting files! Please clone repository and try again!"
+ exit 3
+fi
+
+echo "***********************************"
+echo "* Installing pip *"
+echo "***********************************"
+
+curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
+python3 /tmp/get-pip.py --user --no-warn-script-location
+
+export PATH=$PATH:/root/.local/bin
+
+echo "***********************************"
+echo "* Installing ansible *"
+echo "***********************************"
+
+pip install ansible
+
+echo "***********************************"
+echo "* Running Kali playbook *"
+echo "***********************************"
+
+ansible-playbook ${PATH_TO_SCRIPT}/kali.yml --extra-vars "tmux=${PATH_TO_SCRIPT}/${TMUX_FILE} zsh_func=${PATH_TO_SCRIPT}/${ZSH_FUNC_FILE}"
+
+echo "***********************************"
+echo "* Done! *"
+echo "***********************************"
+
+echo "You should reboot your system now."
diff --git a/master-tmux_conf b/tmux_conf
index 55cf067..55cf067 100644
--- a/master-tmux_conf
+++ b/tmux_conf
diff --git a/zsh_functions.zsh b/zsh_functions.zsh
new file mode 100644
index 0000000..5dd56f6
--- /dev/null
+++ b/zsh_functions.zsh
@@ -0,0 +1,17 @@
+# This is a handy list of functions I use
+
+scan() {
+ SCANDIR="${PWD}/nmap_scans"
+ if [ -z $1 ];
+ then
+ read "TARGET?Enter a target: "
+ else
+ TARGET=$1
+ fi
+
+ echo "Scanning ${TARGET}..."
+ mkdir -p $SCANDIR
+ sudo nmap -sS -sV -sC -oN $SCANDIR/initial-scan -v $TARGET
+ sudo nmap -sS -p- -oN $SCANDIR/allports -v0 $TARGET &disown
+ sudo nmap -sU -oN $SCANDIR/udpports -v0 $TARGET &disown
+} \ No newline at end of file