Skip to content

Commit b18f793

Browse files
committed
v1.4.2: Fix for kali-rolling (Close #3)
1 parent e8b5ddf commit b18f793

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

mpc.sh

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
#-Metadata----------------------------------------------------#
3-
# Filename: mpc.sh (v1.4.1) (Update: 2016-01-11) #
3+
# Filename: mpc.sh (v1.4.2) (Update: 2016-01-29) #
44
#-Info--------------------------------------------------------#
55
# Quickly generate Metasploit payloads using msfvenom. #
66
#-Author(s)---------------------------------------------------#
77
# g0tmilk ~ https://blog.g0tmi1k.com/ #
88
#-Operating System--------------------------------------------#
9-
# Designed for & tested on: Kali Linux 2 & Metasploit v4.11+ #
10-
# Reported working: OSX 10.11 + & Kali 1.1 #
9+
# Designed for & tested on: Kali Rolling & Metasploit v4.11+ #
10+
# Reported working: OSX 10.11+ & Kali Linux 1.x / 2.x#
1111
#-Licence-----------------------------------------------------#
1212
# MIT License ~ http://opensource.org/licenses/MIT #
1313
#-Notes-------------------------------------------------------#
@@ -243,7 +243,7 @@ function doHelp {
243243

244244

245245
## Banner
246-
echo -e " ${BLUE}[*]${RESET} ${BLUE}M${RESET}sfvenom ${BLUE}P${RESET}ayload ${BLUE}C${RESET}reator (${BLUE}MPC${RESET} v${BLUE}1.4.1${RESET})"
246+
echo -e " ${BLUE}[*]${RESET} ${BLUE}M${RESET}sfvenom ${BLUE}P${RESET}ayload ${BLUE}C${RESET}reator (${BLUE}MPC${RESET} v${BLUE}1.4.2${RESET})"
247247

248248

249249
## Check system
@@ -474,11 +474,8 @@ if [[ -n "${TYPE}" && -z "${IP}" ]]; then
474474
echo -e "\n ${YELLOW}[i]${RESET} Use which ${BLUE}interface${RESET} - ${YELLOW}IP address${RESET}?:"
475475
I=0
476476
for iface in "${IFACE[@]}"; do
477-
if [[ "$DARWIN" = "true" ]]; then # OSX users
478-
IPs[${I}]="$(\ifconfig "${iface}" | \grep inet | \grep -E '([[:digit:]]{1,2}.){4}' | \sed -e 's_[:|addr|inet]__g; s_^[ \t]*__' | \awk '{print $1}')"
479-
else # nix users
480-
IPs[${I}]="$(\ifconfig "${iface}" | \grep 'inet addr:' | \cut -d':' -f2 | \cut -d' ' -f1)"
481-
fi
477+
IPs[${I}]="$(\ifconfig "${iface}" | \grep inet | \grep -E '([[:digit:]]{1,2}.){4}' | \sed -e 's_[:|addr|inet]__g; s_^[ \t]*__' | \awk '{print $1}')"
478+
[[ -z "${IPs[${I}]}" ]] && IPs[${I}]="$(\ifconfig "${iface}" | \grep 'inet addr:' | \cut -d':' -f2 | \cut -d' ' -f1)"
482479
[[ -z "${IPs[${I}]}" ]] && IPs[${I}]="UNKNOWN"
483480
echo -e " ${YELLOW}[i]${RESET} ${GREEN}$[${I}+1]${RESET}.) ${BLUE}${iface}${RESET} - ${YELLOW}${IPs[${I}]}${RESET}"
484481
I=$[${I}+1]

0 commit comments

Comments
 (0)