csle_common.constants package

Submodules

csle_common.constants.constants module

Constants for csle-common

class csle_common.constants.constants.AGENT[source]

Bases: object

String constants related to the agent

PW = 'agent'
USER = 'agent'
class csle_common.constants.constants.AUXILLARY[source]

Bases: object

Auxillary constants

PW_PLACEHOLDER = 'USER_PLACEHOLDER'
USER_PLACEHOLDER = 'USER_PLACEHOLDER'
class csle_common.constants.constants.AUXILLARY_COMMANDS[source]

Bases: object

Constants related to auxillary shell commands

WHOAMI = 'whoami'
class csle_common.constants.constants.CASSANDRA[source]

Bases: object

Constants related to the Cassandra service

DEFAULT_PORT = 9042
SERVICE_NAME = 'cassandra'
class csle_common.constants.constants.CITUS[source]

Bases: object

Constants related to CITUS

COORDINATOR_PORT = 5432
class csle_common.constants.constants.CLUSTER_CONFIG[source]

Bases: object

Constants related to the cluster configuration

IP = '127.0.0.1'
LEADER = False
class csle_common.constants.constants.COCKROACH[source]

Bases: object

Constants related to the Cockroach service

DEFAULT_PORT = 26257
SERVICE_NAME = 'cockroach'
class csle_common.constants.constants.COMMANDS[source]

Bases: object

Constants related to arbitrary commands

AMP = '&'
ARPTABLES_APPEND_FORWARD = 'sudo arptables -A FORWARD'
ARPTABLES_APPEND_INPUT = 'sudo arptables -A INPUT'
ARPTABLES_APPEND_OUTPUT = 'sudo arptables -A OUTPUT'
BASH = 'bash'
BUILD_CSLE_MGMT_WEBAPP = 'cd $CSLE_HOME/management-system/csle-mgmt-webapp && npm run build'
CADVISOR_LOGS = 'docker logs cadvisor'
CADVISOR_PORT = 8080
CHANGE_PERMISSION_LOG_DIRS = 'sudo chmod -R 777 /var'
CHANNEL_ROOT = 'root\n'
CHANNEL_SU_ROOT = 'su root\n'
CHANNEL_WHOAMI = 'whoami\n'
CHMOD_777 = 'chmod 777'
CHMOD_U_RWX = 'chmod u+rwx'
CLEAR_IPTABLES = 'sudo iptables -F'
CLUSTER_MANAGER_OUTFILE = '/var/log/csle/clustermanager.out'
CLUSTER_MANAGER_PIDFILE = '/var/log/csle/clustermanager.pid'
COLON_DELIM = ':'
CONTAINER_LOGS = 'docker logs {}'
CSLE_MGMT_WEBAPP_PID_FILE = '/var/log/csle/csle_mgmt_webapp.pid'
DASH_DELIM = '-'
DOCKER_ENGINE_LOGS = 'sudo /usr/bin/journalctl -u docker.service -n 100 --no-pager -e'
DOCKER_ENGINE_LOGS_ALTERNATIVE = 'sudo /bin/journalctl -u docker.service -n 100 --no-pager -e'
DOCKER_ENGINE_PORT = 2375
DOCKER_ENGINE_START = 'sudo service docker start'
DOCKER_ENGINE_STATUS = 'service docker status'
DOCKER_ENGINE_STOP = 'sudo service docker stop'
DOCKER_EXEC_COMMAND = 'docker exec'
DOCKER_STATS_MANAGER_OUTFILE = '/var/log/csle/statsmanager.out'
DOCKER_STATS_MANAGER_PIDFILE = '/var/log/csle/statsmanager.pid'
DOT_DELIM = '.'
ECHO = 'echo'
FLASK_LOG_FILE = '/var/log/csle/flask.log'
FLASK_PORT = 7777
GET_LATEST_PID = '$!'
GRAFANA_LOGS = 'docker logs grafana'
GRAFANA_PORT = 3000
GRAFANA_PW = 'admin'
GRAFANA_USERNAME = 'admin'
GREP = 'grep'
HOME_DIR = 'home'
IPTABLES_APPEND_FORWARD = 'sudo iptables -A FORWARD'
IPTABLES_APPEND_INPUT = 'sudo iptables -A INPUT'
IPTABLES_APPEND_OUTPUT = 'sudo iptables -A OUTPUT'
KILL_PROCESS = 'kill -9 {}'
LIST_CACHE = 'ls -1 '
LS = 'ls'
LS_HOME = 'ls /home/'
MANAGEMENT_SYSTEM_PORT = 7777
NETMASK = 'netmask'
NEW_LINE_DELIM = '\n'
NGINX_LOG_DIR = '/var/log/nginx/'
NGINX_START = 'sudo service nginx start'
NGINX_STATUS = 'service nginx status'
NGINX_STOP = 'sudo service nginx stop'
NODE_EXPORTER_LOG_FILE = '/var/log/csle/node_exporter.log'
NODE_EXPORTER_PID_FILE = '/var/log/csle/node_exporter.pid'
NODE_EXPORTER_PORT = 9100
NOHUP = 'nohup'
PGADMIN_LOGS = 'docker logs pgadmin'
PGADMIN_PORT = 7778
PGADMIN_PW = 'cslePassword'
PGADMIN_USERNAME = 'csle@csle.com'
PING = 'ping'
PIPE_DELIM = '|'
PKILL = 'pkill -f'
POSTGRESQL_LOG_DIR = '/var/log/postgresql/'
POSTGRESQL_START = 'sudo service postgresql start'
POSTGRESQL_STATUS = 'service postgresql status'
POSTGRESQL_STATUS_VERSION = 'service postgresql@15-main status'
POSTGRESQL_STOP = 'sudo service postgresql stop'
PROMETHEUS_CONFIG_FILE = '$CSLE_HOME/management-system/prometheus/prometheus.yml'
PROMETHEUS_LOG_FILE = '/var/log/csle/prometheus.log'
PROMETHEUS_PID_FILE = '/var/log/csle/prometheus.pid'
PROMETHEUS_PORT = 9090
PS_AUX = 'ps -aux'
PS_AXR = 'ps -axr'
RM_F = 'rm -f'
RM_F_HOME = 'rm -f home/'
ROOT_DIR = 'root'
SAVE_PID = 'echo {} > {}'
SEARCH_CLIENT_MANAGER = '/root/miniconda3/bin/python3 /client_manager.py'
SEARCH_DOCKER_STATS_MANAGER = 'statsmanager'
SEARCH_ELK_MANAGER = '/root/miniconda3/bin/python3 /elk_manager.py'
SEARCH_HOST_MANAGER = '/root/miniconda3/bin/python3 /host_manager.py'
SEARCH_KAFKA_MANAGER = '/root/miniconda3/bin/python3 /kafka_manager.py'
SEARCH_MONITOR = 'server.py'
SEARCH_NODE_EXPORTER = 'node_exporter'
SEARCH_OSSEC_IDS_MANAGER = '/root/miniconda3/bin/python3 /ossec_ids_manager.py'
SEARCH_PROMETHEUS = 'prometheus'
SEARCH_RYU_MANAGER = '/root/miniconda3/bin/python3 /ryu_manager.py'
SEARCH_SDN_CONTROLLER = '/root/miniconda3/bin/python3 /ryu_controller.py'
SEARCH_SNORT_IDS_MANAGER = '/root/miniconda3/bin/python3 /snort_ids_manager.py'
SEARCH_TRAFFIC_MANAGER = '/root/miniconda3/bin/python3 /traffic_manager.py'
SLASH_DELIM = '/'
SNORT_DUMP_STATS = 'kill -SIGUSR1 {}'
SNORT_PID = '/var/run//snort_eth1:eth0.pid'
SNORT_ROTATE_STATS = 'kill -SIGUSR2 {}'
SPACE_DELIM = ' '
START_CADVISOR = 'docker run  -dt --volume=/:/rootfs:ro   --volume=/var/run:/var/run:ro   --volume=/sys:/sys:ro   --volume=/var/lib/docker/:/var/lib/docker:ro   --volume=/dev/disk/:/dev/disk:ro   --publish=8080:8080  --name=cadvisor  gcr.io/cadvisor/cadvisor'
START_CLIENT_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /client_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_CLUSTER_MANAGER = 'nohup csle clustermanager {} & > /var/log/csle/clustermanager.out && echo $! > /var/log/csle/clustermanager.pid'
START_CSLE_MGMT_WEBAPP = 'nohup python $CSLE_HOME/management-system/csle-mgmt-webapp/server/server.py & > /var/log/csle/flask.log'
START_DOCKER_STATS_MANAGER = 'nohup csle statsmanager {} & > /var/log/csle/statsmanager.out && echo $! > /var/log/csle/statsmanager.pid'
START_ELK_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /elk_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_GRAFANA = 'docker run -d -p 3000:3000 --name grafana grafana/grafana'
START_HOST_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /host_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_KAFKA_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /kafka_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_NODE_EXPORTER = 'nohup $CSLE_HOME/management-system/node_exporter/node_exporter & > /var/log/csle/node_exporter.log && echo $! > /var/log/csle/node_exporter.pid'
START_OSSEC_IDS_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /ossec_ids_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_PGADMIN = "docker run -p 7778:80 -e 'PGADMIN_DEFAULT_EMAIL=csle@csle.com' -e 'PGADMIN_DEFAULT_PASSWORD=cslePassword' -d --name=pgadmin dpage/pgadmin4"
START_PROMETHEUS = 'nohup $CSLE_HOME/management-system/prometheus/prometheus --config.file=$CSLE_HOME/management-system/prometheus/prometheus.yml --storage.tsdb.retention.size=10GB --storage.tsdb.retention.time=5d & > /var/log/csle/prometheus.log && echo $! > /var/log/csle/prometheus.pid'
START_RYU_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /ryu_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_SDN_CONTROLLER = 'sudo nohup /root/miniconda3/bin/python3 /ryu_controller.py --port {} --webport {} --controller {} &'
START_SNORT_IDS_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /snort_ids_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_SYSTEM_IDENTIFICATION_JOB = 'nohup csle systemidentificationjob {} &'
START_TRAFFIC_MANAGER = 'sudo nohup /root/miniconda3/bin/python3 /traffic_manager.py --port {} --logdir {} --logfile {} --maxworkers {} &'
START_TRAINING_JOB = 'nohup csle trainingjob {} &'
STAR_DELIM = '*'
SUDO = 'sudo'
SUDO_ADD_ROUTE = 'sudo route add'
SUDO_RM_RF = 'sudo rm -rf'
SUDO_TOUCH = 'sudo touch'
TAIL = 'tail'
TMP_DIR = 'tmp'
TOUCH = 'touch'
UNDERSCORE_DELIM = '_'
UPDATE_RULESET = '/pulledpork/pulledpork.pl -c /pulledpork/etc/pulledpork.conf -l -P -E -H SIGHUP'
class csle_common.constants.constants.COMMON[source]

Bases: object

Common constants

CVE_FILE = '/allitems_prep.csv'
DEFAULT_RECV_SIZE = 5000
FLAG_FILENAME_PREFIX = 'flag'
LARGE_RECV_SIZE = 1000000
LOCALHOST = 'localhost'
LOCALHOST_127_0_0_1 = '127.0.0.1'
LOCALHOST_127_0_1_1 = '127.0.1.1'
SERVICES_FILE = '/nmap-services'
class csle_common.constants.constants.CONFIG_FILE[source]

Bases: object

Constants related to the config file

CONFIG_FILE_NAME = 'config.json'
CSLE_HOME_ENV_PARAM = 'CSLE_HOME'
PARSED_CONFIG: Union[None, csle_common.dao.emulation_config.config.Config] = None
class csle_common.constants.constants.CONTAINER_IMAGES[source]

Bases: object

String constants representing container images names

BASE = 'base'
BLANK = 'csle_blank'
BLANK_1 = 'csle_blank_1'
CADVISOR = 'cadvisor'
CLIENT_1 = 'csle_client_1'
CLIENT_IMAGES = ['csle_client_1']
CSLE_PREFIX = 'csle_'
CVE_2010_0426_1 = 'csle_cve_2010_0426_1'
CVE_2014_0160_1 = 'csle_cve_2014_0160_1'
CVE_2015_1427_1 = 'csle_cve_2015_1427_1'
CVE_2015_3306_1 = 'csle_cve_2015_3306_1'
CVE_2015_5602_1 = 'csle_cve_2015_5602_1'
CVE_2016_10033_1 = 'csle_cve_2016_10033_1'
DERIVED = 'derived'
DOCKERHUB_USERNAME = 'kimham'
ELK_1 = 'csle_elk_1'
FTP_1 = 'csle_ftp_1'
FTP_2 = 'csle_ftp_2'
GRAFANA = 'grafana'
HACKER_IMAGES = ['csle_hacker_kali_1']
HACKER_KALI_1 = 'csle_hacker_kali_1'
HONEYPOT_1 = 'csle_honeypot_1'
HONEYPOT_2 = 'csle_honeypot_2'
KAFKA_1 = 'csle_kafka_1'
OSSEC_IDS_IMAGES = ['csle_honeypot_1', 'csle_honeypot_2', 'csle_pengine_exploit_1', 'csle_router_1', 'csle_router_2', 'csle_ssh_1', 'csle_ssh_2', 'csle_ssh_3', 'csle_telnet_1', 'csle_telnet_2', 'csle_telnet_3', 'csle_spark_1']
OVS_1 = 'csle_ovs_1'
OVS_IMAGES = ['csle_ovs_1']
PENGINE_EXPLOIT_1 = 'csle_pengine_exploit_1'
PGADMIN = 'pgadmin'
ROUTER_1 = 'csle_router_1'
ROUTER_2 = 'csle_router_2'
ROUTER_IMAGES = ['csle_router_1', 'csle_router_2']
RYU_1 = 'csle_ryu_1'
SAMBA_1 = 'csle_samba_1'
SAMBA_2 = 'csle_samba_2'
SHELLSHOCK_1 = 'csle_shellshock_1'
SNORT_IDS_IMAGES = ['csle_router_2']
SPARK_1 = 'csle_spark_1'
SPARK_IMAGES = ['csle_spark_1']
SQL_INJECTION_1 = 'csle_sql_injection_1'
SSH_1 = 'csle_ssh_1'
SSH_2 = 'csle_ssh_2'
SSH_3 = 'csle_ssh_3'
TELNET_1 = 'csle_telnet_1'
TELNET_2 = 'csle_telnet_2'
TELNET_3 = 'csle_telnet_3'
class csle_common.constants.constants.CONTAINER_OS[source]

Bases: object

String constants representing OS of different containers

CLIENT_1_OS = 'ubuntu'
CVE_2010_0426_1_OS = 'debian'
CVE_2014_0160_1_OS = 'debian'
CVE_2015_1427_1_OS = 'debian'
CVE_2015_3306_1_OS = 'debian'
CVE_2015_5602_1_OS = 'debian'
CVE_2016_10033_1_OS = 'debian'
ELK_1_OS = 'ubuntu'
FTP_1_OS = 'ubuntu'
FTP_2_OS = 'ubuntu'
HACKER_KALI_1_OS = 'kali'
HONEYPOT_1_OS = 'ubuntu'
HONEYPOT_2_OS = 'ubuntu'
KAFKA_1_OS = 'ubuntu'
OVS_1_OS = 'ubuntu'
PENGINE_EXPLOIT_1_OS = 'ubuntu'
ROUTER_1_OS = 'ubuntu'
ROUTER_2_OS = 'ubuntu'
RYU_1_OS = 'ubuntu'
SAMBA_1_OS = 'debian'
SAMBA_2_OS = 'debian'
SHELLSHOCK_1_OS = 'debian'
SPARK_1_OS = 'spark'
SQL_INJECTION_1_OS = 'debian'
SSH_1_OS = 'ubuntu'
SSH_2_OS = 'ubuntu'
SSH_3_OS = 'ubuntu'
TELNET_1_OS = 'ubuntu'
TELNET_2_OS = 'ubuntu'
TELNET_3_OS = 'ubuntu'
class csle_common.constants.constants.CONTAINER_POOLS[source]

Bases: object

Constants related to container pools

AGENT_CONTAINERS = [('csle_hacker_kali_1', '0.0.1')]
CONTAINER_POOL = [('csle_ftp_1', '0.0.1'), ('csle_ftp_2', '0.0.1'), ('csle_honeypot_1', '0.0.1'), ('csle_honeypot_2', '0.0.1'), ('csle_ssh_1', '0.0.1'), ('csle_ssh_2', '0.0.1'), ('csle_ssh_3', '0.0.1'), ('csle_telnet_1', '0.0.1'), ('csle_telnet_2', '0.0.1'), ('csle_telnet_3', '0.0.1'), ('csle_cve_2015_1427_1', '0.0.1'), ('csle_cve_2015_3306_1', '0.0.1'), ('csle_cve_2016_10033_1', '0.0.1'), ('csle_samba_1', '0.0.1'), ('csle_sql_injection_1', '0.0.1'), ('csle_shellshock_1', '0.0.1'), ('csle_cve_2010_0426_1', '0.0.1'), ('csle_cve_2015_5602_1', '0.0.1'), ('csle_cve_2014_0160_1', '0.0.1')]
GW_VULN_CONTAINERS = [('csle_ssh_1', '0.0.1'), ('csle_ssh_2', '0.0.1'), ('csle_ssh_3', '0.0.1'), ('csle_telnet_1', '0.0.1'), ('csle_telnet_2', '0.0.1'), ('csle_telnet_3', '0.0.1'), ('csle_cve_2015_1427_1', '0.0.1'), ('csle_cve_2015_3306_1', '0.0.1'), ('csle_cve_2016_10033_1', '0.0.1'), ('csle_samba_1', '0.0.1'), ('csle_sql_injection_1', '0.0.1'), ('csle_shellshock_1', '0.0.1')]
PRIV_ESC_CONTAINERS = [('csle_cve_2010_0426_1', '0.0.1'), ('csle_cve_2015_5602_1', '0.0.1')]
PW_VULN_CONTAINERS = [('csle_ssh_1', '0.0.1'), ('csle_ssh_2', '0.0.1'), ('csle_ssh_3', '0.0.1'), ('csle_telnet_1', '0.0.1'), ('csle_telnet_2', '0.0.1'), ('csle_telnet_3', '0.0.1'), ('csle_ftp_1', '0.0.1'), ('csle_ftp_2', '0.0.1')]
RCE_CONTAINERS = [('csle_cve_2015_1427_1', '0.0.1'), ('csle_cve_2015_3306_1', '0.0.1'), ('csle_cve_2016_10033_1', '0.0.1'), ('csle_samba_1', '0.0.1'), ('csle_sql_injection_1', '0.0.1'), ('csle_shellshock_1', '0.0.1')]
ROUTER_CONTAINERS = [('csle_router_1', '0.0.1'), ('csle_router_2', '0.0.1')]
SQL_INJECTION_CONTAINERS = [('csle_sql_injection_1', '0.0.1')]
class csle_common.constants.constants.CSLE[source]

Bases: object

Constants related to general CSLE

BRIDGE = 'br'
CSLE_BITMASK = '255.255.0.0'
CSLE_EDGE_BITMASK = '255.255.255.0'
CSLE_EDGE_SUBNETMASK_SUFFIX = '.0/24'
CSLE_FIRST_IP_OCTET_PLACEHOLDER = '<EXECUTION_ID>'
CSLE_LEVEL_SUBNETMASK_SUFFIX = '.0.0/16'
CSLE_NETWORK_PREFIX = 'csle_net_'
CSLE_SUBNETMASK_PREFIX = '<EXECUTION_ID>.'
EDGE_SUBNETMASK_BITS = 24
LEVEL = 'level'
LIST_OF_IP_SUBNETS = [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249]
NAME = 'csle'
NON_IDS_ROUTER = 'router_1'
class csle_common.constants.constants.CSLE_ADMIN[source]

Bases: object

Constants related to the default csle admin account.

MANAGEMENT_EMAIL = 'admin@csle.com'
MANAGEMENT_FIRST_NAME = 'admin'
MANAGEMENT_LAST_NAME = 'adminson'
MANAGEMENT_ORGANIZATION = 'CSLE'
MANAGEMENT_PW = 'admin'
MANAGEMENT_USER = 'admin'
SSH_PW = 'csle@admin-pw_191'
SSH_USER = 'csle_admin'
class csle_common.constants.constants.CSLE_GUEST[source]

Bases: object

Constants related to the default csle guest account

MANAGEMENT_EMAIL = 'guest@csle.com'
MANAGEMENT_FIRST_NAME = 'guest'
MANAGEMENT_LAST_NAME = 'guestson'
MANAGEMENT_ORGANIZATION = 'CSLE'
MANAGEMENT_PW = 'guest'
MANAGEMENT_USER = 'guest'
PW = 'csle@guest-pw_191'
USER = 'csle_guest'
class csle_common.constants.constants.CUDA[source]

Bases: object

String constants related to cuda

CUDA_VISIBLE_DEVICES = 'CUDA_VISIBLE_DEVICES'
class csle_common.constants.constants.CVE_2010_0426[source]

Bases: object

Constants related to CVE-2010-0426

BACKDOOR_PW = 'cve_2010_0426_pwnedpw'
BACKDOOR_USER = 'ssh_backdoor_cve10_0426pwn'
EXPLOIT_FILE = '/etc/fstab'
SERVICE_NAME = 'sudoedit'
VULNERABILITY_NAME = 'cve-2010-0426'
class csle_common.constants.constants.CVE_2015_1427[source]

Bases: object

Constants related to CVE-2015-1427

BACKDOOR_PW = 'cve_2015_1427_pwnedpw'
BACKDOOR_USER = 'ssh_backdoor_cve_2015_1427_pwned'
PORT = 9200
SERVICE_NAME = 'elasticsearch'
VULNERABILITY_NAME = 'cve-2015-1427'
class csle_common.constants.constants.CVE_2015_3306[source]

Bases: object

Constants related to CVE-2015-3306

BACKDOOR_PW = 'cve2015_3306_pwnedpw'
BACKDOOR_USER = 'ssh_backdoor_cve2015_3306_pwned'
PORT = 21
SERVICE_NAME = 'proftpd'
VULNERABILITY_NAME = 'cve-2015-3306'
class csle_common.constants.constants.CVE_2015_5602[source]

Bases: object

Constants related to CVE-2015-5602

BACKDOOR_PW = 'cve_2015_5602_pwnedpw'
BACKDOOR_USER = 'ssh_backdoor_cve15_5602pwn'
ROOT_PW = 'cve_2015_5602_temp_root_pw'
SERVICE_NAME = 'sudoedit'
VULNERABILITY_NAME = 'cve-2015-5602'
class csle_common.constants.constants.CVE_2016_10033[source]

Bases: object

Constants related to CVE-2016-10033

BACKDOOR_PW = 'cve_2016_10033_pwnedpw'
BACKDOOR_USER = 'ssh_backdoor_2016_10033_pwn'
PORT = 80
SERVICE_NAME = 'http'
VULNERABILITY_NAME = 'cve-2016-10033'
class csle_common.constants.constants.DATASETS[source]

Bases: object

Constants related to datasets

ADDED_BY_PROPERTY = 'added_by'
COLUMNS_PROPERTY = 'columns'
CONDITIONS_PROPERTY = 'conditions'
FILE_FORMAT_PROPERTY = 'file_format'
JSON_FILE_FORMAT = 'json'
METADATA_FILE_NAME = 'readme.json'
METRICS_PROPERTY = 'metrics'
NUM_ATTRIBUTES_PER_TIME_STEP_PROPERTY = 'num_attributes_per_time_step'
NUM_CONDITIONS_PROPERTY = 'num_conditions'
NUM_MEASUREMENTS_PROPERTY = 'num_measurements'
NUM_METRICS_PROPERTY = 'num_metrics'
NUM_TRACES_PER_FILE_PROPERTY = 'num_traces_per_file'
NUM_TRACES_PROPERTY = 'num_traces'
SCHEMA_PROPERTY = 'schema'
class csle_common.constants.constants.DNS[source]

Bases: object

Constants related to the DNS service

DEFAULT_PORT = 53
SERVICE_NAME = 'dns'
class csle_common.constants.constants.DOCKER[source]

Bases: object

Constants related to Docker

ATTACHABLE_NETWORK_FLAG = '--attachable'
BASE_CONTAINER_TYPE = 'base'
BRIDGE_NETWORK_DRIVER = 'bridge'
CFG = 'cfg'
CONFIG = 'Config'
CONTAINERS_DIR = 'containers'
CONTAINERS_KEY = 'Containers'
CONTAINER_CONFIG_CFG = 'containers_cfg'
CONTAINER_CONFIG_CFG_PATH = '/containers.json'
CONTAINER_CONFIG_DIR = 'dir'
CONTAINER_CONFIG_FLAGS_CFG = 'flags_cfg'
CONTAINER_CONFIG_FLAGS_CFG_PATH = '/flags.json'
CONTAINER_CONFIG_RESOURCES_CFG_PATH = '/resources.json'
CONTAINER_CONFIG_TOPOLOGY_CFG = 'topology_cfg'
CONTAINER_CONFIG_TOPOLOGY_CFG_PATH = '/topology.json'
CONTAINER_CONFIG_TRAFFIC_CFG = 'traffic_cfg'
CONTAINER_CONFIG_TRAFFIC_CFG_PATH = '/traffic.json'
CONTAINER_CONFIG_USERS_CFG = 'users_cfg'
CONTAINER_CONFIG_USERS_CFG_PATH = '/users.json'
CONTAINER_CONFIG_VULNERABILITIES_CFG = 'vulnerabilities_cfg'
CONTAINER_CONFIG_VULNERABILITIES_CFG_PATH = '/vulnerabilities.json'
CONTAINER_CREATED_STATUS = 'created'
CONTAINER_EXIT_STATUS = 'exited'
CONTAINER_MAKEFILE_TEMPLATE_DIR_RELATIVE = '/../../../common/'
CONTAINER_MAKEFILE_TEMPLATE_NAME = 'Container_Makefile_template'
CONTAINER_MAKEFILE_TEMPLATE_STR = '\nall: run\n\nrun:\n\tdocker container run -dt --name $(PROJECT)-$(CONTAINER)$(SUFFIX)-level$(LEVEL) --hostname=$(CONTAINER)$(SUFFIX) --label dir=$(DIR) --label cfg=$(CFG) --label emulation=$(EMULATION)--network=none --publish-all=true --memory=$(MEMORY) -e TZ=Europe/Stockholm --cpus=$(NUM_CPUS) --restart=$(RESTART_POLICY) --cap-add NET_ADMIN $(PROJECT)/$(CONTAINER):$(VERSION)\n\nshell:\n\tdocker exec -it $(PROJECT)-$(CONTAINER)$(SUFFIX)-level$(LEVEL) /bin/bash\n\nstart:\n\tdocker container start $(PROJECT)-$(CONTAINER)$(SUFFIX)-level$(LEVEL)\n\nstop:\n\t-docker stop $(PROJECT)-$(CONTAINER)$(SUFFIX)-level$(LEVEL)\n\nclean: stop\n\t-docker rm $(PROJECT)-$(CONTAINER)$(SUFFIX)-level$(LEVEL)'
CREATED_INFO = 'Created'
CREATE_FLAGS_SCRIPT = './create_flags.py'
CREATE_TOPOLOGY_SCRIPT = './create_topology.py'
CREATE_TRAFFIC_GENERATORS_SCRIPT = './create_traffic_generators.py'
CREATE_USERS_SCRIPT = './create_users.py'
CREATE_VULN_SCRIPT = './create_vuln.py'
EMULATION = 'emulation'
EMULATION_ENV_CFG_PATH = '/config.json'
EMULATION_ENV_IMAGE = '/env.png'
ENTRYPOINT = 'Entrypoint'
GATEWAY_INFO = 'Gateway'
HOSTNAME_INFO = 'Hostname'
IMAGE = 'Image'
IMAGE_ARCHITECTURE = 'Architecture'
IMAGE_CREATED = 'Created'
IMAGE_INFO = 'Info'
IMAGE_OS = 'Os'
IMAGE_SIZE = 'Size'
INSPECT_CONTAINER_CONFIG_CMD = 'docker inspect'
INSPECT_DOCKER_GWBRIDGE = 'docker network inspect docker_gwbridge'
IPV4_KEY = 'IPv4Address'
IP_ADDRESS_INFO = 'IPAddress'
IP_PREFIX_LEN_INFO = 'IPPrefixLen'
KAFKA_CFG_PATH = '/kafka_config.json'
KAFKA_CONFIG = 'kafka_config'
LIST_NETWORKS_CMD = 'docker network ls'
LIST_RUNNING_CONTAINERS_CMD = 'docker ps -q'
MAC_ADDRESS_INFO = 'MacAddress'
MAKEFILE = 'Makefile'
MAKEFILE_PATH = '/Makefile'
MAKEFILE_TEMPLATE = 'Makefile_template'
NETWORKS = 'Networks'
NETWORK_CONNECT = 'docker network connect'
NETWORK_ID_INFO = 'NetworkID'
NETWORK_SETTINGS = 'NetworkSettings'
NET_ADMIN = 'NET_ADMIN'
ON_FAILURE_3 = 'on-failure:3'
OVERLAY_NETWORK_DRIVER = 'overlay'
REPO_TAGS = 'RepoTags'
SIMULATION_ENV_IMAGE = '/env.png'
SSH_PREFIX = 'ssh://kim@'
UNIX_DOCKER_SOCK_URL = 'unix://var/run/docker.sock'
class csle_common.constants.constants.DUMMY_VEC_ENV[source]

Bases: object

Constants related to creation of Sub-proc-env environments

SLEEP_TIME_STARTUP = 1
class csle_common.constants.constants.DVWA_SQL_INJECTION[source]

Bases: object

Constants related to DVWA SQL Injection Vulnerabilities

EXPLOIT_OUTPUT_FILENAME = 'dvwa_sql_injection_result.txt'
EXPLOIT_PW = '0d107d09f5bbe40cade3de5c71e9e9b7'
EXPLOIT_USER = 'pablo'
PORT = 80
SERVICE_NAME = 'http'
VULNERABILITY_NAME = 'dvwa_sql_injection'
class csle_common.constants.constants.ENV_CONSTANTS[source]

Bases: object

Constants related to emulation environments

ATTACKER_CONTINUE_ACTION_SLEEP = 0.001
ATTACKER_CVE_2010_0426_SLEEP_RETRY = 4
ATTACKER_CVE_2015_1427_SLEEP_RETRY = 4
ATTACKER_CVE_2015_3306_SLEEP_RETRY = 4
ATTACKER_CVE_2015_5602_SLEEP_RETRY = 4
ATTACKER_CVE_2016_10033_SLEEP_RETRY = 4
ATTACKER_DVWA_SQL_INJECTION_SLEEP_RETRY = 4
ATTACKER_FTP_RETRY_FIND_FLAG = 2
ATTACKER_INSTALL_TOOLS_SLEEP_SECONDS = 3
ATTACKER_RETRY_CHECK_ROOT = 3
ATTACKER_RETRY_CVE_2010_0426 = 4
ATTACKER_RETRY_CVE_2015_1427 = 4
ATTACKER_RETRY_CVE_2015_3306 = 4
ATTACKER_RETRY_CVE_2015_5602 = 4
ATTACKER_RETRY_CVE_2016_10033 = 4
ATTACKER_RETRY_DVWA_SQL_INJECTION = 10
ATTACKER_RETRY_FIND_USERS = 5
ATTACKER_RETRY_INSTALL_TOOLS = 5
ATTACKER_RETRY_SAMBACRY = 4
ATTACKER_RETRY_SHELLSHOCK = 4
ATTACKER_SAMBACRY_SLEEP_RETRY = 4
ATTACKER_SHELLSHOCK_SLEEP_RETRY = 4
ATTACKER_SSH_RETRY_FIND_FLAG = 5
MAX_NMAP_COMMAND_OUTPUT_SIZE = 10000000
NUM_RETRIES = 5
RETRY_TIMEOUT = 2
SHELL_MAX_TIMEOUTS = 4000
SHELL_READ_WAIT = 0.5
SLEEP_RETRY = 5
class csle_common.constants.constants.ETC_HOSTS[source]

Bases: object

Constants related to /etc/hosts configuration

APPEND_TO_ETC_HOSTS = 'sudo tee -a /etc/hosts'
DEFAULT_HOST_LINE_1 = "'127.0.0.1 localhost'"
DEFAULT_HOST_LINE_2 = ":':1 localhost ip6-localhost ip6-loopback'"
DEFAULT_HOST_LINE_3 = "'fe00::0 ip6-localnet'"
DEFAULT_HOST_LINE_4 = "'ff00::0 ip6-mcastprefix'"
DEFAULT_HOST_LINE_5 = "'ff02::1 ip6-allnodes'"
DEFAULT_HOST_LINE_6 = "''ff02::2 ip6-allrouters''"
class csle_common.constants.constants.EXPERIMENT[source]

Bases: object

Constants related to experiments folder structure

CONFIG_FILE_PATH = '/config.json'
DATA_DIR = 'data'
ENV_DATA_DIR = 'env_data'
GIFS_DIR = 'gifs'
HYPERPARAMETERS_DIR = 'hyperparameters'
LOG_DIR = 'logs'
PLOTS_DIR = 'plots'
RESULTS_DIR = 'results'
TENSORBOARD_DIR = 'tensorboard'
VIDEOS_DIR = 'videos'
class csle_common.constants.constants.EXPLOIT_VULNERABILITES[source]

Bases: object

Constants related to exploit vulnerabilities

CASSANDRA_DICTS_SAME_USER_PASS = 'cassandra-weak-password'
CVE_2010_0426 = 'cve-2010-0426'
CVE_2010_0426_CVSS = 6
CVE_2014_0160 = 'cve-2014-0160'
CVE_2015_1427 = 'cve-2015-1427'
CVE_2015_1427_CVSS = 9.8
CVE_2015_3306 = 'cve-2015-3306'
CVE_2015_3306_CVSS = 9.8
CVE_2015_5602 = 'cve-2015-5602'
CVE_2015_5602_CVSS = 6
CVE_2016_10033 = 'cve-2016-10033'
CVE_2016_10033_CVSS = 9.8
CVE_VULNS = ['cve-2017-7494', 'cve-2014-6271', 'cve-2015-3306', 'cve-2015-1427', 'cve-2016-10033', 'cve-2010-0426', 'cve-2015-5602']
DVWA_SQL_INJECTION = 'dvwa_sql_injection'
DVWA_SQL_INJECTION_CVSS = 9.5
FTP_DICT_SAME_USER_PASS = 'ftp-weak-password'
IRC_DICTS_SAME_USER_PASS = 'irc-weak-password'
MONGO_DICTS_SAME_USER_PASS = 'mongo-weak-password'
MYSQL_DICTS_SAME_USER_PASS = 'mysql-weak-password'
PENGINE_EXPLOIT = 'pengine-exploit'
PENGINE_EXPLOIT_CVSS = 9.8
POSTGRES_DICTS_SAME_USER_PASS = 'postgres-weak-password'
PRIVILEGE_ESC_VULNS = ['cve-2010-0426', 'cve-2015-5602']
SAMBACRY_CVSS = 9.8
SAMBACRY_EXPLOIT = 'cve-2017-7494'
SHELLSHOCK_CVSS = 9.8
SHELLSHOCK_EXPLOIT = 'cve-2014-6271'
SMTP_DICTS_SAME_USER_PASS = 'smtp-weak-password'
SSH_DICT_SAME_USER_PASS = 'ssh-weak-password'
TELNET_DICTS_SAME_USER_PASS = 'telnet-weak-password'
UNKNOWN = 'unknown'
WEAK_PASSWORD_CVSS = 10.0
WEAK_PW_VULNS = ['ssh-weak-password', 'ftp-weak-password', 'telnet-weak-password', 'irc-weak-password', 'postgres-weak-password', 'smtp-weak-password', 'mysql-weak-password', 'mongo-weak-password', 'cassandra-weak-password']
class csle_common.constants.constants.FILE_PATTERNS[source]

Bases: object

Constants related to file patterns for parsing

ALERTS_FILE_SUFFIX = '_alerts.txt'
COST_FILE_SUFFIX = '_cost.txt'
CSV_SUFFIX = '.csv'
GZ_SUFFIX = '.gz'
LOG_SUFFIX = '.log'
NMAP_ACTION_RESULT_SUFFIX = '.xml'
TXT_FILE_SUFFIX = '.txt'
XML_FILE_SUFFIX = '.xm'
class csle_common.constants.constants.FIREWALL[source]

Bases: object

Firewall string constants

ACCEPT = 'ACCEPT'
DROP = 'DROP'
class csle_common.constants.constants.FTP[source]

Bases: object

Constants related to the FTP service

ACCESS_FAILED = 'Access failed'
DEFAULT_PORT = 21
INCORRECT_LOGIN = 'Login incorrect'
LFTP_PREFIX = 'lftp ftp://'
LFTP_PROMPT = ':~>'
LFTP_PROMPT_2 = ':/>'
LOCALHOST = '127.0.0.1'
SERVICE_NAME = 'ftp'
class csle_common.constants.constants.GENERAL[source]

Bases: object

General constants

EMULATION_PROPERTY = 'emulation'
EXECUTION_ID_PROPERTY = 'execution_id'
IP_PROPERTY = 'ip'
PORT_PROPERTY = 'port'
THREAD_PROPERTY = 'thread'
class csle_common.constants.constants.GRPC_SERVERS[source]

Bases: object

Constants related to grpc servers

CLIENT_MANAGER_PORT = 50044
CLUSTER_MANAGER_PORT = 50041
DOCKER_STATS_MANAGER_PORT = 50046
ELK_MANAGER_PORT = 50045
GRPC_OPTIONS = [('grpc.max_message_length', 100000000), ('grpc.max_send_message_length', 100000000), ('grpc.max_receive_message_length', 100000000)]
HOST_MANAGER_PORT = 50049
OSSEC_IDS_MANAGER_PORT = 50047
RYU_MANAGER_PORT = 50042
SNORT_IDS_MANAGER_PORT = 50048
TRAFFIC_MANAGER_PORT = 50043
class csle_common.constants.constants.HTTP[source]

Bases: object

Constants related to the HTTP service

DEFAULT_PORT = 80
DEFAULT_TIMEOUT = 5
HTTP_PROTOCOL_PREFIX = 'http://'
SERVICE_NAME = 'http'
class csle_common.constants.constants.HTTPS[source]

Bases: object

Constants related to the HTTPS service

BAD_REQUEST_STATUS_CODE = 400
CONFLICT_STATUS_CODE = 409
CREATED_STATUS_CODE = 201
DEFAULT_PORT = 443
INTERNAL_SERVER_ERROR_STATUS_CODE = 500
METHOD_NOT_ALLOWED_CODE = 405
NOT_FOUND_STATUS_CODE = 404
OK_STATUS_CODE = 200
SERVICE_NAME = 'HTTPS'
UNAUTHORIZED_STATUS_CODE = 401
class csle_common.constants.constants.INFO_DICT[source]

Bases: object

Constants for strings in the info dict of the csle_CTF Environment

ATTACKER_ACTION = 'attacker_action'
ATTACKER_ALERTS = 'attacker_alerts'
ATTACKER_ALERTS_NORM = 'attacker_alerts_norm'
ATTACKER_COST = 'attacker_cost'
ATTACKER_COST_NORM = 'attacker_cost_norm'
DEFENDER_FIRST_STOP_STEP = 'defender_first_stop_step'
DEFENDER_FOURTH_STOP_STEP = 'defender_fourth_stop_step'
DEFENDER_SECOND_STOP_STEP = 'defender_second_stop_step'
DEFENDER_STOPS_REMAINING = 'defender_stops_remaining'
DEFENDER_THIRD_STOP_STEP = 'defender_third_stop_step'
EARLY_STOPPED = 'early_stopped'
EPISODE_LENGTH = 'episode_length'
FLAGS = 'flags'
IDX = 'idx'
INTRUSION_STATE = 'intrusion_state'
INTRUSION_STEP = 'intrusion_step'
OPTIMAL_DEFENDER_EPISODE_STEPS = 'optimal_defender_episode_steps'
OPTIMAL_DEFENDER_REWARD = 'optimal_defender_reward'
OPTIMAL_FIRST_STOP_STEP = 'optimal_first_stop_step'
OPTIMAL_FOURTH_STOP_STEP = 'optimal_fourth_stop_step'
OPTIMAL_SECOND_STOP_STEP = 'optimal_second_stop_step'
OPTIMAL_STOPS_REMAINING = 'optimal_stops_remaining'
OPTIMAL_THIRD_STOP_STEP = 'optimal_third_stop_step'
SNORT_CRITICAL_BASELINE_CAUGHT_ATTACKER = 'snort_critical_baseline_caught_attacker'
SNORT_CRITICAL_BASELINE_EARLY_STOPPING = 'snort_critical_baseline_early_stopping'
SNORT_CRITICAL_BASELINE_FIRST_STOP_STEP = 'snort_critical_baseline_first_stop_step'
SNORT_CRITICAL_BASELINE_FOURTH_STOP_STEP = 'snort_critical_baseline_fourth_stop_step'
SNORT_CRITICAL_BASELINE_REWARD = 'snort_critical_baseline_reward'
SNORT_CRITICAL_BASELINE_SECOND_STOP_STEP = 'snort_critical_baseline_second_stop_step'
SNORT_CRITICAL_BASELINE_STEP = 'snort_critical_baseline_step'
SNORT_CRITICAL_BASELINE_STOPS_REMAINING = 'snort_critical_baseline_stops_remaining'
SNORT_CRITICAL_BASELINE_THIRD_STOP_STEP = 'snort_critical_baseline_third_stop_step'
SNORT_CRITICAL_BASELINE_UNCAUGHT_INTRUSION_STEPS = 'snort_critical_baseline_uncaught_intrusion_steps'
SNORT_SEVERE_BASELINE_CAUGHT_ATTACKER = 'snort_severe_baseline_caught_attacker'
SNORT_SEVERE_BASELINE_EARLY_STOPPING = 'snort_severe_baseline_early_stopping'
SNORT_SEVERE_BASELINE_FIRST_STOP_STEP = 'snort_severe_baseline_first_stop_step'
SNORT_SEVERE_BASELINE_FOURTH_STOP_STEP = 'snort_severe_baseline_fourth_stop_step'
SNORT_SEVERE_BASELINE_REWARD = 'snort_severe_baseline_reward'
SNORT_SEVERE_BASELINE_SECOND_STOP_STEP = 'snort_severe_baseline_second_stop_step'
SNORT_SEVERE_BASELINE_STEP = 'snort_severe_baseline_step'
SNORT_SEVERE_BASELINE_STOPS_REMAINING = 'snort_severe_baseline_stops_remaining'
SNORT_SEVERE_BASELINE_THIRD_STOP_STEP = 'snort_severe_baseline_third_stop_step'
SNORT_SEVERE_BASELINE_UNCAUGHT_INTRUSION_STEPS = 'snort_severe_baseline_uncaught_intrusion_steps'
SNORT_WARNING_BASELINE_CAUGHT_ATTACKER = 'snort_warning_baseline_caught_attacker'
SNORT_WARNING_BASELINE_EARLY_STOPPING = 'snort_warning_baseline_early_stopping'
SNORT_WARNING_BASELINE_FIRST_STOP_STEP = 'snort_warning_baseline_first_stop_step'
SNORT_WARNING_BASELINE_FOURTH_STOP_STEP = 'snort_warning_baseline_fourth_stop_step'
SNORT_WARNING_BASELINE_REWARD = 'snort_warning_baseline_reward'
SNORT_WARNING_BASELINE_SECOND_STOP_STEP = 'snort_warning_baseline_second_stop_step'
SNORT_WARNING_BASELINE_STEP = 'snort_warning_baseline_step'
SNORT_WARNING_BASELINE_STOPS_REMAINING = 'snort_warning_baseline_stops_remaining'
SNORT_WARNING_BASELINE_THIRD_STOP_STEP = 'snort_warning_baseline_third_stop_step'
SNORT_WARNING_BASELINE_UNCAUGHT_INTRUSION_STEPS = 'snort_warning_baseline_uncaught_intrusion_steps'
STEP_BASELINE_CAUGHT_ATTACKER = 'step_baseline_caught_attacker'
STEP_BASELINE_EARLY_STOPPING = 'step_baseline_early_stopping'
STEP_BASELINE_FIRST_STOP_STEP = 'step_baseline_uncaught_first_stop_step'
STEP_BASELINE_FOURTH_STOP_STEP = 'step_baseline_uncaught_fourth_stop_step'
STEP_BASELINE_REWARD = 'step_baseline_reward'
STEP_BASELINE_SECOND_STOP_STEP = 'step_baseline_uncaught_second_stop_step'
STEP_BASELINE_STEP = 'step_baseline_step'
STEP_BASELINE_STOPS_REMAINING = 'step_baseline_uncaught_stops_remaining'
STEP_BASELINE_THIRD_STOP_STEP = 'step_baseline_uncaught_third_stop_step'
STEP_BASELINE_UNCAUGHT_INTRUSION_STEPS = 'step_baseline_uncaught_intrusion_steps'
SUCCESSFUL_INTRUSION = 'successful_intrusion'
TERMINAL_OBSERVATION = 'terminal_observation'
UNCAUGHT_INTRUSION_STEPS = 'uncaught_intrusion_steps'
VAR_LOG_BASELINE_CAUGHT_ATTACKER = 'var_log_baseline_caught_attacker'
VAR_LOG_BASELINE_EARLY_STOPPING = 'var_log_baseline_early_stopping'
VAR_LOG_BASELINE_FIRST_STOP_STEP = 'var_log_baseline_first_stop_step'
VAR_LOG_BASELINE_FOURTH_STOP_STEP = 'var_log_baseline_fourth_stop_step'
VAR_LOG_BASELINE_REWARD = 'var_log_baseline_reward'
VAR_LOG_BASELINE_SECOND_STOP_STEP = 'var_log_baseline_second_stop_step'
VAR_LOG_BASELINE_STEP = 'var_log_baseline_step'
VAR_LOG_BASELINE_STOPS_REMAINING = 'var_log_baseline_stops_remaining'
VAR_LOG_BASELINE_THIRD_STOP_STEP = 'var_log_baseline_third_stop_step'
VAR_LOG_BASELINE_UNCAUGHT_INTRUSION_STEPS = 'var_log_baseline_uncaught_intrusion_steps'
class csle_common.constants.constants.IRC[source]

Bases: object

Constants related to the IRC service

DEFAULT_PORT = 194
SERVICE_NAME = 'irc'
class csle_common.constants.constants.LOGGING[source]

Bases: object

Constants related to logging

DEFAULT_LOG_DIR = '/tmp/csle/'
class csle_common.constants.constants.MAKEFILE[source]

Bases: object

Constants related to Makefiles

CFG = 'CFG'
CONTAINER = 'CONTAINER'
DIR = 'DIR'
EMULATION = 'EMULATION'
EXTERNAL_NETWORK = 'EXTERNAL_NETWORK'
FLAGSCFG = 'FLAGSCFG'
INTERNAL_NETWORK = 'INTERNAL_NETWORK'
LEVEL = 'LEVEL'
MEMORY = 'MEMORY'
NUM_CPUS = 'NUM_CPUS'
PROJECT = 'PROJECT'
RESTART_POLICY = 'RESTART_POLICY'
SUFFIX = 'SUFFIX'
TOPOLOGYCFG = 'TOPOLOGYCFG'
USERSCFG = 'USERSCFG'
VERSION = 'VERSION'
VULNERABILITIESCFG = 'VULNERABILITIESCFG'
class csle_common.constants.constants.MANAGEMENT[source]

Bases: object

Constants related to the management system

ALL = 'all'
APPLY_CONFIG = 'apply_config'
CLEAN = 'clean'
CLEAN_CONFIG = 'clean_config'
CLEAN_ENVS = 'clean_envs'
CLEAN_FS_CACHE = 'clean_fs_cache'
FLAGS = 'flags'
GEN_CONFIG = 'gen_config'
LIST_IMAGES = 'list_images'
LIST_NETWORKS = 'list_networks'
LIST_RUNNING = 'list_running'
LIST_STOPPED = 'list_stopped'
RM_IMAGES = 'rm_images'
RM_NETWORKS = 'rm_networks'
RM_STOPPED = 'rm_stopped'
RUN = 'run'
START = 'start'
START_STOPPED = 'start_stopped'
STOP = 'stop'
STOP_RUNNING = 'stop_running'
TOPOLOGY = 'topology'
TRAFFIC = 'traffic'
USERS = 'users'
VULN = 'vuln'
class csle_common.constants.constants.MASSCAN[source]

Bases: object

Constants related to Masscan commands

BASE_ARGS = '-p0-1024 --max-rate 100000 --max-retries 1 --wait 0'
HOST_ARG = '--source-ip '
OUTPUT_ARG = '-oX '
class csle_common.constants.constants.METADATA_STORE[source]

Bases: object

String constants related to the metadata store

ALPHA_VEC_POLICIES_TABLE = 'alpha_vec_policies'
CONFIG_TABLE = 'config'
DATA_COLLECTION_JOBS_TABLE = 'data_collection_jobs'
DBNAME = 'csle'
DB_NAME_PROPERTY = 'dbname'
DQN_POLICIES_TABLE = 'dqn_policies'
EMPIRICAL_SYSTEM_MODELS_TABLE = 'empirical_system_models'
EMULATIONS_TABLE = 'emulations'
EMULATION_EXECUTIONS_TABLE = 'emulation_executions'
EMULATION_IMAGES_TABLE = 'emulation_images'
EMULATION_SIMULATION_TRACES_TABLE = 'emulation_simulation_traces'
EMULATION_STATISTICS_TABLE = 'emulation_statistics'
EMULATION_TRACES_TABLE = 'emulation_traces'
EXPERIMENT_EXECUTIONS_TABLE = 'experiment_executions'
FNN_W_SOFTMAX_POLICIES_TABLE = 'fnn_w_softmax_policies'
GAUSSIAN_MIXTURE_SYSTEM_MODELS_TABLE = 'gaussian_mixture_system_models'
GP_SYSTEM_MODELS_TABLE = 'gp_system_models'
HOST = '172.31.212.92'
HOST_PROPERTY = 'host'
LINEAR_THRESHOLD_STOPPING_POLICIES_TABLE = 'linear_threshold_stopping_policies'
MANAGEMENT_USERS_TABLE = 'management_users'
MCMC_SYSTEM_MODELS_TABLE = 'mcmc_system_models'
MULTI_THRESHOLD_STOPPING_POLICIES_TABLE = 'multi_threshold_stopping_policies'
NUM_RETRIES_UPDATE_TRAINING_JOB = 5
PASSWORD = 'csle'
PPO_POLICIES_TABLE = 'ppo_policies'
PW_PROPERTY = 'password'
SESSION_TOKENS_TABLE = 'session_tokens'
SIMULATIONS_TABLE = 'simulations'
SIMULATION_IMAGES_TABLE = 'simulation_images'
SIMULATION_TRACES_TABLE = 'simulation_traces'
STATISTICS_DATASETS_TABLE = 'statistics_datasets'
SYSTEM_IDENTIFICATION_JOBS_TABLE = 'system_identification_jobs'
TABULAR_POLICIES_TABLE = 'tabular_policies'
TRACES_DATASETS_TABLE = 'traces_datasets'
TRACES_PROPERTY = 'traces'
TRAINING_JOBS_TABLE = 'training_jobs'
USER = 'csle'
USER_PROPERTY = 'user'
VECTOR_POLICIES_TABLE = 'vector_policies'
class csle_common.constants.constants.MONGO[source]

Bases: object

Constants related to the MongoDB service

DEFAULT_PORT = 27017
SERVICE_NAME = 'mongo'
class csle_common.constants.constants.MYSQL[source]

Bases: object

Constants related to the MySQL service

DEFAULT_PORT = 3306
SERVICE_NAME = 'mysql'
class csle_common.constants.constants.NETWORKING[source]

Bases: object

Networking string constants

ETH0 = 'eth0'
ETH1 = 'eth1'
ETH10 = 'eth10'
ETH2 = 'eth2'
ETH3 = 'eth3'
ETH4 = 'eth4'
ETH5 = 'eth5'
ETH6 = 'eth6'
ETH7 = 'eth7'
ETH8 = 'eth8'
ETH9 = 'eth9'
class csle_common.constants.constants.NEURAL_NETWORKS[source]

Bases: object

Constants related to neural networks

ACTIVATION_FUNCTION = 'activation_function'
DEVICE = 'device'
NUM_HIDDEN_LAYERS = 'num_hidden_layers'
NUM_NEURONS_PER_HIDDEN_LAYER = 'num_neurons_per_hidden_layer'
class csle_common.constants.constants.NIKTO[source]

Bases: object

Constants related to Nikto commands

BASE_ARGS = '-port 80 -Format xml --maxtime 60s -timeout 5 '
HOST_ARG = '-h '
OUTPUT_ARG = '-output '
class csle_common.constants.constants.NIKTO_XML[source]

Bases: object

Constants related to Nikto XML parsing

DESCR = 'description'
ITEM = 'item'
ITEM_ID = 'id'
METHOD = 'method'
NIKTOSCAN = 'niktoscan'
OSVDB_ID = 'osvdbid'
SCANDETAILS = 'scandetails'
SITENAME = 'sitename'
TARGETIP = 'targetip'
TARGETPORT = 'targetport'
URI = 'uri'
class csle_common.constants.constants.NMAP[source]

Bases: object

Constants related to nmap commands

CASSANDRA_BRUTE_HOST = '-p 9160 --script cassandra-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,cassandra-brute.timeout=8s,brute.firstonly=true'
CASSANDRA_BRUTE_SUBNET = '-p 9160 --script cassandra-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,cassandra-brute.timeout=8s,brute.firstonly=true'
FILE_ARGS = '-oX'
FINGER = '--script=finger'
FIREWALK_HOST = '--script=firewalk --traceroute --script-args=firewalk.max-retries=1,firewalk.probe-timeout=800ms'
FTP_BRUTE_HOST = '-p 21 --script ftp-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,ftp-brute.timeout=8s,brute.firstonly=true'
FTP_BRUTE_SUBNET = '-p 21 --script ftp-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,ftp-brute.timeout=8s,brute.firstonly=true'
HTTP_ENUM = '--script=http-enum'
HTTP_GREP = '--script=http-grep'
IRC_BRUTE_HOST = '-p 6667 --script irc-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,irc-brute.timeout=8s,brute.firstonly=true'
IRC_BRUTE_SUBNET = '-p 6667 --script irc-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,irc-brute.timeout=8s,brute.firstonly=true'
MONGO_BRUTE_HOST = '-p 27017 --script mongo-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,mongo-brute.timeout=8s,brute.firstonly=true'
MONGO_BRUTE_SUBNET = '-p 27017 --script mongo-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,mongo-brute.timeout=8s,brute.firstonly=true'
MYSQL_BRUTE_HOST = '-p 27017 --script mysql-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,mysql-brute.timeout=8s,brute.firstonly=true'
MYSQL_BRUTE_SUBNET = '-p 27017 --script mysql-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,mysql-brute.timeout=8s,brute.firstonly=true'
POSTGRES_BRUTE_HOST = '-p 5432 --script pgsql-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,pgsql-brute.timeout=8s,brute.firstonly=true'
POSTGRES_BRUTE_SUBNET = '-p 5432 --script pgsql-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,pgsql-brute.timeout=8s,brute.firstonly=true'
RESULTS_DIR = '/home/agent/'
SAMBA_CVE_2017_7494_SCAN = '--script smb-vuln-cve-2017-7494 --script-args smb-vuln-cve-2017-7494.check-version -p445'
SHELL_ESCAPE = re.compile('(\\x9B|\\x1B\\[)[0-?]*[ -\\/]*[@-~]')
SMTP_BRUTE_HOST = '-p 25 --script smtp-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,smtp-brute.timeout=8s,brute.firstonly=true'
SMTP_BRUTE_SUBNET = '-p 25 --script smtp-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,smtp-brute.timeout=8s,brute.firstonly=true'
SPEED_ARGS = '--min-rate 100000 --max-retries 1 -T5 -n'
SSH_BRUTE_HOST = '-p 22 --script ssh-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,ssh-brute.timeout=8s,brute.firstonly=true'
SSH_BRUTE_SUBNET = '-p 22 --script ssh-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,ssh-brute.timeout=8s,brute.firstonly=true'
TELNET_BRUTE_HOST = '-p 23 --script telnet-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,telnet-brute.timeout=8s,brute.firstonly=true'
TELNET_BRUTE_SUBNET = '-p 23 --script telnet-brute --script-args userdb=/SecLists/Usernames/top-usernames-shortlist.txt,passdb=/SecLists/Usernames/top-usernames-shortlist.txt,telnet-brute.timeout=8s,brute.firstonly=true'
class csle_common.constants.constants.NMAP_XML[source]

Bases: object

Constants related to nmap XML output

ACCOUNTS = 'Accounts'
ACCURACY = 'accuracy'
ADDR = 'addr'
ADDRESS = 'address'
ADDR_TYPE = 'addrtype'
ARP_RESPONSE = 'arp-response'
BRUTE_SCRIPTS = ['telnet-brute', 'ssh-brute', 'ftp-brute', 'cassandra-brute', 'irc-brute', 'mongo-brute', 'mysql-brute', 'smtp-brute', 'postgres-brute']
CASSANDRA_BRUTE_SCRIPT_ID = 'cassandra-brute'
CVSS = 'cvss'
ELEM = 'elem'
FTP_BRUTE_SCRIPT_ID = 'ftp-brute'
HOP = 'hop'
HOST = 'host'
HOSTNAME = 'hostname'
HOSTNAMES = 'hostnames'
HTTP_ENUM_SCRIPT = 'http-enum'
HTTP_GREP_SCRIPT = 'http-grep'
ID = 'id'
IP = 'ip'
IPADDR = 'ipaddr'
IRC_BRUTE_SCRIPT_ID = 'irc-brute'
KEY = 'key'
MAC = 'mac'
MONGO_BRUTE_SCRIPT_ID = 'mongo-brute'
MYSQL_BRUTE_SCRIPT_ID = 'mysql-brute'
NAME = 'name'
OPEN_STATE = 'open'
OS = 'os'
OS_CLASS = 'osclass'
OS_FAMILY = 'osfamily'
OS_MATCH = 'osmatch'
OUTPUT = 'output'
PASSWORD = 'password'
PORT = 'port'
PORTS = 'ports'
PORT_ID = 'portid'
POSTGRES_BRUTE_SCRIPT_ID = 'postgres-brute'
REASON = 'reason'
RTT = 'rtt'
SCRIPT = 'script'
SERVICE = 'service'
SERVICEFP = 'servicefp'
SMTP_BRUTE_SCRIPT_ID = 'smtp-brute'
SSH_BRUTE_SCRIPT_ID = 'ssh-brute'
STATE = 'state'
STATUS = 'status'
STATUS_UP = 'up'
TABLE = 'table'
TELNET_BRUTE_SCRIPT_ID = 'telnet-brute'
TRACE = 'trace'
TTL = 'ttl'
UNKNOWN = 'unknown'
USERNAME = 'username'
VENDOR = 'vendor'
VERSION = 'version'
VULNERS_SCRIPT_ID = 'vulners'
VULSCAN_SCRIPT = 'vulscan'
class csle_common.constants.constants.NTP[source]

Bases: object

Constants related to the NTP service

DEFAULT_PORT = 123
SERVICE_NAME = 'ntp'
class csle_common.constants.constants.OPENFLOW[source]

Bases: object

Constants related to OPENFLOW

OPENFLOW_V_1_0 = 'OpenFlow10'
OPENFLOW_V_1_1 = 'OpenFlow11'
OPENFLOW_V_1_2 = 'OpenFlow12'
OPENFLOW_V_1_3 = 'OpenFlow13'
OPENFLOW_V_1_4 = 'OpenFlow14'
OPENFLOW_V_1_5 = 'OpenFlow15'
class csle_common.constants.constants.OS[source]

Bases: object

Operating systems constants

KALI = 'kali'
UBUNTU = 'ubuntu'
os_lookup = {'centos': 5, 'debian': 7, 'fedora': 6, 'kali': 3, 'linux': 9, 'redhat': 8, 'suse': 4, 'ubuntu': 2, 'unknown': 0, 'windows': 1}
os_lookup_inv = {0: 'unknown', 1: 'windows', 2: 'ubuntu', 3: 'kali', 4: 'suse', 5: 'centos', 6: 'fedora', 7: 'debian', 8: 'redhat', 9: 'linux'}
class csle_common.constants.constants.OVS[source]

Bases: object

String constants related to OVS

ADD_BR = 'add-br'
ADD_PORT = 'add-port'
DEFAULT_BRIDGE_NAME = 'ovs-br0'
DEL_BR = 'del-br'
IPADDRESS = '--ipaddress'
OPTIONS_PEER = 'options:peer'
OVS_DOCKER = 'ovs-docker'
OVS_VSCTL = 'ovs-vsctl'
SET_INTERFACE = 'set interface'
SET_VLAN = 'set-vlan'
TYPE_PATCH = 'type=patch'
class csle_common.constants.constants.PENGINE_EXPLOIT[source]

Bases: object

Constants related to Pengine Exploit

BACKDOOR_PW = 'ssh_backdoor_pengine_exploitpwnpw'
BACKDOOR_USER = 'ssh_backdoor_pengine_exploitpwn'
PORT = 4000
SERVICE_NAME = 'http'
VULNERABILITY_NAME = 'pengine-exploit'
class csle_common.constants.constants.POSTGRES[source]

Bases: object

Constants related to the Postgres service

DEFAULT_PORT = 5432
SERVICE_NAME = 'postgres'
class csle_common.constants.constants.RENDERING[source]

Bases: object

Rendering constants

BLACK = (0, 0, 0)
BLACK_ALPHA = (0, 0, 0, 255)
BLUE = (0, 0, 255)
BLUE_PURPLE = (102, 102, 153)
CAPTION = 'csle'
DEFAULT_HEIGHT = 900
DEFAULT_WIDTH = 950
FIREWALL_SPRITE_NAME = 'firewall.png'
FLAG_SPRITE_NAME = 'flag_1.png'
GREEN = (0, 128, 0)
GREEN_ALPHA = (0, 128, 0, 255)
GREY = (220, 220, 220)
HACKER_SPRITE_NAME = 'hacker.png'
LIME = (0, 255, 0)
LINE_WIDTH = 1
RECT_SIZE = 200
RED = (205, 55, 35)
RED_ALPHA = (128, 0, 0, 255)
RESOURCES_DIR = 'resources'
TITLE = 'csle'
WHITE = (255, 255, 255)
WHITE_ALPHA = (255, 255, 255, 255)
class csle_common.constants.constants.RETHINKDB[source]

Bases: object

Constants related to the RethinkDb service

DEFAULT_PORT = 28015
SERVICE_NAME = 'rethinkdb'
class csle_common.constants.constants.SAMBA[source]

Bases: object

Constants related to the Samba service

ALREADY_EXISTS = 'already exists'
AUTH_OK = 'Authentication ok'
BACKDOOR_PW = 'sambapwnedpw'
BACKDOOR_USER = 'ssh_backdoor_sambapwned'
ERROR = 'Error'
PORT = 445
PW = 'nosambanocry'
SERVICE_NAME = 'samba'
USER = 'sambacry'
VERIFYING = 'Verifying'
VULNERABILITY_NAME = 'cve-2017-7494'
class csle_common.constants.constants.SECLISTS[source]

Bases: object

Constants related to seclists

TOP_USERNAMES_SHORTLIST = '/SecLists/Usernames/top-usernames-shortlist.txt'
class csle_common.constants.constants.SERVICES[source]

Bases: object

Services constants

service_lookup = {'3m-image-lm': 53, 'XmlIpcRegSvc': 33, 'aairnet-2': 100, 'abb-escp': 44, 'ajp13': 34, 'ansoft-lm-1': 91, 'apani1': 31, 'apc-9951': 84, 'bis-web': 81, 'bitcoin': 28, 'bittorrent': 27, 'can-dch': 74, 'can-ferret-ssl': 59, 'cassandra': 13, 'clariion-evr01': 40, 'client-ctrl': 99, 'cockroachdb': 103, 'corelccam': 54, 'dbdb': 39, 'ddt': 51, 'dhcp': 20, 'directnet': 45, 'directplay8': 80, 'dns': 23, 'docker': 25, 'domain': 23, 'dsmipv6': 73, 'e-builder': 90, 'efi-lm': 60, 'eforward': 32, 'elasticsearch': 110, 'escvpnet': 65, 'esimport': 42, 'evtp-data': 58, 'faxportwinport': 85, 'fcp-srvr-inst2': 96, 'finger': 1, 'fjicl-tep-b': 50, 'fln - spx': 46, 'fmpro-v6': 37, 'ftp': 29, 'glassfish': 104, 'gopher': 16, 'hacl-monitor': 75, 'hdfs': 21, 'http': 15, 'http-proxy': 15, 'imap': 19, 'informer': 52, 'irc': 6, 'itm-lm': 97, 'jdmn-port': 57, 'kafka': 9, 'kerberos': 17, 'ktelnet': 92, 'landmarks': 61, 'lmp': 71, 'lotusnotes': 72, 'mac-srvr-admin': 86, 'mccwebsvr-port': 69, 'mentaserver': 66, 'microsoft-ds': 107, 'mongo': 2, 'mongod': 2, 'mtrgtrans': 89, 'mysql': 24, 'ncconfig': 98, 'ncdmirroring': 43, 'netbios': 18, 'netbios-ssn': 106, 'netconf': 22, 'netiq-voipa': 36, 'neto-wol-server': 78, 'netspeak-is': 47, 'newheights': 70, 'nfsrdma': 102, 'nokia-ann-ch2': 67, 'none': 0, 'ntp': 7, 'opsmgr': 95, 'pdb': 79, 'pengine': 12, 'piccolo': 38, 'plysrv-http': 56, 'postgres': 8, 'postgresql': 8, 'powerguardian': 63, 'pxc-ntfy': 93, 'rapidmq-reg': 77, 'ridgeway2': 49, 'rsmtp': 83, 'samba': 105, 'saris': 62, 'sec-pc2fax-srv': 48, 'senomix06': 82, 'servistaitsm': 101, 'sip': 68, 'smtp': 10, 'snmp': 5, 'spiral-admin': 76, 'ssh': 11, 'sstp-1': 64, 'sybasesrvmon': 94, 'teamspeak': 4, 'telnet': 14, 'tomcat': 3, 'ts3': 4, 'unknown': 30, 'ventrilo': 26, 'vrace': 108, 'vrml-multi-use': 71, 'vrts-at-port': 87, 'vrtstrapserver': 88, 'wap-wsp': 109, 'wiegand': 35, 'worldfusion2': 41, 'xmlipcregsvc': 33}
service_lookup_inv = {0: 'none', 1: 'finger', 2: 'mongod', 3: 'tomcat', 4: 'ts3', 5: 'snmp', 6: 'irc', 7: 'ntp', 8: 'postgresql', 9: 'kafka', 10: 'smtp', 11: 'ssh', 12: 'pengine', 13: 'cassandra', 14: 'telnet', 15: 'http-proxy', 16: 'gopher', 17: 'kerberos', 18: 'netbios', 19: 'imap', 20: 'dhcp', 21: 'hdfs', 22: 'netconf', 23: 'domain', 24: 'mysql', 25: 'docker', 26: 'ventrilo', 27: 'bittorrent', 28: 'bitcoin', 29: 'ftp', 30: 'unknown', 31: 'apani1', 32: 'eforward', 33: 'xmlipcregsvc', 34: 'ajp13', 35: 'wiegand', 36: 'netiq-voipa', 37: 'fmpro-v6', 38: 'piccolo', 39: 'dbdb', 40: 'clariion-evr01', 41: 'worldfusion2', 42: 'esimport', 43: 'ncdmirroring', 44: 'abb-escp', 45: 'directnet', 46: 'fln - spx', 47: 'netspeak-is', 48: 'sec-pc2fax-srv', 49: 'ridgeway2', 50: 'fjicl-tep-b', 51: 'ddt', 52: 'informer', 53: '3m-image-lm', 54: 'corelccam', 56: 'plysrv-http', 57: 'jdmn-port', 58: 'evtp-data', 59: 'can-ferret-ssl', 60: 'efi-lm', 61: 'landmarks', 62: 'saris', 63: 'powerguardian', 64: 'sstp-1', 65: 'escvpnet', 66: 'mentaserver', 67: 'nokia-ann-ch2', 68: 'sip', 69: 'mccwebsvr-port', 70: 'newheights', 71: 'vrml-multi-use', 72: 'lotusnotes', 73: 'dsmipv6', 74: 'can-dch', 75: 'hacl-monitor', 76: 'spiral-admin', 77: 'rapidmq-reg', 78: 'neto-wol-server', 79: 'pdb', 80: 'directplay8', 81: 'bis-web', 82: 'senomix06', 83: 'rsmtp', 84: 'apc-9951', 85: 'faxportwinport', 86: 'mac-srvr-admin', 87: 'vrts-at-port', 88: 'vrtstrapserver', 89: 'mtrgtrans', 90: 'e-builder', 91: 'ansoft-lm-1', 92: 'ktelnet', 93: 'pxc-ntfy', 94: 'sybasesrvmon', 95: 'opsmgr', 96: 'fcp-srvr-inst2', 97: 'itm-lm', 98: 'ncconfig', 99: 'client-ctrl', 100: 'aairnet-2', 101: 'servistaitsm', 102: 'nfsrdma', 103: 'cockroachdb', 104: 'glassfish', 105: 'samba', 106: 'netbios-ssn', 107: 'microsoft-ds', 108: 'vrace', 109: 'wap-wsp', 110: 'elasticsearch'}
class csle_common.constants.constants.SHELL[source]

Bases: object

Constants related to shell commands

CHECK_FOR_SECLISTS = 'test -e /SecLists && echo file exists || echo file not found'
LIST_ALL_USERS = 'cut -d: -f1 /etc/passwd'
SAMBA_EXPLOIT = '/samba_exploit.py -e /libbindshell-samba.so -s data -r /data/libbindshell-samba.so -u sambacry -p nosambanocry -P 6699 -t '
class csle_common.constants.constants.SHELLSHOCK[source]

Bases: object

Constants related to ShellShock

BACKDOOR_PW = 'shellshockedpw'
BACKDOOR_USER = 'ssh_backdoor_shellshocked'
PORT = 80
SERVICE_NAME = 'http'
VULNERABILITY_NAME = 'cve-2014-6271'
class csle_common.constants.constants.SIMULATION[source]

Bases: object

Constants related to simulations

SIMULATION_ENV_CFG_PATH = '/config.json'
class csle_common.constants.constants.SMTP[source]

Bases: object

Constants related to the SMTP service

DEFAULT_PORT = 25
SERVICE_NAME = 'smtp'
class csle_common.constants.constants.SNMP[source]

Bases: object

Constants related to the SNMP service

DEFAULT_PORT = 161
SERVICE_NAME = 'snmp'
class csle_common.constants.constants.SPARK[source]

Bases: object

Constants related to the spark service

DEFAULT_PORT = 7077
SERVICE_NAME = 'spark'
SPARK_PROTOCOL_PREFIX = 'spark://'
class csle_common.constants.constants.SSH[source]

Bases: object

Constants related to the SSH service

DEFAULT_PORT = 22
DIRECT_CHANNEL = 'direct-tcpip'
MAX_FILE_READ_BYTES = 50000
SERVICE_NAME = 'ssh'
class csle_common.constants.constants.SSH_BACKDOOR[source]

Bases: object

Constants related to creation of SSH backdoors

BACKDOOR_PREFIX = 'ssh_backdoor'
DEFAULT_PW = 'csle'
class csle_common.constants.constants.STATIC_ATTACKERS[source]

Bases: object

Constants related to static attackers

EXPERIENCED = 'experienced'
EXPERT = 'expert'
NOVICE = 'novice'
class csle_common.constants.constants.SUB_PROC_ENV[source]

Bases: object

Constants related to creation of Sub-proc-env environments

SLEEP_TIME_STARTUP = 5
class csle_common.constants.constants.SYSTEM_IDENTIFICATION[source]

Bases: object

Constants related to the system identification process

DEFENDER_DYNAMICS_MODEL_FILE = 'defender_dynamics_model.json'
EMULATION_TRACES_FILE = 'emulation_traces.json'
INTRUSION_CONDITIONAL = 'intrusion'
NETWORK_CONF_FILE = 'network_conf.pickle'
NO_INTRUSION_CONDITIONAL = 'no_intrusion'
SIMULATION_TRACES_FILE = 'simulation_taus.json'
SYSTEM_ID_LOGS_FILE = 'system_id_log.csv'
class csle_common.constants.constants.TEAMSPEAK3[source]

Bases: object

Constants related to the Teamspeak3 service

DEFAULT_PORT = 30033
SERVICE_NAME = 'teamspeak3'
class csle_common.constants.constants.TELNET[source]

Bases: object

Constants related to the Telnet service

DEFAULT_PORT = 23
INCORRECT_LOGIN = 'Login incorrect'
LOCALHOST = '127.0.0.1'
LOGIN_PROMPT = b'login: '
PASSWORD_PROMPT = b'Password: '
PROMPT = b':~$'
SERVICE_NAME = 'telnet'
class csle_common.constants.constants.TOMCAT[source]

Bases: object

Constants related to the TOMCAT service

DEFAULT_PORT = 8080
SERVICE_NAME = 'tomcat'
class csle_common.constants.constants.TRAFFIC_COMMANDS[source]

Bases: object

Constants related to traffic commands

BASH_PREAMBLE = '#!/bin/bash'
CLIENT_1_SUBNET = 'client_1_subnet'
CLIENT_MANAGER_FILE_NAME = 'client_manager.py'
DEFAULT_COMMANDS = {'client_1_subnet': [], 'csle_cve_2010_0426_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:8080 > /dev/null 2>&1'], 'csle_cve_2014_0160_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:443 > /dev/null 2>&1'], 'csle_cve_2015_1427_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'snmpwalk -v2c {} -c csle_1234'], 'csle_cve_2015_3306_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'snmpwalk -v2c {} -c csle_1234', 'timeout 5 curl {} > /dev/null 2>&1'], 'csle_cve_2015_5602_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1"], 'csle_cve_2016_10033_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {} > /dev/null 2>&1'], 'csle_ftp_1': ['timeout 5 ftp {} > /dev/null 2>&1', "timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:8080 > /dev/null 2>&1'], 'csle_ftp_2': ['timeout 5 ftp {} > /dev/null 2>&1', "timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", '(sleep 2; echo test; sleep 2; echo test; sleep 3;) | telnet {} > /dev/null 2>&1'], 'csle_honeypot_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 snmpwalk -v2c {} -c csle_1234 > /dev/null 2>&1', 'timeout 10 /irc_login_test.sh {} > /dev/null 2>&1', 'timeout 5 psql -h {} -p 5432 > /dev/null 2>&1'], 'csle_honeypot_2': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 snmpwalk -v2c {} -c csle_1234 > /dev/null 2>&1', 'timeout 10 /irc_login_test.sh {} > /dev/null 2>&1', 'timeout 5 psql -h {} -p 5432 > /dev/null 2>&1'], 'csle_ovs_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1"], 'csle_pengine_exploit_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:4000 > /dev/null 2>&1', 'timeout 5 curl --header "Content-Type: application/json" --request POST                  --data $\'{{"application": "pengine_sandbox", "ask": "problem(1, Rows), sudoku(Rows)", "chunk": 1, "destroy": true, "format":"json", "src_text": "problem(1, [[_,_,_,_,_,_,_,_,_],[_,_,_,_,_,3,_,8,5],[_,_,1,_,2,_,_,_,_],[_,_,_,5,_,7,_,_,_],[_,_,4,_,_,_,1,_,_],[_,9,_,_,_,_,_,_,_],[5,_,_,_,_,_,_,7,3],[_,_,2,_,1,_,_,_,_],[_,_,_,_,4,_,_,_,9]]).\n"}}\' {}'], 'csle_router_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1"], 'csle_router_2': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1"], 'csle_samba_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", '(sleep 2; echo testcsleuser; sleep 3;) | smbclient -L {} > /dev/null 2>&1'], 'csle_samba_2': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", '(sleep 2; echo testcsleuser; sleep 3;) | smbclient -L {} > /dev/null 2>&1'], 'csle_shellshock_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {} > /dev/null 2>&1', 'timeout 5 snmpwalk -v2c {} -c csle_1234 > /dev/null 2>&1'], 'csle_spark_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:8080 > /dev/null 2>&1', 'timeout 5 curl {}:8081 > /dev/null 2>&1', '/root/miniconda3/bin/python3 /spark_job.py --sparkmaster {} > /dev/null 2>&1'], 'csle_sql_injection_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}/login.php > /dev/null 2>&1', 'timeout 10 /irc_login_test.sh {} > /dev/null 2>&1'], 'csle_ssh_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:80 > /dev/null 2>&1'], 'csle_ssh_2': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 nslookup limmen.dev {} > /dev/null 2>&1'], 'csle_ssh_3': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 10 /irc_login_test.sh {} > /dev/null 2>&1'], 'csle_telnet_1': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {} > /dev/null 2>&1', '(sleep 2; echo test; sleep 2; echo test; sleep 3;) | telnet {} > /dev/null 2>&1'], 'csle_telnet_2': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:8080 > /dev/null 2>&1', '(sleep 2; echo test; sleep 2; echo test; sleep 3;) | telnet {} > /dev/null 2>&1'], 'csle_telnet_3': ["timeout 5 sshpass -p 'testcsleuser' ssh -oStrictHostKeyChecking=no {} > /dev/null 2>&1", 'timeout 5 curl {}:8080 > /dev/null 2>&1', '(sleep 2; echo test; sleep 2; echo test; sleep 3;) | telnet {} > /dev/null 2>&1'], 'generic_commands': ['timeout 5 ping {} > /dev/null 2>&1', 'timeout 5 traceroute {} > /dev/null 2>&1']}
ELK_MANAGER_FILE_NAME = 'elk_manager.py'
GENERIC_COMMANDS = 'generic_commands'
HOST_MANAGER_FILE_NAME = 'host_manager.py'
KAFKA_MANAGER_FILE_NAME = 'kafka_manager.py'
OSSEC_IDS_MANAGER_FILE_NAME = 'ossec_ids_manager.py'
RYU_MANAGER_FILE_NAME = 'ryu_manager.py'
SDN_CONTROLLER_FILE_NAME = 'ryu_controller.py'
SNORT_IDS_MANAGER_FILE_NAME = 'snort_ids_manager.py'
TRAFFIC_GENERATOR_FILE_NAME = 'traffic_generator.sh'
TRAFFIC_MANAGER_FILE_NAME = 'traffic_manager.py'
class csle_common.constants.constants.T_SPSA[source]

Bases: object

String constants related to T-SPSA

A = 'A'
EPSILON = 'epsilon'
GRADIENT_BATCH_SIZE = 'gradient_batch_size'
IMPROVE_BREAK = 'improve_break'
L = 'L'
LAMBDA = 'lambda'
N = 'N'
OBJECTIVE_TYPE = 'objective_type'
POLICY_TYPE = 'policy_type'
STOP_DISTRIBUTION_ATTACKER = 'stop_distribution_attacker'
STOP_DISTRIBUTION_DEFENDER = 'stop_distribution_defender'
THETA1 = 'theta1'
THETAS = 'thetas'
THRESHOLDS = 'thresholds'
a = 'a'
c = 'c'
class csle_common.constants.constants.VULNERABILITIES[source]

Bases: object

Vulnerabilities constants

default_cvss = 2.0
vuln_lookup = {'CVE-2014-9278': 20, 'CVE-2019-6470': 13, 'CVE-2020-14422': 25, 'CVE-2020-15523': 24, 'CVE-2020-8616': 12, 'CVE-2020-8617': 11, 'CVE-2020-8618': 19, 'CVE-2020-8619': 18, 'CVE-2020-8620': 10, 'CVE-2020-8621': 15, 'CVE-2020-8622': 17, 'CVE-2020-8623': 14, 'CVE-2020-8624': 16, 'PACKETSTORM:157836': 26, 'drown': 5, 'eternal_blue': 6, 'ftp-weak-password': 23, 'ghostcat': 2, 'heartbleed': 1, 'none': 0, 'poodle': 8, 'shellshock': 7, 'sql_injection': 3, 'ssh-weak-password': 21, 'telnet-weak-password': 22, 'timthumb': 9, 'unknown': 27, 'weak_password': 4}
vuln_lookup_inv = {0: 'none', 1: 'heartbleed', 2: 'ghostcat', 3: 'sql_injection', 4: 'weak_password', 5: 'drown', 6: 'eternal_blue', 7: 'shellshock', 8: 'poodle', 9: 'timthumb', 10: 'CVE-2020-8620', 11: 'CVE-2020-8617', 12: 'CVE-2020-8616', 13: 'CVE-2019-6470', 14: 'CVE-2020-8623', 15: 'CVE-2020-8621', 16: 'CVE-2020-8624', 17: 'CVE-2020-8622', 18: 'CVE-2020-8619', 19: 'CVE-2020-8618', 20: 'CVE-2014-9278', 21: 'ssh-weak-password', 22: 'telnet-weak-password', 23: 'ftp-weak-password', 24: 'CVE-2020-15523', 25: 'CVE-2020-14422', 26: 'PACKETSTORM:157836', 27: 'unknown'}
class csle_common.constants.constants.VULNERABILITY_GENERATOR[source]

Bases: object

Constants related to the vulnerability generator

NAMES_SHORTLIST = ['admin', 'test', 'guest', 'info', 'adm', 'mysql', 'user', 'administrator', 'oracle', 'ftp', 'pi', 'puppet', 'ansible', 'ec2-user', 'vagrant', 'azureuser', 'donald', 'alan']

Module contents