Code Review – Telegram
Code Review
2.72K subscribers
47 photos
5 files
25 links
Security code review
Admin @Scriptkiddo0o0
Download Telegram
Channel created
Channel photo updated
فارسی :
درود درود
بچه ها تو این چنل میخوایم 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
🔥94👌3👍2🎉1
Security Code Review #c1

Environment : #PHP

آسیب پذیری کجاست ؟
Where is the vulnerability ?

فارسی :
داخل این تیکه کد ها ممکنه باگ های زیادی باشه ما کار به این باگ ها نداریم ، اون چیزی که مدنظر ماعه آسیب پذیری هست که ایمپکت داره.
این کد به حمله CSRF آسیب پذیره ، چرا ؟ چون هیچ CSRF توکنی استفاده و چک نشده.
لاین 14 و 17 صرفا ولید بودن ایمیل چک میشه.
و در آخر تابع EditUser صدا زده میشه.
پس اگر ما به عنوان کاربر نرمال وارد سایت اتکر بشیم ، اتکر میتونه از طرف ما یک درخواست ولید ارسال کنه و ایمیل مارو تغیر بده.


English :

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 :

فارسی :
اکسپلویتش میشه : 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
👍52😁1
Security Code Review #c3

Environment : #NodeJS

آسیب پذیری کجاست ؟
Where is the vulnerability ?
2
Security Code Review #c4

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

کدوم خط آسیب پذیره ؟
(اکسپلویت کنین و فلگ رو به دست بیارین)
بچه ها شاید آسیب پذیری تو نگاه اول قابل تشخیص باشه ولی اصل کار اکسپلویت کردنشه که برای درک بهتر میتونین تو لوکال رانش کنین.


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.
👍63
Security Code Review #c6

Environment : #NodeJS #Nginx

چجوری میتونیم به فلگ دسترسی پیدا کنیم؟
یکیش کانفیگ Nginx و اون یکی NodeJS.


How can we access the flag?
one image is Nginx config and the other one is NodeJS.


Hint : It's all your fault Phillip Hallam-Baker.
👍54👏3
Security Code Review #c7

Environment : #Flask

آسیب پذیری کدوم قسمته؟
اصلا آسیب پذیر هست؟


Which part is vulnerable?
Is it vulnerable at all?


Author : logicalhunter
👍8🔥43
Security Code Review #c8

Environment : #PHP

آسیب پذیری کدوم قسمته؟
(اکسپلویت لازم نیست ، همین که با چشم بتونین تشخیص بدین کدوم تیکه آسیب پذیره و آسیب پذیری چی هست کافیه)
پ ن:
این کد چلنج بونس استعدادیابی Blackhole هست. آنچنان تو سناریوهای Real world کاربرد نداره خیلی خیلی کم ، اونم بعضی جاها که به صورت وایت باکس پنتست میشه ، تو بلک باکس هم هست ولی درصدش خیلی پایینه. بیشترین جایی هم که استفاده میشه داخل CTF ها هست.
(جواب داخل کامنت ها هستش)


Which part is vulnerable?

(An exploit is not necessary; just being able to visually identify which part is vulnerable and what the vulnerability is will suffice.)

Note: This code is a bonus challenge for Blackhole talent scouting. It doesn’t have much application in real-world scenarios, very rarely, and only in some cases where white-box pentesting is done. It’s also present in black-box testing, but the percentage is very low. The most common use is in CTFs.

(The answer is in the comments.)
🔥71
Security Code Review #c9

Environment : #Flask

آسیب پذیری کدوم قسمته؟
(چجوری اکسپلویتش کنیم)
پ ن : جواب داخل کامنت ها هستش


Which part is vulnerable?
How to exploit it ?
👍10🔥21
Security Code Review #c10

Environment : #Java

آسیب پذیری کدوم قسمته ؟
(چجور اکسپلویت کنیم؟)
پ ن : جواب تو کامنتا هست.


Which part is vulnerable?
How to exploit it ?
👍5🔥31🐳1
Security Code Review #c11

Environment : #C

وقتشه یکم بریم زبان های سطح پایین تر ، اینجا آسیب پذیری کدوم قسمته ؟
پ ن : جواب و توضیحات تو کامنت


It's time to dive into lower-level languages. Where is the vulnerability here?
4👏2
Security Code Review #c12

Environment : #NodeJS

آسیب پذیری کجاست ؟
چجوری اکسپلویتش کنیم ؟
پ ن : جواب تو کامنتا هست. سناریوهم Real هست.


Where is the vulnerability?
How can we exploit it?
The answer is in the comments. The scenario is real.
👍10
Security Code Review #c13

Environment : #PHP

قسمت آسیب پذیر کجاست؟
و از همه مهم تر چرا آسیب پذیره ؟


Where is the vulnerable part?
And most importantly, why is it vulnerable?


پ ن : بچه ها من یه تایمی نبودم ، درگیر ریکورد کردن یه سری دوره بودم.
یکی از دوره ها JS for bug hunters هست که سعی کردم قسمت هایی که برای برنامه نویس ها هست رو اسکیپ کنم و فقط قسمت هایی که برای Hunter ها نیازه رو آموزش بدم ، امیدوارم جبران اون تایمی ک نبودم باشه :
https://www.huntlearn.com/courses/JS-for-Bug-Bounty-Hunters
👍8