Pylint cleanup

pull/14/head
Thorsten Sick 3 years ago
parent 17ec685400
commit b1e13da419

@ -76,7 +76,6 @@ class AttackLog():
""" Returns the default tactics for this ability based on a db """
data = {"bd527b63-9f9e-46e0-9816-b8434d2b8989": "System Owner/User Discovery",
"697e8a432031075e47cccba24417013d": "Persistence",
"f39161b2fa5d692ebe3972e0680a8f97": "Persistence",
"16e6823c4656f5cd155051f5f1e5d6ad": "Persistence",
"443b853ac50a79fc4a85354cb2c90fa2": "Persistence",
@ -104,7 +103,6 @@ class AttackLog():
""" Returns the default name for this ability based on a db """
data = {"bd527b63-9f9e-46e0-9816-b8434d2b8989": "T1033",
"697e8a432031075e47cccba24417013d": "TA0003",
"f39161b2fa5d692ebe3972e0680a8f97": "TA0003",
"16e6823c4656f5cd155051f5f1e5d6ad": "TA0003",
"443b853ac50a79fc4a85354cb2c90fa2": "TA0003",

@ -14,6 +14,11 @@ class DocGenerator():
self.outfile = None
def generate(self, jfile, outfile="tools/human_readable_documentation/source/contents.rst"):
""" Generates human readable documentation out of a template.
@param jfile: json attack log created by PurpleDome as data source
@param outfile: rst file to write. Can be compiled into pdf using sphinx
"""
self.outfile = outfile

@ -4,8 +4,9 @@
from glob import glob
import os
import re
import straight.plugin # type: ignore
from typing import Optional
import straight.plugin # type: ignore
from plugins.base.plugin_base import BasePlugin
from plugins.base.attack import AttackPlugin
@ -132,11 +133,11 @@ class PluginManager():
return False
# Unkown: ???
if "???" == ttp:
if ttp == "???":
return False
# Multiple TTPs in this attack
if "multiple" == ttp:
if ttp == "multiple":
return False
return True

@ -90,9 +90,6 @@ class SSHFeatures(BasePlugin):
if retry <= 0:
raise NetworkError from error
do_retry = True
except paramiko.ssh_exception.NoValidConnectionsError as error:
self.vprint(f"No valid connection. Errors: {error.errors}", 1)
do_retry = True
if do_retry:
self.disconnect()
self.connect()
@ -133,14 +130,14 @@ class SSHFeatures(BasePlugin):
except paramiko.ssh_exception.NoValidConnectionsError as error:
self.vprint(f"SSH PUT: No valid connection. Errors: {error.errors}", 1)
do_retry = True
except FileNotFoundError as error:
self.vprint(f"SSH PUT: File not found: {error}", 0)
break
except OSError:
self.vprint("SSH PUT: Obscure OSError, ignoring (file should have been copied)", 1)
pass
# do_retry = True
# breakpoint()
except FileNotFoundError as error:
self.vprint(f"SSH PUT: File not found: {error}", 0)
break
if do_retry:
self.vprint(f"SSH PUT: Will retry {retries} times. Timeout: {timeout}", 3)
retries -= 1
@ -177,13 +174,12 @@ class SSHFeatures(BasePlugin):
except paramiko.ssh_exception.NoValidConnectionsError as error:
self.vprint(f"SSH GET: No valid connection. Errors: {error.errors}", 1)
do_retry = True
except OSError:
self.vprint("SSH GET: Obscure OSError, ignoring (file should have been copied)", 1)
pass
# do_retry = True
except FileNotFoundError as error:
self.vprint(error, 0)
break
except OSError:
self.vprint("SSH GET: Obscure OSError, ignoring (file should have been copied)", 1)
# do_retry = True
if do_retry:
self.disconnect()
self.connect()

Loading…
Cancel
Save