diff --git a/bin/metasploit.sh b/bin/metasploit.sh new file mode 100755 index 0000000..f20d36b --- /dev/null +++ b/bin/metasploit.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +export NAME=$(basename "$0") +export BASE="/opt/metasploit" # TODO: search this path + +# Autogen'd +. ${BASE}/scripts/setenv.sh + +# Use Pro's bundled gems instead of the gemcache +export MSF_BUNDLE_GEMS=0 +export BUNDLE_GEMFILE=${BASE}/apps/pro/Gemfile + +# Set a flag so Gemfile can limit gems +export FRAMEWORK_FLAG=true + +export MSF_DATABASE_CONFIG=${BASE}/apps/pro/ui/config/database.yml +export TERMINFO=${BASE}/common/share/terminfo/ + +# Check for ruby scripts such as msfconsole directly to avoid having to add +# msf3 to the path. +if [ -f "${BASE}/apps/pro/msf3/${NAME}" ]; then + exec ${BASE}/apps/pro/msf3/${NAME} "$@" +fi +if [ -f "${BASE}/apps/pro/msf3/tools/exploit/${NAME}.rb" ]; then + exec ${BASE}/apps/pro/msf3/tools/exploit/${NAME}.rb "$@" +fi + +exec ${NAME} "$@" diff --git a/bin/nasm_shell b/bin/nasm_shell new file mode 120000 index 0000000..c12a3ea --- /dev/null +++ b/bin/nasm_shell @@ -0,0 +1 @@ +metasploit.sh \ No newline at end of file diff --git a/bin/pattern_create b/bin/pattern_create new file mode 120000 index 0000000..c12a3ea --- /dev/null +++ b/bin/pattern_create @@ -0,0 +1 @@ +metasploit.sh \ No newline at end of file diff --git a/bin/pattern_offset b/bin/pattern_offset new file mode 120000 index 0000000..c12a3ea --- /dev/null +++ b/bin/pattern_offset @@ -0,0 +1 @@ +metasploit.sh \ No newline at end of file diff --git a/dotfiles/zshrc.d/msf.zsh b/dotfiles/zshrc.d/msf.zsh deleted file mode 100644 index 836e7ac..0000000 --- a/dotfiles/zshrc.d/msf.zsh +++ /dev/null @@ -1,18 +0,0 @@ -function _find_msf { - local CHOICES=("/opt/metasploit") - for p in ${CHOICES} ; do - if [ -d ${p} ] ; then - export MSF_PATH=${p} - break - fi - done -} - -_find_msf - -if [ -d ${MSF_PATH}/apps/pro/msf3/ ] ; then - export PATH="${PATH}:${MSF_PATH}/apps/pro/msf3" -fi -alias pattern_create="${MSF_PATH}/apps/pro/msf3/tools/exploit/pattern_create.rb" -alias pattern_offset="${MSF_PATH}/apps/pro/msf3/tools/exploit/pattern_offset.rb" -alias nasm_shell="${MSF_PATH}/apps/pro/msf3/tools/exploit/nasm_shell.rb" diff --git a/install.sh b/install.sh index fefda14..a10990a 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ function install_dotfile_dir { -name install.sh -o \ -name README.md -o \ -name .gitignore \) \ - -prune -o -type f -print | \ + -prune -o -xtype f -print | \ while read dotfile ; do local TARGET="${HOME}/.${dotfile#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"` @@ -43,7 +43,7 @@ function install_basic_dir { local SRCDIR="${1}" local DESTDIR="${2}" local file - find "${SRCDIR}" -type f -print | \ + find "${SRCDIR}" -xtype f -print | \ while read file ; do local TARGET="${2}/${file#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"`