diego-treitos / linux-smart-enumeration

Linux enumeration tool for pentesting and CTFs with verbosity levels
GNU General Public License v3.0
3.45k stars 573 forks source link

Colour issues dependent on system? #67

Closed hdysec closed 2 years ago

hdysec commented 2 years ago

Hi, I've had frequent issues with multiple unix systems where the exploit executes however no color formatting is working on these older machines whereas other scripts color coding still works.

Is there any guidance on this?

output:

expected:

diego-treitos commented 2 years ago

I would need to know in what linux systems that error is appearing.

robertstrom commented 2 years ago

I just experienced the same issue and can tell you that it was on:

CentOS release 5.6 (Final) Linux version 2.6.18-238.12.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue May 31 13:23:01 EDT 2011

It looked like the first screenshot above. Yes, it's ancient but it is an OSCP system and I can tell you that I very recently experienced an interaction with a very old HPUX system that would probably behave similarly or worse (I have not had the opportunity to use the script on it (I may .. maybe get to do so in the next week or so).

I also tried using the -c argument which I would have thought would have gotten rid of all of the color code characters, but it did not.

diego-treitos commented 2 years ago

Thank you for reporting this @robertstrom . I have checked in a CentOS 5.6 and I could reproduce the problem. There are actually 2 separate problems:

  1. The -c option not working. I have fixed this and the next release (4.9nw) will have the patch.
  2. The color not working is due to the printf function in the sh shell does not support ANSI codes. This is solved if you execute the script with bash lse.sh to force the use of bash and its printf version.

I am closing this as this should solve the problems. Please feel free to reopen if you find any additional information.

brightio commented 11 months ago

Hello, I made a pull request that fixes this issue (#82).