Skip to content

Instantly share code, notes, and snippets.

View Diviei's full-sized avatar

Daniel Vaca Araujo Diviei

  • Málaga (Spain)
View GitHub Profile
@Diviei
Diviei / downloading using drag & drop(Chrome).js
Created June 24, 2012 01:45
Hacer drag & drop de ficheros fuera del navegador con Chrome
var file = document.getElementById("dragout");
file.addEventListener("dragstart",function(evt){
evt.dataTransfer.setData("DownloadURL",fileDetails);
},false);
@Diviei
Diviei / drag and drop upload.html
Created June 24, 2012 01:58
Ejemplo de drag & drop upload (By Craig Buckler)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>HTML5 File Drag &amp; Drop API</title>
<style>
/*
Styles for HTML5 File Drag & Drop demonstration
Featured on SitePoint.com
Developed by Craig Buckler (@craigbuckler) of OptimalWorks.net
@Diviei
Diviei / js_no_referrer.
Created December 8, 2012 20:39
New Window No Referrer
function openNewTab(url)
{
var url = url.replace(/"/g,'%22').replace(/#/g,'%23');
var newtab = window.open();
newtab.location = 'data:text/html,<title>Redirect</title><meta http-equiv=refresh content="0;url='+url+'">';
}
@Diviei
Diviei / middleware.py
Created April 1, 2015 10:17
Hide admin panel for unprivileged users
# -*- coding: utf-8 -*-
from django.http import HttpResponseNotFound
class AdminSiteSecurizeMiddleware(object):
"""Hide admin panel for unprivileged users"""
def process_response(self, request, response):
"""
Return a 404 Not Found page if there is no authenticated user
or if user has no enough privileges
"""
@Diviei
Diviei / apks_related.py
Last active August 9, 2019 02:41
Simple script using Koodous anon API to find related samples of one search
@Diviei
Diviei / amtrckr_koodous.py
Created October 22, 2016 08:30
Mergin amtrckr.info API with Koodous API to find samples
import requests
r = requests.get("https://amtrckr.info/json/live")
matches = []
for row in r.json():
koodous_r = requests.get("https://api.koodous.com/apks?search=network.hosts:'%s'" % row.get("ip"))
for apk in koodous_r.json().get("results"):
matches.append(apk.get("sha256"))
curl -s -g -O -J -L -H "Authorization: Token $1" https://api.koodous.com/feed/apks
unzip -o apk*.zip
rm apk*.zip
mkdir downloads
while read p; do
IFS=';' read -r -a array <<< "$p"
echo "Downloading ${array[0]}"
curl -s ${array[1]} > downloads/${array[0]}.apk
done < samples
@Diviei
Diviei / html2static.py
Created October 31, 2016 19:04
A script intended to create a non dependencies html (inline .js and .css and base64 images)
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import base64
base_url = "http://getbootstrap.com/"
r = requests.get(base_url)
html = r.text #htmlstring
f = open('result.html', 'w+')
@Diviei
Diviei / integration-Koodous.yml
Last active November 15, 2016 09:57
Demisto Koodous integration
commonfields:
id: Koodous
version: -1
name: Koodous
display: Koodous
category: Malware
system: true
image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABHNCSVQICAgIfAhkiAAAAAZiS0dEAP8A/wD/oL2nkwAAIABJREFUeJzsnXd8HFe593/PmZldVduyZdlWcZFsx44Tl8TpCQRIdSBcSgLcCyS8dEgg9wKhhlACl9BC74FwKaFc4JJiOYWEJBAIqY4dl9iWm7olq2vLzJzn/WNm5dXurDS7O9uk+ebjfKTZM2eOdmd++zzPec5zCD4+CTRvPXqqJLFCMBqYsIiIqiBlBYiqAMwlwjxI1LCgIDGXAShjoBzMCojYuVcOAQgTRBjgCIOGmXkQhEEBGiZgXDJCYNlDRD1SyIMHL218GkRmHv90nyKHCj0An/zTfH/7Kkh1tWC5WBLXAzgJEqeCUE8ghcEagTSAA6SoBCGsE5mtfwCYGQADDNj/cwHZdxyBKPY7nTjODDZ0MJFOzFEQ6cxSEsRxMO9kwh4wjjBzL0vsP/Sqxu1evi8+xY8vWDOcVX/pbzCM6Nlk8isgcBqBK8CYx8BiESjTAAakBFhaIhQvQGmJkYdQ7Lakid9JCIAEQASOhgFGNxMGiDAmGfvB+DtBPtK2pWlH/gfsky98wZphrLiv45WQuFgQNTPzqSIQXAYSgDQBKcHgE5YSF0CMPIEAYVlmRLaVJhSACDISHgDwDJgPA/hb25aGnxV4sD4e4gtWCXNSa9dyA+YlzLSZCC9hoJkICglVgAhsi9SsgoRtjZHlXgIGgB4w/YOIn5AQjxy8fMmThR6mT2b4glVCLL3ncI2iBlcJNrcAeCWIlgCoJ1UDmybAtjiVrOXkNXZsjAgkFACANPU+AMeY8Sik+QeS6t62V9UfKegwfVzjC1YJsLy181IBfheB1kN
@Diviei
Diviei / dark.css
Last active October 9, 2020 12:28
Dark theme for dummies
html {
filter: invert(1) hue-rotate(180deg) brightness(1.0) contrast(1);
}
img {
filter: invert(1) hue-rotate(180deg);
}