Skip to content

Instantly share code, notes, and snippets.

View kanazux's full-sized avatar
🏠
Working from home

Silvio Giunge a.k.a kanazuchi kanazux

🏠
Working from home
View GitHub Profile
@kanazux
kanazux / call_func.js
Created January 3, 2018 14:18
call php function from a js script
<script src="/vendor/jquery/jquery-1.12.0.min.js"></script>
<script type='text/javascript'>
function stats(x) {
var s = x.split('\n');
var thead = document.getElementById('arping');
for (i=0; i<s.length; i++) {
if (s[i] != '') {
var tr = document.createElement('tr');
var d = s[i].split(';');
var name = document.createTextNode(d[0]);
@kanazux
kanazux / arpyng_monitor.py
Last active January 1, 2018 14:49
arpyng_monitor arp scapy monitor
#!/usr/local/bin/python2.7
# -*- coding: utf-8 -*-
import os
import re
import time
from scapy.all import arping, ARP, sniff
from xml_default_dict import xml_default_dict
from collections import defaultdict
@kanazux
kanazux / get_iface_ip_by_gateway.php
Created October 19, 2017 19:04
get interface ip by the default gateway on pfsense
<?php
require_once("interfaces.inc");
require_once("gwlb.inc");
$i = get_interfaces_with_gateway();
$a = shell_exec("netstat -rn | grep -i default | sed -r 's/(.*\ )([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(.*)/\\2/p' | sort -u");
$gw_arr = return_gateways_array();

Keybase proof

I hereby claim:

  • I am kanazux on github.
  • I am kanazuchi (https://keybase.io/kanazuchi) on keybase.
  • I have a public key whose fingerprint is 0DDD 1C68 8470 9AF8 D833 3B50 B798 4ABE 02DA 6FDD

To claim this, I am signing this object:

@kanazux
kanazux / proxy_test.py
Last active February 2, 2018 12:46
Teste proxy squid com wget e lib requests em python
#!/usr/local/bin/python2.7
# -*- coding: utf-8 -*-
#
# test_proxy.py
# Autor: Silvio Giunge a.k.a kanazuchi <[email protected]>
# Script to test proxy navigation
# Requeriments: lib requests, bs4 and colorama
# To use wget needs only install, wgetrc don't need changes
#
root@current:~ # usbconfig -d ugen1.3
ugen1.3: <HUAWEI HUAWEI Mobile> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
root@current:~ # usbconfig -d ugen1.3 dump_device_desc
ugen1.3: <HUAWEI HUAWEI Mobile> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
@kanazux
kanazux / process_squid_logs
Last active November 25, 2020 13:49
Teste com shell script e redirector para logs do squid.
Aug 15 10:53:24 BluePexEMB redirector[75822]: 1502805204 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:53:45 BluePexEMB redirector[75822]: 1502805225 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:54:06 BluePexEMB redirector[75822]: 1502805246 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:54:28 BluePexEMB redirector[75822]: 1502805268 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:54:52 BluePexEMB redirector[75822]: 1502805292 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:54:58 BluePexEMB redirector[75822]: 1502805298 https://api.imusicaradios.com.br/ 1 - 192.168.213.16 - - 0
Aug 15 10:55:13 BluePexEMB redirector[75822]: 1502805313 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:55:35 BluePexEMB redirector[75822]: 1502805335 https://cocacola-go-lag.stream1.fyre.co/ 1 - 192.168.213.16 - - 0
Aug 15 10:55:45 BluePexEMB redirector[75822]: 1
@kanazux
kanazux / nanga.txt
Last active July 10, 2017 20:03
nanga problems
kanazuchi@sbuilder:~/nanga % ./nanga_server1.py
Arquivos a serem copiados: 3 1 5 2
3 100% 0 0.0KB/s 00:00
1 100% 0 0.0KB/s 00:00
5 100% 0 0.0KB/s 00:00
2 100% 0 0.0KB/s 00:00
@kanazux
kanazux / kanazux.py
Last active June 7, 2017 15:45
Bot em python para o jogo Summoners War
#!/usr/local/bin/python2.7
# -*- coding: UTF-8 -*-
#
# Author: kanazuchi <[email protected]>
#
# Bot para listar os mobs do Summoners War
# Pra gente como eu não ficar boiando quando alguém falar o nome
# do mob despertado e não saber de quem estão falando :3
# Ele herdou uma função /tempo de outro bot pra mostrar a previsão
# de tempo pra cidade escolhida :)
@kanazux
kanazux / xml2dict
Last active May 19, 2017 13:53
xml parser to defaultdict
Python 2.7.13 (default, Jan 12 2017, 17:59:37)
Type "copyright", "credits" or "license" for more information.
IPython 3.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: execfile('return_nodes_dict.py')