Skip to content

Commit

Permalink
react_sync_rta_updates_4215 Network Connection by Foomatic-rip Child (#…
Browse files Browse the repository at this point in the history
…4196)

(cherry picked from commit 77f0ee8)
  • Loading branch information
protectionsmachine authored and github-actions[bot] committed Oct 23, 2024
1 parent 9ac381f commit 020140a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions rta/linux_command_and_control_cupsd_foomatic_rip_netcon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.

import sys
from . import RtaMetadata, common

metadata = RtaMetadata(
uuid="8c634401-fd71-475e-b449-41b776b2b8c9",
platforms=["linux"],
endpoint=[
{
"rule_name": "Network Connection by Foomatic-rip Child",
"rule_id": "93d7b72d-3914-44fb-92bf-63675769ef12",
},
],
techniques=["T1203"],
)


@common.requires_os(*metadata.platforms)
def main() -> None:
# Path for the fake executable
masquerade = "/tmp/foomatic-rip"
source = common.get_path("bin", "netcon_exec_chain.elf")

common.log("Creating a fake executable..")
common.copy_file(source, masquerade)
common.log("Granting execute permissions...")
common.execute(['chmod', '+x', masquerade])

# Execute the fake executable
common.log("Executing the fake executable..")
commands = [
masquerade,
'chain',
'-h',
'8.8.8.8',
'-p',
'53',
'-c',
'/tmp/foomatic-rip netcon -h 8.8.8.8 -p 53'
]
common.execute([*commands], timeout=5, kill=True)

# Cleanup
common.remove_file(masquerade)


if __name__ == "__main__":
sys.exit(main())

0 comments on commit 020140a

Please sign in to comment.