Skip to content

Instantly share code, notes, and snippets.

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 / 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

@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 };
}, {});
# 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 / dup.sh
Last active June 15, 2016 16:34
Docker UP
#!/bin/bash
function print_help_dup() {
echo " usage:"
echo " dup [-i|--image] (options)"
echo
echo " -i|--images required The name of the docker image you to load into your container"
echo " dup -i node"
echo " -cmd|--command optional Provide a different command to run"
echo " default: /bin/bash"
@EnoF
EnoF / banana.yml
Created May 8, 2016 14:51
Example rest-io Resource description
---
Banana
type: object
properties:
id:
type: string
description: Mongoose ID
description:
type: string
description: Some text to describe this specific banana

REST.IO

Small extendable REST framework for express and mongoose. wercker status

Installation

$ npm install rest-io --save

New in v1.0.0

  • Custom Resource declarations
function Router(){
this.addRoute = function addRoute(route){
route.url = route.url || 'defaultUrl';
route.name = route.name || 'defaultName';
// Do your stuff
}
}
@EnoF
EnoF / gist:9256893
Created February 27, 2014 19:08
express.js example
'use strict';
var express = require('express');
var mongoskin = require('mongoskin');
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With');
@EnoF
EnoF / gist:8941149
Created February 11, 2014 18:37
Super and Constructor!
var Animal = clazz(function Animal(){
this.private = {
name: 'animal'
};
this.public = {
sayHello: function sayHello(){
return 'Hi, my name is ' + this.private.name + '!';
}
};