Skip to content

Instantly share code, notes, and snippets.

View andresriancho's full-sized avatar
🎯
Focusing

Andres Riancho andresriancho

🎯
Focusing
View GitHub Profile
@andresriancho
andresriancho / randomize.py
Created October 6, 2012 11:47
nosetests plugin to randomize test ordering
"""
This plugin randomizes the order of tests within a unittest.TestCase class
"""
__test__ = False
import logging
import os
from nose.plugins import Plugin
from nose import loader
from inspect import isfunction, ismethod
@andresriancho
andresriancho / csrf-db.py
Created February 8, 2013 11:52
Common CSRF parameter names used by web applications, help the w3af project by submitting more!
COMMON_CSRF_NAMES = (
'csrf_token',
'CSRFName', # OWASP CSRF_Guard
'CSRFToken', # OWASP CSRF_Guard
'anticsrf', # AntiCsrfParam.java
'__RequestVerificationToken', # AntiCsrfParam.java
'token',
'csrf'
)
@andresriancho
andresriancho / w3af-beta-test.txt
Last active December 13, 2015 21:58
Steps to beta-test w3af's threading2 branch
It's time. The w3af project needs your help. I've been improving this software during the last months and now I need you to test it before the release. I've done my fair share of testing, but I'm also the developer and that's never good.
I'm looking for bugs, crashes, false positives, false negatives, typos, etc. anything that can be improved is welcome.
Follow these steps for testing:
cd ~
git clone https://github.com/andresriancho/w3af.git
git checkout threading2
@andresriancho
andresriancho / HTTP-Traceroute.py
Created March 10, 2013 22:42
HTTP-Traceroute.py
#!/usr/bin/env python
import getopt, sys, re, urllib2, urllib, BaseHTTPServer
from urllib2 import Request, urlopen, URLError, HTTPError
################## HEADER ###################################
#
# Traceroute-like HTTP scanner
# Using the "Max-Forwards" header
@andresriancho
andresriancho / non-ascii.py
Created April 11, 2013 12:25
Detect non-ascii chars in scan database file.
import string
for line in file('scan_database.db'):
line = line.strip()
for char in line:
if char not in string.printable:
print repr(char), line
@andresriancho
andresriancho / pool.py
Created April 24, 2013 23:36
My modified pool.py
#
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
import time
import threading
from multiprocessing.pool import ThreadPool
def wait():
time.sleep(5)
class A(object):
def __init__(self):
self.p = ThreadPool(10)
@andresriancho
andresriancho / setup.py
Created June 12, 2013 19:27
Test for w3af's setup.py
#!/usr/bin/env python
from setuptools import setup, find_packages
from os.path import join
LONG_DESCRIPTION = '''\
Introduction
============
@andresriancho
andresriancho / strace.txt
Created July 3, 2013 01:10
strace for uwsgi bug
root@server:/home/ubuntu# gcc --print-file-name=libgcc_s.so.1
/lib/x86_64-linux-gnu/libgcc_s.so.1
root@server:/home/ubuntu# ls -lah /lib/x86_64-linux-gnu/libgcc_s.so.1
-rw-r--r-- 1 root root 87K Apr 15 2012 /lib/x86_64-linux-gnu/libgcc_s.so.1
root@server:/home/ubuntu# file /lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libgcc_s.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xa922f3ec3c63266e82f1105dd40d17152cf85a39, stripped
root@server:/home/ubuntu# strace -o strace.txt -e trace=file /usr/local/bin/uwsgi --ini /etc/uwsgi/django_uwsgi.ini
@andresriancho
andresriancho / runner.py
Created August 14, 2013 15:48
Test runner for circleci
import sys
import re
import os
import subprocess
TEST_RUNNER = 'nosetests'
TEST_ARGS = ['-s', '-v']
CRAWL_EXCLUSIONS = ('./build', './.git', './venv',)