Skip to content

Commit 318ac2e

Browse files
move fail logs into single row for better readability
1 parent aae875d commit 318ac2e

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

nxc/modules/efsr_spray.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from impacket.smb3structs import FILE_SHARE_WRITE, FILE_SHARE_DELETE, FILE_ATTRIBUTE_ENCRYPTED
55
from impacket.smbconnection import SessionError, SMBConnection
66

7+
78
def get_error_string(exception):
89
if hasattr(exception, "getErrorString"):
910
try:
@@ -44,10 +45,7 @@ def on_login(self, context: Context, connection):
4445
shares = conn.listShares()
4546
except SessionError as e:
4647
error = get_error_string(e)
47-
context.log.fail(
48-
f"Error enumerating shares: {error}",
49-
color="magenta",
50-
)
48+
context.log.fail(f"Error enumerating shares: {error}", color="magenta")
5149
return
5250

5351
# Check if named pipe is already available
@@ -59,10 +57,7 @@ def on_login(self, context: Context, connection):
5957
return
6058
except SessionError as e:
6159
error = get_error_string(e)
62-
context.log.fail(
63-
f"Error enumerating named pipes: {error}",
64-
color="magenta",
65-
)
60+
context.log.fail(f"Error enumerating named pipes: {error}", color="magenta")
6661
return
6762

6863
# Write an encrypted file on the share root.
@@ -107,8 +102,5 @@ def on_login(self, context: Context, connection):
107102
if error == "STATUS_OBJECT_NAME_NOT_FOUND":
108103
context.log.debug("efsrpc pipe was not activated.")
109104
else:
110-
context.log.fail(
111-
f"Error waiting for named pipe: {error}",
112-
color="magenta",
113-
)
105+
context.log.fail(f"Error waiting for named pipe: {error}", color="magenta")
114106
return

0 commit comments

Comments
 (0)