From 1f4d23d0b171515dfe140a9c6e4cd8acee849990 Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Wed, 13 Sep 2023 14:14:00 +0330 Subject: [PATCH 01/17] start --- 3-frames-and-windows/06-clickjacking/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 696105358..cefc50c0e 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -1,4 +1,4 @@ -# The clickjacking attack +# حمله‌ی کلیک جک The "clickjacking" attack allows an evil page to click on a "victim site" *on behalf of the visitor*. From a735ea8f837966317055e540b93e9081ef4f568a Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Wed, 13 Sep 2023 19:38:48 +0330 Subject: [PATCH 02/17] line 18 --- .../06-clickjacking/article.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index cefc50c0e..05cc87d06 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -1,21 +1,21 @@ # حمله‌ی کلیک جک -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 From 1508f25403055a7ba53f7343bb17d204f125b46e Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Sun, 17 Sep 2023 08:05:59 +0330 Subject: [PATCH 07/17] line 144 --- 3-frames-and-windows/06-clickjacking/article.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 19c5ab543..8f2b52aaa 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -121,26 +121,26 @@ window.onbeforeunload = function() { ## 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`. ````online -Here's the result: +نتیجه اینجاست: ```html From 490a52e0dd24eedc5eaf5718cbb3deb4783a4975 Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Sun, 17 Sep 2023 11:56:34 +0330 Subject: [PATCH 08/17] line 190 --- .../06-clickjacking/article.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 8f2b52aaa..4a2b8fae9 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -137,7 +137,7 @@ window.onbeforeunload = function() { `ALLOW-FROM domain` : گر parent document از دامنه‌ی داده شده باشد، درون یک فریم را مجاز می‌کند. -For instance, Twitter uses `X-Frame-Options: SAMEORIGIN`. +برای مثال، Twitter از `X-Frame-Options: SAMEORIGIN` استفاده می‌کند. ````online نتیجه اینجاست: @@ -149,16 +149,16 @@ For instance, Twitter uses `X-Frame-Options: SAMEORIGIN`. -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)!
+
...و تو باحال هستی (در واقع من یک هکر باحال هستم)
From 4e089657597042f17b3bf42b1d111f235953d99a Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Mon, 18 Sep 2023 12:55:50 +0330 Subject: [PATCH 12/17] Update index.html --- .../06-clickjacking/clickjacking.view/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)!
+
...و تو باحال هستی (در واقع من یک هکر باحال هستم)!
From fba07052dfee679fb357010b6bd8c3b9e28b60b7 Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Mon, 18 Sep 2023 13:01:04 +0330 Subject: [PATCH 13/17] Update iframe.html --- .../06-clickjacking/protector.view/iframe.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 اما اگر صفحه درون یک - + From 29d0f513ff803e3b3fc8e1115a6c75a200a2a8b3 Mon Sep 17 00:00:00 2001 From: Shahrzad Javadi Koushesh Date: Mon, 18 Sep 2023 13:02:31 +0330 Subject: [PATCH 14/17] Update iframe.html --- .../06-clickjacking/top-location.view/iframe.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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