Skip to content

Instantly share code, notes, and snippets.

View abdallah's full-sized avatar
🏠
Working from home

Abdallah Deeb abdallah

🏠
Working from home
View GitHub Profile
#!/bin/bash
httpdconfdir=/etc/httpd/conf
[ -e /etc/apache2 ] && httpdconfdir=/etc/apache2
is_wildcard="n"
domainname=""
keyfile=""
certfile=""
csrfile=""
conffile=".sslconf"
[Definition]
failregex = <HOST>.*] "POST /wp-login.php
ignoreregex =
@abdallah
abdallah / .htaccess
Created November 26, 2013 09:18
email tracking
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(png|css)$
RewriteRule (.*) n.php [L,QSA]
@abdallah
abdallah / ntp-ddos-vulnerable-ips.sh
Created January 15, 2014 10:03
Inspect range of IPs for NTP DDOS vulnerability
IPRANGE=10.10.10.0/24
nmap -sU -pU:123 -Pn -n --script=ntp-monlist $IPRANGE | grep -B 4 ntp-monlist | grep report | awk '{ print $5 }'
@abdallah
abdallah / newdjango.sh
Last active January 22, 2016 15:09
Bash script to initialize new django project
#!/bin/bash
#
# Author: Abdallah Deeb <abdallah@deeb.me>
# Requirements: python, pip, virtualenv, virutalenvwrapper, git
#
# Edit the following 2 lines
PROJECTNAME=proj
APPNAME=myapp
if [ -n "$2" ]
then
@abdallah
abdallah / README.md
Created November 4, 2014 16:17
Check SSL for domain if SHA-1 or SHA-256

Suggested usage

Put certificates list in certs.txt and run:

awk '{ print $3 }' certs.txt | while read d; do bash check_sha256.sh $d 2>/dev/null; done | grep OK
@abdallah
abdallah / block_http1.0_ddos.sh
Created November 28, 2014 11:14
attacker using http 1.0 so that should block them but let everybody else in
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "HTTP/1.0" --algo bm -j DROP
@abdallah
abdallah / 00monit
Last active August 29, 2015 14:18
Monit configurations
files in /etc/monit/conf.d/
@abdallah
abdallah / other_languages_switcher.php
Last active September 9, 2015 11:04
WPML custom switcher to show "other" languages
<?php
function other_languages_switcher(){
$languages = icl_get_languages('skip_missing=1');
foreach($languages as $l){
if(!$l['active']) {
$langs[] = '<a href="'.$l['url'].'">'.$l['language_code'].'</a>';
}
}
echo join(', ', $langs);
}
@abdallah
abdallah / plugin.php
Created February 10, 2016 08:33
WordPress ajax skeleton
<?php
/*
Plugin Name: My Plugin
Plugin URI: https://deeb.me
Description: 10 ways to peel an orange
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}