Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
free 4 ever

Aysad Kozanoglu AysadKozanoglu

💭
free 4 ever
View GitHub Profile
@AysadKozanoglu
AysadKozanoglu / sysctl.conf
Created Apr 10, 2016
high secure & perfornce debian sysctl.conf setting - debian sysctl yüksek güven ve performans ayarlari
View sysctl.conf
# Kernel sysctl configuration file for Linux
# Version 1.11 - 2015-07-07
# Aysad Kozanoglu Aysad K.
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
#
# Tested with: Ubuntu 14.04 LTS kernel version 3.13
@AysadKozanoglu
AysadKozanoglu / iptable-script.sh
Last active Feb 28, 2020
iptable script enable http https ssh 222001 postfix&dovecot imp
View iptable-script.sh
#!/bin/sh
IPT="/sbin/iptables"
# Flush old rules, old custom tables
$IPT --flush
$IPT --delete-chain
@AysadKozanoglu
AysadKozanoglu / nginx-rate_limit_flood_protect.conf
Last active Feb 28, 2020
request flood protection rate limiting nginx
View nginx-rate_limit_flood_protect.conf
# To enable rate limiting simply add the following line to the top-level of your config file:
# 1 request / second
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
# Then apply it to a location by adding a rate limiting burst to your server block:
location /account/login/ {
# apply rate limiting
limit_req zone=login burst=5;
View befehle-liste
// kill ip connection
tcpkill host <ip>
//get concurrency connection per ip
netstat -atun | awk '{print $5}' | cut -d: -f1 | sed -e '/^$/d' |sort | uniq -c | sort -n
// shell simultanously connection simulate
for i in {0..60}; do (curl -Is http://46.101.214.181:10101 | head -n1 &) 2>/dev/null; sleep 1; done;
//ip from hostname domain
@AysadKozanoglu
AysadKozanoglu / iptables_autoBlock_Ddos-flooting.sh
Last active Feb 28, 2020
get the informations with netstat and and see of count of connetion per ip and if the limit is reached block it in ipatbles
View iptables_autoBlock_Ddos-flooting.sh
#!/bin/bash
#
# auto detetion and blocking
# source of flooting ip adress
#
# by Aysad Kozanoglu
# email: aysadx@gmail.com
#
# manually unblock the blocked source ip:
#
@AysadKozanoglu
AysadKozanoglu / netWatch_ddos.sh
Last active Feb 28, 2020
display all connection by counting the connection per ip address
View netWatch_ddos.sh
#! /bin/sh
# author: Aysad Kozanoglu
# email: aysadx@gmail.com
#
# QUICK USAGE:
# wget -O - "https://git.io/fAtyh" | bash
View ddos detection methods
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@AysadKozanoglu
AysadKozanoglu / .ssh-agent_bashrc
Created Feb 24, 2020
Sharing the same `ssh-agent` among multiple login sessions
View .ssh-agent_bashrc
# put the following code to your .bashrc
# Sharing the same `ssh-agent` among multiple login sessions
SSH_ENV=$HOME/.ssh/environment
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
View bashrc_template.sh
#
# aurhor: Aysad Kozanoglu
# email: aysadx@gmail.com
#
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
View php7.2 install debian_jessie
#!/bin/sh
#author: Aysad Kozanoglu
#email: aysadx@gmail.com
#
# QUICK launch script
# wget -O - https://git.io/fhxNt | bash
#