SlideShare a Scribd company logo
Hack Proof Your ASP.NET Applications
By Sarvesh Kushwaha
Content Spoofing
• Content Spoofing is an attack technique that allows an attacker to inject a malicious payload that is
later misrepresented as legitimate content of a web application.
• Text Only Content Spoofing (Dynamic pages build from query string values e.g. error pages, story websites, news)
Example : http://foo.com/news?id=123&title=company+stock+rises
http://foo.com/news?id=123&title=company+filing+bankrupcy
• HTML Markup Reflected Content spoofing (Change the dynamic src tag on a website (iframe src,img src) )
Example : http://foo.com/Sarvesh?ProfileImage=http://validGravatar.com/abc.jpeg
http:// foo.com/Sarvesh?ProfileImage=http://naughty.com/abc.jpeg
• Prevent content spoofing
• For Data transmission use post (sensitive data should be transmit in POST request)
• Validate user input (Avoid URL from diff sources)
• Encode user input
• Encrypt sensitive data in query string (Not recommended)
XPath Injection
• XPath is used to navigate through elements and attributes in an XML document.
• Exploit : Lets suppose your login screen validating from XML and your XML is as follows :
<?xml version="1.0" encoding="utf-8" ?>
<Users>
<user> <id>Sarvesh</id> <password>12345</password> <age> 80</age> </user>
<user> <id>Thor</id> <password>asgard</password> <age>100</age> </user>
</Users>
Now an attacker can pass login and password values as follows to make your code condition true.
„ or „1‟ = „1‟
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.Load("...");
XPathNavigator nav = XmlDoc.CreateNavigator();
XPathExpression expr =
nav.Compile("string(//user[id/text()='"+TextBox1.Text+"'
and
password/text()='"+TextBox2.Text+"']/account/text())")'
String account=Convert.ToString(nav.Evaluate(expr));
if (account=="") { }
Prevention :
• Precompile your xpath expression (XPathExpression.Compile)
• Use MVP.XML (Precompiled and AddVariable)
• Use of parameterized XPath queries
• Use of custom error pages(Don‟t disclose too much
information)
• Use replace method to replace “‟” sign
• Validate user input
• Use XPathExpression.SetContext() for variable use
XXE (XML External Entity)
An XML External Entity attack is a type of attack against an application that parses XML input. This attack
occurs when XML input containing a reference to an external entity is processed by a weakly configured
XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side
request forgery, port scanning from the perspective of the machine where the parser is located, and other
system impacts. [OWASP]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test [ //Using DTD
<!ENTITY xxeattack SYSTEM "file:///system/FinancialData"> ]>
<xxx>&xxeattack;</xxx>
Now In HTTPResposne you can see the password file
Prevention from XXE Attack :
• Prior to .NET 4.0 set prohibitDTD property to true for XMLReaderSettings , set XMLResolver to null for XMLDocument
• After .NET 4.0 use DTDProcessing.prohibit for XmlReaderSettings, set XMLResolver to null for XMLDocument
• Use configurable XML Parser and configure it to ignore certain entities
• Validate your XML Data
• For More Detail Visit OWASP CheatSheet
Brute Force Attack
• It‟s a try try until you succeed attack by applications to decode encrypted data , keys, sensitive data.
• Popular tools for Brute Force Attack ;
• Aircrack-ng (For wifi)
• John The Ripper (For passwords)
• Rainbow Crack
• Cain and Abel
• Lopht crack (For windows)
• Crack
• Prevention from Brute Force Attack
• Locking accounts (Like any Bank do)
• Use Captcha
• Block suspicious IP
• Dynamic IP Restrictions Extension for IIS
• Diff Login username and passwords
• Forcing secure passwords (1Usabcd@) dictionary attacker will cry 
Hack Proof Your ASP.NET Applications
• Hack Proof Your ASP.NET Applications From SQL Injection
• Hack Proof Your ASP.NET Application From Cross Site Scripting (XSS)
• Hack Proof Your ASP.NET Application Part 3 (Cross Site Request Forgery)
• Hack proof your ASP.NET applications from Sensitive Data Exposure and
Information Leakage
• Hack proof your asp.net applications from Session Hijacking
• Hack proof your JavaScript using JavaScript Obfuscation in ASP.NET
applications
Security Testing for ASP.NET Applications
• OWASP Zed Attack Proxy (ZAP)
• Fiddler with Watcher and X5S extensions
• Wapiti
• W3af
• Skip fish
• Arachni
• OWASP Vulnerability Testing Tools
• OWASP Phoenix tools List
Sarvesh Kushwaha | | | | | |

More Related Content

What's hot (20)

PPT
XSS - Attacks & Defense
Blueinfy Solutions
 
PPT
Defending against Injections
Blueinfy Solutions
 
PPT
Cache poisoning
AlexandraLacatus
 
PPTX
Cross site scripting XSS
Ronan Dunne, CEH, SSCP
 
PPTX
Http response splitting
Sharath Unni
 
PPTX
Web Hacking Series Part 4
Aditya Kamat
 
PPT
Bypass file upload restrictions
Mukesh k.r
 
PPTX
Web Security Attacks
Sajid Hasan
 
PPT
Writing Secure Code – Threat Defense
amiable_indian
 
PPTX
Web Cache Poisoning
KuldeepPandya5
 
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Soroush Dalili
 
PDF
CNIT 123 Ch 10: Hacking Web Servers
Sam Bowne
 
PPTX
Web hacking series part 3
Aditya Kamat
 
PDF
2013 OWASP Top 10
bilcorry
 
PDF
Pentesting RESTful webservices
Mohammed A. Imran
 
PDF
Owasp top 10 2013
Edouard de Lansalut
 
PPTX
Cross Domain Hijacking - File Upload Vulnerability
Ronan Dunne, CEH, SSCP
 
PDF
Http requesting smuggling
Apijay Kumar
 
XSS - Attacks & Defense
Blueinfy Solutions
 
Defending against Injections
Blueinfy Solutions
 
Cache poisoning
AlexandraLacatus
 
Cross site scripting XSS
Ronan Dunne, CEH, SSCP
 
Http response splitting
Sharath Unni
 
Web Hacking Series Part 4
Aditya Kamat
 
Bypass file upload restrictions
Mukesh k.r
 
Web Security Attacks
Sajid Hasan
 
Writing Secure Code – Threat Defense
amiable_indian
 
Web Cache Poisoning
KuldeepPandya5
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Soroush Dalili
 
CNIT 123 Ch 10: Hacking Web Servers
Sam Bowne
 
Web hacking series part 3
Aditya Kamat
 
2013 OWASP Top 10
bilcorry
 
Pentesting RESTful webservices
Mohammed A. Imran
 
Owasp top 10 2013
Edouard de Lansalut
 
Cross Domain Hijacking - File Upload Vulnerability
Ronan Dunne, CEH, SSCP
 
Http requesting smuggling
Apijay Kumar
 

Similar to Hack proof your ASP NET Applications (20)

PPTX
Cross Site Scripting (XSS)
OWASP Khartoum
 
PPTX
Spa Secure Coding Guide
Geoffrey Vandiest
 
PDF
Building Client-Side Attacks with HTML5 Features
Conviso Application Security
 
PPTX
04. xss and encoding
Eoin Keary
 
KEY
Cross Site Scripting - Mozilla Security Learning Center
Michael Coates
 
PPTX
Vulnerabilities in modern web applications
Niyas Nazar
 
PDF
Lets Make our Web Applications Secure
Aryashree Pritikrishna
 
PPTX
Security vulnerabilities - 2018
Marius Vorster
 
PDF
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
PPTX
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Cyber Security Alliance
 
PPTX
Hacking WebApps for fun and profit : how to approach a target?
Yassine Aboukir
 
PDF
Devbeat Conference - Developer First Security
Michael Coates
 
PPTX
15 owasp top 10 - a3-xss
appsec
 
PDF
Modern Web Application Defense
Frank Kim
 
PPTX
Postcards from the post xss world- content exfiltration null
Piyush Pattanayak
 
PDF
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
PPT
Security Vulnerabilities
Marius Vorster
 
PDF
The top 10 security issues in web applications
Devnology
 
PPTX
Top Ten Java Defense for Web Applications v2
Jim Manico
 
Cross Site Scripting (XSS)
OWASP Khartoum
 
Spa Secure Coding Guide
Geoffrey Vandiest
 
Building Client-Side Attacks with HTML5 Features
Conviso Application Security
 
04. xss and encoding
Eoin Keary
 
Cross Site Scripting - Mozilla Security Learning Center
Michael Coates
 
Vulnerabilities in modern web applications
Niyas Nazar
 
Lets Make our Web Applications Secure
Aryashree Pritikrishna
 
Security vulnerabilities - 2018
Marius Vorster
 
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Cyber Security Alliance
 
Hacking WebApps for fun and profit : how to approach a target?
Yassine Aboukir
 
Devbeat Conference - Developer First Security
Michael Coates
 
15 owasp top 10 - a3-xss
appsec
 
Modern Web Application Defense
Frank Kim
 
Postcards from the post xss world- content exfiltration null
Piyush Pattanayak
 
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
Security Vulnerabilities
Marius Vorster
 
The top 10 security issues in web applications
Devnology
 
Top Ten Java Defense for Web Applications v2
Jim Manico
 

Recently uploaded (20)

PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Best Web development company in india 2025
Greenusys
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
PDF
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
From spreadsheets and delays to real-time control
SatishKumar2651
 
PPTX
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Latest Capcut Pro 5.9.0 Crack Version For PC {Fully 2025
utfefguu
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Best Web development company in india 2025
Greenusys
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
From spreadsheets and delays to real-time control
SatishKumar2651
 
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Latest Capcut Pro 5.9.0 Crack Version For PC {Fully 2025
utfefguu
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 

Hack proof your ASP NET Applications

  • 1. Hack Proof Your ASP.NET Applications By Sarvesh Kushwaha
  • 2. Content Spoofing • Content Spoofing is an attack technique that allows an attacker to inject a malicious payload that is later misrepresented as legitimate content of a web application. • Text Only Content Spoofing (Dynamic pages build from query string values e.g. error pages, story websites, news) Example : http://foo.com/news?id=123&title=company+stock+rises http://foo.com/news?id=123&title=company+filing+bankrupcy • HTML Markup Reflected Content spoofing (Change the dynamic src tag on a website (iframe src,img src) ) Example : http://foo.com/Sarvesh?ProfileImage=http://validGravatar.com/abc.jpeg http:// foo.com/Sarvesh?ProfileImage=http://naughty.com/abc.jpeg • Prevent content spoofing • For Data transmission use post (sensitive data should be transmit in POST request) • Validate user input (Avoid URL from diff sources) • Encode user input • Encrypt sensitive data in query string (Not recommended)
  • 3. XPath Injection • XPath is used to navigate through elements and attributes in an XML document. • Exploit : Lets suppose your login screen validating from XML and your XML is as follows : <?xml version="1.0" encoding="utf-8" ?> <Users> <user> <id>Sarvesh</id> <password>12345</password> <age> 80</age> </user> <user> <id>Thor</id> <password>asgard</password> <age>100</age> </user> </Users> Now an attacker can pass login and password values as follows to make your code condition true. „ or „1‟ = „1‟ XmlDocument XmlDoc = new XmlDocument(); XmlDoc.Load("..."); XPathNavigator nav = XmlDoc.CreateNavigator(); XPathExpression expr = nav.Compile("string(//user[id/text()='"+TextBox1.Text+"' and password/text()='"+TextBox2.Text+"']/account/text())")' String account=Convert.ToString(nav.Evaluate(expr)); if (account=="") { } Prevention : • Precompile your xpath expression (XPathExpression.Compile) • Use MVP.XML (Precompiled and AddVariable) • Use of parameterized XPath queries • Use of custom error pages(Don‟t disclose too much information) • Use replace method to replace “‟” sign • Validate user input • Use XPathExpression.SetContext() for variable use
  • 4. XXE (XML External Entity) An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts. [OWASP] <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE test [ //Using DTD <!ENTITY xxeattack SYSTEM "file:///system/FinancialData"> ]> <xxx>&xxeattack;</xxx> Now In HTTPResposne you can see the password file Prevention from XXE Attack : • Prior to .NET 4.0 set prohibitDTD property to true for XMLReaderSettings , set XMLResolver to null for XMLDocument • After .NET 4.0 use DTDProcessing.prohibit for XmlReaderSettings, set XMLResolver to null for XMLDocument • Use configurable XML Parser and configure it to ignore certain entities • Validate your XML Data • For More Detail Visit OWASP CheatSheet
  • 5. Brute Force Attack • It‟s a try try until you succeed attack by applications to decode encrypted data , keys, sensitive data. • Popular tools for Brute Force Attack ; • Aircrack-ng (For wifi) • John The Ripper (For passwords) • Rainbow Crack • Cain and Abel • Lopht crack (For windows) • Crack • Prevention from Brute Force Attack • Locking accounts (Like any Bank do) • Use Captcha • Block suspicious IP • Dynamic IP Restrictions Extension for IIS • Diff Login username and passwords • Forcing secure passwords (1Usabcd@) dictionary attacker will cry 
  • 6. Hack Proof Your ASP.NET Applications • Hack Proof Your ASP.NET Applications From SQL Injection • Hack Proof Your ASP.NET Application From Cross Site Scripting (XSS) • Hack Proof Your ASP.NET Application Part 3 (Cross Site Request Forgery) • Hack proof your ASP.NET applications from Sensitive Data Exposure and Information Leakage • Hack proof your asp.net applications from Session Hijacking • Hack proof your JavaScript using JavaScript Obfuscation in ASP.NET applications
  • 7. Security Testing for ASP.NET Applications • OWASP Zed Attack Proxy (ZAP) • Fiddler with Watcher and X5S extensions • Wapiti • W3af • Skip fish • Arachni • OWASP Vulnerability Testing Tools • OWASP Phoenix tools List
  • 8. Sarvesh Kushwaha | | | | | |