Skip to content

Instantly share code, notes, and snippets.

@R3DHULK
Created February 4, 2023 17:06
Show Gist options
  • Save R3DHULK/c66dee19518867a333996688023850c5 to your computer and use it in GitHub Desktop.
Save R3DHULK/c66dee19518867a333996688023850c5 to your computer and use it in GitHub Desktop.
Osint In C Program
#include <stdio.h>
#include <curl/curl.h>
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {
size_t written = fwrite(ptr, size, nmemb, stream);
return written;
}
int main(void) {
CURL *curl;
FILE *fp;
CURLcode res;
char *url = "https://example.com";
char outfilename[FILENAME_MAX] = "example.html";
curl = curl_easy_init();
if (curl) {
fp = fopen(outfilename,"wb");
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
fclose(fp);
}
@R3DHULK
Copy link
Author

R3DHULK commented Feb 4, 2023

HELP ME
osint-in-c.c:2:10: fatal error: curl/curl.h: No such file or directory
2 | #include <curl/curl.h>
| ^~~~~~~~~~~~~
compilation terminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment