Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3aa29f
commit 6ed786f
Showing
79 changed files
with
1,218 additions
and
1,322 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/cmake-build-* | ||
.idea | ||
PKGBUILD | ||
.vscode |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef XERXES_VECTOR_H | ||
#define XERXES_VECTOR_H | ||
|
||
#include <memory> | ||
|
||
#include "config.h" | ||
|
||
class Vector { | ||
public: | ||
explicit Vector(std::shared_ptr<Config> config); | ||
virtual ~Vector() = default; | ||
virtual void run() = 0; | ||
|
||
protected: | ||
std::shared_ptr<Config> config; | ||
}; | ||
|
||
#endif // XERXES_VECTOR_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_ACK_FLOOD_H | ||
#define XERXES_ACK_FLOOD_H | ||
|
||
#include "spoofed_tcp_flood.h" | ||
|
||
class ack_flood : public spoofed_tcp_flood { | ||
|
||
public: | ||
explicit ack_flood(std::shared_ptr<Config> config); | ||
~ack_flood() override = default; | ||
|
||
protected: | ||
void finalize_hdr(tcphdr *tcp, iphdr *ip) override; | ||
}; | ||
|
||
#endif // XERXES_ACK_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef XERXES_BASE_FLOOD_H | ||
#define XERXES_BASE_FLOOD_H | ||
|
||
#include "Vector.h" | ||
#include "socket.h" | ||
#include <vector> | ||
|
||
class base_flood : public Vector { | ||
|
||
public: | ||
base_flood(std::shared_ptr<Config> config, int sock_type); | ||
~base_flood() override = default; | ||
void run() override; | ||
|
||
protected: | ||
virtual int gen_hdr(std::string &string); | ||
virtual void init_sockets(std::vector<std::unique_ptr<Socket>> &sockets); | ||
int sock_type{}; | ||
}; | ||
|
||
#endif // XERXES_BASE_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef XERXES_BASE_SPOOFED_FLOOD_H | ||
#define XERXES_BASE_SPOOFED_FLOOD_H | ||
|
||
#include "Vector.h" | ||
#include "rsocket.h" | ||
|
||
class base_spoofed_flood : public Vector { | ||
public: | ||
base_spoofed_flood(std::shared_ptr<Config> config, int protocol); | ||
~base_spoofed_flood() override = default; | ||
void run() override; | ||
|
||
protected: | ||
virtual char *gen_hdr(sockaddr_in *dst, int len) = 0; | ||
virtual void init_sockets(std::vector<std::unique_ptr<Rsocket>> &sockets); | ||
int proto{}; | ||
int hdr_len{}; | ||
}; | ||
|
||
#endif // XERXES_BASE_SPOOFED_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_BLACKNURSE_H | ||
#define XERXES_BLACKNURSE_H | ||
|
||
#include "icmp_flood.h" | ||
|
||
class blacknurse : public icmp_flood { | ||
|
||
public: | ||
explicit blacknurse(std::shared_ptr<Config> config); | ||
~blacknurse() override = default; | ||
|
||
protected: | ||
void finalize_hdr(icmphdr *icmp, iphdr *ip) override; | ||
}; | ||
|
||
#endif // XERXES_BLACKNURSE_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef XERXES_CONFIG_H | ||
#define XERXES_CONFIG_H | ||
|
||
#include <string> | ||
|
||
enum __Vector__ { | ||
NULL_TCP = 0, | ||
NULL_UDP, | ||
TCP_FLOOD, | ||
UDP_FLOOD, | ||
HTTP_FLOOD, | ||
ICMP_FLOOD, | ||
SYN_FLOOD, | ||
ACK_FLOOD, | ||
FIN_FLOOD, | ||
SPOOFED_UDP_FLOOD, | ||
TEARDROP, | ||
BLACKNURSE, | ||
LAND, | ||
SMURF | ||
}; | ||
|
||
struct Config { | ||
std::string rhost; | ||
std::string rport; | ||
std::string bcast; | ||
int vec; | ||
int trds; | ||
int conn; | ||
bool tls; | ||
bool rand_lhost; | ||
bool rand_lport; | ||
timespec time; | ||
}; | ||
|
||
#endif // XERXES_CONFIG_H |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_FIN_FLOOD_H | ||
#define XERXES_FIN_FLOOD_H | ||
|
||
#include "spoofed_tcp_flood.h" | ||
|
||
class fin_flood : public spoofed_tcp_flood { | ||
|
||
public: | ||
explicit fin_flood(std::shared_ptr<Config> config); | ||
~fin_flood() override = default; | ||
|
||
protected: | ||
void finalize_hdr(tcphdr *tcp, iphdr *ip) override; | ||
}; | ||
|
||
#endif // XERXES_FIN_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef XERXES_HTTP_H | ||
#define XERXES_HTTP_H | ||
|
||
#include "utils.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
struct httphdr { | ||
std::string method{}; | ||
std::string path{}; | ||
std::string useragent{}; | ||
std::string cache_control{}; | ||
std::string encoding{}; | ||
std::string charset[2]{}; | ||
std::string referer{}; | ||
std::string content_type{}; | ||
std::string cookie[2]{}; | ||
std::string connection_type{"Keep-Alive"}; | ||
std::string accept{"*/*"}; | ||
}; | ||
|
||
namespace http { | ||
|
||
namespace randomizer { | ||
|
||
void random_referer(std::string &src); | ||
|
||
void random_useragent(std::string &src); | ||
|
||
void random_encoding(std::string &src); | ||
|
||
void random_caching(std::string &src); | ||
|
||
void random_charset(std::string &src); | ||
|
||
void random_contenttype(std::string &src); | ||
|
||
void random_method(std::string &src); | ||
} // namespace randomizer | ||
|
||
void hdr_gen(httphdr &hdr, std::string &str); | ||
|
||
void load_usr(std::vector<std::string> &useragents); | ||
} // namespace http | ||
|
||
#endif // XERXES_HTTP_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef XERXES_HTTP_FLOOD_H | ||
#define XERXES_HTTP_FLOOD_H | ||
|
||
#include "tcp_flood.h" | ||
|
||
class http_flood : public tcp_flood { | ||
public: | ||
explicit http_flood(std::shared_ptr<Config> config); | ||
~http_flood() override = default; | ||
|
||
protected: | ||
int gen_hdr(std::string &string) override; | ||
}; | ||
|
||
#endif // XERXES_HTTP_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef XERXES_ICMP_FLOOD_H | ||
#define XERXES_ICMP_FLOOD_H | ||
|
||
#include "base_spoofed_flood.h" | ||
|
||
#include <netinet/ip.h> | ||
#include <netinet/ip_icmp.h> | ||
|
||
class icmp_flood : public base_spoofed_flood { | ||
|
||
public: | ||
explicit icmp_flood(std::shared_ptr<Config> config); | ||
~icmp_flood() override = default; | ||
|
||
protected: | ||
char *gen_hdr(sockaddr_in *dst, int len) override; | ||
virtual void init_hdr(icmphdr *icmp, iphdr *ip); | ||
virtual void finalize_hdr(icmphdr *icmp, iphdr *ip); | ||
}; | ||
|
||
#endif // XERXES_ICMP_FLOOD_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_LAND_H | ||
#define XERXES_LAND_H | ||
|
||
#include "spoofed_tcp_flood.h" | ||
|
||
class land : public spoofed_tcp_flood { | ||
|
||
public: | ||
explicit land(std::shared_ptr<Config> config); | ||
~land() override = default; | ||
|
||
protected: | ||
void finalize_hdr(tcphdr *tcp, iphdr *ip) override; | ||
}; | ||
|
||
#endif // XERXES_LAND_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_NULL_TCP_H | ||
#define XERXES_NULL_TCP_H | ||
|
||
#include "tcp_flood.h" | ||
|
||
class null_tcp : public tcp_flood { | ||
public: | ||
explicit null_tcp(std::shared_ptr<Config> config); | ||
|
||
~null_tcp() override = default; | ||
|
||
protected: | ||
int gen_hdr(std::string &string) override; | ||
}; | ||
|
||
#endif // XERXES_NULL_TCP_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_NULL_UDP_H | ||
#define XERXES_NULL_UDP_H | ||
|
||
#include "udp_flood.h" | ||
|
||
class null_udp : public udp_flood { | ||
public: | ||
explicit null_udp(std::shared_ptr<Config> config); | ||
|
||
~null_udp() override = default; | ||
|
||
protected: | ||
int gen_hdr(std::string &string) override; | ||
}; | ||
|
||
#endif // XERXES_NULL_UDP_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef XERXES_RSOCKET_H | ||
#define XERXES_RSOCKET_H | ||
|
||
#include <netdb.h> | ||
#include <string> | ||
#include <vector> | ||
|
||
class Rsocket { | ||
|
||
public: | ||
Rsocket(std::string host, std::string port, int proto); | ||
virtual ~Rsocket() = default; | ||
virtual ssize_t Write(const char *str, size_t len); | ||
virtual bool Open(); | ||
virtual bool Close(); | ||
virtual bool Alive(); | ||
sockaddr_in *GetDst(); | ||
|
||
protected: | ||
bool open(); | ||
bool close(); | ||
std::string rhost; | ||
std::string rport; | ||
int proto; | ||
int fd{}; | ||
sockaddr_in dst; | ||
}; | ||
|
||
#endif // XERXES_RSOCKET_H |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XERXES_SMURF_H | ||
#define XERXES_SMURF_H | ||
|
||
#include "icmp_flood.h" | ||
|
||
class smurf : public icmp_flood { | ||
|
||
public: | ||
explicit smurf(std::shared_ptr<Config> config); | ||
~smurf() override = default; | ||
|
||
protected: | ||
void finalize_hdr(icmphdr *icmp, iphdr *ip) override; | ||
}; | ||
|
||
#endif // XERXES_SMURF_H |
Oops, something went wrong.