This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# auto detetion and blocking | |
# source of flooting ip adress | |
# | |
# by Aysad Kozanoglu | |
# email: aysadx@gmail.com | |
# | |
# manually unblock the blocked source ip: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# author: Aysad Kozanoglu | |
# email: aysadx@gmail.com | |
# | |
# QUICK USAGE: | |
# wget -O - "https://git.io/fAtyh" | bash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#author: Aysad Kozanoglu | |
#email: aysadx@gmail.com | |
# | |
# QUICK launch script | |
# wget -O - https://git.io/fhxNt | bash | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: Aysad Kozanoglu | |
# Dists: debian 9, 10 (stretch buster) | |
# ubuntu 18 and above | |
which apt-get && apt-get install -y --yes apt-mirror || apt install apt-mirror -y --yes | |
apt-mirror |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# file: rc-local.service | |
# author: Aysad Kozanoglu | |
# OS types: systemd | |
# | |
# Description | |
# ============ | |
# execute rc.local on boot startup | |
# systemd-rc-local-generator if /etc/rc.local is executable. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Aysad Kozanoglu | |
# Effectively restarting kvm/libvirt network | |
set -e | |
set -u | |
NET_NAME=default | |
# NET_HOOK=/etc/libvirt/hooks/qemu |