SlideShare a Scribd company logo
1 of 28
By: M. Swain
Client-side
 refers to operations that are performed by the client in
a client–server environment
 Typically, web browser, that runs on a user's local
computer
 The user has complete control over the client
Client Side Control
 An application may rely on client-side controls to
restrict user input in two broad ways.
• Transmitting data via the client component
• Implementing measures on the client side
Capturing User Data: HTML Forms
 Simplest and most common mechanism for capturing
input from the user and submitting it to the server
 Example: Consider this HTML form
<form action=”order.asp” method=”post”>
<p>Product: Sony VAIO A217S</p>
<p>Quantity: <input size=”2” maxlength=”3”
name=”quantity”>
Hack Steps for Length Limit
 Look for form elements containing a max-length
attribute.
 Submit data that is longer than this length
 If the application accepts the overlong data, you may
infer that the client-side validation is not replicated on
the server.
 The above security flaws if exists, can lead to
possibilities of other vulnerabilities such as SQL
injection, cross-site scripting, or buffer overflows.
Script-Based Validation
 Input validation mechanisms built into HTML forms
are simple and fine-grained to perform relevant
validation for many kinds of input
 Therefore, common to see customized client-side
input validation implemented within scripts
 <script>
 function ValidateForm(theForm)
 {
 var isInteger = /^d+$/
 if(!isInteger.test(theForm.quantity.value))
 {
 alert(“Please enter a valid quantity”);
 return false;
 }
 return true;
 }
 </script>
 <form action=”order.asp” method=”post” onsubmit=”return
 ValidateForm(this)“>
 <p>Product: Sony VAIO A217S</p>
 <p>Quantity: <input size=”2” name=”quantity”>
 <input name=”price” type=”hidden” value=”1224.95”>
 <input type=”submit” name=”buy” value=”Buy!”></p>
 </form>
Hack Steps
 Identify any cases where client-side JavaScript is used
 Submit data to the server by blocking the validation
steps
 Determine whether the client-side controls are
replicated on the server
 And if not, whether this can be exploited for any
malicious purpose.
Disabled Elements
 Element on an HTML form is flagged as disabled, it
appears on-screen but is grayed out and is not editable
or usable
 Consider the following form:
Disabled Elements
<form action=”order.asp” method=”post”>
<p>Product: <input disabled=”true” name=”product” value=”Sony
VAIO
A217S”></p>
<p>Quantity: <input size=”2” name=”quantity”>
<input name=”price” type=”hidden” value=”1224.95”>
<input type=”submit” value=”Buy!”></p>
</form>
Capturing User Data: Thick-Client
Components
 Besides HTML forms, the other main method for
capturing, validating, and submitting user data
 Technology: Java Applet, ActiveX Control, Shock Wave
Flash Objects
 Internal workings are less transparently visible than
HTML forms and JavaScript
Java Applets
 Popular for implementing thick-client components
 cross-platform and run in a sandboxed environment
 Main use: to capture user input or other in-browser
information
Java game example
 <script>
 function play()
 {
 alert(“you scored “ + TheApplet.getScore());
 document.location = “submitScore.jsp?score=” +
 TheApplet.getObsScore() + “&name=” +
 document.playForm.yourName.value;
 }
 </script>
 <form name=playForm>
 <p>Enter name: <input type=”text” name=”yourName” value=”“></p>
 <input type=”button” value=”Play” onclick=JavaScript:play()>
 </form>
 <applet code=”https://wahh-game.com/JavaGame.class”
 id=”TheApplet”></applet>
Java example
 URL entry that is returned after playing game:
https://wahh-game.com/submitScore.jsp?score=
c1cc3139323c3e4544464d51515352585a61606a6b&name=daf
 Want to cheat the game, one way is to harvest a large
number of scores and attempt to reverse engineer the
algorithm
Decompiling Java Bytecode
 Better approach to hack Java
 To decompile: first save a copy of file/URL to disk
 Use browser to request the URL specified in the code
attribute of the applet tag
Jad
 Tool for decompiling Java bytecode
 Once Jad has decompiled the applet back to its source
code, you can start to bypass the client-side controls
 For example, you could change the getObsScore
method to:
return obfuscate(“99999|0.123456789”);
Coping with Bytecode Obfuscation
 Various techniques have been developed to obfuscate
bytecode because of the ease Java can decompile it
 These techniques result in bytecode that is harder to
decompile or that leads to misleading or invalid source
code
Obfuscation techniques
 Meaningful class, method, and member variable names are
replaced with meaningless expressions like a, b, c.
 Redundant code may be added for Obscurity
ActiveX Controls
 Heavyweight technology compared to Java
 ActiveX controls are written in C and C++
 Can’t be decompiled back to source code easily
 It’s possible for a user to hack ActiveX, but too
complicated
Fixing Inputs Processed by Controls
 ActiveX controls are sometimes put as a client-side
control to verify that the client computer compiles
with specific security standards before access is
granted to certain server-side functionality
 Filemon and Regmon (now Process Monitor)
 Enable you to monitor all of a process’s interaction with
the computer’s file system and registry
Decompiling Managed Code
 .NET Reflector by Lutz Roeder
 Useful tool for decompiling a thick-client component
written in C# & Visual Basic
Shockwave Flash Objects
 Most common use of Flash is for an application
context for online games
 Flash objects are contained within a compiled file that
the browser downloads from the server and executes in
a virtual machine (Flash player)
 SWF file contains bytecode that can be decompiled to
recover the original source
Flasm
 Dissembler and assembler for SWF bytecode and can
be used to extract human-readable representation of
the bytecode from an SWF file then reassemble
modified bytecode into a new SWF file
Handling Client-Side Data Securely
 Security problems with web applications arise because
client-side components and user input are outside of
the server’s direct control
Transmitting Data via the Client
 Encryption techniques can be used to prevent
tampering by the user
 If the above is used, then there are two important
pitfalls to avoid:
 Replay Attack
 Cryptographic Attack
Validating Client-Generated Data
 Data generated on the client and transmitted to the
server cannot be validated securely on the client:
 Lightweight client-side controls like HTML form fields
and JavaScript provide zero assurance about the input
received by the server
 Use of thick-client components are sometimes more
difficult to circumvent, but this may merely slow down
an attacker for a short period.
Logging and Alerting
 Integration of server-side intrusion detection defenses
 Anomalies should be logged and administrators
should be alerted in real time to take action
Summary
 Almost all client-server applications must accept the
fact that the client component, and all processing that
occurs on it, cannot be trusted to behave as expected
 Questions?

More Related Content

Similar to Chapter5-Bypass-ClientSide-Control-Presentation.pptx

Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Nino Ho
 
Www architecture,cgi, client server security, protection
Www architecture,cgi, client server security, protectionWww architecture,cgi, client server security, protection
Www architecture,cgi, client server security, protectionAustina Francis
 
Documentation
DocumentationDocumentation
DocumentationKalyan A
 
Web Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server MaintenanceWeb Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server MaintenancePort80 Software
 
E-Business And Technology Essay
E-Business And Technology EssayE-Business And Technology Essay
E-Business And Technology EssayPamela Wright
 
XCS110_All_Slides.pdf
XCS110_All_Slides.pdfXCS110_All_Slides.pdf
XCS110_All_Slides.pdfssuser01066a
 
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009AlertSite
 
AlertSite Slideshow at Web 2.0 Expo 2009
AlertSite Slideshow at Web 2.0 Expo 2009AlertSite Slideshow at Web 2.0 Expo 2009
AlertSite Slideshow at Web 2.0 Expo 2009AlertSite
 
Jan 2008 Allup
Jan 2008 AllupJan 2008 Allup
Jan 2008 Allupllangit
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Input validation slides of web application workshop
Input validation slides of web application workshopInput validation slides of web application workshop
Input validation slides of web application workshopPayampardaz
 
Web 20 Security - Vordel
Web 20 Security - VordelWeb 20 Security - Vordel
Web 20 Security - Vordelguest2a1135
 
IRJET- Survey on Web Application Vulnerabilities
IRJET- Survey on Web Application VulnerabilitiesIRJET- Survey on Web Application Vulnerabilities
IRJET- Survey on Web Application VulnerabilitiesIRJET Journal
 
Virutalization and the Future of Datacenter Security
Virutalization and the Future of Datacenter SecurityVirutalization and the Future of Datacenter Security
Virutalization and the Future of Datacenter Securityguestb09e16
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1MSc CST
 
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...Veracode
 

Similar to Chapter5-Bypass-ClientSide-Control-Presentation.pptx (20)

Online banking
Online bankingOnline banking
Online banking
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares
 
Www architecture,cgi, client server security, protection
Www architecture,cgi, client server security, protectionWww architecture,cgi, client server security, protection
Www architecture,cgi, client server security, protection
 
Saas security
Saas securitySaas security
Saas security
 
Documentation
DocumentationDocumentation
Documentation
 
Web Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server MaintenanceWeb Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server Maintenance
 
JavaScript
JavaScriptJavaScript
JavaScript
 
E-Business And Technology Essay
E-Business And Technology EssayE-Business And Technology Essay
E-Business And Technology Essay
 
XCS110_All_Slides.pdf
XCS110_All_Slides.pdfXCS110_All_Slides.pdf
XCS110_All_Slides.pdf
 
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
 
AlertSite Slideshow at Web 2.0 Expo 2009
AlertSite Slideshow at Web 2.0 Expo 2009AlertSite Slideshow at Web 2.0 Expo 2009
AlertSite Slideshow at Web 2.0 Expo 2009
 
Jan 2008 Allup
Jan 2008 AllupJan 2008 Allup
Jan 2008 Allup
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Input validation slides of web application workshop
Input validation slides of web application workshopInput validation slides of web application workshop
Input validation slides of web application workshop
 
Web 20 Security - Vordel
Web 20 Security - VordelWeb 20 Security - Vordel
Web 20 Security - Vordel
 
IRJET- Survey on Web Application Vulnerabilities
IRJET- Survey on Web Application VulnerabilitiesIRJET- Survey on Web Application Vulnerabilities
IRJET- Survey on Web Application Vulnerabilities
 
Virutalization and the Future of Datacenter Security
Virutalization and the Future of Datacenter SecurityVirutalization and the Future of Datacenter Security
Virutalization and the Future of Datacenter Security
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
 
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...
Developing Web Applications Securely - How to Fix Common Code Vulnerabilities...
 

Recently uploaded

代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 

Recently uploaded (20)

代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 

Chapter5-Bypass-ClientSide-Control-Presentation.pptx

  • 2. Client-side  refers to operations that are performed by the client in a client–server environment  Typically, web browser, that runs on a user's local computer  The user has complete control over the client
  • 3. Client Side Control  An application may rely on client-side controls to restrict user input in two broad ways. • Transmitting data via the client component • Implementing measures on the client side
  • 4. Capturing User Data: HTML Forms  Simplest and most common mechanism for capturing input from the user and submitting it to the server  Example: Consider this HTML form <form action=”order.asp” method=”post”> <p>Product: Sony VAIO A217S</p> <p>Quantity: <input size=”2” maxlength=”3” name=”quantity”>
  • 5. Hack Steps for Length Limit  Look for form elements containing a max-length attribute.  Submit data that is longer than this length  If the application accepts the overlong data, you may infer that the client-side validation is not replicated on the server.  The above security flaws if exists, can lead to possibilities of other vulnerabilities such as SQL injection, cross-site scripting, or buffer overflows.
  • 6. Script-Based Validation  Input validation mechanisms built into HTML forms are simple and fine-grained to perform relevant validation for many kinds of input  Therefore, common to see customized client-side input validation implemented within scripts
  • 7.  <script>  function ValidateForm(theForm)  {  var isInteger = /^d+$/  if(!isInteger.test(theForm.quantity.value))  {  alert(“Please enter a valid quantity”);  return false;  }  return true;  }  </script>  <form action=”order.asp” method=”post” onsubmit=”return  ValidateForm(this)“>  <p>Product: Sony VAIO A217S</p>  <p>Quantity: <input size=”2” name=”quantity”>  <input name=”price” type=”hidden” value=”1224.95”>  <input type=”submit” name=”buy” value=”Buy!”></p>  </form>
  • 8. Hack Steps  Identify any cases where client-side JavaScript is used  Submit data to the server by blocking the validation steps  Determine whether the client-side controls are replicated on the server  And if not, whether this can be exploited for any malicious purpose.
  • 9. Disabled Elements  Element on an HTML form is flagged as disabled, it appears on-screen but is grayed out and is not editable or usable  Consider the following form:
  • 10. Disabled Elements <form action=”order.asp” method=”post”> <p>Product: <input disabled=”true” name=”product” value=”Sony VAIO A217S”></p> <p>Quantity: <input size=”2” name=”quantity”> <input name=”price” type=”hidden” value=”1224.95”> <input type=”submit” value=”Buy!”></p> </form>
  • 11. Capturing User Data: Thick-Client Components  Besides HTML forms, the other main method for capturing, validating, and submitting user data  Technology: Java Applet, ActiveX Control, Shock Wave Flash Objects  Internal workings are less transparently visible than HTML forms and JavaScript
  • 12. Java Applets  Popular for implementing thick-client components  cross-platform and run in a sandboxed environment  Main use: to capture user input or other in-browser information
  • 13. Java game example  <script>  function play()  {  alert(“you scored “ + TheApplet.getScore());  document.location = “submitScore.jsp?score=” +  TheApplet.getObsScore() + “&name=” +  document.playForm.yourName.value;  }  </script>  <form name=playForm>  <p>Enter name: <input type=”text” name=”yourName” value=”“></p>  <input type=”button” value=”Play” onclick=JavaScript:play()>  </form>  <applet code=”https://wahh-game.com/JavaGame.class”  id=”TheApplet”></applet>
  • 14. Java example  URL entry that is returned after playing game: https://wahh-game.com/submitScore.jsp?score= c1cc3139323c3e4544464d51515352585a61606a6b&name=daf  Want to cheat the game, one way is to harvest a large number of scores and attempt to reverse engineer the algorithm
  • 15. Decompiling Java Bytecode  Better approach to hack Java  To decompile: first save a copy of file/URL to disk  Use browser to request the URL specified in the code attribute of the applet tag
  • 16. Jad  Tool for decompiling Java bytecode  Once Jad has decompiled the applet back to its source code, you can start to bypass the client-side controls  For example, you could change the getObsScore method to: return obfuscate(“99999|0.123456789”);
  • 17. Coping with Bytecode Obfuscation  Various techniques have been developed to obfuscate bytecode because of the ease Java can decompile it  These techniques result in bytecode that is harder to decompile or that leads to misleading or invalid source code
  • 18. Obfuscation techniques  Meaningful class, method, and member variable names are replaced with meaningless expressions like a, b, c.  Redundant code may be added for Obscurity
  • 19. ActiveX Controls  Heavyweight technology compared to Java  ActiveX controls are written in C and C++  Can’t be decompiled back to source code easily  It’s possible for a user to hack ActiveX, but too complicated
  • 20. Fixing Inputs Processed by Controls  ActiveX controls are sometimes put as a client-side control to verify that the client computer compiles with specific security standards before access is granted to certain server-side functionality  Filemon and Regmon (now Process Monitor)  Enable you to monitor all of a process’s interaction with the computer’s file system and registry
  • 21. Decompiling Managed Code  .NET Reflector by Lutz Roeder  Useful tool for decompiling a thick-client component written in C# & Visual Basic
  • 22. Shockwave Flash Objects  Most common use of Flash is for an application context for online games  Flash objects are contained within a compiled file that the browser downloads from the server and executes in a virtual machine (Flash player)  SWF file contains bytecode that can be decompiled to recover the original source
  • 23. Flasm  Dissembler and assembler for SWF bytecode and can be used to extract human-readable representation of the bytecode from an SWF file then reassemble modified bytecode into a new SWF file
  • 24. Handling Client-Side Data Securely  Security problems with web applications arise because client-side components and user input are outside of the server’s direct control
  • 25. Transmitting Data via the Client  Encryption techniques can be used to prevent tampering by the user  If the above is used, then there are two important pitfalls to avoid:  Replay Attack  Cryptographic Attack
  • 26. Validating Client-Generated Data  Data generated on the client and transmitted to the server cannot be validated securely on the client:  Lightweight client-side controls like HTML form fields and JavaScript provide zero assurance about the input received by the server  Use of thick-client components are sometimes more difficult to circumvent, but this may merely slow down an attacker for a short period.
  • 27. Logging and Alerting  Integration of server-side intrusion detection defenses  Anomalies should be logged and administrators should be alerted in real time to take action
  • 28. Summary  Almost all client-server applications must accept the fact that the client component, and all processing that occurs on it, cannot be trusted to behave as expected  Questions?