forked from p15670423/monkey
Some more easy noqas or invalid escape fixes
This commit is contained in:
parent
accd6bd0fa
commit
5696c3e536
|
@ -7,8 +7,9 @@ import sys
|
|||
import traceback
|
||||
from multiprocessing import freeze_support
|
||||
|
||||
# dummy import for pyinstaller
|
||||
# noinspection PyUnresolvedReferences
|
||||
import infection_monkey.post_breach # dummy import for pyinstaller
|
||||
import infection_monkey.post_breach # noqa: F401
|
||||
from common.version import get_version
|
||||
from infection_monkey.config import EXTERNAL_CONFIG_FILE, WormConfiguration
|
||||
from infection_monkey.dropper import MonkeyDrops
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from infection_monkey.model.host import VictimHost
|
||||
from infection_monkey.model.host import VictimHost # noqa: F401
|
||||
|
||||
__author__ = 'itamar'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ __author__ = 'itamar'
|
|||
|
||||
PING_COUNT_FLAG = "-n" if "win32" == sys.platform else "-c"
|
||||
PING_TIMEOUT_FLAG = "-w" if "win32" == sys.platform else "-W"
|
||||
TTL_REGEX_STR = '(?<=TTL\=)[0-9]+'
|
||||
TTL_REGEX_STR = r'(?<=TTL\=)[0-9]+'
|
||||
LINUX_TTL = 64
|
||||
WINDOWS_TTL = 128
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from infection_monkey.network.tools import check_tcp_port
|
|||
|
||||
SSH_PORT = 22
|
||||
SSH_SERVICE_DEFAULT = 'tcp-22'
|
||||
SSH_REGEX = 'SSH-\d\.\d-OpenSSH'
|
||||
SSH_REGEX = r'SSH-\d\.\d-OpenSSH'
|
||||
TIMEOUT = 10
|
||||
BANNER_READ = 1024
|
||||
LINUX_DIST_SSH = ['ubuntu', 'debian']
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SCHEDULED_TASK_NAME = 'monkey-spawn-cmd'
|
||||
SCHEDULED_TASK_COMMAND = 'C:\windows\system32\cmd.exe'
|
||||
SCHEDULED_TASK_COMMAND = r'C:\windows\system32\cmd.exe'
|
||||
|
||||
# Commands from: https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1053.005/T1053.005.md
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
from infection_monkey.transport.http import HTTPServer, LockedHTTPServer
|
||||
from infection_monkey.transport.http import HTTPServer, LockedHTTPServer # noqa: F401
|
||||
|
|
|
@ -65,7 +65,7 @@ class TcpProxy(TransportProxyBase):
|
|||
dest = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
try:
|
||||
dest.connect((self.dest_host, self.dest_port))
|
||||
except socket.error as ex:
|
||||
except socket.error:
|
||||
source.close()
|
||||
dest.close()
|
||||
continue
|
||||
|
|
|
@ -5,8 +5,8 @@ from infection_monkey.utils.linux.hidden_files import (
|
|||
get_linux_commands_to_delete, get_linux_commands_to_hide_files,
|
||||
get_linux_commands_to_hide_folders)
|
||||
from infection_monkey.utils.windows.hidden_files import (
|
||||
get_winAPI_to_hide_files, get_windows_commands_to_delete,
|
||||
get_windows_commands_to_hide_files, get_windows_commands_to_hide_folders)
|
||||
get_windows_commands_to_delete, get_windows_commands_to_hide_files,
|
||||
get_windows_commands_to_hide_folders)
|
||||
|
||||
|
||||
def get_commands_to_hide_files():
|
||||
|
|
|
@ -52,12 +52,12 @@ def get_winAPI_to_hide_files():
|
|||
fileFlags = win32file.FILE_ATTRIBUTE_HIDDEN # make hidden
|
||||
|
||||
_ = win32file.CreateFile(HIDDEN_FILE_WINAPI,
|
||||
fileAccess,
|
||||
0, # sharing mode: 0 => can't be shared
|
||||
None, # security attributes
|
||||
fileCreation,
|
||||
fileFlags,
|
||||
0) # template file
|
||||
fileAccess,
|
||||
0, # sharing mode: 0 => can't be shared
|
||||
None, # security attributes
|
||||
fileCreation,
|
||||
fileFlags,
|
||||
0) # template file
|
||||
|
||||
return "Succesfully created hidden file: {}".format(HIDDEN_FILE_WINAPI), True
|
||||
except Exception as err:
|
||||
|
|
Loading…
Reference in New Issue