Skip to content

Instantly share code, notes, and snippets.

View diegoparrilla's full-sized avatar
😀

Diego Parrilla diegoparrilla

😀
  • @threatjammer
  • Madrid, Spain
  • 18:31 (UTC +02:00)
  • X @soyparrilla
View GitHub Profile

Keybase proof

I hereby claim:

  • I am diegoparrilla on github.
  • I am diegoparrilla (https://keybase.io/diegoparrilla) on keybase.
  • I have a public key ASAKD-FQAW-uya3hSvwHSGx15DU6OqRSoVN0A-L90WklVgo

To claim this, I am signing this object:

@diegoparrilla
diegoparrilla / threatjammer.com
Last active March 7, 2022 17:15
Fail2Ban action to notify ThreatJammer.com about the banned and unbanned IP addresses
[Definition]
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
#
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = curl -X 'POST' <threatjammer_url>/v1/ip -H 'accept: application/json' -H 'Authorization: Bearer <threatjammer_apikey>' -H 'Content-Type: application/json' -d '{ "addresses": [ "<ip>" ], "ttl": <threatjammer_ttl>, "type": "<threatjammer_type>", "tags": ["<threatjammer_tag>"] }'
@diegoparrilla
diegoparrilla / Code.gs
Created April 16, 2020 17:08
Google Spreadsheet custom function to get the full ip report from Auth0 Signals/Apility
function SIGNALSFULLIP(input) {
var response = UrlFetchApp.fetch("https://signals.api.auth0.com/ip/" + input + "?token=YOUR_API_TOKEN");
// Parse the JSON reply
var json = response.getContentText();
var data = JSON.parse(json);
var score = data['fullip']['score'];
var blacklists = data['fullip']['badip']['blacklists'].join(',');
var as = data['fullip']['geo']['as']['name'];
var asnum = data['fullip']['geo']['as']['asn'];
var country = data['fullip']['geo']['country'];
{
"response": {
"score": 0,
"ip": {
"score": 0,
"blacklist": [],
"is_quarantined": false,
"address": "35.189.84.182"
},
"address": {
@diegoparrilla
diegoparrilla / aws-lambdaedge-apilityio-add-header.js
Created August 23, 2018 13:43
Using AWS Lambad@edge and Cloudfront with https://Apility.io API to add to the request headers information of the blacklists of abusers that contains the IP address of the client.
'use strict';
const http = require('http');
exports.handler = (event, context, callback) => {
var startTime = new Date();
const request = event.Records[0].cf.request;
let clientIp = request.clientIp;
var options = {
host: "api.apility.net",
path: "/badip/" + clientIp,
@diegoparrilla
diegoparrilla / cloudflare-workers-block-europeans.js
Created May 25, 2018 15:29
Using Cloudflare Workers and https://Apility.io API to block access to the pages filtered if the IP belongs to an European country because of the GDPR.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const apilityio = await fetch('https://api.apility.net/badip/' + ip + '?token=APILITY_IO_API_KEY');
@diegoparrilla
diegoparrilla / cloudflare-workers-block-blacklisted.js
Created May 11, 2018 15:16
Using Cloudflare Workers and https://Apility.io API to block access to the pages filtered if the IP belongs to a blacklisted IP address of the service
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const apilityio = await fetch('https://api.apility.net/badip/' + ip + '?token=APILITY_IO_API_KEY');
@diegoparrilla
diegoparrilla / cloudflare-workers-apilityio.js
Last active April 19, 2023 12:20
Using Cloudflare Workers and https://Apility.io API add to the request headers information of the blacklists of abusers that contains the IP address of the client.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
startTime = new Date();
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const es = req.headers.get('cf-ipcountry');
riseup.net
e.sino.tw
e.ycn.ro
g.tiv.cc
o.civx.org
mx.dnses.ro
dr.vankin.de
mx.dnses.ro
mx1.dnses.ro
mx2.dnses.ro
@diegoparrilla
diegoparrilla / disposable-email-provider-domains
Last active August 12, 2021 05:46
List of disposable email provider domains
0815.ru
0clickemail.com
0experts.com
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
1blackmoon.com
1fsdfdsfsdf.tk