-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from fkie-cad/dev
Merge dev into main
- Loading branch information
Showing
43 changed files
with
614 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ | |
- generate_malware | ||
- ssh_config | ||
- dosfstools | ||
- grc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
grc_version: "1.13.1-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
- name: Install grc | ||
apt: | ||
name: grc={{ grc_version }} | ||
state: present | ||
update_cache: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from attacks import Attack, AttackInfo | ||
from attacks.nmap_attack_options import NmapAttackOptions as AttackOptions | ||
from attacks.nmap_attack_options import get_speed | ||
|
||
|
||
class NmapHostDiscoveryAttackOptions(AttackOptions): | ||
target: str = "Target range or IP" | ||
|
||
def _set_defaults(self) -> None: | ||
self.target = "192.168.56.1/23" | ||
|
||
|
||
class NmapHostDiscoveryAttack(Attack): | ||
info: AttackInfo = AttackInfo( | ||
name="misc_nmap_host_discovery", | ||
description="Scan the network for available hosts", | ||
) | ||
options_class = NmapHostDiscoveryAttackOptions | ||
|
||
def run(self) -> None: | ||
command: str = f"nmap -T{get_speed(self.options)} -n -sn {self.options.target}" | ||
self.exec_command_on_target(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from attacks import Attack, AttackInfo | ||
from attacks.nmap_attack_options import NmapAttackOptions as AttackOptions | ||
from attacks.nmap_attack_options import get_speed | ||
|
||
|
||
class NmapPortscanAttackOptions(AttackOptions): | ||
target: str = "Target IP or range" | ||
scan_type: str = "Scan Type" | ||
ports: str = "Ports to scan, set to 'ics' to scan a list of ICS-specific ports" | ||
|
||
def _set_defaults(self) -> None: | ||
self.target = "192.168.56.101" | ||
self.scan_type = "-sT -sU" | ||
self.ports = "top10" | ||
|
||
|
||
class NmapPortscanAttack(Attack): | ||
info = AttackInfo( | ||
name="misc_nmap_portscan", | ||
description="Scan for open ports", | ||
) | ||
options_class = NmapPortscanAttackOptions | ||
ics_ports: str = ( | ||
"U:47808,20000,34980,2222,44818,55000-55003,1089-1091,34962-34964,4000,161," | ||
+ "T:20000,44818,1089-1091,102,502,4840,80,443,34962-34964,4000,2404" | ||
) | ||
|
||
def run(self) -> None: | ||
port = self._set_port() | ||
|
||
command: str = ( | ||
f"sudo nmap -T{get_speed(self.options)} -n {self.options.scan_type} " | ||
f"{self.options.target}{port}" | ||
) | ||
self.exec_command_on_target(command) | ||
|
||
def _set_port(self) -> str: | ||
if self.options.ports == "ics": | ||
return f" -p {self.ics_ports}" | ||
|
||
if self.options.ports.startswith("top"): | ||
return f" --top-ports {self.options.ports.strip('top')}" | ||
|
||
return f" -p {self.options.ports}" |
Oops, something went wrong.