Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 3e1b958

Browse files
author
byt3bl33d3r
committed
Added check to see if connection was established before shutting down if a Exception was raised
1 parent 659baf3 commit 3e1b958

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crackmapexec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,8 +2056,9 @@ def run(self, addr):
20562056
result = self.shell.send_data(self.__command)
20572057
smb_server.stop()
20582058

2059-
except (Exception, KeyboardInterrupt), e:
2060-
self.shell.finish()
2059+
except (Exception, KeyboardInterrupt) as e:
2060+
if hasattr(self, 'shell'):
2061+
self.shell.finish()
20612062
sys.stdout.flush()
20622063
sys.exit(1)
20632064

0 commit comments

Comments
 (0)