NetExec icon indicating copy to clipboard operation
NetExec copied to clipboard

Invalid database credential ID

Open Unreachabl opened this issue 1 year ago • 4 comments

Describe the bug When logging in using the database id, sometimes the error "ERROR Invalid database credential ID 1! connection.py:351" despite the fact that authentication is successful on other hosts under the same id

To Reproduce Steps to reproduce the behavior i.e.: Command: netexec smb hosts -id 1 screen1

NetExec info

  • OS: Kali
  • Version of nxc: 1.3.0
  • Installed from: pipx install git+https://github.com/Pennyw0rth/NetExec

Unreachabl avatar Oct 31 '24 08:10 Unreachabl

That is weird, any hints to why that could be? How did you populate the "credentials 1"? Login or some kind of dump?

Can't reproduce the error on my side: image

NeffIsBack avatar Oct 31 '24 08:10 NeffIsBack

The id number is 1 was added to the database when I entered the username and password correctly and verified them at a my hosts (using the -u and -p flags). These errors started appearing after updating the system using apt-get dist-upgrade and nxc version 1.3.0. After the update, I install the ncx version (1.2.0), which worked, but send errors

Exception error when calling proto_flow() for the target object 192.168.20.14: connection.py:168 ((((sqlite3.Interface error) invalid parameter or other incorrect API usage [SQL: SELECT hosts.id , hosts.ip, hosts.hostname, hosts.domain, hosts.os, hosts.as , hosts.dc, hosts.smbv1, hosts.signing, hosts.spooler, hosts.zerologin, hosts.petit potam FROM hosts WHERE hosts.ip =?] [parameters: ('192.168.20.14',)]

Now, after displaying the invalid database credentials error, nxc also starts going through the credentials of their database in the list.

If you log in to each host separately, there is no error. Only when working with multiple hosts at the same time.

Linux kali 6.11.2-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.11.2-1kali1 (2024-10-15) x86_64 GNU/Linux

Unreachabl avatar Oct 31 '24 09:10 Unreachabl

Could you provide a debug file log? My guess would be there is an error with the hosts being added to the database.

EDIT: You can get the debug output with --debug

NeffIsBack avatar Oct 31 '24 09:10 NeffIsBack

debug.log

I also attach this log file to the topic https://github.com/Pennyw0rth/NetExec/issues/479, since both errors are reflected in it.

Unreachabl avatar Oct 31 '24 10:10 Unreachabl