Skip to content

Instantly share code, notes, and snippets.

@2xyo
2xyo / setup.sh
Last active December 17, 2015 00:49
Play with cybox, maex and stix
# create a virtualenv
# http://virtualenvwrapper.readthedocs.org/en/latest/
sudo pip -v install --upgrade https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz#md5=07e09df0adfca0b2d487e39a4bf2270a
sudo pip -v install --upgrade https://pypi.python.org/packages/source/v/virtualenvwrapper/virtualenvwrapper-4.0.tar.gz#md5=78df3b40735e959479d9de34e4b8ba15
###############################################
# STABLE
mkvirtualenv --no-site-packages --use-distribute playground
@2xyo
2xyo / phishing.py
Created May 12, 2013 09:45
Phishing example with Stix / CyBox
# Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
'''
File: ex_02.py
Description: Build a STIX Indicator document containing a File observable with an associated hash.
'''
from datetime import datetime
@2xyo
2xyo / drop-pc.sh
Created May 19, 2013 07:27
Ingress auto drop items
#!/system/xbin/bash
# Author : 2xyo 14/02/2013
# Tested with :
# # Linux localhost 2.6.35.14-cyanogenmod-g295e82f #1 PREEMPT Sun Nov 13 14:34:17 CET 2011 armv7l GNU/Linux
# HTC Desire HD
# Usage :
# copy this file to /sdcard/
# Open a shell :
# cd /sdcard
# bash drop.sh x ; to drop x items
@2xyo
2xyo / install.sh
Created June 22, 2013 11:46
PyQt5 on ubuntu 13.04
sudo aptitude install qt5-default
wget "http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-5.0/PyQt-gpl-5.0.tar.gz?r=http%3A%2F%2Fwww.riverbankcomputing.co.uk%2Fsoftware%2Fpyqt%2Fdownload5&ts=1371881389&use_mirror=ncu"
tar xzf PyQt-gpl-5.0.tar.gz
cd PyQt-gpl-5.0
python ./configure.py
@2xyo
2xyo / DNSCybox.md
Created July 5, 2013 12:23
DNS Draft for Cybox

According to the RFC 1035, DNS query or response have several fields in their header which are not yet defined in CybOX. Therefore, it could be relevant to add these identifiers to DNSQueryObjectType :

  • ID : A 16 bit identifier assigned by the program that generates any kind of query. This identifier is copied the corresponding reply and can be used by the requester to match up replies to outstanding queries.
<xs:element minOccurs="0" name="Identifier" type="cyboxCommon:HexBinaryObjectPropertyType">
    <xs:annotation>
        <xs:documentation> The Identifier field specifies the ID field of the DNS Query.</xs:documentation>
    </xs:annotation>
</xs:element>
@2xyo
2xyo / gist:5982554
Created July 12, 2013 07:23
Python qualité
pip install --upgrade pyflakes pep8 pylint
@2xyo
2xyo / python-install-2.7.5.sh
Last active August 13, 2017 09:38
Python 2.7.5 from source + virtualenv with Debian GNU/Linux 6.0.7 (squeeze)
#!/usr/bin/env bash
cd /tmp
# Install dependencies
aptitude -y install build-essential python-pip libmysqlclient-dev libadns1-dev \
python-dev libreadline-dev libgdbm-dev zlib1g-dev libsqlite3-dev \
libssl-dev libbz2-dev libncurses5-dev libdb-dev
# Download latest version
@2xyo
2xyo / benchmark.py
Created July 23, 2013 09:17
This is NOT a serious Python DNS benchmark ( adns / dnspython pool / dnspython thread )
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import adns
from Queue import Queue
from threading import Thread
@2xyo
2xyo / TEST
Created September 26, 2013 10:23
TEST
TEST DATA
@2xyo
2xyo / Readme.md
Created October 7, 2013 12:40
Kernel sysctl configuration file for Linux dedicated server systems at high-speed networks with loads of RAM and bandwidth available.

Sysctl-IP-Tunning

Kernel sysctl configuration file for Linux dedicated server systems at high-speed networks with loads of RAM and bandwidth available.

Installation

This file should be saved as /etc/sysctl.d/sysctl.local.conf and can be activated using the command: sysctl -e -p /etc/sysctl.d/*