refactor: small perflint improvements

main
Marshall Hallenbeck 2023-05-05 14:37:20 -04:00
parent 574fc5a212
commit 788701cb2c
2 changed files with 7 additions and 10 deletions

View File

@ -28,7 +28,7 @@
#
import logging
import os
from os.path import join as path_join
from time import sleep
from cme.helpers.misc import gen_random_string
@ -241,7 +241,7 @@ class MMCEXEC:
while True:
try:
with open(
os.path.join("/tmp", "cme_hosted", self.__output), "r"
path_join("/tmp", "cme_hosted", self.__output), "r"
) as output:
self.output_callback(output.read())
break

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
from os.path import join as path_join
from time import sleep
from impacket.dcerpc.v5 import transport, scmr
from cme.helpers.misc import gen_random_string
@ -120,9 +121,7 @@ class SMBEXEC:
else:
command = self.__shell + data
with open(
os.path.join("/tmp", "cme_hosted", self.__batchFile), "w"
) as batch_file:
with open(path_join("/tmp", "cme_hosted", self.__batchFile), "w") as batch_file:
batch_file.write(command)
self.logger.debug("Hosting batch file with command: " + command)
@ -168,7 +167,7 @@ class SMBEXEC:
sleep(2)
pass
else:
logger.debug(e)
self.logger.debug(e)
pass
self.__smbconnection.deleteFile(self.__share, self.__output)
@ -187,9 +186,7 @@ class SMBEXEC:
else:
command = self.__shell + data
with open(
os.path.join("/tmp", "cme_hosted", self.__batchFile), "w"
) as batch_file:
with open(path_join("/tmp", "cme_hosted", self.__batchFile), "w") as batch_file:
batch_file.write(command)
self.logger.debug("Hosting batch file with command: " + command)
@ -227,7 +224,7 @@ class SMBEXEC:
while True:
try:
with open(
os.path.join("/tmp", "cme_hosted", self.__output), "rb"
path_join("/tmp", "cme_hosted", self.__output), "rb"
) as output:
self.output_callback(output.read())
break