ASP.NET Web Application Security Hannes Preishuber ppedv AG

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
ATTACKING AUTHENTICATION The Web Application Hacker’s Handbook, Ch. 6 Presenter: Jie Huang 10/31/2012.
ASP.NET Web Application Security Hannes Preishuber ppedv AG
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Microsoft ASP.NET Security Venkat Chilakala Support Professional Microsoft Corporation.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Security in SQL Jon Holmes CIS 407 Fall Outline Surface Area Connection Strings Authenticating Permissions Data Storage Injections.
Building Applications using ASP.NET and C# / Session 14 / 1 of 18 Session 14.
Jonas Thomsen, Ph.d. student Computer Science University of Aarhus Best Practices and Techniques for Building Secure Microsoft.
Hacking Web Server Defiana Arnaldy, M.Si
Designing Security In Web Applications Andrew Tomkowiak 10/8/2013 UW-Platteville Software Engineering Department
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Internet Information Server 6.0. Overview  What’s New in IIS 6.0?  Built-in Accounts and IIS 6.0  IIS Pass-Through Authentication  Securing Web Traffic.
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
Edwin Sarmiento Microsoft MVP – Windows Server System Senior Systems Engineer/Database Administrator Fujitsu Asia Pte Ltd
Configuring a Web Server. Overview Overview of IIS Preparing for an IIS Installation Installing IIS Configuring a Web Site Administering IIS Troubleshooting.
Session 11: Security with ASP.NET
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Security.NET Chapter 1. How Do Attacks Occur? Stages of attack Examples of attacker actions 1. FootprintRuns a port scan on the firewall 2. PenetrationExploits.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
MCSE Guide to Microsoft Exchange Server 2003 Administration Chapter Four Configuring Outlook and Outlook Web Access.
Author: Bill Buchanan. Work Schedule Author: Bill Buchanan.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
Windows Security. Security Windows 2000/XP Professional security oriented Authentication Authorization Internet Connection Firewall.
1 Web services and security ---discuss different ways to enforce security Presenter: Han, Xue.
Sofia, Bulgaria | 9-10 October Writing Secure Code for ASP.NET Stephen Forte CTO, Corzen Inc Microsoft Regional Director NY/NJ (USA) Stephen Forte CTO,
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
ColdFusion Security Michael Smith President TeraTech, Inc ColdFusion, Database & VB custom development
Dr. Mustafa Cem Kasapbaşı Security in ASP.NET. Determining Security Requirements Restricted File Types.
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
All Input is Evil (Part 1) Introduction Will not cover everything Healthy level of paranoia Use my DVD Swap Shop application (week 2)
Grid Chemistry System Architecture Overview Akylbek Zhumabayev.
Securing Your ASP.NET Application Presented by: Rob Bagby Developer Evangelist Microsoft ( )
The.NET Runtime and IIS Presented by Chris Dickey – cdickey.net consulting
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
Hands-On Microsoft Windows Server Implementing Microsoft Internet Information Services Microsoft Internet Information Services (IIS) –Software included.
Module 11: Securing a Microsoft ASP.NET Web Application.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
DEV301 Building Secure ASP.NET Applications Scott Guthrie ASP.NET Team.
Building Secure Web Applications With ASP.Net MVC.
G CITRIXHACKIN. Citrix Presentation Server 4.5 New version is called XenApp/Server Common Deployments Nfuse classic CSG – Citrix Secure Gateway Citrix.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Configuring and Deploying Web Applications Lesson 7.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
ArcGIS for Server Security: Advanced
Building Secure ColdFusion Applications
Web Application Vulnerabilities
Unit 7 Learning Objectives
Agenda Introduction Security flow for a request Authentication
# 66.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Chapter 7: Identifying Advanced Attacks
Jim Fawcett CSE686 – Internet Programming Summer 2005
Security mechanisms and vulnerabilities in .NET
Security.
Introduction to .net Impersonation
ASP.NET Module Subtitle.
Security.
HACKIN G CITRIX.
Designing IIS Security (IIS – Internet Information Service)
Presentation transcript:

ASP.NET Web Application Security Hannes Preishuber ppedv AG

Classic rules  Passwords  encrypted  Min. length & case sensitive & unusual  Dictionary attack  Sniffers  Men  Trojan  Network  Not limited to Microsoft!

ASP.NET Features  Authentication  IIS, ASP.NET  ASP.NET: Forms, Windows, Passport, Default, and Custom  Authorization  Access to Directories, Files  Role-Based Security  if User.IsInRole("Admin")  Impersonation  Code and User

Authentication  ASP.NET is an ISAPI extension  Only receives requests for mapped content  Windows Authentication (via IIS)  Basic, Digest, NTLM, Kerberos, Certificate Support  Leverages platform authentication  Forms-based (Cookie) Authentication  Application credential verification  Supports Microsoft ® Passport Authentication  Custom Authentication

Forms-Based Authentication  Easy to implement  ASP.NET provides redirection  Steps  Configure IIS to allow anonymous users (typically)  Configure ASP.NET cookie authentication  Write your login page  Secures not all  Only Files with named extensions

Forms Auth Configuration <forms <forms name=".ASPXAUTH" name=".ASPXAUTH" loginUrl="login.aspx" loginUrl="login.aspx" protection="all" protection="all" timeout="30" timeout="30" path="/" path="/"/></authentication>

Risk  Authentication Data  Username  Shown in web pages  Password  Authentication Flow  HTTP is clear text  use SSL  ASP.NET to Database is clear text  Store hashed passwords

Show

Risk Cookieless  Sends Session ID in Query String  Web.Config  <sessionState cookieless=“true“  Session lives 20 minutes  From last activity  Attach on Session  public terminal  Sniffer  Also for HTTP Headers and Cookies

Show

Config Topics  Machine.config  System.Web.HttpForbiddenHandler  <processModel  userName=“machine"  Web.Config    Encrypt Connection Strings  HttpOnly  Client side script

Show

SQL Injection  How Web pages works?  INPUT rendered from Textbox Web Control  Query String  Use values concat a SQL command  Search knowledge base  Paged results  Look for specific record  User credentials

What really exists!  DON’T LIKE  More comfort for the user  Hacker types: %  User authentication! string sql = "select * from KB where content like '" + search.Text + "' content like '" + search.Text + "' string sql = "select * from KB where content like '%' content like '%'

SQL Injection Attack  Developer concate SQL statements  Hacker types: ‘ or 1=1 --‘  Result is the first database entry  Maybe the Admin string sql = "select * from Users where user ='" + User.Text + "' user ='" + User.Text + "' and pwd='" + Password.Text + "'" and pwd='" + Password.Text + "'" string sql = "select * from Users where user = ' ' or 1=1 --' and pwd= '' " user = ' ' or 1=1 --' and pwd= '' "

Show

SQL Injection Attack  Take over control  User types: ; xp_cmdshell 'format c: /q /yes '; drop database myDB; --  Result: Hacker can do everything  SQL process runs with system privileges select * from tabelle where id=1; xp_cmdshell 'format c: /q /yes '; drop database myDB; -- drop database myDB; --

SQL Injection Attack  Never use “sa”  Default blank password  Hacker knows a lot about sa  Trusted Security  Application user  Only with needed access rights  Storing Connection Strings  Web.Config  Hashed not clear text  error case source code is often visible

Best Tip  Use parameterized Select  Use Stored Procedures  Cookie & URL Injection sql = "select * from Users where user and pwd SqlCommand cmd = new SqlCommand(sql,con);

Show

Cross site-scripting  User Input is stored in Database  Database content is presented  Injection of  HTML code  JScript code  A different denial of service  Redirect the user to dialer page window.navigate('net.htm'); window.navigate('net.htm'); <script>

Cross site-scripting  Don’t trust the user  Use validators controls  Use regexp  Remove: " ' % ; ) ( & + -  Check for the length  Use Server.HtmlEncode .NET 1.1  Default no HTML code in Textboxes  Page Attribut ValidateRequest =false

HTTP Harvesting  Database driven websites  Display result based on  Text Input, Querystring, Cookie  Special type of SQL query language  Datagrid list with detail link  Detail.aspx?id=1  Session attaching+ pagelink  address for spammer

Prevent HTTP harvesting  Encrypt querystrings  Combine user input with textboxes  Use Jscript to write the data  Draw the data  System.drawing  Monitor the web usage  Third party review

Canonicalization  Character Sets URL, Querystring, Filename  %20=“ “  IP Address as decimal  Compare values  HTMLDecode

Much more…

Architecture  Operation System  Reduce the rights of accounts  Never use Admin Rights  Switch of unused services and ports  Web Farm  Use ipsec to encrypt traffic  Between SQL Server and Web Application  Session Management  IP restrictions  Change common used things  Directories, users, path

Tools  Microsoft Baseline Security Analyzer 1.2  Scan network or local  Scan installed updates  Scan well-known issues

How to be secure  Don't believe in 100 %  Evaluate the risk  Risk of attack  Damage result  Train everybody  Architects, Developer, User, Administrator  Review  Code and user interface

© 2004 ppedv AG. All rights reserved. Security begins in mind

Hinweise  Abo Angebot ASP.NET professional  24 Euro statt 36 ( hier und jetzt)  ASP-Konferenz  Juni Burghausen  DevTrain Camp  5 Tage – 50 h -.NET Burghausen  DevTrain.de  Kostenfreies Community Portal