Advertisement
Guest User

Untitled

a guest
May 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <sys/socket.h>
  5. #include <netinet/in.h>
  6. #include <arpa/inet.h>
  7.  
  8. #include "hacking.h"
  9.  
  10. int main(void) {
  11.     int i, recv_length, sockfd;
  12.  
  13.     u_char buffer[9000];
  14.  
  15.     if((sockfd = socket(PF_INET, SOCK_RAW, IPPROTO_TCP)) == -1)
  16.         fatal("in socket");
  17.  
  18.     for(i=0; i < 3; i++) {
  19.         recv_length = recv(sockfd, buffer, 8000, 0);
  20.         printf("Got a %d byte packet\n", recv_length);
  21.         dump(buffer, recv_length);
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement