Skip to content

Instantly share code, notes, and snippets.

View darkarnium's full-sized avatar
💭
🔥

Peter darkarnium

💭
🔥
View GitHub Profile
rule MyExample {
strings:
$a = /EXAMPLE[A-Z]{10}/ ascii wide nocase
$b = /EXAMPLE[A-Z]{5}KNOWN/ ascii wide nocase
condition:
for any i in (1..#a) : ( @a[i] != @b[i] )
// for any i in (1..#a) : ( @a[i] == @a[i] )
// any of them
}
@darkarnium
darkarnium / arm-literal-pool-hammer.py
Created December 15, 2019 14:33
IDA - Attempt to locate literal pools, and mark subsequent sections as code
#
# NOTE: Before running, please ensure to set the minimal string length to 2
# characters. This can be done by right-clicking any white space in the
# IDA Strings window, selecting 'Setup', entering '2' into the 'Minimal
# string length' field, and clicking 'OK'.
#
import time
import idautils
@darkarnium
darkarnium / arm-ldr-string-patchup.py
Last active December 20, 2019 11:40
IDA - Attempt to patch-up any missing data references to ARM LDR pseudo-instructions where a known string is referenced.
import idautils
# Define the addresses to 'scan' for literal pools.
rom_scan_start = 0x8000000
rom_scan_end = 0x807FFFF
ldr_addrs = dict()
def get_ldr_psudo_instructions(s_addr, e_addr):
@darkarnium
darkarnium / ida-next-unknown.py
Last active September 21, 2021 18:59
IDA - Bind a hotkey to find the next address marked as Unknown (F3)
import idaapi
def find_next_unknown():
'''
Attempts to find the next unknown section from the cursor. This will only
look a maximum of 0xFFFF bytes into the future to prevent infinite loops.
'''
s_addr = ScreenEA()
@darkarnium
darkarnium / ida-procedures-from-kallsyms.py
Last active November 14, 2022 15:33
IDA - Uses kallsyms to mark procedures and names.
'''
Attempts to mark all addresses indicated by kallsyms as procedures, and renames
to match.
This script assumes that the contents of /proc/kallsyms from the target device
has been copied into the same directory as this script. It also assumes that
the relocation base / offset is properly set below.
Author: Peter Adkins (@Darkarnium)
'''
@darkarnium
darkarnium / diff.patch
Last active April 10, 2020 22:31
Janky ass patch for plugin.video.plutotv/resources/lib/plutotv.py
diff -w /tmp/a /tmp/b
203,205c203,207
< tz = str(timezone())
< start = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00').replace('T','%20').replace(':00:00','%3A00%3A00.000'+tz)
< stop = (datetime.datetime.now() + datetime.timedelta(hours=4)).strftime('%Y-%m-%dT%H:00:00').replace('T','%20').replace(':00:00','%3A00%3A00.000'+tz)
---
> tz = timezone()
> tz = '{0:04d}'.format(timezone())
> tz = '%2B{}{}:{}{}'.format(*list(tz))
> start = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00') + tz
@darkarnium
darkarnium / exploit.sh
Last active June 1, 2020 07:03
spacedb
(ctf) [darkarnium::Callisto SpaceDB][0]$ python3 -i flagger.py
[x] Opening connection to spacedb.satellitesabove.me on port 5062
[x] Opening connection to spacedb.satellitesabove.me on port 5062: Trying 18.191.160.21
[+] Opening connection to spacedb.satellitesabove.me on port 5062: Done
[*] Sending ticket
[*] Waiting for Telemetry service endpoint
[*] 18.191.160.21:19587/tel/graphiql
[*] Starting voltage fix-up thread
[*] Waiting for Scheduler service to start
[!] VIDIODE fixed to 7.0 (from 6.47) for 1590260897.99999
(ctf) [darkarnium::Callisto MagicBus][0]$ ipython3 --no-banner -i magic_bus.py
[x] Opening connection to bus.satellitesabove.me on port 5041
[x] Opening connection to bus.satellitesabove.me on port 5041: Trying 18.222.201.16
[+] Opening connection to bus.satellitesabove.me on port 5041: Done
[*] Sent b'^93+00+00+35+.' to bus
[*] Sent b'^93+00+00+45+.' to bus
[*] Sent b'^93+00+00+55+.' to bus
[*] Sent b'^93+00+00+75+.' to bus
[*] Sent b'^93+00+00+85+.' to bus
[*] Sent b'^93+00+00+a5+.' to bus
@darkarnium
darkarnium / commands
Last active June 1, 2020 07:03
That's not on my calendar
# Disable Slot 1
cmd("KIT_SCH CFG_SCH_ENTRY with CCSDS_STREAMID 6293, CCSDS_SEQUENCE 49152, CCSDS_LENGTH 6, CCSDS_FUNCCODE 4, CCSDS_CHECKSUM 0, SLOT 1, ACTIVITY 0, CONFIG 0")
# Reprogram Slot 0, Activity 0 to call KIT_TO_TLM_FLAG_MID.
cmd("KIT_SCH LOAD_SCH_ENTRY with CCSDS_STREAMID 6293, CCSDS_SEQUENCE 49152, CCSDS_LENGTH 13, CCSDS_FUNCCODE 5, CCSDS_CHECKSUM 0, SLOT 0, ACTIVITY 0, CONFIG 1, FREQ 1, OFFSET 0, MSG_TBL_IDX 42")
# Reprogram Slot 1, Activity 0 to call KIT_TO_TLM_FLAG_MID.
cmd("KIT_SCH LOAD_SCH_ENTRY with CCSDS_STREAMID 6293, CCSDS_SEQUENCE 49152, CCSDS_LENGTH 13, CCSDS_FUNCCODE 5, CCSDS_CHECKSUM 0, SLOT 0, ACTIVITY 0, CONFIG 1, FREQ 1, OFFSET 0, MSG_TBL_IDX 42")
# Enable Telemetry
@darkarnium
darkarnium / DESCRIPTION.MD
Created November 15, 2020 20:16
[PATCH] OpenNetworkLinux on Ubuntu 20.04.1 LTS

Overview

This patch allows the current ONL master branch (ref. 1537d833) to build on Ubuntu 20.04.1. Without this patch, the following error is observed while building using the docker/tools/onlbuilder environment when targetting armel:

INFO:onlrfs:dpkg-configure filesystem...
DEBUG:onlrfs:Executing:sudo chroot jessie/rootfs-armel.d /tmp/configure.sh