CiscoCXSecurity / enum4linux

enum4Linux is a Linux alternative to enum.exe for enumerating data from Windows and Samba hosts
Other
1.14k stars 235 forks source link

Use of uninitialized value $os_info in concatenation (.) or string at /bin/enum4linux line 464. #5

Open r3k2 opened 6 years ago

r3k2 commented 6 years ago

for some time I can't use -o on enum4linux I have try ti find out the issue.. and I think is smbclient has changed.. enum4linux is trying: smbclient -W 'MYGROUP' //'xx.xx.x.xx'/ipc$ -U''%'' -c 'q' 2>&1 but returns nothing..

smbclient when connected does not output any information anymore

I went into the code I see no issue:

# Get OS info
 456 sub get_os_info {
 457   print_heading("OS information on $global_target");
 458   my $command = "smbclient -W '$global_workgroup' //'$global_target'/ipc\$ -U'$global_username'\%'$global_password' -c 'q' 2>&1";
 459   print "[V] Attempting to get OS info with command: $command\n" if $verbose;
 460   my $os_info = `$command`;
 461   chomp $os_info;
 462   if (defined($os_info)) {
 463     ($os_info) = $os_info =~ /(Domain=[^\n]+)/s;
 464     print "[+] Got OS info for $global_target from smbclient: $os_info\n";
 465   }

so I think smbclient newer versions are missing something anyone have an idea to fix this with out going to an old version of smbclient?

r3k2 commented 6 years ago

in the mean time I am using the metasploit auxiliary but I rather use enum4linux if they ever fix this.. I rarely use metasploit so is a pain to load it just for this.

schrodyn commented 6 years ago

Hi,

Did you ever figure out what changed with smbclient that it doesn't show this output anymore? I came across your bug while trying to figure this issue out myself. I, like you, don't want to have to rely on the MSF aux each time I want the running service information.

Cheers.

8l1NKY commented 6 years ago

Same issue as above

ghost commented 6 years ago

same issue

batterystaples commented 6 years ago

It appears to be related to this commit in Samba: https://github.com/samba-team/samba/commit/5a794ece3d2c5b8dbb5d6e71ad25784a370230d4

Compiling 2.6.7 from source works for now. I've made a bug report to Kali with some suggested solutions since this is appears to be more of a packaging/dependency problem. https://bugs.kali.org/view.php?id=4495

kd8bny commented 6 years ago

@appleorange1 Interesting IP in that bug report ;) Can confirm issue and solution

kerbroasted commented 6 years ago

Has this been resolved, as I still appear to be having the same issue. enum4linux v0.8.9 OS: Linux linux 4.15.0-kali3-amd64 #1 SMP Debian 4.15.17-1kali1 (2018-04-25) x86_64 GNU/Linux

boomshankerx commented 6 years ago

Bump Kali 2018.1 enum4linux v0.8.9 Linux vkali 4.15.0-kali3-amd64 #1 SMP Debian 4.15.17-1kali1 (2018-04-25) x86_64 GNU/Linux

Looks like it's a Kali bug though.

derWeihnachtsmann commented 6 years ago

Still got this bug...

r3k2 commented 6 years ago

me to on kali and on Blackarch and Arch still

Dvirus89 commented 5 years ago

It appears to be related to this commit in Samba: samba-team/samba@5a794ec

Compiling 2.6.7 from source works for now. I've made a bug report to Kali with some suggested solutions since this is appears to be more of a packaging/dependency problem. https://bugs.kali.org/view.php?id=4495

Hi, "Compiling 2.6.7 from source works for now" -> can you please explain? I need a workaround as well.

thanks.

noraj commented 5 years ago

still have the bug

JustOneMoreDog commented 5 years ago

still have the bug

sopsmattw commented 4 years ago

As a workaround for this, add "-w domainname" to the command line. -w specifies the workgroup, which in AD is also the domain name.

pr0b3r7 commented 3 years ago

@sopsmattw - tried -w solution without joy:

Screenshot 2021-04-09 14:36:47

timb-machine commented 3 years ago

I have a couple of ideas for this. Leave it with me and I'll see if I can get a reliable fix done.

timb-machine commented 3 years ago

So, I've just added workgroup/domain guessing via DNS (something Mark and I played with years ago but never rolled into enum4linux). I've also added some cleaned up detection to handle the case where smbclient can't gain the null share due to a protocol mismatch. This isn't a full fix but it at least takes us in the right direction. I have a test domain spunk up on latest Windows, next job is to get out a Kali and see if we can improve the version detection because I suspect there are probably multiple root causes depending on the exact combinations of Samba and victim.

pr0b3r7 commented 3 years ago

@timb-machine thank you for looking into it and sharing the plans. Is there anything I can do to collaborate with the testing or make things easier for you? Thank you