-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmsfconsole
38 lines (37 loc) · 1.06 KB
/
msfconsole
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/data/data/com.termux/files/usr/bin/bash
SCRIPT_NAME=$(basename "$0")
METASPLOIT_PATH="${PREFIX}/opt/metasploit-framework"
# set ruby version
android=$(getprop ro.build.version.release)
#if [ ${android%%.*} -ge 7 ]; then
# RUBYVER=3.0.0
#else
RUBYVER=2.7.0
#fi
# Fix ruby bigdecimal extensions linking error.
case "$(uname -m)" in
aarch64)
export LD_PRELOAD="${PREFIX}/lib/ruby/$RUBYVER/aarch64-linux-android/bigdecimal.so:$LD_PRELOAD"
;;
arm*)
export LD_PRELOAD="${PREFIX}/lib/ruby/$RUBYVER/arm-linux-androideabi/bigdecimal.so:$LD_PRELOAD"
;;
i686)
export LD_PRELOAD="${PREFIX}/lib/ruby/$RUBYVER/i686-linux-android/bigdecimal.so:$LD_PRELOAD"
;;
x86_64)
export LD_PRELOAD="${PREFIX}/lib/ruby/$RUBYVER/x86_64-linux-android/bigdecimal.so:$LD_PRELOAD"
;;
*)
;;
esac
case "$SCRIPT_NAME" in
msfconsole|msfd|msfrpc|msfrpcd|msfvenom)
pg_ctl --silent --log=$HOME/.log_msf -D $PREFIX/var/lib/postgresql restart &> /dev/null
exec ruby "$METASPLOIT_PATH/$SCRIPT_NAME" "$@"
;;
*)
echo "[!] Unknown Metasploit command '$SCRIPT_NAME'."
exit 1
;;
esac