Skip to content

Instantly share code, notes, and snippets.

View millken's full-sized avatar

millken

  • Changde,China
View GitHub Profile
@millken
millken / bpf.go
Created January 26, 2018 15:51 — forked from cjoudrey/bpf.go
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
)
func main() {
handle, err := pcap.OpenLive("en0", 1600, true, pcap.BlockForever)
@millken
millken / extensions.json
Last active September 17, 2020 10:54
VSCode's Settings - Syncing
[
{
"id": "azemoh.one-monokai",
"name": "one-monokai",
"publisher": "azemoh",
"version": "0.4.6"
},
{
"id": "be5invis.toml",
"name": "toml",
@millken
millken / udp-loader.go
Created September 26, 2017 01:56 — forked from jtblin/udp-loader.go
UDP server performance optimisation
package main
import (
"crypto/rand"
"flag"
"log"
mrand "math/rand"
"net"
"os"
"os/signal"
# Got from https://www.digitalocean.com/community/questions/how-to-install-pptp-vpn-on-centos-7 and changed new workable epel rpm url
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
yum -y install ppp pptpd
cp /etc/pptpd.conf /etc/pptpd.conf.bak
cat >/etc/pptpd.conf<<EOF
option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254
@millken
millken / install.sh
Created March 21, 2017 09:19 — forked from marklit/install.sh
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
@millken
millken / BotBuster.md
Created February 23, 2017 06:35 — forked from hsiboy/BotBuster.md
Bot-Buster™ - Tracks nefarious activity on website, and manages accordingly.

#Bot-Buster™

Tracks nefarious activity on website, and manages accordingly.

##It's probably a bot.

If the requesting entity:

  • declares its user-agent as being wget, curl, webcopier etc - it's probably a bot.
  • requests details -> details -> details -> details ad nauseum - it's probably a bot.
  • requests the html, but not .css, .js or site furniture - it's probably a bot.
@millken
millken / um.js
Last active November 30, 2016 09:03
//http://g.alicdn.com/security/umscript/3.3.2/um.js ////s.tbcdn.cn/g/security/umscript/3.3.2/um.js
/* 2016-08-25 16:32:12 */
!
function(e) {
function t(r) {
if (n[r]) return n[r].exports;
var a = n[r] = {
exports: {},
id: r,
loaded: !1
};
@millken
millken / centos7_init.sh
Last active November 30, 2016 02:34
centos7
#!/bin/bash
#base on https://javapipe.com/iptables-ddos-protection
platform=`uname -i`
if [ $platform != "x86_64" ];then
echo "this script is only for 64bit Operating System !"
exit 1
fi
echo "the platform is ok"
version=`cat /etc/redhat-release |awk '{print substr($4,1,1)}'`
if [ $version != 7 ];then
@millken
millken / gist:1a9f98ba073330476d5b9fc4ee6bc17c
Last active November 30, 2016 02:58
iptables 1.4.8 skill
limit icmp
````
iptables -A INPUT -p icmp --icmp-type echo-request -m recent --set
iptables -A INPUT -p icmp --icmp-type echo-request -m recent --update --seconds 3 --hitcount 2 -j DROP
````
and add to ipset blacklist
```
iptables -A INPUT -p icmp --icmp-type echo-request -m recent --update --seconds 3 --hitcount 2 -j SET --add-set blacklist src
```
null route
<html>
<body>
<input type="text" id="SpammersGoAwayCode" value="" />
<script>
var _0xea8f=["","\x6C\x65\x6E\x67\x74\x68","\x70\x75\x73\x68","\x63\x68\x61\x72\x43\x6F\x64\x65\x41\x74","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x73\x74\x61\x72\x74\x73\x57\x69\x74\x68","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x69\x6E\x64\x65\x78\x4F\x66","\x6E\x6F\x77","\x72\x61\x6E\x64\x6F\x6D","\x30\x30\x30\x30"];function sha1(_0xc386x2){var _0xc386x3=function(_0xc386x5,_0xc386xd){return _0xc386x5<<_0xc386xd|_0xc386x5>>>32-_0xc386xd;},_0xc386x4=function(_0xc386x5){var _0xc386xd=_0xea8f[0],_0xc386x2,_0xc386x6;for(_0xc386x2=7;0<=_0xc386x2;_0xc386x2--){_0xc386x6=_0xc386x5>>>4*_0xc386x2&15,_0xc386xd+=_0xc386x6.toString(16);};return _0xc386xd;},_0xc386x5,_0xc386x6,_0xc386x7=Array(80),_0xc386x8=1732584193,_0xc386x9=4023233417,_0xc386xa=2562383102,_0xc386xb=271733878,_0xc386xc=3285377520,_0xc386xd,_0xc386xe,_0xc386xf,_0xc386x10,_0xc386x11;_0xc386x2=unescape(encodeURIComponent(_0xc386x2));_0xc3