PYTHONWITHMEDEV Telegram 394
توکن CSRF یه توکن غیرقابل پیشبینی‌عه که برنامه نویس اون رو طراحی می‌کنه. این توکن باید توی درخواست‌های حساس کاربر که به سمت سرور ارسال می‌کنه وجود داشته باشه، در غیر این صورت اون درخواست توسط سرور پردازش نمی‌شه. برای مثال:
<form name="change-email-form" action="/my-account/change-email" method="POST">
<label>Email</label>
<input required type="email" name="email" value="[email protected]">
<input required type="hidden" name="csrf" value="50FaWgdOhi9M9wyna8taR1k3ODOR8d6u">
<button class='button' type='submit'> Update email </button>
</form>
با درست ست شدن توکن CSRF درخواست‌های حساس، شبیه به درخواست زیر ارسال می‌شن:
POST /my-account/change-email HTTP/1.1
Host: normal-website.com
Content-Length: 70
Content-Type: application/x-www-form-urlencoded

csrf=50FaWgdOhi9M9wyna8taR1k3ODOR8d6u&[email protected]
و با وجود توکن CSRF جلوی این آسیب پذیری گرفته می‌شه. چرا که مهاجم نمی‌تونه این توکن رو حدس بزنه و درخواست کاربر رو جعل کنه.
البته این رو هم توجه کنید که توکن CSRF همیشه به عنوان یه پارامتر مخفی با متد POST ارسال نمی‌شه و توی برخی موارد به عنوان یه هدر HTTP هم ست می‌شه.



tgoop.com/pythonwithmedev/394
Create:
Last Update:

توکن CSRF یه توکن غیرقابل پیشبینی‌عه که برنامه نویس اون رو طراحی می‌کنه. این توکن باید توی درخواست‌های حساس کاربر که به سمت سرور ارسال می‌کنه وجود داشته باشه، در غیر این صورت اون درخواست توسط سرور پردازش نمی‌شه. برای مثال:
<form name="change-email-form" action="/my-account/change-email" method="POST">
<label>Email</label>
<input required type="email" name="email" value="[email protected]">
<input required type="hidden" name="csrf" value="50FaWgdOhi9M9wyna8taR1k3ODOR8d6u">
<button class='button' type='submit'> Update email </button>
</form>
با درست ست شدن توکن CSRF درخواست‌های حساس، شبیه به درخواست زیر ارسال می‌شن:
POST /my-account/change-email HTTP/1.1
Host: normal-website.com
Content-Length: 70
Content-Type: application/x-www-form-urlencoded

csrf=50FaWgdOhi9M9wyna8taR1k3ODOR8d6u&[email protected]
و با وجود توکن CSRF جلوی این آسیب پذیری گرفته می‌شه. چرا که مهاجم نمی‌تونه این توکن رو حدس بزنه و درخواست کاربر رو جعل کنه.
البته این رو هم توجه کنید که توکن CSRF همیشه به عنوان یه پارامتر مخفی با متد POST ارسال نمی‌شه و توی برخی موارد به عنوان یه هدر HTTP هم ست می‌شه.

BY 🧑‍💻Cyber.vision🧑‍💻


Share with your friend now:
tgoop.com/pythonwithmedev/394

View MORE
Open in Telegram


Telegram News

Date: |

Although some crypto traders have moved toward screaming as a coping mechanism, several mental health experts call this therapy a pseudoscience. The crypto community finds its way to engage in one or the other way and share its feelings with other fellow members. 2How to set up a Telegram channel? (A step-by-step tutorial) The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said. Don’t publish new content at nighttime. Since not all users disable notifications for the night, you risk inadvertently disturbing them. The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.”
from us


Telegram 🧑‍💻Cyber.vision🧑‍💻
FROM American