Skip to content

Commit b23bfa8

Browse files
authored
Update 0xa8-injection.md
1 parent a29ed9c commit b23bfa8

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

2019/ar/src/0xa8-injection.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
API8:2019 Injection
2-
===================
1+
<h2 dir='rtl' align='right'> API8:2019 الحقن </h2>
32

4-
| Threat agents/Attack vectors | Security Weakness | Impacts |
5-
| - | - | - |
6-
| API Specific : Exploitability **3** | Prevalence **2** : Detectability **3** | Technical **3** : Business Specific |
7-
| Attackers will feed the API with malicious data through whatever injection vectors are available (e.g., direct input, parameters, integrated services, etc.), expecting it to be sent to an interpreter. | Injection flaws are very common and are often found in SQL, LDAP, or NoSQL queries, OS commands, XML parsers, and ORM. These flaws are easy to discover when reviewing the source code. Attackers can use scanners and fuzzers. | Injection can lead to information disclosure and data loss. It may also lead to DoS, or complete host takeover. |
83

9-
## Is the API Vulnerable?
4+
<table dir='rtl' align="right">
5+
<tr>
6+
<th>عوامل التهديد/ الاستغلال </th>
7+
<th> نقاط الضعف </th>
8+
<th> التأثير </th>
9+
<tr>
10+
<td> خصائص API : قابلية الاستغلال 3 </td>
11+
<td> الانتشار : 2 قابلية الاكتشاف : 3 </td>
12+
<td> التأثر التقني و تأثر الاعمال: 3 </td>
13+
</tr>
14+
<td>يقوم المهاجمون بإرسال بيانات ضارة من خلال واجهة برمجة التطبيقاتAPI وذلك بهدف حقنها وارسالها الى المفسر ومن صور طرق ادخل البيانات ( الادخال المباشر، التعليمات البرمجية، طرق ربط الخدمات ..الخ) متوقعين ارسالها الى المفسر. </td>
15+
<td> تعد أساليب الحقن أسلوب شائع لدى المهاجمين وغالباً ما توجد استعلامات جاهزة لمختلف أنواع اللغات SQL,LDAP,NoSQL ,OS Command ,XML parsers. حيث انه من السهل الكشف عن الثغرات عند قراءة الشفرة المصدرية للاكواد البرمجية باستخدامات عمليات المسح الالية او اليدوية.</td>
16+
<td> يمكن ان يؤدي الحقن الى الكشف عن المعلومات الغير مصرح به او مسح وفقدان البيانات وفي بعض الأحيان قد يودي الى هجمات حجب الخدمة DOS، او اختراق الكامل لنظام.</td>
17+
</tr>
18+
</table>
1019

11-
The API is vulnerable to injection flaws if:
20+
<h3 dir='rtl' align='right'>هل أنا معرض لهذه الثغرة؟</h3>
1221

13-
* Client-supplied data is not validated, filtered, or sanitized by the API.
14-
* Client-supplied data is directly used or concatenated to SQL/NoSQL/LDAP
15-
queries, OS commands, XML parsers, and Object Relational Mapping (ORM)/Object
16-
Document Mapper (ODM).
17-
* Data coming from external systems (e.g., integrated systems) is not validated,
18-
filtered, or sanitized by the API.
22+
<p dir='rtl' align='right'> قد يكون واجهة برمجة التطبيقات API معرض للاستغلال بمثل هذه الهجمات عند :
1923

20-
## Example Attack Scenarios
24+
<p dir='rtl' align='right'>▪️ لا يتم تصفية البيانات او التحقق منها في حال كانت مقدمة من المستخدمين من طريق واجهة برمجة التطبيقات
25+
<p dir='rtl' align='right'>▪️ يتم استخدام البيانات بشكل مباشر مع SQL/NoSQL/LDAP queries, OS commands, XML parsers.
26+
<p dir='rtl' align='right'>▪️ لا يتم التحقق من صحة البيانات الواردة من أنظمة خارجية مثل (الأنظمة المرتبطة بالخادم) او تصفيتها او التحقق منها قبل واجهة برمجة التطبيقات API قبل عملية استخدامها
27+
28+
<h3 dir='rtl' align='right'> امثلة على سيناريوهات الهجوم: </h3>
2129

22-
### Scenario #1
30+
<h4 dir='rtl' align='right'>السيناريو الاول: </h4>
2331

24-
Firmware of a parental control device provides the endpoint
25-
`/api/CONFIG/restore` which expects an appId to be sent as a multipart
26-
parameter. Using a decompiler, an attacker finds out that the appId is passed
27-
directly into a system call without any sanitization:
32+
<p dir='rtl' align='right'> يتم استخدام الكاميرات للمراقبة في المنازل مصدر بيانات للإعدادات في المسار التالي /api/CONFIG/restore و من المتوقع ان يتم استقبال معرف فريد في أجزاء متعددة، فباستخدام برنامج فك وتحويل الشفرات البرمجية(decompile)، تمكن المهاجم من إيجاد طريقة لتعامل مع النظام بشكل مباشر ومن غير عوامل التصفية المقترحة.
2833

2934
```c
3035
snprintf(cmd, 128, "%srestore_backup.sh /tmp/postfile.bin %s %d",
3136
"/mnt/shares/usr/bin/scripts/", appid, 66);
3237
system(cmd);
3338
```
3439
35-
The following command allows the attacker to shut down any device with the same
36-
vulnerable firmware:
40+
<p dir='rtl' align='right'> يسمح الامر التالي للمهاجم بإغلاق أي جهاز مصاب بتلك الثغرة البرمجية
3741
3842
```
3943
$ curl -k "https://${deviceIP}:4567/api/CONFIG/restore" -F 'appid=$(/etc/pod/power_down.sh)'
@@ -59,10 +63,11 @@ router.delete('/bookings', async function (req, res, next) {
5963
});
6064
```
6165

62-
The attacker intercepted the request and changed `bookingId` query string
63-
parameter as shown below. In this case, the attacker managed to delete another
64-
user's booking:
66+
<h4 dir='rtl' align='right'>السيناريو الثاني : </h4>
6567

68+
<p dir='rtl' align='right'> تطبيق للحجوزات قائم على وظائف CRUD، حيث قام المهاجم بالعديد من محاولات الفحص التي مكنته من معرفة اللغة المستخدمة في المفسر وهي NoSQL والتي استطاع من خلالها حقن المعرف الفريد للحجوزات bookingid باوامر من اجل مسح وحذف الحجوزات من خلال استخدام المسار التالي: DELETE /api/bookings?bookingId=678
69+
<p dir='rtl' align='right'> حيث قام المهاجم بإرسال الطلب من خلال واجهة برمجة التطبيقات API لتعامل مع طلب الحذف الامر التالي:
70+
6671
```
6772
DELETE /api/bookings?bookingId[$ne]=678
6873
```

0 commit comments

Comments
 (0)