26
Automation in Security Prasanna K, Ketan Soni

Selenium Conference 2014 -- Bangalore

Embed Size (px)

DESCRIPTION

Presentation in Selenium Conference @ Banagalore

Citation preview

Page 1: Selenium Conference 2014 -- Bangalore

Automation in SecurityPrasanna K, Ketan Soni

Page 2: Selenium Conference 2014 -- Bangalore

AgendaTypical use of Selenium

Information Security

How To achieve complete coverage

Workflow

Injection Attacks

Conclusion

Page 3: Selenium Conference 2014 -- Bangalore

IntroductionsPrasanna Kanagasabai

Pentester @ ThoughtWorks

Author of IronSAP

Speaker @ various security conferences

Proud OSCP

Ketan Soni

QA @ ThoughtWorks

Page 4: Selenium Conference 2014 -- Bangalore

Typical use of SeleniumUI Automation

Cross Browser Testing

Could We do more …….

Page 5: Selenium Conference 2014 -- Bangalore

Information SecurityExploratory testing

Find Defects

Proactive Harming the system

One of the most Exciting Jobs

Page 6: Selenium Conference 2014 -- Bangalore

How To achieve complete coverage

Applications are ever increasing

Applications Tech stack has become vast

Security attacks have become complex

Security cannot be compromised

Trained resources are finite

Solution : Automation

Page 7: Selenium Conference 2014 -- Bangalore

Workflow

Define a Scenario

Generate Payload

Deliver Payload

Match Results for Success /

Failure

Test Scenario

Identify Test Data

Execution of Test

Scenario’s

Validation

QA Flow

Security Flow

Page 8: Selenium Conference 2014 -- Bangalore

Workflow -- ExampleLogin

without User

Credentials

Password List

Brute force

Script

Login Success /

Failure

Page 9: Selenium Conference 2014 -- Bangalore

How did we arrive @ Selenium

Ajax in Normal “Urllib” Libraries were difficult

Selenium could handle Ajax Requests easily.

Page 10: Selenium Conference 2014 -- Bangalore

Security !!!

Page 11: Selenium Conference 2014 -- Bangalore

SQL Injection

11

admin

adminPass

Username

Password

Submit

SELECT * FROM users WHERE username = ‘admin’ AND password = ‘adminPass’

Page 12: Selenium Conference 2014 -- Bangalore

SQL Injection

12

 ’OR 1=1--' 

BlahBlah

Username

Password

Submit

SELECT * FROM users WHERE username = ‘’

OR 1=1--’’AND password = ‘BlahBlah’

Page 13: Selenium Conference 2014 -- Bangalore

SQL Injection

13

 ’OR 1=1--' 

BlahBlah

Username

Password

Submit

SELECT * FROM users WHERE username = ‘’

OR 1=1

Page 14: Selenium Conference 2014 -- Bangalore

DEMO

14

Page 15: Selenium Conference 2014 -- Bangalore

XSS

15

Search

Page 16: Selenium Conference 2014 -- Bangalore

XSS

16

Hello there friendsSearch

Search results for “Hello there friends”

Page 17: Selenium Conference 2014 -- Bangalore

XSS

17

Hello <script>alert(“Hello World)</script> there friendsSearch

Search results for “Hello

Page 18: Selenium Conference 2014 -- Bangalore

DEMO

18

Page 19: Selenium Conference 2014 -- Bangalore

Command Injection

Ping Host 12.0.0.1

64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.044 ms64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.049 ms64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.040 ms

--- 127.0.0.1 ping statistics ---3 packets transmitted, 3 packets received, 0.0% packet lossround-trip min/avg/max/stddev = 0.040/0.044/0.049/0.004 ms

Page 20: Selenium Conference 2014 -- Bangalore

Command Injection

How do we attack ??

Page 21: Selenium Conference 2014 -- Bangalore

Binary ProtocolsBinary Json, Protobuff

Data is travelling in Mostly HEX

Add code to teach tools

Presented this plugin @ C0C0N

Page 22: Selenium Conference 2014 -- Bangalore

DEMO

22

Page 23: Selenium Conference 2014 -- Bangalore

What More …Cookiejar – for Cookie Management

Suds – Web services Automation

Lxml – Similar to BS4

Json – To work with Json

pyAmf – AMF Protocol

SimpleHTTPServer – Simplest Webserver (python –m SimpleHTTPServer 9080)

Twisted

Page 24: Selenium Conference 2014 -- Bangalore

ConclusionHelps in larger code coverage

Saving time

Careful calibration is needed

Cant fully replace manual testing

Page 25: Selenium Conference 2014 -- Bangalore

Questions [email protected]

[email protected]

@prasannain

@ketan_soni

Thank You !!

Page 26: Selenium Conference 2014 -- Bangalore

References https://github.com/prasanna-in/Random-Scripts