Automated vulnerability scanning and exploitation Dennis Pellikaan - - PowerPoint PPT Presentation

automated vulnerability scanning and exploitation
SMART_READER_LITE
LIVE PREVIEW

Automated vulnerability scanning and exploitation Dennis Pellikaan - - PowerPoint PPT Presentation

Automated vulnerability scanning and exploitation Dennis Pellikaan Thijs Houtenbos University of Amsterdam System and Network Engineering July 4, 2013 Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 1 / 20


slide-1
SLIDE 1

Automated vulnerability scanning and exploitation

Dennis Pellikaan Thijs Houtenbos

University of Amsterdam

System and Network Engineering

July 4, 2013

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 1 / 20

slide-2
SLIDE 2

Introduction

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 2 / 20

slide-3
SLIDE 3

Research question

How feasible is an automated approach to compromise servers using a known source code attack on a large scale?

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 3 / 20

slide-4
SLIDE 4

Collect scripts

Collected scripts

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 4 / 20

slide-5
SLIDE 5

Analyse scripts

SQL Injection mysql_query ("SELECT * FROM users WHERE id=’$_GET[id]’"); File Inclusion require $_POST["lang_install"].".php"; Command Injection exec ($_GET[’com’], $result);

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 5 / 20

slide-6
SLIDE 6

Analyse scripts

Vulnerable scripts

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 6 / 20

slide-7
SLIDE 7

Analyse scripts

Vulnerable categories

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 7 / 20

slide-8
SLIDE 8

Exploit vulnerabilities

SQL Injection mysql_query ("SELECT * FROM users WHERE id=’$_GET[id]’"); File Inclusion require $_POST["lang_install"].".php"; Command Injection exec ($_GET[’com’], $result);

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 8 / 20

slide-9
SLIDE 9

Exploit vulnerabilities

SQL Injection

  • verride_function (mysql_query, log_function);

File Inclusion 338 require $_POST["lang_install"].".php"; 338 log_function ($_POST["lang_install"].".php"); Command Injection 183 exec ($_GET[’com’], $result); 183 log_function ($_GET[’com’], $result);

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 9 / 20

slide-10
SLIDE 10

Exploit vulnerabilities

Exploitability

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 10 / 20

slide-11
SLIDE 11

Search

Google Advanced Search Operators

allinurl:"/page.php?page_id=" allintitle:"My special script v0.2a"

Selective results Rate-limiting, CAPTCHA, IPv6 20,000 search queries per day 120,000 results with 22,000 queries

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 11 / 20

slide-12
SLIDE 12

Search

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 12 / 20

slide-13
SLIDE 13

Validate search results

Installation root

http://www.example.com/users/script/install/admin.php /sourceforge/special1.0/install/admin.php

File comparison with bundled files (readme.txt, style.css, etc) Hash and text matching Scoring system based on matching 1,555 results had a perfect match 4,214 results had a partial match

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 13 / 20

slide-14
SLIDE 14

Results

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 14 / 20

slide-15
SLIDE 15

Example (1)

42 $sql = mysql_query("UPDATE users SET userid=’$_GET[userid]’

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 15 / 20

slide-16
SLIDE 16

Example (1)

42 $sql = mysql_query("UPDATE users SET userid=’$_GET[userid]’

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 16 / 20

slide-17
SLIDE 17

Example (2)

47 $sql="update staff set first_name=’$_POST[fname]’, last_name=’$_POST[lname]’, middle_name=’$_POST[mname]’, username=’".$_SESSION[’admin_name’]."’, password=’".$_SESSION[’admin_pwd’]."’, profile_id=1 where username=’admin’ "; 48 $result = mysql_query($sql);

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 17 / 20

slide-18
SLIDE 18

Example (2)

47 $sql="update staff set first_name=’$_POST[fname]’, last_name=’$_POST[lname]’, middle_name=’$_POST[mname]’, username=’".$_SESSION[’admin_name’]."’, password=’".$_SESSION[’admin_pwd’]."’, profile_id=1 where username=’admin’ "; 48 $result = mysql_query($sql);

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 18 / 20

slide-19
SLIDE 19

Conclusion

How feasible is an automated approach to compromise servers using a known source code attack on a large scale? Lots of components in the system, all with own quirks Almost 6,000 vulnerable servers identified Process can run continuously for more results More input is more output :-)

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 19 / 20

slide-20
SLIDE 20

Questions

Dennis Pellikaan, Thijs Houtenbos Automated vulnerability scanning and exploitation 20 / 20