byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.38k stars 1.64k forks source link

Add an option to see successful actions only #50

Closed maaaaz closed 8 years ago

maaaaz commented 8 years ago

Hello @byt3bl33d3r,

In the same way as the VERBOSE true|false option in msf, could you add an option to see only successful actions (bruteforcing users, listing stuff etc.) that is to say, hide [-] lines for clearer result reporting :)

(venvcrackmapexec)root@kali:~/Partage/CrackMapExec_fork# python crackmapexec.py 192.168.11.136 -u user1 -p passwords.txt
11-29-2015 14:26:23 [*] 192.168.11.136:445 is running Windows 6.3 Build 9600 (name:DC01) (domain:ADYOLO)
11-29-2015 14:26:23 [-] 192.168.11.136:445 ADYOLO\user1:yolo SMB SessionError: STATUS_LOGON_FAILURE(The attempted logon is invalid. This is either due to a bad username or authentication information.)
11-29-2015 14:26:23 [-] 192.168.11.136:445 ADYOLO\user1:swag SMB SessionError: STATUS_LOGON_FAILURE(The attempted logon is invalid. This is either due to a bad username or authentication information.)
11-29-2015 14:26:23 [-] 192.168.11.136:445 ADYOLO\user1:test123! SMB SessionError: STATUS_LOGON_FAILURE(The attempted logon is invalid. This is either due to a bad username or authentication information.)
11-29-2015 14:26:23 [+] 192.168.11.136:445 Login successful ADYOLO\user1:yoloswag1!

Cheers.

maaaaz commented 8 years ago

On this feature, do you think that the following simple trick would be good ? From:

def print_error(message):
    clog = logging.getLogger('crack')
    clog.info(colored("[-] ", 'red', attrs=['bold']) + message)

To something like this (with args.quiet a boolean option, by default on False (i.e print everything)):

def print_error(message, args.quiet):
    if not(args.quiet):
      clog = logging.getLogger('crack')
      clog.info(colored("[-] ", 'red', attrs=['bold']) + message)
byt3bl33d3r commented 8 years ago

Closing since this was somewhat addressed in v3.0. I'm also a firm believer in verbosity so don't think I'll be implementing this