SlideShare ist ein Scribd-Unternehmen logo
1 von 56
SECURITY ENGINEER
AJIN ABRAHAM
INJECTING SECURITY 

INTO WEB APPS AT RUNTIME
▸ Security Engineering @
▸ Research on Runtime Application Self Defence
▸ Authored MobSF, Xenotix and NodeJScan
▸ Teach Security: https://opsecx.com
▸ Runs: http://opensecurity.in
#WHOAMI
AGENDA : WHAT THE TALK IS ABOUT?
RASP
WAF
WHAT THE TALK IS NOT ABOUT?
APPSEC CHALLENGES
▸ Writing Secure Code is not Easy
▸ Most follows agile development strategies
▸ Frequent releases and builds
▸ Any release can introduce or reintroduce vulnerabilities
▸ Problems by design. 

Ex: Session Hijacking, Credential Stuffing
STATE OF WEB FRAMEWORK SECURITY
▸ Automatic CSRF Token - Anti CSRF
▸ Templates escapes User Input - No XSS
▸ Uses ORM - No SQLi
You need to use secure APIs or write Code to 

enable some of these
Security Bugs happens when people write bad code.
STATE OF WEB FRAMEWORK SECURITY
▸ Anti CSRF - Can easily be turned off/miss configurations
▸ Templates escapes User Input - Just HTML Escape -> XSS
▸ https://jsfiddle.net/1c4f271c/
▸ Uses ORM - SQLi is still possible
▸ http://rails-sqli.org/
STATE OF WEB FRAMEWORK SECURITY
▸ Remote OS Command Execution - No
▸ Remote Code Injection - No
▸ Server Side Template Injection RCE - No
▸ Session Hijacking - No
▸ Verb Tampering - No
▸ File Upload Restriction - No
The list goes on…..
WE NEED TO PREVENT EXPLOITATION
LET’S USE WAF
▸ First WAF AppShield in 1999, almost 18 years of existence
▸ Quick question : How many of you run a WAF in defence/
protection mode?
▸ Most organisations use them, but in monitor mode due

high rate false positives.
▸ Most WAFs use BLACKLISTS
CAN A WAF SOLVE THIS?
20%
70%
10%
False Negatives False Positive Detection
APPLICATION SECURITY RULE OF THUMB
Gets bypassed, today or tomorrow
WHAT WAF SEES?
ATTACK != VULNERABILITY
HOW WAF WORKS
▸ The strength of WAF is the blacklist
▸ They detect Attacks not Vulnerability
▸ WAF has no application context
▸ Doesn’t know if a vulnerability got exploited inside

the app server or not.
WAFGET http://xyz.com APP SERVER
HTTP REQUEST
HTTP RESPONSE
▸ WAFs used to downgrade your security.
▸ No Perfect Forward Secrecy
▸ Can’t Support elliptic curves like ECDHE
▸ Some started to support with a Reverse Proxy
▸ Organisations are moving to PFS (Heartbleed bug)
▸ SSL Decryption and Re-encryption Overhead
WAF PROBLEMS
TLS 1.3 COMING SOON ….
We can do much better.

It’s time to evolve
WAF - > SAST -> DAST -> IAST -> RASP
Attack Detection 

&

Prevention/Neutralization

+

Precise 

Vulnerability Detection

+

Extras
Attack Detection 

&

Prevention
Vulnerability Detection
Precise 

Vulnerability Detection
RUNTIME APPLICATION SELF DEFENCE
▸ Detect both Attacks and Vulnerability
▸ Zero Code Modification and Easy Integration
▸ No Hardware Requirements
▸ Apply defence inside the application
▸ Have Code Level insights
▸ Fewer False positives
▸ Inject Security at Runtime
▸ No use of Blacklists
SO WHAT’S THE IDEAL PLACE FOR SECURITY?
REQUEST
RESPONSE APP SERVER
APP SERVER CORE
SECURITY LAYER
TYPES OF RASP
▸ Pattern Matching with Blacklist - Old wine in new
bottle (Fancy WAF)
▸ Dynamic Tainting - Good but Performance over head
▸ Virtualisation and Compartmentalisation - Good, but
Less Precise, Container oriented and not application
oriented, Platform Specific (JVM)
▸ Code Instrumentation and Dynamic Whitelist - Good,
but specific to Frameworks, Developer deployed
FOCUS OF RESEARCH
▸ Other AppSec Challenges
▸ Preventing Verb Tampering
▸ Preventing Header Injection
▸ File Upload Protection
▸ Preventing Path Traversal
▸ Ongoing Research
▸ Preventing Session Hijacking
▸ Preventing Layer 7 DDoS
▸ Credential Stuffing
▸ RASP by API Instrumentation

and Dynamic Whitelist
▸ Securing a vulnerable Python 

Tornado app with Zero Code change.
▸ Code Injection Vulnerabilities
▸ Preventing SQLi
▸ Preventing RCE
▸ Preventing Stored & Reflected XSS
▸ Preventing DOM XSS
RASP BY API INSTRUMENTATION AND DYNAMIC WHITELIST
▸ MONKEY PATCHING
▸ LEXICAL ANALYSIS
▸ CONTEXT DETERMINATION
MONKEY PATCHING
▸ Also know as Runtime Hooking and Patching of functions/
methods.
▸ https://jsfiddle.net/h1gves49/2/
LEXICAL ANALYSIS AND TOKEN GENERATION
▸ A lexical analyzer breaks these syntaxes into a series of
tokens, by removing any whitespace or comments in the
source code.
▸ Lexical analyzer generates error if it sees an invalid token.
LEXICAL ANALYSIS AND TOKEN GENERATION
SYNTAX TOKEN
int KEYWORD
value IDENTIFIER
= OPERATOR
100 CONSTANT
; SYMBOL
INPUT: int value = 100;//value is 100
Normal Lexer
SYNTAX TOKEN
int KEYWORD
WHITESPACE
value IDENTIFIER
WHITESPACE
= OPERATOR
WHITESPACE
100 CONSTANT
; SYMBOL
//value is 100 COMMENT
Custom Lexer
CONTEXT DETERMINATION
HTML PARSER
HTML CODE
DOM TREE
PREVENTING CODE INJECTION VULNERABILITIES
Interpreter cannot distinguish between 

Code and Data
Solve that and you solve the code injection problems
PREVENTING CODE INJECTION VULNERABILITIES
▸ Preventing SQL Injection
▸ Preventing Remote OS Command Execution
▸ Preventing Stored & Reflected Cross Site Scripting
▸ Preventing DOM XSS
SQL INJECTION
SELECT * FROM <user_input>
SQL INJECTION : HOOK
SQL Execution API

cursor.execute(‘SELECT * FROM logs‘)
SQL INJECTION : LEARN
SELECT * FROM logs
SYNTAX TOKEN
SELECT KEYWORD
WHITESPACE
* OPERATOR
WHITESPACE
FROM KEYWORD
WHITESPACE
logs STRING
SQL INJECTION : PROTECT
SYNTAX TOKEN
SELECT KEYWORD
WHITESPACE
* OPERATOR
WHITESPACE
FROM KEYWORD
WHITESPACE
logs STRING
WHITESPACE
AND KEYWORD
WHITESPACE
DROP KEYWORD
WHITESPACE
TABLE KEYWORD
WHITESPACE
admin STRING
SELECT * FROM logs AND DROP TABLE admin
SQL INJECTION : PROTECT
KEYWORD WHITESPACE OPERATOR WHITESPACE KEYWORD WHITESPACE STRING
Rule for Context: SELECT * FROM <user_input>
SELECT * FROM logs
SELECT * FROM history
SELECT * FROM logs AND DROP TABLE admin
KEYWORD WHITESPACE OPERATOR WHITESPACE KEYWORD WHITESPACE STRING 

WHITESPACE KEYWORD WHITESPACE KEYWORD WHITESPACE KEYWORD WHITESPACE STRING
DEMO
REMOTE OS COMMAND INJECTION
ping -c 3 <user input>
REMOTE OS COMMAND INJECTION : HOOK
Command Execution API

os.system(ping -c 3 127.0.0.1)
REMOTE OS COMMAND INJECTION : LEARN
ping -c 3 127.0.0.1
SYNTAX TOKEN
ping EXECUTABLE
WHITESPACE
-c ARGUMENT_DASH
WHITESPACE
3 NUMBER
WHITESPACE
127.0.0.1 IP_OR_DOMAIN
REMOTE OS COMMAND INJECTION : PROTECT
ping -c 3 127.0.0.1 & cat /etc/passwd
SYNTAX TOKEN
ping EXECUTABLE
WHITESPACE
-c ARGUMENT_DASH
WHITESPACE
3 NUMBER
WHITESPACE
127.0.0.1 IP_OR_DOMAIN
WHITESPACE
& SPLITTER
WHITESPACE
cat EXECUTABLE
WHITESPACE
/etc/passwd UNIX_PATH
REMOTE OS COMMAND INJECTION : PROTECT
EXECUTABLE WHITESPACE ARGUMENT_DASH WHITESPACE NUMBER WHITESPACE IP_OR_DOMAIN
Rule for Context: ping -c 3 <user_input>
ping -c 3 127.0.0.1

ping -c 3 google.com
ping -c 3 127.0.0.1 & cat /etc/passwd 

EXECUTABLE WHITESPACE ARGUMENT_DASH WHITESPACE NUMBER WHITESPACE IP_OR_DOMAIN

WHITESPACE SPLITTER WHITESPACE EXECUTABLE WHITESPACE UNIX_PATH
DEMO
CROSS SITE SCRIPTING
<body><h1>hello {{user_input1}} </h1></body>

<script> var x=‘{{user_input2}}’;</script>
CROSS SITE SCRIPTING : HOOK
Template Rendering API



template.render(“<body><h1>hello {{user_input1}}

</h1></body><script> var x=‘{{user_input2}}’;

</script>“, user_input1, user_input2)
CROSS SITE SCRIPTING : CONTEXT DETERMINATION
Parsing the DOM Tree
<body><h1>hello {{user_input1}}

</h1></body><script> var x=‘{{user_input2}}’;

</script>
HTML_CONTEXT
JAVASCRIPT_VALUE_CONTEXT
CROSS SITE SCRIPTING : PROTECT
<body><h1>hello {{user_input1}} </h1></body>

<script> var x=‘{{user_input2}}’;</script>
<body><h1>hello World </h1></body>

<script> var x=‘Hello World’;</script>
user_input1 = “World”

user_input2 = “Hello World”
CROSS SITE SCRIPTING : PROTECT
<body><h1>hello &lt;script&gt;alert(0)&lt;/
script&gt; </h1></body>

<script> var x=‘';alert(0);//x3C/scriptx3E’;</
script>
user_input1 = “<script>alert(0)</script>”

user_input2 = “‘;alert(0);//</script>”
DEMO
PREVENTING DOM XSS
https://jsfiddle.net/vno23woL/3/
▸ Inject Security into JavaScript Frameworks
▸ Common JavaScript Frameworks - jQuery, AngularJS, MustacheJS etc…
▸ DOMPurify - https://github.com/cure53/DOMPurify
▸ jPurify - https://github.com/cure53/jPurify
OTHER APPSEC CHALLENGES
▸ Preventing Verb Tampering
▸ Preventing Header Injection
▸ File Upload Protection
▸ Preventing Path Traversal
▸ WAFs blindly blocks TRACE and OPTION Request
▸ Hook HTTP Request API
▸ Learn the HTTP Verbs and Generate Whitelist
▸ Block if not in the list
PREVENTING VERB TAMPERING
DEMO
PREVENTING HEADER INJECTION
▸ Unlike WAF we don’t have to keep a blacklist 

of every possible encoded combination of 

“%0a” and “%0d”
▸ Hook HTTP Request API
▸ Look for “%0a,%0d“ in HTTP Request Headers
▸ Block if Present
DEMO
FILE UPLOAD PROTECTION
▸ Classic File Upload Bypass

image.jpg.php, image.php3 etc.
▸ Hook File/IO API : 

io.open(“/tmp/nice.jpg”, 'wb')
▸ Learn file extensions to create a whitelist.
▸ Block any unknown file extensions

io.open(“/tmp/nice.py”, 'wb')
DEMO
PREVENTING PATH TRAVERSAL
▸ WAF Looks for
PREVENTING PATH TRAVERSAL
▸ Hook File/IO API:

io.open(“/read_dir/index.txt”, ‘rb')
▸ Learn directories and file extensions
▸ Block any unknown directories and file extensions

io.open(“/read_dir/../../etc/passwd”, 'rb')
DEMO
ON GOING RESEARCH
▸ Preventing Session Hijacking
▸ Preventing Layer 7 DDoS
▸ Credential Stuffing
THE RASP ADVANTAGES
▸ Accurate and Precise in Vulnerability Detection & Prevention
▸ Code Level Insight (Line no, Stack trace)
▸ Not based on Heuristics - Zero/Negligible False Positives
▸ No SSL Decryption and Re-encryption overhead
▸ Doesn’t Downgrade your Security
▸ Preemptive security - Zero Day protection
▸ Zero Code Change and easy integration



pip install rasp_module

import rasp_module
BIGGEST ADVANTAGE
Now you can deploy it on protection mode
CHARACTERISTICS OF AN IDEAL RASP
▸ Ideal RASP should have minimal Performance impact
▸ Should not introduce vulnerabilities
▸ Must not consume PII of users
▸ Should not learn the bad stuff
▸ Should be a “real RASP” not a fancy WAF with Blacklist.
▸ Minimal Configuration and Easy deployment
THAT’S ALL FOLKS!
▸ Thanks to
▸ Zaid Al Hamami, Mike Milner, Steve
Williams, Oliver Lavery

(Team IMMUNIO inc).
▸ Kamaiah, Francis, Bharadwaj,
Surendar, Vivek & Sinu 

(Team Yodlee Security Office - YSO)
▸ Due Credits
▸ Graphics/Image Owners
@ajinabraham
ajin25@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

Attack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuAttack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuRob Ragan
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionDaniel Owens
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by defaultSecuRing
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
End to end web security
End to end web securityEnd to end web security
End to end web securityGeorge Boobyer
 
Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?HackIT Ukraine
 
Attacking Oracle with the Metasploit Framework
Attacking Oracle with the Metasploit FrameworkAttacking Oracle with the Metasploit Framework
Attacking Oracle with the Metasploit FrameworkChris Gates
 
Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧Orange Tsai
 
Ten Commandments of Secure Coding
Ten Commandments of Secure CodingTen Commandments of Secure Coding
Ten Commandments of Secure CodingMateusz Olejarka
 
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and DefensesOWASP
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireRob Ragan
 
Сканирование с использованием бэкслэша: подключаем интуицию
Сканирование с использованием бэкслэша: подключаем интуициюСканирование с использованием бэкслэша: подключаем интуицию
Сканирование с использованием бэкслэша: подключаем интуициюPositive Hack Days
 
HackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs wafHackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs wafIMMUNIO
 
Threat stack aws
Threat stack awsThreat stack aws
Threat stack awsJen Andre
 
Big problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securityBig problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securitySecuRing
 

Was ist angesagt? (20)

Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
 
Attack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuAttack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack Fu
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental Edition
 
Angular js security
Angular js securityAngular js security
Angular js security
 
Kioptrix 2014 5
Kioptrix 2014 5Kioptrix 2014 5
Kioptrix 2014 5
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
End to end web security
End to end web securityEnd to end web security
End to end web security
 
Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?
 
Attacking Oracle with the Metasploit Framework
Attacking Oracle with the Metasploit FrameworkAttacking Oracle with the Metasploit Framework
Attacking Oracle with the Metasploit Framework
 
Php web app security (eng)
Php web app security (eng)Php web app security (eng)
Php web app security (eng)
 
Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧
 
Ten Commandments of Secure Coding
Ten Commandments of Secure CodingTen Commandments of Secure Coding
Ten Commandments of Secure Coding
 
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the Wire
 
Сканирование с использованием бэкслэша: подключаем интуицию
Сканирование с использованием бэкслэша: подключаем интуициюСканирование с использованием бэкслэша: подключаем интуицию
Сканирование с использованием бэкслэша: подключаем интуицию
 
HackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs wafHackFest 2015 - Rasp vs waf
HackFest 2015 - Rasp vs waf
 
Threat stack aws
Threat stack awsThreat stack aws
Threat stack aws
 
Big problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securityBig problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces security
 

Ähnlich wie Внедрение безопасности в веб-приложениях в среде выполнения

Injecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeInjecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeAjin Abraham
 
Technical Architecture of RASP Technology
Technical Architecture of RASP TechnologyTechnical Architecture of RASP Technology
Technical Architecture of RASP TechnologyPriyanka Aash
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) securityNahidul Kibria
 
Automating Security Testing with the OWTF
Automating Security Testing with the OWTFAutomating Security Testing with the OWTF
Automating Security Testing with the OWTFJerod Brennen
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using AnsibleSonatype
 
The Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API WorldThe Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API World42Crunch
 
DevSecOps - automating security
DevSecOps - automating securityDevSecOps - automating security
DevSecOps - automating securityJohn Staveley
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxjohnpragasam1
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxazida3
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxnmk42194
 
Null bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationNull bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationAnant Shrivastava
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxcgt38842
 
How the antiviruses work
How the antiviruses workHow the antiviruses work
How the antiviruses workDawid Golak
 
10 Mistakes Hackers Want You to Make
10 Mistakes Hackers Want You to Make10 Mistakes Hackers Want You to Make
10 Mistakes Hackers Want You to MakeJoe Kutner
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the CloudAtlassian
 
Pentest-Bukalapak-Marzuki Hasibuan.pdf
Pentest-Bukalapak-Marzuki Hasibuan.pdfPentest-Bukalapak-Marzuki Hasibuan.pdf
Pentest-Bukalapak-Marzuki Hasibuan.pdfMarzuki Hasibuan
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxFernandoVizer
 

Ähnlich wie Внедрение безопасности в веб-приложениях в среде выполнения (20)

Injecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeInjecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at Runtime
 
Technical Architecture of RASP Technology
Technical Architecture of RASP TechnologyTechnical Architecture of RASP Technology
Technical Architecture of RASP Technology
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) security
 
Automating Security Testing with the OWTF
Automating Security Testing with the OWTFAutomating Security Testing with the OWTF
Automating Security Testing with the OWTF
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using Ansible
 
The Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API WorldThe Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API World
 
DevSecOps - automating security
DevSecOps - automating securityDevSecOps - automating security
DevSecOps - automating security
 
OWASP Top10 2010
OWASP Top10 2010OWASP Top10 2010
OWASP Top10 2010
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptx
 
Null bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationNull bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web Application
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
Cyber ppt
Cyber pptCyber ppt
Cyber ppt
 
How the antiviruses work
How the antiviruses workHow the antiviruses work
How the antiviruses work
 
10 Mistakes Hackers Want You to Make
10 Mistakes Hackers Want You to Make10 Mistakes Hackers Want You to Make
10 Mistakes Hackers Want You to Make
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the Cloud
 
Pentest-Bukalapak-Marzuki Hasibuan.pdf
Pentest-Bukalapak-Marzuki Hasibuan.pdfPentest-Bukalapak-Marzuki Hasibuan.pdf
Pentest-Bukalapak-Marzuki Hasibuan.pdf
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP an Introduction
OWASP an Introduction OWASP an Introduction
OWASP an Introduction
 

Mehr von Positive Hack Days

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesPositive Hack Days
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerPositive Hack Days
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesPositive Hack Days
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikPositive Hack Days
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQubePositive Hack Days
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityPositive Hack Days
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Positive Hack Days
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для ApproofPositive Hack Days
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Positive Hack Days
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложенийPositive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложенийPositive Hack Days
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application SecurityPositive Hack Days
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летPositive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиPositive Hack Days
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОPositive Hack Days
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке СиPositive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CorePositive Hack Days
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опытPositive Hack Days
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterPositive Hack Days
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиPositive Hack Days
 

Mehr von Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Kürzlich hochgeladen

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Kürzlich hochgeladen (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Внедрение безопасности в веб-приложениях в среде выполнения

  • 1. SECURITY ENGINEER AJIN ABRAHAM INJECTING SECURITY 
 INTO WEB APPS AT RUNTIME
  • 2. ▸ Security Engineering @ ▸ Research on Runtime Application Self Defence ▸ Authored MobSF, Xenotix and NodeJScan ▸ Teach Security: https://opsecx.com ▸ Runs: http://opensecurity.in #WHOAMI
  • 3. AGENDA : WHAT THE TALK IS ABOUT? RASP WAF WHAT THE TALK IS NOT ABOUT?
  • 4. APPSEC CHALLENGES ▸ Writing Secure Code is not Easy ▸ Most follows agile development strategies ▸ Frequent releases and builds ▸ Any release can introduce or reintroduce vulnerabilities ▸ Problems by design. 
 Ex: Session Hijacking, Credential Stuffing
  • 5. STATE OF WEB FRAMEWORK SECURITY ▸ Automatic CSRF Token - Anti CSRF ▸ Templates escapes User Input - No XSS ▸ Uses ORM - No SQLi You need to use secure APIs or write Code to 
 enable some of these Security Bugs happens when people write bad code.
  • 6. STATE OF WEB FRAMEWORK SECURITY ▸ Anti CSRF - Can easily be turned off/miss configurations ▸ Templates escapes User Input - Just HTML Escape -> XSS ▸ https://jsfiddle.net/1c4f271c/ ▸ Uses ORM - SQLi is still possible ▸ http://rails-sqli.org/
  • 7. STATE OF WEB FRAMEWORK SECURITY ▸ Remote OS Command Execution - No ▸ Remote Code Injection - No ▸ Server Side Template Injection RCE - No ▸ Session Hijacking - No ▸ Verb Tampering - No ▸ File Upload Restriction - No The list goes on…..
  • 8. WE NEED TO PREVENT EXPLOITATION LET’S USE WAF
  • 9. ▸ First WAF AppShield in 1999, almost 18 years of existence ▸ Quick question : How many of you run a WAF in defence/ protection mode? ▸ Most organisations use them, but in monitor mode due
 high rate false positives. ▸ Most WAFs use BLACKLISTS CAN A WAF SOLVE THIS? 20% 70% 10% False Negatives False Positive Detection
  • 10. APPLICATION SECURITY RULE OF THUMB Gets bypassed, today or tomorrow
  • 11. WHAT WAF SEES? ATTACK != VULNERABILITY
  • 12. HOW WAF WORKS ▸ The strength of WAF is the blacklist ▸ They detect Attacks not Vulnerability ▸ WAF has no application context ▸ Doesn’t know if a vulnerability got exploited inside
 the app server or not. WAFGET http://xyz.com APP SERVER HTTP REQUEST HTTP RESPONSE
  • 13. ▸ WAFs used to downgrade your security. ▸ No Perfect Forward Secrecy ▸ Can’t Support elliptic curves like ECDHE ▸ Some started to support with a Reverse Proxy ▸ Organisations are moving to PFS (Heartbleed bug) ▸ SSL Decryption and Re-encryption Overhead WAF PROBLEMS
  • 14. TLS 1.3 COMING SOON ….
  • 15. We can do much better.
 It’s time to evolve WAF - > SAST -> DAST -> IAST -> RASP Attack Detection 
 &
 Prevention/Neutralization
 +
 Precise 
 Vulnerability Detection
 +
 Extras Attack Detection 
 &
 Prevention Vulnerability Detection Precise 
 Vulnerability Detection
  • 16. RUNTIME APPLICATION SELF DEFENCE ▸ Detect both Attacks and Vulnerability ▸ Zero Code Modification and Easy Integration ▸ No Hardware Requirements ▸ Apply defence inside the application ▸ Have Code Level insights ▸ Fewer False positives ▸ Inject Security at Runtime ▸ No use of Blacklists
  • 17. SO WHAT’S THE IDEAL PLACE FOR SECURITY? REQUEST RESPONSE APP SERVER APP SERVER CORE SECURITY LAYER
  • 18. TYPES OF RASP ▸ Pattern Matching with Blacklist - Old wine in new bottle (Fancy WAF) ▸ Dynamic Tainting - Good but Performance over head ▸ Virtualisation and Compartmentalisation - Good, but Less Precise, Container oriented and not application oriented, Platform Specific (JVM) ▸ Code Instrumentation and Dynamic Whitelist - Good, but specific to Frameworks, Developer deployed
  • 19. FOCUS OF RESEARCH ▸ Other AppSec Challenges ▸ Preventing Verb Tampering ▸ Preventing Header Injection ▸ File Upload Protection ▸ Preventing Path Traversal ▸ Ongoing Research ▸ Preventing Session Hijacking ▸ Preventing Layer 7 DDoS ▸ Credential Stuffing ▸ RASP by API Instrumentation
 and Dynamic Whitelist ▸ Securing a vulnerable Python 
 Tornado app with Zero Code change. ▸ Code Injection Vulnerabilities ▸ Preventing SQLi ▸ Preventing RCE ▸ Preventing Stored & Reflected XSS ▸ Preventing DOM XSS
  • 20. RASP BY API INSTRUMENTATION AND DYNAMIC WHITELIST ▸ MONKEY PATCHING ▸ LEXICAL ANALYSIS ▸ CONTEXT DETERMINATION
  • 21. MONKEY PATCHING ▸ Also know as Runtime Hooking and Patching of functions/ methods. ▸ https://jsfiddle.net/h1gves49/2/
  • 22. LEXICAL ANALYSIS AND TOKEN GENERATION ▸ A lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code. ▸ Lexical analyzer generates error if it sees an invalid token.
  • 23. LEXICAL ANALYSIS AND TOKEN GENERATION SYNTAX TOKEN int KEYWORD value IDENTIFIER = OPERATOR 100 CONSTANT ; SYMBOL INPUT: int value = 100;//value is 100 Normal Lexer SYNTAX TOKEN int KEYWORD WHITESPACE value IDENTIFIER WHITESPACE = OPERATOR WHITESPACE 100 CONSTANT ; SYMBOL //value is 100 COMMENT Custom Lexer
  • 25. PREVENTING CODE INJECTION VULNERABILITIES Interpreter cannot distinguish between 
 Code and Data Solve that and you solve the code injection problems
  • 26. PREVENTING CODE INJECTION VULNERABILITIES ▸ Preventing SQL Injection ▸ Preventing Remote OS Command Execution ▸ Preventing Stored & Reflected Cross Site Scripting ▸ Preventing DOM XSS
  • 27. SQL INJECTION SELECT * FROM <user_input>
  • 28. SQL INJECTION : HOOK SQL Execution API
 cursor.execute(‘SELECT * FROM logs‘)
  • 29. SQL INJECTION : LEARN SELECT * FROM logs SYNTAX TOKEN SELECT KEYWORD WHITESPACE * OPERATOR WHITESPACE FROM KEYWORD WHITESPACE logs STRING
  • 30. SQL INJECTION : PROTECT SYNTAX TOKEN SELECT KEYWORD WHITESPACE * OPERATOR WHITESPACE FROM KEYWORD WHITESPACE logs STRING WHITESPACE AND KEYWORD WHITESPACE DROP KEYWORD WHITESPACE TABLE KEYWORD WHITESPACE admin STRING SELECT * FROM logs AND DROP TABLE admin
  • 31. SQL INJECTION : PROTECT KEYWORD WHITESPACE OPERATOR WHITESPACE KEYWORD WHITESPACE STRING Rule for Context: SELECT * FROM <user_input> SELECT * FROM logs SELECT * FROM history SELECT * FROM logs AND DROP TABLE admin KEYWORD WHITESPACE OPERATOR WHITESPACE KEYWORD WHITESPACE STRING 
 WHITESPACE KEYWORD WHITESPACE KEYWORD WHITESPACE KEYWORD WHITESPACE STRING
  • 32. DEMO
  • 33. REMOTE OS COMMAND INJECTION ping -c 3 <user input>
  • 34. REMOTE OS COMMAND INJECTION : HOOK Command Execution API
 os.system(ping -c 3 127.0.0.1)
  • 35. REMOTE OS COMMAND INJECTION : LEARN ping -c 3 127.0.0.1 SYNTAX TOKEN ping EXECUTABLE WHITESPACE -c ARGUMENT_DASH WHITESPACE 3 NUMBER WHITESPACE 127.0.0.1 IP_OR_DOMAIN
  • 36. REMOTE OS COMMAND INJECTION : PROTECT ping -c 3 127.0.0.1 & cat /etc/passwd SYNTAX TOKEN ping EXECUTABLE WHITESPACE -c ARGUMENT_DASH WHITESPACE 3 NUMBER WHITESPACE 127.0.0.1 IP_OR_DOMAIN WHITESPACE & SPLITTER WHITESPACE cat EXECUTABLE WHITESPACE /etc/passwd UNIX_PATH
  • 37. REMOTE OS COMMAND INJECTION : PROTECT EXECUTABLE WHITESPACE ARGUMENT_DASH WHITESPACE NUMBER WHITESPACE IP_OR_DOMAIN Rule for Context: ping -c 3 <user_input> ping -c 3 127.0.0.1
 ping -c 3 google.com ping -c 3 127.0.0.1 & cat /etc/passwd 
 EXECUTABLE WHITESPACE ARGUMENT_DASH WHITESPACE NUMBER WHITESPACE IP_OR_DOMAIN
 WHITESPACE SPLITTER WHITESPACE EXECUTABLE WHITESPACE UNIX_PATH
  • 38. DEMO
  • 39. CROSS SITE SCRIPTING <body><h1>hello {{user_input1}} </h1></body>
 <script> var x=‘{{user_input2}}’;</script>
  • 40. CROSS SITE SCRIPTING : HOOK Template Rendering API
 
 template.render(“<body><h1>hello {{user_input1}}
 </h1></body><script> var x=‘{{user_input2}}’;
 </script>“, user_input1, user_input2)
  • 41. CROSS SITE SCRIPTING : CONTEXT DETERMINATION Parsing the DOM Tree <body><h1>hello {{user_input1}}
 </h1></body><script> var x=‘{{user_input2}}’;
 </script> HTML_CONTEXT JAVASCRIPT_VALUE_CONTEXT
  • 42. CROSS SITE SCRIPTING : PROTECT <body><h1>hello {{user_input1}} </h1></body>
 <script> var x=‘{{user_input2}}’;</script> <body><h1>hello World </h1></body>
 <script> var x=‘Hello World’;</script> user_input1 = “World”
 user_input2 = “Hello World”
  • 43. CROSS SITE SCRIPTING : PROTECT <body><h1>hello &lt;script&gt;alert(0)&lt;/ script&gt; </h1></body>
 <script> var x=‘';alert(0);//x3C/scriptx3E’;</ script> user_input1 = “<script>alert(0)</script>”
 user_input2 = “‘;alert(0);//</script>”
  • 44. DEMO
  • 45. PREVENTING DOM XSS https://jsfiddle.net/vno23woL/3/ ▸ Inject Security into JavaScript Frameworks ▸ Common JavaScript Frameworks - jQuery, AngularJS, MustacheJS etc… ▸ DOMPurify - https://github.com/cure53/DOMPurify ▸ jPurify - https://github.com/cure53/jPurify
  • 46. OTHER APPSEC CHALLENGES ▸ Preventing Verb Tampering ▸ Preventing Header Injection ▸ File Upload Protection ▸ Preventing Path Traversal
  • 47. ▸ WAFs blindly blocks TRACE and OPTION Request ▸ Hook HTTP Request API ▸ Learn the HTTP Verbs and Generate Whitelist ▸ Block if not in the list PREVENTING VERB TAMPERING DEMO
  • 48. PREVENTING HEADER INJECTION ▸ Unlike WAF we don’t have to keep a blacklist 
 of every possible encoded combination of 
 “%0a” and “%0d” ▸ Hook HTTP Request API ▸ Look for “%0a,%0d“ in HTTP Request Headers ▸ Block if Present DEMO
  • 49. FILE UPLOAD PROTECTION ▸ Classic File Upload Bypass
 image.jpg.php, image.php3 etc. ▸ Hook File/IO API : 
 io.open(“/tmp/nice.jpg”, 'wb') ▸ Learn file extensions to create a whitelist. ▸ Block any unknown file extensions
 io.open(“/tmp/nice.py”, 'wb') DEMO
  • 51. PREVENTING PATH TRAVERSAL ▸ Hook File/IO API:
 io.open(“/read_dir/index.txt”, ‘rb') ▸ Learn directories and file extensions ▸ Block any unknown directories and file extensions
 io.open(“/read_dir/../../etc/passwd”, 'rb') DEMO
  • 52. ON GOING RESEARCH ▸ Preventing Session Hijacking ▸ Preventing Layer 7 DDoS ▸ Credential Stuffing
  • 53. THE RASP ADVANTAGES ▸ Accurate and Precise in Vulnerability Detection & Prevention ▸ Code Level Insight (Line no, Stack trace) ▸ Not based on Heuristics - Zero/Negligible False Positives ▸ No SSL Decryption and Re-encryption overhead ▸ Doesn’t Downgrade your Security ▸ Preemptive security - Zero Day protection ▸ Zero Code Change and easy integration
 
 pip install rasp_module
 import rasp_module
  • 54. BIGGEST ADVANTAGE Now you can deploy it on protection mode
  • 55. CHARACTERISTICS OF AN IDEAL RASP ▸ Ideal RASP should have minimal Performance impact ▸ Should not introduce vulnerabilities ▸ Must not consume PII of users ▸ Should not learn the bad stuff ▸ Should be a “real RASP” not a fancy WAF with Blacklist. ▸ Minimal Configuration and Easy deployment
  • 56. THAT’S ALL FOLKS! ▸ Thanks to ▸ Zaid Al Hamami, Mike Milner, Steve Williams, Oliver Lavery
 (Team IMMUNIO inc). ▸ Kamaiah, Francis, Bharadwaj, Surendar, Vivek & Sinu 
 (Team Yodlee Security Office - YSO) ▸ Due Credits ▸ Graphics/Image Owners @ajinabraham ajin25@gmail.com