-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmsrpc_fuzz.c
38 lines (31 loc) · 913 Bytes
/
msrpc_fuzz.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(int argc, char *argv[]) {
int sockfd;
struct sockaddr_in target;
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
}
memset(&target, 0, sizeof(target));
target.sin_family = AF_INET;
if (inet_aton(argv[1], &target.sin_addr) == 0) {
perror("inet_aton");
exit(1);
}
target.sin_port = htons(135);
if (connect(sockfd, (struct sockaddr *)&target, sizeof(target)) == -1) {
perror("connect");
exit(1);
}
printf("Connected to %s\n", inet_ntoa(target.sin_addr));
char buf[1024];
memset(&buf, 'A', 1024);
send(sockfd, buf, 1024, 0);
close(sockfd);
return 0;
}