Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/refacto/rm_useless_things' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	sources/install/common.sh
  • Loading branch information
ShutdownRepo committed Sep 14, 2023
2 parents ed04443 + 1c9e6ca commit 5bb1728
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 94 deletions.
1 change: 0 additions & 1 deletion sources/assets/zsh/history.d/msfconsole

This file was deleted.

86 changes: 0 additions & 86 deletions sources/install/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,6 @@ function fapt() {
apt-fast install -y --no-install-recommends "$@"
}

function fapt-noexit() {
# This function tries the same thing as fapt but doesn't exit in case something's wrong.
# Example: a package exists in amd64 but not arm64. I didn't find a way of knowing that beforehand.
colorecho "Installing (no-exit) apt package(s): $*"
apt-get install -y --no-install-recommends "$*" || echo -e "${RED}[EXEGOL ERROR] Package(s) $* probably doesn't exist for architecture $(uname -m), or no installation candidate was found, or some other error...${NOCOLOR}" 2>&1
}

function fapt-history() {
fapt "$@"
for i in "$@"; do
add-history "$i"
done
}

function fapt-aliases() {
fapt "$@"
for i in "$@"; do
add-aliases "$i"
done
}

function fapt-history-aliases() {
fapt "$@"
for i in "$@"; do
add-history "$i"
add-aliases "$i"
done
}

function set_go_env() {
colorecho "Setting golang environment variables for installation"
export GO111MODULE=on
Expand All @@ -93,63 +64,6 @@ function set_ruby_env() {
rvm use 3.0.0@default
}

function install_pipx_git_tool() {
colorecho "Installing $2 with pipx"
pipx install $1
if [ "$3" ]
then
add-test-command $3
fi
if [[ "$*" == *"history"* ]]
then
add-history $2
fi
}

function install_go_tool() {
colorecho "Installing $2 with Golang"
go install -v $1
if [ "$3" ]
then
add-test-command $3
fi
if [[ "$*" == *"history"* ]]
then
add-history $2
fi
}

function install_pipx_tool() {
colorecho "Installing $1 with pipx"
pipx install $1
if [ "$2" ]
then
add-test-command $2
fi
if [[ "$*" == *"history"* ]]
then
add-history $1
fi
}

function install_apt_tool() {
colorecho "Installing $1 with apt"
fapt $1
if [ "$2" ]
then
add-test-command $2
fi
if [[ "$*" == *"history"* ]]
then
add-history $1
fi

if [[ "$*" == *"aliases"* ]]
then
add-aliases $1
fi
}

### Catch & retry definitions

function catch_and_retry() {
Expand Down
20 changes: 15 additions & 5 deletions sources/install/package_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,23 @@ function package_base() {
less x11-apps net-tools vim nano jq iputils-ping iproute2 tidy mlocate libtool \
dos2unix ftp sshpass telnet nfs-common ncat netcat-traditional socat rdate putty \
screen p7zip-full p7zip-rar unrar xz-utils xsltproc parallel tree ruby ruby-dev ruby-full bundler \
nim perl libwww-perl openjdk-17-jre openjdk-11-jre openjdk-11-jdk-headless openjdk-17-jdk-headless openjdk-11-jdk openjdk-17-jdk openvpn openresolv logrotate tmux tldr bat python3-pyftpdlib libxml2-utils \
virtualenv chromium libsasl2-dev python-dev libldap2-dev libssl-dev isc-dhcp-client sqlite3
nim perl libwww-perl openjdk-17-jre openjdk-11-jre openjdk-11-jdk-headless openjdk-17-jdk-headless \
openjdk-11-jdk openjdk-17-jdk openvpn openresolv logrotate tmux tldr bat python3-pyftpdlib libxml2-utils \
virtualenv chromium libsasl2-dev python-dev libldap2-dev libssl-dev isc-dhcp-client sqlite3 dnsutils samba \
ssh snmp faketime php python3 grc emacs-nox xsel
chsh -s /bin/zsh

fapt-history dnsutils samba ssh snmp faketime
fapt-aliases php python3 grc emacs-nox xsel
add-history dnsutils
add-history samba
add-history ssh
add-history snmp
add-history faketime

add-aliases php
add-aliases python3
add-aliases grc
add-aliases emacs-nox
add-aliases xsel
add-aliases pyftpdlib

install_rust_cargo
Expand Down Expand Up @@ -323,7 +334,6 @@ function package_base() {
add-test-command "bat --version"
DEBIAN_FRONTEND=noninteractive fapt macchanger # Macchanger
install_gf # wrapper around grep
fapt-noexit rar # rar (Only AMD)
install_firefox

cp -v /root/sources/assets/grc/grc.conf /etc/grc.conf # grc
Expand Down
3 changes: 1 addition & 2 deletions sources/install/package_c2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function install_pwncat() {
}

function install_metasploit() {
# CODE-CHECK-WHITELIST=add-aliases
# CODE-CHECK-WHITELIST=add-aliases,add-history
colorecho "Installing Metasploit"
fapt libpcap-dev libpq-dev zlib1g-dev libsqlite3-dev
mkdir /tmp/metasploit_install
Expand All @@ -29,7 +29,6 @@ function install_metasploit() {
bundle install --gemfile /opt/metasploit-framework/embedded/framework/Gemfile
rvm use 3.0.0@default
# https://github.com/ruby/fileutils/issues/22 -> Warnings
add-history msfconsole
add-test-command "msfconsole --help"
add-test-command "msfvenom --help|&grep 'Metasploit standalone payload generator'"
add-to-list "metasploit,https://github.com/rapid7/metasploit-framework,A popular penetration testing framework that includes many exploits and payloads"
Expand Down

0 comments on commit 5bb1728

Please sign in to comment.