Skip to content

Instantly share code, notes, and snippets.

# this cleans up your dead containers, cleaned up 50gigs before...
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
@EnoF
EnoF / kda-helper.js
Created April 13, 2023 08:59
Helper for KDA-Tool (requires node v18+)
#!/usr/bin/env node
const fs = require("fs");
const acceptedArgs = ["--send", "--local", "--node"];
const { send, local, node } = process.argv.reduce((args, arg) => {
const [key, value] = arg.split("=");
if (!value) return args;
if (!acceptedArgs.includes(key)) return args;
return { ...args, [key.replace("--", "")]: value };
}, {});
@EnoF
EnoF / README.md
Created July 5, 2023 09:12
Example of an vulnerable module

Capabilities and Referenced modules vulnerability

Modules can be brought into scope dynamically. This can be done like:

(defun test(referenced-module:module{interface-of-module})
  (module::a-function-that-is-defined-on-the-interface))

This is useful for it's dynamic nature, but brings potential vulnerabilities

What are Principals in pact?

An account has many different forms and can be used in different ways. When users create an account an attacker could try to frontrun the transaction. The attacker would mutate the guard associated with the account, hoping the user won't notice or worse tokens are already on it's way to this newly created account. We can prevent such attacks by providing a way to pin an account to it's guard. If the attackes decides to mutate the guard now,

@EnoF
EnoF / GAS_STATIONS.md
Last active November 13, 2024 13:58
Gas Stations

Gas Stations

A gas station is a coin account that pays for gas fees on behalf of a user. Let's explore how we can create an account that is scoped to only pay for gas for specific transactions.

Unscoped Gas Station

To start off, let's create a gas station that is unscoped. From there we can then see how we can scope it to only pay for gas for specific transactions.