🔎 Exploitation and Countermeasures for Modern Web Applications
✍️ Andrew Hoffman

#Security
#Hack
#Hacker
#Hacking
#Security
#Web_applications
#Bug
#Hunting
#Bounty
#Cybersecurity
#DoS
#XSS
#XXE
#CSRF
#CDN
#GraphQL
🛡️ امنیت برنامههای وب؛ از شناسایی و حمله تا دفاع
🔐 ویرایش دوم کتاب تحسینشده Web Application Security امنیت برنامههای وب را در سه ستون اصلی Recon، Offense و Defense آموزش میده. کتاب از شناسایی معماری و نقاط ضعف شروع میشه، روشهای حمله را بررسی میکنه و در نهایت به طراحی دفاعهای مؤثر و ماندگار میرسه.
✨ ویژگیهای کلیدی
🔎 با تکنیکهای Recon برای نقشهبرداری و مستندسازی برنامههای وب از راه دور، پیداکردن Subdomainها، تحلیل APIها و شناسایی وابستگیهای Third-Party آشنا میشی.
⚔️ روشهای حمله به برنامههای وب با استفاده از XSS، CSRF، XXE، Injection، DoS، حملات Client-Side و آسیبپذیریهای Business Logic بررسی میشن.
🛡️ یاد میگیری برای حملات مطرحشده، راهکارهای دفاعی مؤثر و بادوام طراحی کنی و Security را در معماری، پیکربندی، تجربه کاربری و Code Review وارد کنی.
🌐 ویرایش دوم فناوریهای جدیدتری مثل GraphQL، NoSQL Databaseها، استقرارهای Cloud-Based، Content Delivery Network یا CDN و Server-Side Rendering یا SSR را هم پوشش میده.
📚 بیش از صد صفحه محتوای تازه، دهها صفحه ویرایششده و مباحث پیشرفتهتر در فصلهای مختلف اضافه شده تا متخصصان ارشد Security هم استفاده بیشتری از کتاب داشته باشن.
📘 توضیح کتاب
🧱 اندرو هافمن در ویرایش اول این کتاب، سه ستون اصلی Application Security یعنی Reconnaissance، Offense و Defense را تعریف کرد. در ویرایش دوم بازبینیشده و بهروزشده، دهها موضوع مرتبط بررسی میشن؛ از جدیدترین حملات و روشهای Mitigation گرفته تا Threat Modeling، چرخه امن توسعه نرمافزار یا SSDL/SDLC و موضوعات دیگر.
🔎 ستون اول، یعنی Recon، تکنیکهای لازم برای نقشهبرداری و مستندسازی برنامههای وب از راه دور را آموزش میده. این بخش ساختار برنامههای وب مدرن، کشف Subdomainها، تحلیل API، وابستگیهای Third-Party و نقاط ضعف معماری برنامه را بررسی میکنه.
⚔️ ستون دوم، یعنی Offense، به روشهای حمله به برنامههای وب اختصاص داره. در این بخش مجموعهای از Exploitهای مؤثر بررسی میشن که کارایی آنها توسط برخی از بهترین هکرهای دنیا ثابت شده است. مهارتهای این بخش زمانی ارزش بیشتری پیدا میکنن که در کنار مباحث دفاعی ستون سوم استفاده بشن.
🛡️ ستون سوم، یعنی Defense، بر مهارتهای بهدستآمده در دو بخش قبلی بنا شده است. در این قسمت یاد میگیری برای هر حمله مطرحشده در بخش Offense، راهکارهای دفاعی مؤثر و ماندگاری طراحی کنی و Security را در معماری، پیکربندی، User Experience، Code Review، Vulnerability Discovery و Vulnerability Management وارد کنی.
☁️ هافمن که Senior Staff Security Engineer در Ripple است، اطلاعاتی درباره Exploitها و Mitigationهای چند فناوری دیگر برنامههای وب هم ارائه میده. این فناوریها شامل GraphQL، استقرارهای Cloud-Based، CDN و SSR میشن.
🧠 کتاب فقط روش دفاع در برابر هکرها را توضیح نمیده، بلکه مراحل بررسی و نفوذ آنها به یک برنامه وب را هم دنبال میکنه. تکنیکهایی بررسی میشن که امروزه برای حمله به برنامههای تحت وب شرکتها، دولتها و گاهی پروژههای شخصی استفاده میشن؛ سپس روشهای ایمنسازی برنامهها در برابر این تهدیدها توضیح داده میشن.
🏗️ در طول این مسیر با شیوههای تازهای برای فکرکردن درباره Application Architecture آشنا میشی و یاد میگیری Security Best Practiceها را در یک Engineering Organization ادغام کنی. کتاب همچنین مجموعهای از روشهای دفاع در برابر رایجترین و خطرناکترین حملات امروزی به برنامههای وب را ارزیابی میکنه.
🎯 پس از مطالعه کتاب، میتونی بدون دسترسی به Source Code عملیات Recon انجام بدی، Threat Vectorها و آسیبپذیریها را شناسایی کنی و Payloadهایی برای بهخطرانداختن دادهها، مختلکردن Execution Flow یا ایجاد اختلال در عملکرد مورد انتظار برنامه بسازی. در کنار این مهارتها، میتونی بخشهای پرریسک Codebase را پیدا کنی و کدی بنویسی که از برنامه و کاربرانش در برابر حملات محافظت کنه.
🆕 تغییرات نسبت به ویرایش اول
📄 ویرایش دوم در مقایسه با ویرایش اول بیش از صد صفحه محتوای جدید داره و علاوه بر آن، دهها صفحه از مطالب قبلی نیز ویرایش شدهاند.
📈 ویرایش اول بیشتر برای مهندسان سطح Entry و Mid-Level نوشته شده بود، اما بازخورد خوانندگان نشان داد که به محتوای پیشرفتهتری برای ادامه مسیر یادگیری هر فصل نیاز دارن. به همین دلیل، بیشتر فصلهای ویرایش دوم حالا مطالب پیشرفته هم دارن تا متخصصان ارشد Security استفاده بیشتری از کتاب ببرن.
🌐 محتوای کتاب بهشکل گستردهای برای پوشش فناوریهای جدید بهروزرسانی شده است. مثالها و کدهای تازهای برای حمله و ایمنسازی فناوریهای جدید اما رایج برنامههای وب، از جمله GraphQL و NoSQL Databaseها، اضافه شدهاند.
🛠️ بخشهای قابلتوجهی از محتوای Security ویرایش دوم کاملا تازه هستن و جدیدترین و محبوبترین فناوریهای برنامههای وب را پوشش میدن. در هر فصل محتوای پیشرفتهتری قرار گرفته و دهها، و شاید صدها، پیشنهاد و درخواست خوانندگان و ویراستاران در صفحات کتاب اعمال شده است.
🎓 هدف اینه که کتاب ساختاری منظم و خواندنی داشته باشه و پس از پایان مطالعه، دانش و دیدگاههای تازهای به دست بیاری که مجموعه مهارتهای Information Security را تقویت کنن.
🎯 چیزهایی که یاد میگیری
🔍 یاد میگیری بدون دسترسی به کد، Recon انجام بدی و ساختار و سطح حمله یک Web Application را مستند کنی.
🌐 میتونی Subdomainها، APIها، وابستگیهای Third-Party و نقاط ضعف Application Architecture را شناسایی کنی.
⚔️ با نحوه عملکرد حملاتی مثل XSS، CSRF، XXE، Injection، DoS و حملات Client-Side آشنا میشی.
📦 یاد میگیری حملات مرتبط با دادهها، Objectها، وابستگیهای Third-Party و Business Logic را تحلیل کنی.
🏗️ میتونی Threat Modeling انجام بدی و معماری، پیکربندی و تجربه کاربری امنتری طراحی کنی.
🧪 با Security Code Review، Vulnerability Discovery و Vulnerability Management آشنا میشی.
🎯 یاد میگیری Payloadهایی بسازی که ضعفهای برنامه را در یک محیط مجاز و کنترلشده ارزیابی کنن.
🛡️ میتونی بخشهای پرریسک Codebase را تشخیص بدی و برای مقابله با حملات رایج، کد و Mitigationهای مناسب طراحی کنی.
👤 این کتاب برای چه کسانیه؟
💻 این کتاب برای Software Engineerها، Web Developerها، Application Security Engineerها، Penetration Testerها و متخصصان Cybersecurity مناسبه که میخوان فرایند شناسایی، بهرهبرداری و دفاع از برنامههای وب را یکپارچه یاد بگیرن.
📈 ویرایش اول بیشتر روی مهندسان Entry-Level و Mid-Level تمرکز داشت، اما ویرایش دوم در بیشتر فصلها محتوای پیشرفتهتری ارائه میده و برای متخصصان ارشد Security هم کاربرد بیشتری داره.
📌 حداقل پیشنیاز کتاب، سابقه مهندسی نرمافزار در سطح متوسط است. برای دنبالکردن مثالها باید مهارتهای زیر را داشته باشی:
➕ این مهارتها حداقل معیار لازم برای دنبالکردن موفق مثالهای کتاب هستن. هر تجربهای فراتر از این موارد، مطالعه کتاب و استفاده آموزشی از آن را سادهتر میکنه.
📖 فهرست مطالب
فصل ۱. تاریخچه Security در نرمافزار
بخش اول. Recon
فصل ۲. مقدمهای بر Reconnaissance برنامههای وب
فصل ۳. ساختار یک برنامه وب مدرن
فصل ۴. پیداکردن Subdomainها
فصل ۵. تحلیل API
فصل ۶. شناسایی وابستگیهای Third-Party
فصل ۷. شناسایی نقاط ضعف در معماری برنامه
فصل ۸. جمعبندی بخش اول
بخش دوم. Offense
فصل ۹. مقدمهای بر هک برنامههای وب
فصل ۱۰. Cross-Site Scripting
فصل ۱۱. Cross-Site Request Forgery
فصل ۱۲. XML External Entity
فصل ۱۳. Injection
فصل ۱۴. Denial of Service
فصل ۱۵. حمله به دادهها و Objectها
فصل ۱۶. حملات Client-Side
فصل ۱۷. بهرهبرداری از وابستگیهای Third-Party
فصل ۱۸. آسیبپذیریهای Business Logic
فصل ۱۹. جمعبندی بخش دوم
بخش سوم. Defense
فصل ۲۰. ایمنسازی برنامههای وب مدرن
فصل ۲۱. معماری امن برنامه
فصل ۲۲. پیکربندی امن برنامه
فصل ۲۳. تجربه کاربری امن
فصل ۲۴. Threat Modeling برنامهها
فصل ۲۵. بررسی امنیتی کد
فصل ۲۶. کشف آسیبپذیری
فصل ۲۷. مدیریت آسیبپذیری
فصل ۲۸. دفاع در برابر حملات XSS
فصل ۲۹. دفاع در برابر حملات CSRF
فصل ۳۰. دفاع در برابر XXE
فصل ۳۱. دفاع در برابر Injection
فصل ۳۲. دفاع در برابر DoS
فصل ۳۳. دفاع از دادهها و Objectها
فصل ۳۴. دفاع در برابر حملات Client-Side
فصل ۳۵. ایمنسازی وابستگیهای Third-Party
فصل ۳۶. کاهش خطر آسیبپذیریهای Business Logic
فصل ۳۷. جمعبندی بخش سوم
👤 درباره نویسنده
🛡️ اندرو هافمن Senior Staff Security Engineer در Ripple است و تخصص او روی آسیبپذیریهای عمیق امنیتی DOM و JavaScript تمرکز داره.
🌐 او با تمام Browser Vendorهای اصلی و همچنین TC39 و Web Hypertext Application Technology Working Group یا WHATWG همکاری کرده است؛ سازمانهایی که مسئول نسخه آینده JavaScript و مشخصات DOM مرورگر هستن.
In the first edition of this critically acclaimed book, Andrew Hoffman defined the three pillars of application security: reconnaissance, offense, and defense. In this revised and updated second edition, he examines dozens of related topics, from the latest types of attacks and mitigations to threat modeling, the secure software development lifecycle (SSDL/SDLC), and more.
Hoffman, senior staff security engineer at Ripple, also provides information regarding exploits and mitigations for several additional web application technologies such as GraphQL, cloud-based deployments, content delivery networks (CDN) and server-side rendering (SSR). Following the curriculum from the first book, this second edition is split into three distinct pillars comprising three separate skill sets:
Table of Contents
Chapter 1. The History of Software Security
Part I. Recon
Chapter 2. Introduction to Web Application Reconnaissance
Chapter 3. The Structure of a Modern Web Application
Chapter 4. Finding Subdomains
Chapter 5. API Analysis
Chapter 6. Identifying Third-Party Dependencies
Chapter 7. Identifying Weak Points in
Application Architecture
Chapter 8. Part I Summary
Part II. Offense
Chapter 9. Introduction to Hacking Web Applications
Chapter 10. Cross-Site Scripting
Chapter 11 . Cross-Site Request Forgery
Chapter 12. XML External Entity
Chapter 13. Injection
Chapter 14. Denial of Service
Chapter 15. Attacking Data and Objects
Chapter 16. Client-Side Attacks
Chapter 17. Exploiting Third-Party Dependencies
Chapter 18. Business Logic Vulnerabilities
Chapter 19. Part II Summary
Part Ill. Defense
Chapter 20. Securing Modern Web Applications
Chapter 21. Secure Application Architecture
Chapter 22. Secure Application Configuration
Chapter 23. Secure User Experience
Chapter 24. Threat Modeling Applications
Chapter 25. Reviewing Code for Security
Chapter 26. Vulnerability Discovery
Chapter 27. Vulnerability Management
Chapter 28. Defending Against XSS Attacks
Chapter 29. Defending Against CSRF Attacks
Chapter 30. Defending Against XXE
Chapter 31. Defending Against Injection
Chapter 32. Defending Against DoS
Chapter 33. Defending Data and Objects
Chapter 34. Defense Against Client-Side Attacks
Chapter 35. Securing Third-Party Dependencies
Chapter 36. Mitigating Business Logic Vulnerabilities
Chapter 37. Part Ill Summary
Changes from the First Edition
You will find a significant number of changes when comparing this book to its prior first edition. There are over one hundred pages of new content, but beyond that there are dozens of edited pages.
The first edition was primarily focused at the entry- and mid-level engineer, but feedback often requested more advanced content from which you could continue down a particular learning path for each chapter. Most chapters now have advanced content offered, and as such my hope is that senior security professionals will now benefit more from reading this book.
Additionally, the book has had a significant amount of updates to incorporate recent technologies. I felt it imperative to add example cases and code for securing and attacking new but common forms of technology in web applications, for example GraphQL and NoSQL databases.
The second edition has significant swaths of new security content including content covering the latest and most popular web application technologies. It also has been modified to include more advanced content per chapter and to incorporate dozens, if not hundreds, of reader and editor suggestions and requests within its pages.
I hope you find this book well organized and enjoyable to read, and that once you have finished it, you walk away with new knowledge and perspectives that enhance your information security skill set.
Prerequisite Knowledge and Learning Goals
This is a book that will not only aid you in learning how to defend your web application against hackers, but will also walk you through the steps hackers take in order to investigate and break into a web application.
Throughout this book we will discuss many techniques that hackers are using today to break into web applications hosted by corporations, governments, and occasionally even hobbyists. Following sufficient investigation into the previously mentioned techniques, we begin a discussion on how to secure web applications against these hackers.
In doing so you will discover brand-new ways of thinking about application architecture. You will also learn how to integrate security best practices into an engineering organization. Finally, we will evaluate a number of techniques for defending against the most common and dangerous types of attacks that occur against web applications today.
After completing Web Application Security, you will have the required knowledge to perform recon techniques against applications you do not have code-level access to. You will also be able to identify threat vectors and vulnerabilities in web applications and craft payloads designed to compromise application data, interrupt execution flow, or interfere with the intended function of a web application.
With these skills in hand, and the knowledge gained from the final section on securing web applications, you will be able to identify risky areas of a web application’s codebase and understand how to write code to defend against attacks that would otherwise leave your application and its users at risk.
Minimum Required Skills
In this book, an “intermediary-level background in software engineering” implies the following:
These skills represent the minimum criteria for successfully following the examples in this book. Any experience you have beyond these bullet points is a plus and will make this book that much easier for you to consume and derive educational value from.
Andrew Hoffman is a senior staff security engineer at Ripple. His expertise is in deep DOM and JavaScript security vulnerabilities. He's worked with every major browser vendor, including TC39 and the Web Hypertext Application Technology Working Group (WHATWG) - organizations responsible for the upcoming version of JavaScript and the browser DOM spec.
رئوف باغجریواقعا کتاب خفنیه چندین و چندین بار خوندمش









