0% found this document useful (0 votes)
85 views13 pages

Web Application Component Models Explained

The document outlines various models of web application components, including traditional three-tier architecture, MVC, SPA, microservices, serverless, component-based architectures, PWAs, and API-based architecture, emphasizing their roles in delivering dynamic web services. It also discusses the SET protocol for secure online transactions, detailing its objectives, participants, security features, limitations, and evolution towards modern payment systems. Additionally, it explains XML as a markup language for data representation, its structure, advantages, and use cases, while also covering methodologies for session management testing to ensure web application security.

Uploaded by

Nasar Mirza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views13 pages

Web Application Component Models Explained

The document outlines various models of web application components, including traditional three-tier architecture, MVC, SPA, microservices, serverless, component-based architectures, PWAs, and API-based architecture, emphasizing their roles in delivering dynamic web services. It also discusses the SET protocol for secure online transactions, detailing its objectives, participants, security features, limitations, and evolution towards modern payment systems. Additionally, it explains XML as a markup language for data representation, its structure, advantages, and use cases, while also covering methodologies for session management testing to ensure web application security.

Uploaded by

Nasar Mirza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q1: Explain Models of Web Applica on Components.

Web applica ons are so ware programs that run on a web server and are accessed through a web
browser. They have become a standard in delivering dynamic and interac ve services over the
internet. The architecture of web applica ons consists of several components that interact to process
requests, perform opera ons, and return results to the user.
1. Tradi onal Three-Tier Architecture
a. Presenta on Tier
 The front-end or client layer.
 Technologies include HTML, CSS, JavaScript, Bootstrap, React, Angular, etc.
 Main role: provide a user interface to interact with the system.
 Handles user input and sends it to the server for processing.
b. Applica on Tier
 Also known as the logic er or business logic layer.
 Processes user requests and applies business rules.
 Server-side scrip ng languages like PHP, Python, Java, .NET, [Link] are used here.
 Acts as a bridge between the front-end and the database.
c. Data Tier
 Manages data storage and retrieval.
 Can include rela onal databases (MySQL, PostgreSQL) or NoSQL databases (MongoDB,
Firebase).
 The applica on er communicates with this layer to fetch or store informa on.
2. MVC (Model-View-Controller) Architecture
 Model: Manages the data and business logic.
 View: Represents the UI.
 Controller: Handles user input and calls the model and view.
MVC separates concerns and helps manage code more efficiently in large-scale applica ons.
3. Single Page Applica on (SPA) Architecture
 Uses JavaScript frameworks (like Angular, Vue, React).
 Loads a single HTML page and dynamically updates the content.
 Reduces server load and improves user experience by avoiding full page reloads.
4. Microservices Architecture
 Applica on is divided into small independent services.
 Each service has its own logic and database.
 Easier to scale, deploy, and maintain.
 Communicates via REST or messaging queues (RabbitMQ, Ka a).
5. Serverless Architecture
 Developers focus only on code; the cloud provider manages the infrastructure.
 Popular pla orms: AWS Lambda, Google Cloud Func ons, Azure Func ons.
 Best suited for applica ons with varying traffic and short tasks.
6. Component-Based Architecture
 Reusable UI components that encapsulate func onality.
 Prominent in [Link], Angular, [Link].
 Helps in building modular and maintainable code.
7. Progressive Web Apps (PWAs)
 Combines features of web and na ve apps.
 Works offline, supports push no fica ons.
 Built using service workers, manifest files, and responsive designs.
8. API-based Architecture
 Backend exposes services via APIs (REST, GraphQL).
 Front-end is decoupled and can be developed independently.
 Promotes scalability and separa on of concerns.
Conclusion
Understanding different models of web applica on components helps in choosing the right
architecture based on project needs. Whether it’s a simple CRUD app or a scalable enterprise-level
solu on, selec ng the right structure ensures performance, maintainability, and a be er user
experience.
Q2: Describe SET Protocols with Its Working.
SET (Secure Electronic Transac on) is a protocol developed by Visa and MasterCard to secure online
payment transac ons over the internet. It was designed to ensure the confiden ality, integrity, and
authen city of electronic transac ons, par cularly those involving credit cards.
1. Introduc on to SET
 SET was introduced in the 1990s to combat increasing online fraud.
 Unlike SSL/TLS, which protects the communica on channel, SET protects the transac on
content itself.
 It involves encryp on and digital cer ficates to protect cardholder and merchant data.
2. Objec ves of SET
 Authen ca on: Verifies the iden es of all par es (cardholder, merchant, bank).
 Confiden ality: Ensures sensi ve data (credit card details) is encrypted.
 Integrity: Guarantees data is not altered in transit.
 Interoperability: Works across different hardware and so ware pla orms.
3. Key Par cipants
 Cardholder: The customer making a purchase.
 Merchant: The seller offering goods/services online.
 Issuer: The bank that issued the customer’s credit card.
 Acquirer: The merchant’s bank.
 Payment Gateway: Facilitates communica on between banks and SET network.
 Cer ficate Authority (CA): Issues digital cer ficates.
4. Digital Cer ficates in SET
 Digital cer ficates are used to verify iden es.
 Every par cipant in the SET system has a cer ficate.
 These are issued by a trusted Cer ficate Authority.
5. SET Protocol Components
 Dual Signature: A cryptographic technique that keeps order info and payment info separate
but linked.
 Purchase Request: Sent from customer to merchant, encrypted.
 Authoriza on Request: Sent from merchant to payment gateway.
 Capture Request: Sent a er approval to finalize the transac on.
6. Working of SET Protocol
Step-by-step Process:
1. Ini aliza on:
o All par es obtain digital cer ficates.
o The customer installs a digital wallet.
2. Order Placement:
o Customer selects items and places an order on the merchant's website.
3. Payment Informa on Encryp on:
o Customer's digital wallet encrypts:
 Order Informa on (OI) for the merchant.
 Payment Informa on (PI) for the bank.
o A Dual Signature links OI and PI, ensuring both authen city and privacy.
4. Sending to Merchant:
o The merchant receives the encrypted order info and forwards payment info to the
payment gateway.
5. Authoriza on Process:
o Payment gateway decrypts the payment info.
o Contacts the issuer bank to authorize payment.
o Sends response back to the merchant.
6. Capture Request:
o A er authoriza on, the merchant sends a request to capture funds.
o Funds are transferred to the merchant’s account.
7. Confirma on:
o Both customer and merchant receive confirma on messages.
7. Security Features of SET
 Uses RSA for encryp on and digital signatures.
 Ensures end-to-end security of payment informa on.
 Prevents merchant from seeing customer’s credit card details.
 Defends against replay a acks and man-in-the-middle a acks.
8. Limita ons of SET
 Complex implementa on.
 Required all par cipants to have digital cer ficates and specific so ware.
 Never gained widespread adop on due to usability issues.
 Gradually replaced by SSL/TLS with 3D Secure, tokeniza on, and other modern payment
protocols.
9. Evolu on Post-SET
 3D Secure (like Visa Secure, Mastercard Iden ty Check) offers similar protec ons in a more
user-friendly manner.
 Tokeniza on, biometrics, and EMV chips are modern techniques used for card security.
 Mobile wallets (Google Pay, Apple Pay) also offer secure payment channels.
Conclusion
Although SET is no longer widely used, it laid the founda on for many modern secure payment
systems. Its concepts of digital cer ficates, encryp on, and dual signature con nue to influence
today’s payment security protocols. Understanding SET helps in grasping the evolu on of online
transac on security.
Q3: Explain XML in Detail
XML (eXtensible Markup Language) is a widely used markup language that defines rules for
encoding documents in a format that is both human-readable and machine-readable. It is extensively
used in web technologies, data exchange, configura on files, and more.
1. What is XML?
 XML stands for eXtensible Markup Language.
 Developed by W3C as a standard to store and transport data.
 It is a self-descrip ve language, meaning it describes its content using custom-defined tags.
 XML is not a programming language; it's a data representa on language.
2. Features of XML
 Simplicity: Easy to read and write.
 Extensibility: Users can define their own tags and structure.
 Self-descrip ve: Data is wrapped within meaningful tags.
 Pla orm Independent: Works across all pla orms and systems.
 Unicode Support: Can handle virtually any language.
3. Basic Structure of XML
An XML document has a hierarchical tree structure. Here’s an example:
xml
CopyEdit
<employee>
<name>Shaik</name>
<id>101</id>
<department>IT</department>
</employee>
 <employee> is the root element.
 Tags like <name>, <id>, and <department> are child elements.
4. XML Declara on
An XML document may start with a declara on like:
xml
CopyEdit
<?xml version="1.0" encoding="UTF-8"?>
 This specifies the XML version and character encoding.
5. Elements and A ributes
Elements:
 Represent data using tags.
 Can be nested within other elements.
A ributes:
 Provide addi onal informa on within an element.
Example:
xml
CopyEdit
<employee id="101">
<name>Shaik</name>
</employee>
6. Well-Formed XML Rules
To be a valid XML document, it must follow certain rules:
 Must have a single root element.
 Tags must be properly closed.
 Tags must be properly nested.
 A ribute values must be in quotes.
 Case-sensi ve tags (i.e., <Name> ≠ <name>).
7. XML Namespaces
Used to avoid element name conflicts when combining documents from different XML vocabularies.
Example:
xml
CopyEdit
<book xmlns:ns1="h p://[Link]/ns1">
<ns1: tle>XML Guide</ns1: tle>
</book>
8. XML vs HTML
XML HTML
Designed to store and transport data Designed to display data
Custom tags allowed Fixed tag set
Data-centric Presenta on-centric
Strict syntax Flexible syntax
9. XML Schema (XSD) and DTD
 DTD (Document Type Defini on) and XSD (XML Schema Defini on) are used to validate
XML structure.
 XSD is more powerful and supports data types.
Example XSD snippet:
xml
CopyEdit
<xs:element name="name" type="xs:string"/>
10. Use Cases of XML
 Data Interchange: Between systems (e.g., in SOAP APIs).
 Web Services: Especially in SOAP.
 RSS Feeds: For news and blog syndica on.
 Configura on Files: (e.g., [Link]fig in .NET).
 Document Storage: Office formats like .docx, .xlsx are ZIP archives of XML files.
11. Parsing XML
Two main methods:
 DOM (Document Object Model): Loads the en re XML into memory as a tree.
 SAX (Simple API for XML): Event-based parser; faster and uses less memory.
12. Advantages of XML
 Pla orm and language independent.
 Flexible and extensible.
 Integrates with many tools and technologies.
 Suitable for both simple and complex data structures.
13. Disadvantages of XML
 Verbose and can be large in size.
 Parsing can be slow for very large files.
 Less human-friendly compared to JSON.
14. XML vs JSON
Feature XML JSON
Format Markup Key-Value pairs
Verbosity More verbose Less verbose
Readability Less More
Data Types Needs schema Na ve support
Use in APIs Mostly SOAP Mostly REST
Conclusion
XML remains a powerful and flexible data format, especially in enterprise systems, configura on
files, and services that need strict structure and valida on. Although JSON is now widely adopted in
web APIs due to its simplicity, XML con nues to be relevant in systems where data integrity,
extensibility, and valida on are cri cal.
Q4: Describe Methodologies for Session Management Tes ng
Session Management Tes ng is a crucial part of web applica on security and func onal tes ng. It
ensures that a user’s session is correctly handled, secure, and cannot be hijacked or manipulated by
a ackers. A session represents a series of interac ons between a user and a web applica on a er
authen ca on.

1. What is a Session?
 A session is a temporary stateful interac on between a client and server.
 A er a successful login, the server assigns a Session ID (typically stored in cookies, headers,
or URLs) to iden fy and maintain the user's state.

2. Why is Session Management Important?


 Prevents unauthorized access.
 Manages user state in stateless HTTP protocol.
 Protects sensi ve data and user ac ons.
 Mi gates risks like session hijacking, fixa on, meout exploits, etc.

3. Key Areas in Session Management


 Session ID genera on
 Session ID transmission and storage
 Session expira on and meout
 Session regenera on a er login
 Logout and session invalida on

4. Session Management Tes ng Methodologies


A. Session ID Analysis
 Objec ve: Ensure session IDs are random, unique, and long enough.
 Tools: Burp Suite, OWASP ZAP, Postman.
 How:
o Capture mul ple session IDs and analyze pa erns.
o Check for predictability using entropy analysis tools.
o Look for reuse of session IDs across logins.
B. Session Timeout Tes ng
 Objec ve: Ensure session expires a er inac vity.
 How:
o Log in and stay idle for the meout period (e.g., 15 mins).
o Try accessing a protected page a er meout.
o Expect redirec on to login page.
C. Session Expiry a er Logout
 Objec ve: Confirm sessions are destroyed a er logout.
 How:
o Log in and then log out.
o Press browser back or use session cookie again.
o Verify that access is denied.
D. Session Fixa on Tes ng
 Objec ve: Ensure the server assigns a new session ID a er login.
 A ack Simula on:
o A acker fixes a known session ID before vic m logs in.
o If server does not issue a new ID post-login, session fixa on vulnerability exists.
 Fix: Always regenerate a session ID a er login.
E. Session Hijacking Tes ng
 Objec ve: Test if sessions can be stolen and reused.
 How:
o Capture session ID using network tools (e.g., Wireshark if HTTP).
o Replay the session ID in a different browser.
o If access is granted, hijacking is possible.
 Fixes: Use HTTPS, H pOnly cookies, IP binding, user-agent valida on.
F. Concurrent Session Tes ng
 Objec ve: Check how the applica on handles mul ple ac ve logins.
 How:
o Log in from mul ple devices/browsers.
o Test whether previous sessions are invalidated or kept alive.
 Security Concern: Concurrent sessions can increase hijacking risk.
G. Cookie A ribute Tes ng
 A ributes to Test:
o Secure: Should be enabled to restrict cookie to HTTPS.
o H pOnly: Prevents client-side JavaScript from accessing cookie.
o SameSite: Prevents cross-site request forgery (CSRF).
 Tools: Burp Suite, browser developer tools.
H. Transport Layer Protec on
 Objec ve: Ensure session tokens are never transmi ed over insecure (HTTP) channels.
 How:
o Use a proxy tool to force HTTP and monitor if session cookies are exposed.
o Sessions must only work over HTTPS.
I. Brute Force Protec on on Session IDs
 Objec ve: Ensure session IDs are not guessable.
 How:
o Try genera ng session IDs manually.
o Test the format and structure.
o Use automa on tools to simulate session guessing.

5. Tools Used in Session Tes ng


 Burp Suite: Intercepts and manipulates session data.
 OWASP ZAP: Open-source security tes ng tool.
 Wireshark: Sniffs packets for session leakage.
 Postman: Tests session headers and cookies in APIs.

6. OWASP Guidelines
According to OWASP, session management must:
 Generate unpredictable session iden fiers.
 Bind sessions to specific users and user agents.
 Implement absolute and idle meouts.
 Invalidate sessions completely a er logout.

7. Automa on in Session Tes ng


 Selenium or Cypress can automate login/logout and session handling.
 Custom scripts can check session token reuse, concurrent session behavior, and meout
handling.

8. Common Vulnerabili es in Session Management


Vulnerability Impact
Session Fixa on A acker logs in using vic m's session
Session Hijacking A acker uses valid session ID
Weak Session Timeout Session remains ac ve indefinitely
Session Not Invalidated Allows reuse of old sessions

9. Mi ga on Best Prac ces


 Use strong, random session IDs (128-bit or higher).
 Enforce HTTPS.
 Set H pOnly, Secure, and SameSite cookie flags.
 Invalidate sessions on logout or inac vity.
 Implement user-specific checks (IP, user agent).
 Log session ac vity.

Conclusion
Session management tes ng is vital to ensure that users remain secure throughout their interac on
with a web applica on. Any weakness in session handling could allow a ackers to impersonate users
and perform unauthorized ac ons. Therefore, strong, well-tested session controls form the
founda on of secure web applica ons.
Q5: Describe Architecture and Characteris cs of Web Services
Web services are standardized ways of integra ng web-based applica ons using open standards over
an internet protocol backbone. They allow different applica ons from various sources to
communicate with each other without me-consuming custom coding.

1. What is a Web Service?


 A web service is a so ware module that performs a specific task and communicates using
standard web protocols.
 It enables interoperability between different applica ons over the web.
 Typically uses HTTP for communica on and XML/JSON for data exchange.

2. Types of Web Services


A. SOAP (Simple Object Access Protocol)
 Protocol-based web service.
 Uses XML for request and response.
 Strict standards (WSDL, XSD).
 Suitable for enterprise-level applica ons.
B. REST (Representa onal State Transfer)
 Architectural style using standard HTTP methods (GET, POST, PUT, DELETE).
 Lightweight, uses JSON or XML.
 Widely used in modern web/mobile APIs.

3. Architecture of Web Services


The architecture includes three main roles:
A. Service Provider
 Hosts the web service.
 Publishes its defini on (like WSDL in SOAP).
 Handles client requests.
B. Service Consumer (Client)
 Calls the web service.
 Sends requests and consumes responses.
 Can be a web app, mobile app, or another web service.
C. Service Registry (op onal)
 Directory to publish and discover services.
 Example: UDDI (Universal Descrip on, Discovery, and Integra on).

4. Web Service Architecture Diagram


rust
CopyEdit
[Client] <---> [Internet] <---> [Web Server / Applica on Server] <---> [Database / Logic]
<--HTTP / SOAP / REST--> |
Business Logic / Web Service

5. Components of Web Services (SOAP-Based)


 WSDL (Web Service Descrip on Language): Defines what the service does, how to access it,
and where it is located.
 SOAP: Messaging protocol using XML.
 UDDI: Service discovery registry.
 XML Schema: Defines the data format used.

6. RESTful Web Service Architecture


 Stateless client-server model.
 Uses HTTP verbs:
o GET: Retrieve data.
o POST: Create data.
o PUT: Update data.
o DELETE: Remove data.
 Uses URLs as resource iden fiers.

7. Characteris cs of Web Services


Characteris c Descrip on
Interoperability Works across pla orms, languages, and devices.
Standardized Protocols Uses HTTP, XML, JSON, SOAP, WSDL, etc.
Loosely Coupled Changes in one system don’t affect others directly.
Reusable Once created, a web service can be reused across many applica ons.
Stateless Each request is independent (especially in REST).
Discoverable Can be published and discovered (via WSDL or UDDI).
Scalable and Modular Easy to scale and break down into microservices.

8. Benefits of Web Services


 Cross-pla orm communica on.
 Language-independent (Java client can talk to .NET service).
 Integra on of legacy systems with new applica ons.
 Facilitates distributed compu ng.
 Supports cloud applica ons and microservices.

9. Use Cases of Web Services


 Payment Gateways: Razorpay, PayPal APIs.
 Weather Data: Fetching real- me weather updates.
 Social Media Integra on: Pos ng to Facebook, Twi er via API.
 Shipping & Logis cs: Tracking parcels via carrier APIs.
 Banking Services: Account info, fund transfers, KYC checks.

10. Security in Web Services


 Authen ca on: API keys, OAuth, JWT.
 Encryp on: HTTPS, XML Encryp on.
 Integrity: XML Signature, HMAC.
 Authoriza on: Role-based access control (RBAC).

11. Challenges in Web Services


 Managing mul ple APIs.
 Versioning and backward compa bility.
 Security threats like injec on, man-in-the-middle, etc.
 High traffic scalability.
 Fault tolerance in distributed systems.

12. Tools and Technologies


Tool/Tech Purpose
Postman Tes ng APIs
SoapUI Tes ng SOAP/REST services
Swagger Documen ng and tes ng REST
WSDL Editor Designing SOAP services
API Gateway Managing service access & security

13. Web Services vs Web APIs


Web Services Web APIs
Formal (SOAP, WSDL) Informal or REST-based
XML only JSON, XML, others
Strict standards Flexible and lightweight
Suitable for enterprise Popular in mobile/web apps

14. Future Trends


 GraphQL: More flexible alterna ve to REST.
 gRPC: High-performance RPC framework.
 Microservices: Web services are core to microservices architecture.
 Serverless APIs: Cloud-na ve, event-driven services.

Conclusion
Web services are founda onal to modern applica on architecture. Whether SOAP or RESTful, they
provide a standard way to enable communica on and data exchange between heterogeneous
systems. Their characteris cs such as interoperability, loose coupling, and reusability make them
ideal for enterprise and cloud-na ve environments.

You might also like