Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
disable ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvar1984 committed Jun 12, 2020
1 parent 8f24e4d commit 124a75c
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 38 deletions.
Binary file modified build/main.phar
Binary file not shown.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
],
"require": {
"ext-curl": "*",
"ext-bz2": "*"
"ext-bz2": "*",
"campo/random-user-agent": "^1.3"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 11 additions & 7 deletions main.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

require __DIR__ . '/vendor/autoload.php';

use Cvar1984\LiteOtp\Otp;

if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
$app = new Otp;

if ($app->os != 'Linux') {
$R = '';
$RR = '';
$G = '';
Expand Down Expand Up @@ -33,12 +36,13 @@
|_____|_|\__\___|\___/ |_| |_|
$R++++++++++++++++++++++++++++++++++++++
$B Author : Cvar1984 $R
$B Github : https://github.com/Cvar1984$R
$B Team : BlackHole Security $R
$B Version : 2.0.7 $R
$B Date : 13-03-2018 $R
$R++++++++++++++++++++++++++++++++++++++$G$X
$B Author :$G $app->author
$B Github :$G $app->github
$B Team :$G $app->team
$B Version :$G $app->version
$B Date :$G $app->date
$B OS :$G $app->os
$R++++++++++++++++++++++++++++++++++++++$X
BANNER;
Expand Down
53 changes: 23 additions & 30 deletions src/Otp.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,58 @@

namespace Cvar1984\LiteOtp;

class Otp
class Otp extends Request
{
protected static function post($url, $data)
{
$ch = curl_init();
$ca = openssl_get_cert_locations();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, $ca['default_cert_file']);
curl_setopt($ch, CURLOPT_CAPATH, $ca['default_cert_file']);
$exec = curl_exec($ch);
curl_close($ch);
return $exec;
}
public $version = '2.0.8';
public $os = PHP_OS;
public $author = 'Cvar1984';
public $team = 'BlackHole Security';
public $date = '13-03-2018'; // date of birth
public $github = 'https://github.com/Cvar1984';

public static function tokopedia(int $no)
public static function tokopedia(int $no) : string
{
return self::post(
return self::request(
'https://www.tokocash.com/oauth/otp',
[
'msisdn' => $no,
'accept' => 'call'
]
],
'POST'
);
}
public static function jdid(int $no)
public static function jdid(int $no) : string
{
return self::post(
return self::request(
'https://sc.jd.id/phone/sendPhoneSms',
[
'phone' => $no,
'smsType' => '1'
]
],
'POST'
);
}
public static function phd(int $no)
public static function phd(int $no) : string
{
return self::post(
return self::request(
'https://www.phd.co.id/en/users/sendOTP',
[
'phone_number' => $no
]
],
'POST'
);
}
public static function pedulisehat(int $no)
public static function pedulisehat(int $no) : string
{
return self::post(
return self::request(
'https://passport.pedulisehat.id/v2/sms/captcha',
[
'mobile' => $no,
'mobile_country_code' => '62',
'channel' => 'WhatsApp',
'_' => 1691007074597
]
],
'POST'
);
}
}
36 changes: 36 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Cvar1984\LiteOtp;

abstract class Request
{
protected static function request(
string $url,
array $data,
string $method = 'GET',
bool $verbose = false
) : string
{
$ch = curl_init();
$ua = \Campo\UserAgent::random(
[
'device_type' => ['Tablet', 'Mobile']
]
);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //2
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, $verbose);
$exec = curl_exec($ch);
if (curl_errno($ch)) {
throw new \Exception(curl_error($ch));
}
curl_close($ch);
return $exec;
}
}

0 comments on commit 124a75c

Please sign in to comment.