hack using firefox

31
Hack Using Firefox Ahmad Prayitno,CEH [email protected]

Upload: reza-nurfachmi

Post on 15-Apr-2017

88 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Hack using firefox

Hack Using Firefox

Ahmad Prayitno,[email protected]

Page 2: Hack using firefox

Reconnaissance Cross Site Scripting (XSS) Cross Site Request Forgery (CSRF) SQL Injection

Agenda

Page 3: Hack using firefox

Reconnaissance

Page 4: Hack using firefox

What is Reconaissance

Finding as much information about the target as possible before launching the first attack

Page 5: Hack using firefox

Types Of Reconaissance

Active ReconaissancePassive Reconaissance

Page 6: Hack using firefox

Active Reconaissance

Active reconnaissance is a type of reconnaissance in which an attacker engages with the targeted person/corporate to gather information. DNS Whois Netcraft Archives Search Engine Social Media

Page 7: Hack using firefox

Passive Reconnaissance

Passive reconnaissance is an attempt to gain information about targeted person/corporate without actively engaging with the systems. Go to Target Office Interview with target Read from newspaper Etc

Page 8: Hack using firefox

Useful Information

Names (administrative, technical, billing contacts) for social engineering attack

Telephone numbers Email addresses Format of email addresses eg. [email protected] Family (Wife/Husband, Childre, etc) Places Birthday

Page 9: Hack using firefox

Wappalyzer WorldIP Site Information

Firefox Addon

Page 10: Hack using firefox

XSS

Page 11: Hack using firefox

What is XSS

Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.

Page 12: Hack using firefox

XSS Type

Reflected XSSTriggers off of a linkInteractiveExample : victim.com/{vulnerable_here}

Stored XSSPersistentTriggers when the exploited page is viewedExample : Comment forms

Page 13: Hack using firefox

XSS Attack

XSS attack works this way: The attacker identifies a web site that has one or more XSS bugs (for

example echoing data input, or lacking data input validation) The attacker crafts a special URL that includes a malformed and

malicious querystring containing HTML and script The attacker finds a victim and gets him to click the link The victim clicks the link and the victim’s browser makes a request

to the vulnerable server, passing the malicious querystring. And cookies.

The vulnerable server echoes malicious input, including the script, back to the victim’s browser

The victim’s browser executes the malicious script, which may be crafted to pass data from the victim to the attacker, or other actions

Page 14: Hack using firefox

Cross-Site Scripting Attack in Action

1. The attacker sends a victim a link containing a malicious payload.

2. The victim, tricked into clicking the link, sends a request (and the payload) to the vulnerable application interface.

3. The interface (i.e. a user registration form) accepts the request (and payload), and responds with a confirmation screen. Embedded in the confirmation screen is the malicious code, which has been formatted in such a way that a browser will interpret it as if it were any other JavaScript code.

4. When the victim receives the response, the browser executes the payload, which could send cookie values (including session identifiers) and other sensitive data to the attacker.

Page 15: Hack using firefox

Attack Vectors

Forms that are filled out where values are later presented to the user

Web message boards that allow users to post their own messages

Page 16: Hack using firefox

Why Cookies

Because Cookies is a ticket !

Page 17: Hack using firefox

Firefox Addon

XSS Me Cookie Manager etc

Page 18: Hack using firefox

CSRF

Page 19: Hack using firefox

What is CSRF

Cross-site request forgery, also known as one-click attack or session riding is a type of malicious exploit of a website where unauthorized commands are transmitted from a user that the website trusts. CSRF exploits the trust that a site has in a user's browser.

Page 20: Hack using firefox

Cross-Site Request Forgery

Page 21: Hack using firefox

Threat Models

Client Injects content onto trusted site Unauthorized Application Request

Web Attacker Owns https://www.attacker.com user visit

Page 22: Hack using firefox

Example

Bank Website Request http://bank.com/transfer.do?

acct=budi&amount=100000

Attacker create link <a href="http://bank.com/transfer.do?

acct=hacker&amount=100000">View my Pictures!</a>

Page 23: Hack using firefox

SQL Injection

Page 24: Hack using firefox

What is SQL Injection

SQL Injection is vulnerability in web application which using this method hackers

able to inject SQL commands into the database through input form.

Page 25: Hack using firefox

25

How common is it?

It is probably the most common Website vulnerability today! It is a flaw in "web application" development,

it is not a DB or web server problem Most programmers are still not aware of this problem A lot of the php tutorials & php demo are vulnerable Even worse, a lot of solutions posted on the Internet are not good

enough

Page 26: Hack using firefox

26

Vulnerable Applications

Almost all SQL databases and programming languages are potentially vulnerable MS SQL Server, Oracle, MySQL,

Postgres, DB2, MS Access, Sybase, Informix, etc

PHP, ASP, etc

Page 27: Hack using firefox

27

How does SQL Injection work?

Common vulnerable login query SELECT * FROM users WHERE username = 'ahmad'AND password = 'rahasia'

Page 28: Hack using firefox

28

Injecting through Strings

$username = ' or ‘1’=‘1’ – – $password = anything

Final query would look like this:SELECT * FROM usersWHERE username = ' ' or ‘1’=‘1’ – – AND

password = 'anything'

Page 29: Hack using firefox

29

If it were numeric?

SELECT * FROM clients WHERE account = 12345678AND pin = 1111

PHP/MySQL login syntax$sql = "SELECT * FROM clients WHERE " . "account = $formacct AND " . "pin = $formpin";

Page 30: Hack using firefox

30

Injecting Numeric Fields

$formacct = 1 or 1=1 # $formpin = 1111

Final query would look like this:SELECT * FROM clientsWHERE account = 1 or 1=1 -- AND pin = 1111

Page 31: Hack using firefox

Hack Bar

Firefox Addon