CiscoCXSecurity / enum4linux

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

$global_workgroup is unitialized #7

Closed Ellestad1995 closed 3 years ago

Ellestad1995 commented 6 years ago

Using v0.8.9

From the error output below it seems that the function sub make_session and others is trying to use the $global_workgroup even though it is not supplied on the command line. The man page says that workgroup is usually found automatically, but if it is not $global_workgroup seems to be empty and result in this error below. I suggest that if $global_workgroup is empty output that it is not found and go on using WORKGROUP. The error below resulted from the command: enum4linux -a x.x.x.x

Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 437.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 451.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 359.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 458.
Use of uninitialized value $os_info in concatenation (.) or string at ./enum4linux.pl line 464.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 467.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 866.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 881.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 640.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 501.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 542.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 542.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 593.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 742.
Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 991.
Talanor commented 5 years ago

Ran into the same issue right now

m1cm1c commented 5 years ago

Is there a workaround?

darkt3rr0r commented 5 years ago

Yes, i figured out a work around. So here is the thing, i used nmap scans and traceroute to figure out the issues whether there was a firewall involved or not while trying to play with a vulnerable VM CTF. So after 9 hours, all it took was a change of network to my mobile 4G and everything worked like a charm there on :)

tigre-bleu commented 4 years ago

A dirty workaround is to insert a line after line 385 to initialize the variable:

unless (defined($global_workgroup)) {
   print "[E] Can\'t find workgroup/domain\nDefaulting to WORKGROUP as a dirty workaround\n";
   ($global_workgroup) = "WORKGROUP";    
   print "\n";
   return undef;
 }

At least like this the output is not completely unreadable.

timb-machine commented 3 years ago

I've improved this a bit. enum4linux will also try and guess the domain via DNS (there's a trick to leaking the domain name that Mark and I discovered ages ago but never implemented) now.

RoyMusthang commented 3 years ago

already resolved?