Skip to content

Instantly share code, notes, and snippets.

View maesoser's full-sized avatar
:shipit:

Sergio maesoser

:shipit:
View GitHub Profile
@maesoser
maesoser / ifblinkd.c
Created December 23, 2022 00:33
Armbian/Raspberry led blink daemon
#include <wiringPi.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define TRAFFIC_TRESH 64
#define BLINK_DELAY 83
#define TX_LED 7 // GREEN
#define RX_LED 0 // RED
@maesoser
maesoser / banner-scan
Last active March 4, 2024 08:00
Fast and small multithreading http scanner and html title grabber
#!/usr/bin/env python3
'''
python3 -u titleget --ports 8080 80 443 8443 5601 3000 1900 9000 4444 9090 7777 5555 2332 8888 6002 6001 8000 80 1234 7001 50100 3128 20183 \
--threads 512 \
--input targets --output targets.json
'''
import urllib3
@maesoser
maesoser / cloudflared
Created September 18, 2022 21:10
Cloudflare tunnel service for openwrt
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=30
TOKEN="ey000...0000"
COLO="nyc"
stop_service() {
echo "Stopping cloudflared tunnel"
@maesoser
maesoser / nping
Created June 11, 2022 11:55
Small python script that performs a tcp handshake to see if port is open
#! /usr/bin/env python3
import sys
import socket
try:
target = socket.gethostbyname(sys.argv[1])
port = int(sys.argv[2])
except Exception as e:
print("Error: {}".format(e))
@maesoser
maesoser / server.py
Last active October 20, 2021 14:39
python txt webserver
from http.server import HTTPServer, BaseHTTPRequestHandler
class handler(BaseHTTPRequestHandler):
def _answer(self):
content = f"USA\n"
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
self.wfile.write(content.encode("utf-8"))
def do_GET(self):
@maesoser
maesoser / sdig
Last active February 19, 2024 18:36
sdig is a dig wrapper that adds some common options and query multiple entries at once
#!/usr/bin/env bash
DEFAULT_RESOLVER="1.0.0.1"
do_dig () {
ENTRYTYPES="A AAAA CAA CNAME MX NS PTR SOA SRV TXT DS DNSKEY RRSIG PTR SRV TLSA HINFO NSEC NSEC3 NSEC3PARAM SSHFP type65"
for type in $ENTRYTYPES; do
out=$(dig +noall +dnssec +answer $1 $2 $type | awk '{gsub("IN\t", "", $0); print}')
colorize "$out"
done
@maesoser
maesoser / curly
Last active February 19, 2024 18:35
Shows colored http requests and responses
#!/usr/bin/env bash
TOOL_NAME="curly/0.1.2"
LIBCURL_VER=$(curl -V | head -n1 | awk '{print $4}')
echo -e "curl --compressed --silent --location -vvv --insecure -o /dev/null $@ 2>&1\n"
curl \
--compressed --silent --location -vvv --insecure \
--user-agent "$TOOL_NAME $LIBCURL_VER $(uname)/$(uname -r)" \
-o /dev/null "$@" 2>&1 | awk \
-v black="$(tput setaf 0)" \
@maesoser
maesoser / minijammer.ino
Last active September 23, 2020 18:12
Small and simple esp8266 deauthenticator
#include "ESP8266WiFi.h"
extern "C" {
#include "user_interface.h"
}
#define BOARD_LED 16
#define LED_BUILTIN 2
#define MAX_SCANS 2
#define BLINK_TIME_MS 40
@maesoser
maesoser / har_extract.py
Created July 28, 2020 14:49
Extract resources from har files
import json
import jsbeautifier
import argparse
def get_args():
parser = argparse.ArgumentParser(description="Extract resources from HAR file")
parser.add_argument('--har', required=True, help='Har File')
parser.add_argument('--filter', required=True, help='What the file needs to include to be downloaded', default=".js")
args = parser.parse_args()
return args
@maesoser
maesoser / interfaces
Last active July 19, 2020 17:02
Configuration to create an active-passive bond beween an eth and wlan interfaces
# https://rafalgolarz.com/blog/2018/01/10/bonding_wifi_and_ethernet_interfaces/
allow-hotplug eth0
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0 wlan0
allow-hotplug wlan0
auto wlan0