Skip to content

Instantly share code, notes, and snippets.

View phretor's full-sized avatar

Federico Maggi phretor

View GitHub Profile
@phretor
phretor / blackholeratcheck.sh
Created March 2, 2011 10:02
Quick and dirty check for BlackHole RAT (OSX/MusMinim-A)
#! /bin/sh
# Quick and dirty check for BlackHole RAT (OSX/MusMinim-A)
# * http://www.sophos.com/security/analyses/viruses-and-spyware/osxmusminima.html
#
# USAGE:
# - Copy this file in your Desktop
# - Open Terminal.app
# - Run the following commands:
# - cd ~/Desktop
# - chmod +x blackholeratcheck.sh
{% extends 'form.html' %}
{% block form_body %}
{% for fieldset in form.fieldsets %}
<fieldset class="{{ fieldset.classes }}">
{% if fieldset.legend %}
<legend>{{ fieldset.legend }}</legend>
{% endif %}
{% if fieldset.description %}
<p class="form-field-description">{{ fieldset.description }}</p>
@phretor
phretor / twistwrap.py
Created September 30, 2011 14:23
Wrapping Twisted
class Helper(object):
res = None
def search(self):
d = this_returns_a_deferred()
def _save(results):
self.res = results
d.addCallback(_save)
@phretor
phretor / reflector.c
Created October 19, 2011 15:08
Packet reflector that reflects packets back to the attacker
/*-
* Copyright (c) 2008
* Federico Maggi <fmaggi@elet.polimi.it>, Politecnico di Milano. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@phretor
phretor / migrationChart.as
Created October 20, 2011 14:18
Visualization of the migration screen of BURN
package DetailsPanel.MigrationChart
{
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.display.Sprite;
import flash.events.Event;
public class MigrationEdge extends Sprite
#! /usr/bin/env python
import sys
import argparse
import subprocess
import shlex
def main():
parser = argparse.ArgumentParser(
description='Takes a PDF and attempts to embed the fonts.')

Keybase proof

I hereby claim:

  • I am phretor on github.
  • I am phretor (https://keybase.io/phretor) on keybase.
  • I have a public key ASAv54h27oSEKgN5zwbiNjbuSGIqQM1FYsSYYvLAm7wCgQo

To claim this, I am signing this object:

@phretor
phretor / gist:879ac99e45d6d83497d8febf88c238d8
Last active October 17, 2016 14:59
My Son's First Typed Strings (17 months)
/m nm nmbbvvc ,cxcc
rnf vc .cx.x /x/ /,,,,,?/////////////////////////////////////////////////////////////////////////////////////
@phretor
phretor / dig.py
Created November 30, 2016 11:46
Python pathlib2-based recursive directory iterator with depth limits
def _dig(p, max_depth, depth=1):
for sp in p.iterdir():
if sp.is_file():
yield sp
elif sp.is_dir() and depth <= max_depth:
depth += 1
for ssp in _dig(sp, max_depth, depth):
yield ssp
@phretor
phretor / What we know (technically) about EyePyramid.md
Last active January 12, 2017 11:31
What we know (technically) about EyePyramid