Skip to content

Instantly share code, notes, and snippets.

View tuklusan's full-sized avatar
💭
trading heroes for ghosts.

Supratim Sanyal tuklusan

💭
trading heroes for ghosts.
View GitHub Profile
#!/bin/sh
#
# httpd410server Start/Stop the httpd410server daemon.
#
# chkconfig: 2345 90 60
# description: httpd410server is a minimal http server to ALWAYS return HTTP 410 (Gone)
# to client URI requests. It can thus be used as a fallback server for
# DNS redirected blacklist implementations using dnsmasq, dansguardian etc.
# and malware / attack domain lists like from emerging threats,
# yoyo etc.
# /etc/profile.d/custom.sh - get a fortune-cowsay message on logging in
if [[ $(which cowsay > /dev/null ; echo $?) -eq 0 ]] && [[ $(which fortune > /dev/null ; echo $?) -eq 0 ]] ; then
cowsay -f $(ls $(cowsay -l | awk 'NR==1 {print $4}' | sed 's/://') | shuf -n1) $(fortune)
echo
fi
@tuklusan
tuklusan / messages
Last active September 16, 2016 05:10
Sep 16 04:25:40 anubis-clearos /usr/local/bin/httpd410server[25758]: /usr/local/bin/httpd410server starting up
Sep 16 04:25:40 anubis-clearos /usr/local/bin/httpd410server[25758]: setgid to [99] ok
Sep 16 04:25:40 anubis-clearos /usr/local/bin/httpd410server[25758]: setuid to [99] ok
Sep 16 04:25:40 anubis-clearos /usr/local/bin/httpd410server[25758]: HTTP listen FD: 4
Sep 16 04:25:40 anubis-clearos /usr/local/bin/httpd410server[25758]: HTTPS listen FD: 5
Sep 16 04:25:41 anubis-clearos /usr/local/bin/httpd410server[25758]: HTTP connection on FD 4
Sep 16 04:25:41 anubis-clearos /usr/local/bin/httpd410server[25758]: HTTP connection on FD 4
Sep 16 04:25:41 anubis-clearos /usr/local/bin/httpd410server[25758]: connection_handler[1]: starting
Sep 16 04:25:41 anubis-clearos /usr/local/bin/httpd410server[25758]: HTTP connection on FD 4
Sep 16 04:25:41 anubis-clearos /usr/local/bin/httpd410server[25758]: connection_handler[1]: accept ok server FD 4 on client FD 6
@tuklusan
tuklusan / jail.local
Last active September 22, 2016 12:36
Configure intrusion attempts to CentOS 7 server using fail2ban with reporting to blocklist.de - described at http://supratim-sanyal.blogspot.com/2016/09/fail2ban-for-centos-7-with-ip-and.html
#
#/etc/fail2ban/jail.local
#
[DEFAULT]
banaction = iptables-ipset-proto4
# Whitelist private IPs, blocklist.de IPs and Uptime Robot IPs
ignoreip = 127.0.0.1/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 89.149.254.157 89.149.237.105 89.149.242.40 80.67.29.225 80.67.16.214 78.46.95.41 89.149.201.23 85.181.13.140 178.63.159.40 78.46.91.247 78.46.91.239 69.162.124.226 69.162.124.227 69.162.124.228 69.162.124.229 69.162.124.230 69.162.124.231 69.162.124.232 69.162.124.233 69.162.124.234 69.162.124.235 69.162.124.236 69.162.124.237 69.162.124.238 46.137.190.132 122.248.234.23 188.226.183.141 178.62.52.237 54.79.28.129 54.94.142.218 104.131.107.63 54.67.10.127 54.64.67.106 159.203.30.41 46.101.250.135 108.31.82.24
@tuklusan
tuklusan / httpd410server.c
Last active September 22, 2016 15:42
Complete discussion about this program is in my blog entry at http://supratim-sanyal.blogspot.com/2016/07/httpd410server-tiny-free-web-server-to.html - httpd410server: A TINY FREE WEB SERVER TO ALWAYS RETURN HTTP ERROR LOCALLY FOR DNS BLACKLIST REDIRECTION AND LOGGING
/* +++
Supratim Sanyal's Brain Damaged web server
- ALWAYS RETURNS HTTP 410 (GONE) TO THE CLIENT -
- USE FOR DNS REDIRECTED MALWARE AD BLOCKER BLACKLIST IMPLEMENTATIONS
- Listens on ports http port 80 and https port 443
-
- To build: gcc -o httpd410server -lpthread httpd410server.c
-
- See http://supratim-sanyal.blogspot.com/2016/07/httpd410server-tiny-free-web-server-to.html for details
- I can be reached at http://mcaf.ee/sdlg9f
@tuklusan
tuklusan / mail-whois-common.local
Created September 22, 2016 16:02
Fail2Ban Intrusion Prevention on Solaris 11 OPENINDIANA SunOS 5.11 Illumos with Reporting to Blocklist.de: http://supratim-sanyal.blogspot.com/2016/09/fail2ban-intrusion-prevention-on.html
# /etc/fail2ban/action.d/mail-whois-common.local
# solaris 11 openindiana
# See http://supratim-sanyal.blogspot.com/2016/09/fail2ban-intrusion-prevention-on.html for details
[DEFAULT]
_whois = whois n <ip> || echo "missing whois program"
@tuklusan
tuklusan / default.vcl
Last active September 24, 2016 17:08
/etc/varnish/default.vcl - Varnish 4 Working Simple Basic default.vcl | Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache - http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
# --
# /etc/varnish/default.vcl
# Minimal working Varnish 4.0 Configuration to serve static-only website pages from lighttpd backend
# From "Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache"
# http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
# --
vcl 4.0;
backend default {
@tuklusan
tuklusan / varnish.params
Created September 24, 2016 17:19
/etc/varnish/varnish.params - Varnish 4 Working Simple Basic varnish.params | Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache - http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
# --
# /etc/varnish/varnish.params
# Minimal working Varnish 4.0 Configuration to serve static-only website pages from lighttpd backend
# From "Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache"
# http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
# --
# Varnish environment configuration description. This was derived from
# the old style sysconfig/defaults settings
# Set this to 1 to make systemd reload try to switch vcl without restart.
@tuklusan
tuklusan / lighttpd.conf
Created September 24, 2016 18:53
/etc/lighttpd/lighttpd.conf - VARNISH 4 Working Simple Basic Configuration with LIGHTTPD | Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache - http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
#######################################################################
##
## /etc/lighttpd/lighttpd.conf
## Minimal working Varnish 4.0 Configuration to serve static-only website pages from lighttpd backend
## From "Simple Basic Working VARNISH 4.0 Configuration: default.vcl and varnish.params for a functional web server cache"
## http://supratim-sanyal.blogspot.com/2016/09/simple-basic-working-varnish-40.html
##
## check /etc/lighttpd/conf.d/*.conf for the configuration of modules.
##
#######################################################################
@tuklusan
tuklusan / global_prefs.xml
Created September 26, 2016 17:46
The Definitive How-To for BOINC with SETI@HOME on Fedora / CentOS / RedHat Linux (x64 / x86): http://supratim-sanyal.blogspot.com/2016/09/the-definitive-how-to-for-boinc-with.html
<global_preferences>
<source_project>http://setiathome.berkeley.edu/</source_project>
<source_scheduler>http://setiboinc.ssl.berkeley.edu/sah_cgi/cgi</source_scheduler>
<mod_time>1337766618</mod_time>
<run_on_batteries>1</run_on_batteries>
<run_if_user_active>0</run_if_user_active>
<run_gpu_if_user_active>1</run_gpu_if_user_active>
<idle_time_to_run>15</idle_time_to_run>
<suspend_if_no_recent_input>0</suspend_if_no_recent_input>