forked from p15670423/monkey
Fixed more warnings and lowered the linter upper limit to double digits
This commit is contained in:
parent
b26727d5e0
commit
f23199c4a3
|
@ -72,7 +72,7 @@ script:
|
||||||
## Display the linter issues
|
## Display the linter issues
|
||||||
- cat flake8_warnings.txt
|
- cat flake8_warnings.txt
|
||||||
## Make sure that we haven't increased the amount of warnings.
|
## Make sure that we haven't increased the amount of warnings.
|
||||||
- PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT=120
|
- PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT=90
|
||||||
- if [ $(tail -n 1 flake8_warnings.txt) -gt $PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT ]; then echo "Too many python linter warnings! Failing this build. Lower the amount of linter errors in this and try again. " && exit 1; fi
|
- if [ $(tail -n 1 flake8_warnings.txt) -gt $PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT ]; then echo "Too many python linter warnings! Failing this build. Lower the amount of linter errors in this and try again. " && exit 1; fi
|
||||||
|
|
||||||
## Check import order
|
## Check import order
|
||||||
|
|
|
@ -44,7 +44,7 @@ class CommunicateAsNewUser(PBA):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_random_new_user_name():
|
def get_random_new_user_name():
|
||||||
return USERNAME_PREFIX + ''.join(random.choice(string.ascii_lowercase) for _ in range(5))
|
return USERNAME_PREFIX + ''.join(random.choice(string.ascii_lowercase) for _ in range(5)) # noqa: DUO102
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_commandline_for_http_request(url, is_windows=is_windows_os()):
|
def get_commandline_for_http_request(url, is_windows=is_windows_os()):
|
||||||
|
|
|
@ -7,14 +7,10 @@ from infection_monkey.system_info.windows_cred_collector.mimikatz_cred_collector
|
||||||
MimikatzCredentialCollector
|
MimikatzCredentialCollector
|
||||||
|
|
||||||
sys.coinit_flags = 0 # needed for proper destruction of the wmi python module
|
sys.coinit_flags = 0 # needed for proper destruction of the wmi python module
|
||||||
# noinspection PyPep8
|
import infection_monkey.config # noqa: E402
|
||||||
import infection_monkey.config
|
from common.utils.wmi_utils import WMIUtils # noqa: E402
|
||||||
# noinspection PyPep8
|
from infection_monkey.system_info import InfoCollector # noqa: E402
|
||||||
from common.utils.wmi_utils import WMIUtils
|
from infection_monkey.system_info.wmi_consts import WMI_CLASSES # noqa: E402
|
||||||
# noinspection PyPep8
|
|
||||||
from infection_monkey.system_info import InfoCollector
|
|
||||||
# noinspection PyPep8
|
|
||||||
from infection_monkey.system_info.wmi_consts import WMI_CLASSES
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
LOG.info('started windows info collector')
|
LOG.info('started windows info collector')
|
||||||
|
|
|
@ -51,7 +51,7 @@ def get_winAPI_to_hide_files():
|
||||||
fileCreation = win32file.CREATE_ALWAYS # overwrite existing file
|
fileCreation = win32file.CREATE_ALWAYS # overwrite existing file
|
||||||
fileFlags = win32file.FILE_ATTRIBUTE_HIDDEN # make hidden
|
fileFlags = win32file.FILE_ATTRIBUTE_HIDDEN # make hidden
|
||||||
|
|
||||||
hiddenFile = win32file.CreateFile(HIDDEN_FILE_WINAPI,
|
_ = win32file.CreateFile(HIDDEN_FILE_WINAPI,
|
||||||
fileAccess,
|
fileAccess,
|
||||||
0, # sharing mode: 0 => can't be shared
|
0, # sharing mode: 0 => can't be shared
|
||||||
None, # security attributes
|
None, # security attributes
|
||||||
|
|
Loading…
Reference in New Issue