diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 696105358..aa21fb2ed 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -1,79 +1,79 @@ -# The clickjacking attack +# حمله‌ی clickjacking -The "clickjacking" attack allows an evil page to click on a "victim site" *on behalf of the visitor*. +حمله‌ی "clickjacking" به یک صفحه‌ی شیطانی اجازه می‌دهد تا روی "سایت قربانی" *از طرف بازدیدکننده* کلیک کند. -Many sites were hacked this way, including Twitter, Facebook, Paypal and other sites. They are all fixed, of course. +تعداد زیادی از سایت‌ها با این راه هک می‌شوند، شامل Twitter، Facebook، Paypal و سایت‌های دیگر. البته همه‌ی آن‌ها درست شده‌اند. -## The idea +## ایده -The idea is very simple. +ایده بسیار ساده است. -Here's how clickjacking was done with Facebook: +اینجا می‌گوییم که clickjacking چگونه با Facebook انجام شد: -1. A visitor is lured to the evil page. It doesn't matter how. -2. The page has a harmless-looking link on it (like "get rich now" or "click here, very funny"). -3. Over that link the evil page positions a transparent ` - + */!* -
...And you're cool (I'm a cool hacker actually)!
+
!و شما باحال هستید(در واقع من یک هکر باحال هستم)...
``` -The full demo of the attack: +نسخه‌ی نمایشی کامل این حمله: [codetabs src="clickjacking-visible" height=160] -Here we have a half-transparent ` ``` -There are other ways to work around that simple protection too. +راه‌های دیگری نیز برای دور زدن این حفاظت ساده وجود دارد. ## X-Frame-Options -The server-side header `X-Frame-Options` can permit or forbid displaying the page inside a frame. +هدر سمت سرور `X-Frame-Options` می‌تواند نمایش صفحه را در یک فریم مجاز یا ممنوع کند. -It must be sent exactly as HTTP-header: the browser will ignore it if found in HTML `` tag. So, `` won't do anything. +این باید دقیقا به عنوان HTTP-header فرستاده شود: اگر مرورگر آن را در HTML `` tag پیدا کند، آن را نادیده می‌گیرد. بنابراین `` هیچ کاری انجام نخواهد داد. -The header may have 3 values: +هدر می‌نواند 3 مقدار داشته باشد: `DENY` -: Never ever show the page inside a frame. +: هیچ‌گاه صفحه را درون یک فریم نشان ندهید. `SAMEORIGIN` -: Allow inside a frame if the parent document comes from the same origin. +: اگر parent document از منبع یکسان بیاید، درون یک فریم را مجاز می‌کند. `ALLOW-FROM domain` -: Allow inside a frame if the parent document is from the given domain. +: گر parent document از دامنه‌ی داده شده باشد، درون یک فریم را مجاز می‌کند. -For instance, Twitter uses `X-Frame-Options: SAMEORIGIN`. +برای مثال، Twitter از `X-Frame-Options: SAMEORIGIN` استفاده می‌کند. ````online -Here's the result: +نتیجه اینجاست: ```html @@ -149,16 +149,16 @@ Here's the result: -Depending on your browser, the `iframe` above is either empty or alerting you that the browser won't permit that page to be navigating in this way. +بسته به مرورگرتان، `iframe` بالا یا خالی است یا به شما هشدار می‌دهد که مرورگر اجازه نمی‌دهد آن صفحه به این روش پیمایش کند. ```` -## Showing with disabled functionality +## نمایش با عملکرد غیرفعال -The `X-Frame-Options` header has a side effect. Other sites won't be able to show our page in a frame, even if they have good reasons to do so. +هدر `X-Frame-Options` یک عارضه‌ی جانبی دارد. بقیه‌ی سایت‌ها قادر نخواهند بود که صفحه‌ی ما را در یک فریم نمایش دهند، حتی اگر دلایل خوبی داشته باشند که انجام دهند. -So there are other solutions... For instance, we can "cover" the page with a `
` with styles `height: 100%; width: 100%;`, so that it will intercept all clicks. That `
` is to be removed if `window == top` or if we figure out that we don't need the protection. +بنابراین، راه‌حل‌های دیگری وجود دارد... برای مثال، می‌توانیم یک صفحه را با یک `
` با استایل‌های `height: 100%; width: 100%;` "پوشش" دهیم، در نتیجه تمام کلیک‌ها را قطع می‌کند. اگر `window == top` یا متوجه شویم که به حفاظت نیازی نداریم، `
` باید حذف شود. -Something like this: +چیزی شبیه به این: ```html -
Click to get rich now:
+
:کلیک کنید تا الان ثروتمند شوید
- + - + -
...And you're cool (I'm a cool hacker actually)!
+
...و تو باحال هستی (در واقع من یک هکر باحال هستم)
diff --git a/3-frames-and-windows/06-clickjacking/clickjacking.view/facebook.html b/3-frames-and-windows/06-clickjacking/clickjacking.view/facebook.html index 6b8231c71..c1a3aef37 100644 --- a/3-frames-and-windows/06-clickjacking/clickjacking.view/facebook.html +++ b/3-frames-and-windows/06-clickjacking/clickjacking.view/facebook.html @@ -3,7 +3,7 @@ - + diff --git a/3-frames-and-windows/06-clickjacking/clickjacking.view/index.html b/3-frames-and-windows/06-clickjacking/clickjacking.view/index.html index 05ec48cb8..385ff7764 100644 --- a/3-frames-and-windows/06-clickjacking/clickjacking.view/index.html +++ b/3-frames-and-windows/06-clickjacking/clickjacking.view/index.html @@ -19,14 +19,14 @@ } -
Click to get rich now:
+
کلیک کنید تا الان ثروتمند شوید:
- + -
...And you're cool (I'm a cool hacker actually)!
+
...و تو باحال هستی (در واقع من یک هکر باحال هستم)!
diff --git a/3-frames-and-windows/06-clickjacking/protector.view/iframe.html b/3-frames-and-windows/06-clickjacking/protector.view/iframe.html index a1ca6fcc9..ab76abaa5 100644 --- a/3-frames-and-windows/06-clickjacking/protector.view/iframe.html +++ b/3-frames-and-windows/06-clickjacking/protector.view/iframe.html @@ -20,7 +20,7 @@ - This text is always visible. + .این متن همیشه قابل دیدن است - But if the page was open inside a document from another domain, the div over it would prevent any actions. + .روی آن از هر فعالیتی جلوگیری می‌کرد div از یک دامنه‌ی دیگر باز بود document اما اگر صفحه درون یک - + diff --git a/3-frames-and-windows/06-clickjacking/top-location.view/iframe.html b/3-frames-and-windows/06-clickjacking/top-location.view/iframe.html index da477f400..da2e5c42f 100644 --- a/3-frames-and-windows/06-clickjacking/top-location.view/iframe.html +++ b/3-frames-and-windows/06-clickjacking/top-location.view/iframe.html @@ -7,7 +7,7 @@ -
Changes top.location to javascript.info
+
تغییر می‌دهد javascript.info را به top.location