Skip to content

Commit 1278c27

Browse files
Sync RTA Attempt to Fix Sensor Regex Error (#4213)
1 parent 5d2940f commit 1278c27

26 files changed

+59
-43
lines changed

rta/linux_command_and_control_cupsd_foomatic_rip_netcon.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -21,27 +22,18 @@
2122

2223
@common.requires_os(*metadata.platforms)
2324
def main() -> None:
24-
# Path for the fake executable
25+
# Path for the fake motd executable
2526
masquerade = "/tmp/foomatic-rip"
2627
source = common.get_path("bin", "netcon_exec_chain.elf")
2728

28-
common.log("Creating a fake executable..")
29+
common.log("Creating a fake motd executable..")
2930
common.copy_file(source, masquerade)
3031
common.log("Granting execute permissions...")
31-
common.execute(['chmod', '+x', masquerade])
32-
33-
# Execute the fake executable
34-
common.log("Executing the fake executable..")
35-
commands = [
36-
masquerade,
37-
'chain',
38-
'-h',
39-
'8.8.8.8',
40-
'-p',
41-
'53',
42-
'-c',
43-
'/tmp/foomatic-rip netcon -h 8.8.8.8 -p 53'
44-
]
32+
common.execute(["chmod", "+x", masquerade])
33+
34+
# Execute the fake motd executable
35+
common.log("Executing the fake motd executable..")
36+
commands = [masquerade, "chain", "-h", "8.8.8.8", "-p", "53", "-c", "/tmp/foomatic-rip netcon -h 8.8.8.8 -p 53"]
4537
common.execute([*commands], timeout=5, kill=True)
4638

4739
# Cleanup

rta/linux_command_and_control_curl_wget_hidden_directory_output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(

rta/linux_defense_evasion_lolbin_so_load.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -29,7 +30,7 @@ def main() -> None:
2930
common.log("Granting execute permissions...")
3031
common.execute(["chmod", "+x", masquerade])
3132

32-
commands = [masquerade, 'cdll.LoadLibrary.so']
33+
commands = [masquerade, "cdll.LoadLibrary.so"]
3334
common.execute([*commands], timeout=5, kill=True)
3435
common.log("Cleaning...")
3536
common.remove_file(masquerade)

rta/linux_defense_evasion_process_masquerading_via_exec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(

rta/linux_defense_evasion_proxy_execution_via_crash.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, '-h', masquerade, '-c', 'whoami']
39+
commands = [masquerade, "-h", masquerade, "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

rta/linux_defense_evasion_proxy_execution_via_ld_so.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, masquerade, '-c', 'whoami']
39+
commands = [masquerade, masquerade, "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

rta/linux_defense_evasion_proxy_execution_via_php.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, '-r', masquerade2, '-c', 'whoami']
39+
commands = [masquerade, "-r", masquerade2, "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

rta/linux_defense_evasion_proxy_execution_via_pidstat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, '-e', masquerade, '-c', 'whoami']
39+
commands = [masquerade, "-e", masquerade, "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

rta/linux_defense_evasion_proxy_execution_via_sed.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, '-n', masquerade, '-c', 'whoami']
39+
commands = [masquerade, "-n", masquerade, "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

rta/linux_defense_evasion_proxy_execution_via_split.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 2.0.
55

66
import sys
7+
78
from . import RtaMetadata, common
89

910
metadata = RtaMetadata(
@@ -35,7 +36,7 @@ def main() -> None:
3536
common.log("Granting execute permissions...")
3637
common.execute(["chmod", "+x", masquerade2])
3738

38-
commands = [masquerade, masquerade, '--filter=foo', '-c', 'whoami']
39+
commands = [masquerade, masquerade, "--filter=foo", "-c", "whoami"]
3940
common.execute([*commands], timeout=5, kill=True)
4041
common.log("Cleaning...")
4142
common.remove_file(masquerade)

0 commit comments

Comments
 (0)