Skip to content

Instantly share code, notes, and snippets.

View paralax's full-sized avatar

jose nazario paralax

View GitHub Profile
@paralax
paralax / wolfram_graph_transform.py
Created April 20, 2020 16:00
playing around with networkx and wolfram's physics thinking
import networkx as nx
import matplotlib.pyplot as plt
g = nx.DiGraph(((1,2), (2,3), (3,4), (2,4)))
def wolfram(g):
ns = [ (x, n) for x,n in g.out_degree() if n == 2 ]
print(list(ns))
nns = []
for x, _ in ns:
@paralax
paralax / censys.cs
Created April 6, 2020 00:25
Censys API via C#
using System.IO;
using System.Net;
using System.Text;
var api_id = Environment.GetEnvironmentVariable("CENSYS_API_ID");
var api_secret = Environment.GetEnvironmentVariable("CENSYS_API_SECRET");
var credentials = System.Convert.ToBase64String(Encoding.ASCII.GetBytes(api_id + ":" + api_secret));
var wc = new WebClient();
@paralax
paralax / greynoisebot.py
Created April 1, 2020 19:03
greynoise slack bot (python)
#!/usr/bin/env python3
# https://github.com/slackapi/python-slack-events-api/blob/master/example/example.py
import os
import re
import greynoise
import requests
from slackeventsapi import SlackEventAdapter
from slackclient import SlackClient
@paralax
paralax / ca_breaches.py
Last active January 26, 2020 22:39
quick and dirty skim over the list of CA breach notices
#!/usr/bin/env python
from collections import Counter
import itertools
import urllib
from BeautifulSoup import BeautifulSoup
import timestring
URL="http://oag.ca.gov/ecrime/databreach/list"
@paralax
paralax / robtex_passive_dns.py
Last active November 3, 2019 13:18
recon-ng modules for using Robtex passive DNS
from recon.core.module import BaseModule
from datetime import datetime
import re
import socket
from BeautifulSoup import BeautifulSoup
# for https://bitbucket.org/LaNMaSteR53/recon-ng/
class Module(BaseModule):
@paralax
paralax / censys.ps1
Last active October 17, 2019 18:56
Censys from Powershell
# env vars for your Censys API creds
$apiid = $env:CENSYS_API_ID
$apisecret = $env:CENSYS_API_SECRET
$pair = "$apiid" + ":" + "$apisecret"
# Base64 encode them for auth
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
# set up our headers
@paralax
paralax / recog_match.go
Last active September 29, 2019 13:49
recog_match for recog in golang
package main
// # build
// $ go get github.com/hdm/recog-go
// $ go build
// # install recog for the XML files
// $ git clone https://github.com/hdm/recog.git
// # usage:
// $ echo "Apache/2.4.33 (Unix) OpenSSL/1.0.2o" | ./recog_match recog/xml
@paralax
paralax / README.md
Last active September 24, 2019 12:26
oops command lives

years ago i saw my dad working in a terminal and i could have sworn i typed "oops " when he made a typo and it worked: the command was fixed and rerun, he didn't need to retype the whole thing. i always wanted the oops command.

however, it didn't exist, or at least as i knew it. so i wrote a portable version of it (it seems it exists in zsh, a shell i just don't use). the python part of it is really simple, just a levenshtein distance calculator and a replacement engine. you need to create a command alias for it however:

ksh, sh, bash:

$ alias oops='history>/tmp/oops_history && ~/bin/oops.py'

csh and derivatives:

@paralax
paralax / 3g_4g_cellular_ethernet_serial_gateway_default_creds.py
Last active August 12, 2019 23:26
routersploit module - Microhard Systems 3G/4G Cellular Ethernet and Serial Gateway Default Creds
from routersploit.core.exploit import *
from routersploit.modules.creds.generic.http_basic_digest_default import Exploit as HTTPBasicDigestDefault
class Exploit(HTTPBasicDigestDefault):
__info__ = {
"name": "Microhard Systems 3G/4G Cellular Ethernet and Serial Gateway Default Creds - HTTP Auth",
"description": "Module performs dictionary attack against Microhard Systems "
"3G/4G Cellular Ethernet and Serial Gateway web interface. "
"If valid credentials are found, they are displayed to the user.",
@paralax
paralax / censys.go
Last active May 29, 2019 10:37
search censys from the CLI
package main
import (
"encoding/json"
"fmt"
"github.com/abadojack/gocensys"
"log"
"os"
"strings"
)