mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 13:19:07 -07:00
Alternative solution for path for MSF tools.
This commit is contained in:
28
bin/metasploit.sh
Executable file
28
bin/metasploit.sh
Executable file
@@ -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} "$@"
|
||||
1
bin/nasm_shell
Symbolic link
1
bin/nasm_shell
Symbolic link
@@ -0,0 +1 @@
|
||||
metasploit.sh
|
||||
1
bin/pattern_create
Symbolic link
1
bin/pattern_create
Symbolic link
@@ -0,0 +1 @@
|
||||
metasploit.sh
|
||||
1
bin/pattern_offset
Symbolic link
1
bin/pattern_offset
Symbolic link
@@ -0,0 +1 @@
|
||||
metasploit.sh
|
||||
@@ -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"
|
||||
@@ -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}"`
|
||||
|
||||
Reference in New Issue
Block a user