SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Web Security Programming I Building Security in from the Start Except where otherwise noted all portions of this work are Copyright (c) 2007 Google  and are licensed under the Creative Commons Attribution 3.0 License  http://creativecommons.org/licenses/by/3.0/
A Simple Web Server ,[object Object],[object Object],[object Object]
Some Preliminaries… ,[object Object],[object Object],[object Object]
Some Preliminaries… ,[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: main() ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer Object ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: processRequest 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: processRequest 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: serveFile 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: serveFile 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleWebServer: serveFile 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
What Can Go Wrong? ,[object Object],[object Object],[object Object]
DoS on SimpleWebServer? ,[object Object]
DoS on SimpleWebServer? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DoS on SimpleWebServer? ,[object Object],[object Object]
How Do We Fix This? ,[object Object],[object Object]
How would you fix this code? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A possible solution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Importance of “Careful” Exception Handling ,[object Object],[object Object]
Careful Exception Handling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Careful Exception Handling ,[object Object],[object Object],[object Object],[object Object]
Fail-Safe ,[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object]
Sources ,[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In JavaAnkur Agrawal
 
8 Minutes On Rack
8 Minutes On Rack8 Minutes On Rack
8 Minutes On Rackdanwrong
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connectorGermano Barba
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Languagegiurca
 
From Web Developer to Hardware Developer
From Web Developer to Hardware DeveloperFrom Web Developer to Hardware Developer
From Web Developer to Hardware Developeralexshenoy
 
Sitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesSitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesBenjamin Vangansewinkel
 
Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3HyeonSeok Choi
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPTkamal kotecha
 
Extending Retrofit for fun and profit
Extending Retrofit for fun and profitExtending Retrofit for fun and profit
Extending Retrofit for fun and profitMatthew Clarke
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.ioArnout Kazemier
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioMindfire Solutions
 

Was ist angesagt? (20)

A.java
A.javaA.java
A.java
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 
Socket.io (part 1)
Socket.io (part 1)Socket.io (part 1)
Socket.io (part 1)
 
Pemrograman Jaringan
Pemrograman JaringanPemrograman Jaringan
Pemrograman Jaringan
 
8 Minutes On Rack
8 Minutes On Rack8 Minutes On Rack
8 Minutes On Rack
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Language
 
From Web Developer to Hardware Developer
From Web Developer to Hardware DeveloperFrom Web Developer to Hardware Developer
From Web Developer to Hardware Developer
 
Socket Programming
Socket ProgrammingSocket Programming
Socket Programming
 
Sitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesSitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelines
 
Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Extending Retrofit for fun and profit
Extending Retrofit for fun and profitExtending Retrofit for fun and profit
Extending Retrofit for fun and profit
 
Sockets
SocketsSockets
Sockets
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.io
 
Acs sim errorlog
Acs sim errorlogAcs sim errorlog
Acs sim errorlog
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 

Andere mochten auch

Yy (68)
Yy (68)Yy (68)
Yy (68)google
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Michael Kirst-Neshva
 
30美丽的名片
30美丽的名片30美丽的名片
30美丽的名片zsk91186
 
осъдителна присъда кюстендилски окръжен съд
осъдителна присъда  кюстендилски окръжен съдосъдителна присъда  кюстендилски окръжен съд
осъдителна присъда кюстендилски окръжен съдKristiyan Petroff
 
Unit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTUnit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTJenny Hubbard
 
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙ 실시간토토 실 시간배팅
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙  실시간토토  실  시간배팅스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙  실시간토토  실  시간배팅
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙ 실시간토토 실 시간배팅fdghjhj
 
Crear Unha Conta Gmail
Crear Unha Conta GmailCrear Unha Conta Gmail
Crear Unha Conta Gmailvicente
 
Co Ownership And Shared Equity Arrangements
Co Ownership And Shared Equity ArrangementsCo Ownership And Shared Equity Arrangements
Co Ownership And Shared Equity ArrangementsZCD Properties Inc
 
Case Study Analysis Lucent Technologies
Case Study Analysis Lucent TechnologiesCase Study Analysis Lucent Technologies
Case Study Analysis Lucent TechnologiesDjadja Sardjana
 
Khoa van-tay-kaba e10-fingerprint doorlock
Khoa van-tay-kaba e10-fingerprint doorlockKhoa van-tay-kaba e10-fingerprint doorlock
Khoa van-tay-kaba e10-fingerprint doorlockProtocol Corporation
 
Misawa Post Office Holiday Schedule
Misawa Post Office Holiday ScheduleMisawa Post Office Holiday Schedule
Misawa Post Office Holiday ScheduleNAF Misawa
 
WASH United India | Fellowships | Round 2
WASH United India | Fellowships | Round 2WASH United India | Fellowships | Round 2
WASH United India | Fellowships | Round 2WASH United
 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5John Coggeshall
 

Andere mochten auch (20)

Yy (68)
Yy (68)Yy (68)
Yy (68)
 
dgdgdgdgd
dgdgdgdgddgdgdgdgd
dgdgdgdgd
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
 
30美丽的名片
30美丽的名片30美丽的名片
30美丽的名片
 
осъдителна присъда кюстендилски окръжен съд
осъдителна присъда  кюстендилски окръжен съдосъдителна присъда  кюстендилски окръжен съд
осъдителна присъда кюстендилски окръжен съд
 
Attom
AttomAttom
Attom
 
Daaaaaa
DaaaaaaDaaaaaa
Daaaaaa
 
Unit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTUnit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPT
 
sistemas
sistemas sistemas
sistemas
 
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙ 실시간토토 실 시간배팅
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙  실시간토토  실  시간배팅스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙  실시간토토  실  시간배팅
스타토토⊙o⊙Wifi89,cOm(카톡: XaZa⊙o⊙ 실시간토토 실 시간배팅
 
Crear Unha Conta Gmail
Crear Unha Conta GmailCrear Unha Conta Gmail
Crear Unha Conta Gmail
 
Lesson #3
Lesson #3Lesson #3
Lesson #3
 
Co Ownership And Shared Equity Arrangements
Co Ownership And Shared Equity ArrangementsCo Ownership And Shared Equity Arrangements
Co Ownership And Shared Equity Arrangements
 
Case Study Analysis Lucent Technologies
Case Study Analysis Lucent TechnologiesCase Study Analysis Lucent Technologies
Case Study Analysis Lucent Technologies
 
Khoa van-tay-kaba e10-fingerprint doorlock
Khoa van-tay-kaba e10-fingerprint doorlockKhoa van-tay-kaba e10-fingerprint doorlock
Khoa van-tay-kaba e10-fingerprint doorlock
 
The Beauty Of The Sea
The Beauty Of The SeaThe Beauty Of The Sea
The Beauty Of The Sea
 
Misawa Post Office Holiday Schedule
Misawa Post Office Holiday ScheduleMisawa Post Office Holiday Schedule
Misawa Post Office Holiday Schedule
 
WASH United India | Fellowships | Round 2
WASH United India | Fellowships | Round 2WASH United India | Fellowships | Round 2
WASH United India | Fellowships | Round 2
 
Module english
Module englishModule english
Module english
 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5
 

Ähnlich wie Web

[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docxhanneloremccaffery
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxkacie8xcheco
 
1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will develAgripinaBeaulieuyw
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.comphanleson
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project ReportKavita Sharma
 
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmenMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmenVannaSchrader3
 
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxalfredacavx97
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The ApproachHaci Murat Yaman
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagarNitish Nagar
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming ClientsAdil Jafri
 
Rpi python web
Rpi python webRpi python web
Rpi python websewoo lee
 

Ähnlich wie Web (20)

[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
 
Web Server.pdf
Web Server.pdfWeb Server.pdf
Web Server.pdf
 
1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.com
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
 
Servlets
ServletsServlets
Servlets
 
Servlets
ServletsServlets
Servlets
 
T2
T2T2
T2
 
Sockets
SocketsSockets
Sockets
 
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmenMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen
 
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
 
Server Side? Swift
Server Side? SwiftServer Side? Swift
Server Side? Swift
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The Approach
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming Clients
 
Servlets
ServletsServlets
Servlets
 
Unit 8 Java
Unit 8 JavaUnit 8 Java
Unit 8 Java
 
Rpi python web
Rpi python webRpi python web
Rpi python web
 
03 sockets
03 sockets03 sockets
03 sockets
 

Kürzlich hochgeladen

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Kürzlich hochgeladen (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Web

  • 1. Web Security Programming I Building Security in from the Start Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under the Creative Commons Attribution 3.0 License http://creativecommons.org/licenses/by/3.0/
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.

Hinweis der Redaktion

  1. Now we walk through the code… Main() creates a SimpleWebServer object and calls its run() method. The run() method is just an infinite loop that waits for a connection from a client, and then attempts to process the request.
  2. Here is the SimpleWebServer object. First we initialize a variable that holds the port number the web server should listen to for connections from clients. Then we initialize a ServerSocket. Socket: The method of directing data to the appropriate application in a TCP/IP network. The combination of the IP address of the station and a port number make up a socket. Think of this like an electrical socket. A web server and a web client both have a “virtual” power strip with many sockets on it. A web client can talk to a server by selecting one of its sockets, and then selecting a server socket and plugging a virtual wire into each end. The run() method has an infinite loop waiting for a connection from a client. The call to ServerSocket accept() returns a socket object that corresponds to a unique socket on the server. This allows the server to communicate with the client. Once the communication is established, the client’s request is processed.
  3. processRequest() takes the client socket as input. It uses this socket to create BufferedReader and OutputStreamWriter objects. Once these communication objects are created, the method attempts to read a line of input from the client using the BufferedReader. We expect this line of input to be an HTTP GET request (as discussed earlier).
  4. The StringTokenizer object is used to break up the request into its constituent parts: GET, the pathname to the file the client would like to download. If the command is a “GET”, we call the serveFile() method, else we issue an error. Then we close the connection to the client.
  5. The first “if” removes the initial slash at the beginning of the pathname, and the second “if” sets the file to be downloaded = index.html, if another file was not specified.
  6. Now the method attempts to open the file and read it into the web server’s memory. If the FileReader object is unable to open the file and read a byte from it, it issues an error message.
  7. If the file was successfully opened, send the HTTP/1.0 200 OK message and then the method enters a while loop that reads bytes from the file and appends them to a StringBuffer, until the end of the file is reached. Then this StringBuffer is sent to the client.
  8. Trace the code, assuming a CR sent from the client. We read the line of input from the client. When we tokenize, the line: command = st.nextToken(); results in an exception. Control is returned to run() which does not handle the exception; then control is returned to main() which does not handle the exception either. Java terminates the application.
  9. Close the connection to the client, rather than crash the server…
  10. We also need to make sure the function fails in a secure manner.
  11. This is also a good example of a fail-safe approach: even if one or more components of a system fail, there is still some level of security.