فارسی :
English :
درود درود
بچه ها تو این چنل میخوایم Security Code Review انجام بدیم.
حالا اصلا این چی هست ؟
- ما میایم و یه تیکه کد آسیب پذیر رو برمیداریم و سعی میکنیم اون آسیب پذیری رو پیدا کنیم و اگر کد پیچیده بود تحلیلش میکنیم.
به چه درد میخوره ؟
- کلا در روز شاید 10 دقیقه وقت بگیره ولی به مرور زمان باعث میشه با نوع نوشتار (Syntax) زبان های مختلف آشنا بشیم ، مایندست برنامه نویسارو به دست بیاریم ، تست های وایت باکس بتو.نیم انجام بدیم ، تست های بلک باکس رو ساده تر درک کنیم و ...
این تحلیل ها هم برای برنامه نویس ها مناسبه که امن تر کد بزنن هم هانترها و هکرا و ردتیمرا و خلاصه که همه.
نظری انتقادی بود خوشحال میشم : @ScriptKiddo0o0
English :
Hello, hello!
Guys, in this channel, we want to conduct a Security Code Review.
So, what is this exactly?
We take a piece of vulnerable code and try to find the vulnerability, and if the code is complex, we analyze it.
What is it good for?
It might take about 10 minutes a day, but over time it helps us become familiar with the syntax of different languages, understand the mindset of programmers, perform white-box testing, and better understand black-box testing, and so on.
These analyses are suitable for programmers to code more securely, as well as for hunters, hackers, red teamers, and basically everyone.
If you have any critical opinions, I’d be happy to hear them: @ScriptKiddo0o0
🔥9❤4👌3👍2🎉1
Security Code Review #c1
Environment : #PHP
آسیب پذیری کجاست ؟
Where is the vulnerability ?
فارسی :
English :
Environment : #PHP
آسیب پذیری کجاست ؟
Where is the vulnerability ?
فارسی :
داخل این تیکه کد ها ممکنه باگ های زیادی باشه ما کار به این باگ ها نداریم ، اون چیزی که مدنظر ماعه آسیب پذیری هست که ایمپکت داره.
این کد به حمله CSRF آسیب پذیره ، چرا ؟ چون هیچ CSRF توکنی استفاده و چک نشده.
لاین 14 و 17 صرفا ولید بودن ایمیل چک میشه.
و در آخر تابع EditUser صدا زده میشه.
پس اگر ما به عنوان کاربر نرمال وارد سایت اتکر بشیم ، اتکر میتونه از طرف ما یک درخواست ولید ارسال کنه و ایمیل مارو تغیر بده.
There might be many bugs in these code snippets, but we are not concerned with those bugs. What we are focused on is the vulnerability that has an impact. This code is vulnerable to a CSRF attack. Why? Because no CSRF token is used or checked. Lines 14 and 17 only check for the validity of the email. Finally, the EditUser function is called. So, if we log into the attacker’s site as a normal user, the attacker can send a valid request on our behalf and change our email.
❤5👍5🤔2
Security Code Review #c2
Environment : #PHP
آسیب پذیری رو اکسپلویت کنین.
Solution :
فارسی :
English :
Environment : #PHP
آسیب پذیری رو اکسپلویت کنین.
Solution :
فارسی :
اکسپلویتش میشه : shell.jpg.php
کل مشکل تو لاین 15 هست که ریجکسش مشکل داره.
تو لاین 15 مثلا چک میکنه که آیا فایل دریافتی عکس هست یا نه ( checker function )
این ریجکس داره میگه که آقا تو رشته ای که (اسم فایل) برای من ارسال شده باید نقطه باشه به اضافه jpg یا jpeg یا png ، درغیراینصورت خطا برمیگردونم.
ماهم میگیم اوکی و یه فایل php براش ارسال میکنیم با این اسم : shell.jpg.php
English :
The vulnerability can be exploited by using a file named shell.jpg.php.
The entire issue is in line 15, where the regex has a problem. In line 15, it checks whether the received file is an image or not (checker function). This regex is saying that in the string (file name) sent to me, there must be a dot followed by jpg, jpeg, or png; otherwise, it returns an error. We say okay and send a PHP file with this name: `shell.jpg.php
👍5❤2😁1
❤2
Security Code Review #c4
Environment : #PHP
کدوم خط آسیب پذیره ؟
(اکسپلویت کنین)
Solution :
فارسی :
English :
Environment : #PHP
کدوم خط آسیب پذیره ؟
(اکسپلویت کنین)
Solution :
فارسی :
با path traversal میتونیم فایل های دیگه رو بخونیم ولی چجوری ؟
فقط کافیه این پیلود رو وارد کنیم :
/../secret.txt
اتفاقی که میوفته :
include(index_/../secret.txt)
English :
The vulnerable line is the one that allows for path traversal. By using a payload like /../secret.txt, you can exploit this vulnerability. The code effectively executes something like:
include(index_/../secret.txt);
This allows you to read other files on the server.
👏7👍2
Security Code Review #c5
Environment : #PHP
Environment : #PHP
کدوم خط آسیب پذیره ؟
(اکسپلویت کنین و فلگ رو به دست بیارین)
بچه ها شاید آسیب پذیری تو نگاه اول قابل تشخیص باشه ولی اصل کار اکسپلویت کردنشه که برای درک بهتر میتونین تو لوکال رانش کنین.
Which line is vulnerable?
(Exploit it and get the flag)
Guys, the vulnerability might be obvious at first glance, but the main task is exploiting it, which you can better understand by running it locally.
👍6❤3
👍5❤4👏3
