2022-07-07 16:52:24 +08:00
|
|
|
#ifndef RHOST_H
|
|
|
|
#define RHOST_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <curl/curl.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#define CENTOS_SYSTEM 1
|
|
|
|
#define DEBISN_SYSTEM 2
|
|
|
|
#define UNKNOWN_SYSTEM 3
|
|
|
|
|
|
|
|
#define BUFFER 1024
|
|
|
|
#define LONG_BUFFER 1024*100
|
|
|
|
|
|
|
|
#define AWK " | awk -v num=%d '{a[$1]+=1;} END {for(i in a){if (a[i] >= num) {print i;}}}' "
|
|
|
|
#define GE_10 "grep -E \"^$(LC_ALL=\"C\" date \"+%h\").$(LC_ALL=\"C\" date \"+%d\")\" /var/log/auth.log | grep failure | grep rhost"
|
|
|
|
#define LE_10 "grep -E \"^$(LC_ALL=\"C\" date \"+%h\")..$(LC_ALL=\"C\" date | awk '{print $3}')\" /var/log/auth.log | grep failure | grep rhost"
|
|
|
|
|
|
|
|
#define CENTOS_GE_10 "grep -E \"^$(LC_ALL=\"C\" date \"+%h\").$(LC_ALL=\"C\" date \"+%d\")\" /var/log/secure | grep failure | grep rhost"
|
|
|
|
#define CENTOS_LE_10 "grep -E \"^$(LC_ALL=\"C\" date \"+%h\")..$(LC_ALL=\"C\" date | awk '{print $3}')\" /var/log/secure | grep failure | grep rhost"
|
|
|
|
|
|
|
|
#define IPTABLES "`which iptables` -t filter -I INPUT -s %s -j DROP"
|
|
|
|
#define IPTABLES_CHECK "`which iptables` -t filter -C INPUT -s %s -j DROP 2> /dev/null"
|
|
|
|
|
2022-09-29 13:45:29 +08:00
|
|
|
#define QQMAIL "email -r %s -s \"System ban IP\" -t \"%s\""
|
2022-07-07 16:52:24 +08:00
|
|
|
|
2022-09-29 14:45:29 +08:00
|
|
|
extern void read_conf(char *filename, conf * configure);
|
2022-07-07 16:52:24 +08:00
|
|
|
extern void free_conf(conf * conf);
|
2022-09-29 14:45:29 +08:00
|
|
|
extern void ptintf_conf(conf * conf);
|
2022-07-07 16:52:24 +08:00
|
|
|
|
2022-09-29 14:45:29 +08:00
|
|
|
#endif
|