Skip to content

Instantly share code, notes, and snippets.

Avatar

Andres Hernandez tonejito

View GitHub Profile
View ipxe.cfg
#!ipxe
kernel http://cdn-fastly.deb.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux expert theme=dark priority=low
initrd http://cdn-fastly.deb.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
boot
@tonejito
tonejito / technologic.sh
Last active Sep 16, 2020
Daft Punk - Technologic
View technologic.sh
#!/bin/bash
# = ^ . ^ =
# say -v ? | grep en_US
# VOICE=Alex
# VOICE=Fred
VOICE=Samantha
# VOICE=Victoria
@tonejito
tonejito / get-CV-data.sh
Last active Apr 25, 2020
Pull CV data from official site and convert it to JSON format
View get-CV-data.sh
#!/bin/bash
# Andrés Hernández (tonejito)
# This script is released under the terms of the BSD 2 clause license
set -evx
SITE="coronavirus.gob.mx"
ENDPOINT="datos"
DATA_FILE="Downloads/filesDD.php"
@tonejito
tonejito / Makefile
Last active Jan 29, 2020
Compile @python 3.x for older systems
View Makefile
SHELL=/bin/bash
# = ^ . ^ =
APT_OPTS=-q=2 --assume-yes
APT_DEPS=build-essential \
tcl-dev tk-dev \
libpq-dev libffi-dev zlib1g-dev libreadline-dev libbz2-dev libncurses-dev libdbm-ocaml-dev libgdbm-dev liblzma-dev libsqlite3-dev uuid-dev libxml2-dev libxslt-dev \
libssl-dev openssl \
python3-pip python3-dev
View mock.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
return 200 "<html><body><h1>It works</h1></body></html>";
add_header Content-Type text/html;
}
@tonejito
tonejito / microsoft-sucks.log
Last active Dec 19, 2019
./microsoft-sucks.sh 2>&1 | tee microsoft-sucks.log
View microsoft-sucks.log
#!/bin/bash -v
DOMAIN=microsoft.sucks.
whois ${DOMAIN}
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.nic.sucks
@tonejito
tonejito / Makefile
Last active Dec 16, 2019
Full width separator with Perl or (bash) shell magic
View Makefile
SHELL=/bin/bash
# = ^ . ^ =
SEP?=-
COLS=$(shell tput cols)
.PHONY: separator test
test:
@$(MAKE) -s separator
@tonejito
tonejito / patch_zoom-us_vuln_CVE-2019-13450.sh
Last active Jul 9, 2019
Patch @zoom-us vulnerability on macOS (CVE-2019-13450) reported by @JLLeitschuh
View patch_zoom-us_vuln_CVE-2019-13450.sh
#!/bin/bash -vxe
# = ^ . ^ =
# https://medium.com/@jonathan.leitschuh/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-your-website-ac75c83f4ef5
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13449
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13450
# https://gist.github.com/JLLeitschuh/e2550ddd8d6dfd94447b0b557891ba30.git
# https://gist.github.com/tonejito/6a564deb45b50407f6bc8a8a140f027b.git
# https://twitter.com/JLLeitschuh/status/1148310958391091200
# https://twitter.com/jdpearce/status/1148507087862947840
@tonejito
tonejito / iptables-apache
Last active Apr 8, 2019
Log and DROP "abnormal" @apache / HTTPD connections
View iptables-apache
# Generated by iptables-save v1.4.21 on Wed Dec 26 00:02:00 2018
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:APACHE - [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -s 10.0.0.0/8 -j ACCEPT
@tonejito
tonejito / audit-apache-procs
Last active Apr 8, 2019
Audit @apache HTTPD processes for live forensic analysis
View audit-apache-procs
#!/bin/bash
# Create and change to ${TMP_DIR}
TMP_DIR=${HOME}/tmp
test -e ${TMP_DIR} || mkdir -vp ${TMP_DIR}
cd ${TMP_DIR}
# Output files in ${TMP_DIR}
PS_FILE=ps.log
NETSTAT_FILE=netstat.log