Skip to content

Instantly share code, notes, and snippets.

View maximelb's full-sized avatar

Maxime Lamothe-Brassard maximelb

View GitHub Profile
@maximelb
maximelb / playbook.py
Last active September 29, 2025 13:59
Claude code usage in LC Playbook
import limacharlie
import json
import tempfile
import os
import shutil
import shlex
import subprocess
########################################################
# Setting This Up
@maximelb
maximelb / collect.py
Created February 21, 2022 22:42
Active Artifact Collection
import limacharlie
# The is_interactive allows us to do sensor.simpleRequest() calls
# and get the response inline in this script.
lc = limacharlie.Manager( is_interactive = True, inv_id = "init-artifact-col" )
for sensor in lc.sensors():
# If a sensor is offline, we'll just skip it.
if not sensor.isOnline():
print( "skipping %s since it's not online" % ( sensor.sid, ) )
import limacharlie
OID = ""
KEY = ""
lc = limacharlie.Manager( oid = OID, secret_api_key = KEY, is_interactive = True, inv_id = "simple_commands" )
for sensor in lc.sensors():
if not sensor.isOnline():
@maximelb
maximelb / detect.yaml
Created July 30, 2020 23:27
Excel spawning a process that does an outbound connection.
op: ends with
event: NEW_PROCESS
path: event/FILE_PATH
value: excel.exe
case sensitive: false
with descendant:
op: is
event: NETWORK_CONNECTIONS
path: event/NETWORK_ACTIVITY/IS_OUTGOING
value: 1
@maximelb
maximelb / detect.yaml
Created July 30, 2020 23:02
Detect a process with a descendant opening a specific dest port.
op: ends with
event: NEW_PROCESS
path: event/FILE_PATH
value: excel.exe
case sensitive: false
with descendant:
op: is
event: NETWORK_CONNECTIONS
path: event/NETWORK_ACTIVITY/DESTINATION/PORT
value: 22
@maximelb
maximelb / tag.py
Last active July 2, 2020 16:08
LimaCharlie tag sensors based on os_version.
import limacharlie
OID = ""
KEY = ""
DEVICE_TAG_PREFIX = "dev_"
TAG_FOR_SECONDS = 60 * 60 * 24 * 365 * 10 # Just tag for 10y for now.
lc = limacharlie.Manager( oid = OID, secret_api_key = KEY, is_interactive = True, inv_id = "dev_tagging" )