-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodem
654 lines (653 loc) · 29 KB
/
modem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
#!/bin/bash
#IP Hunter by Chewy Mage
#Github https://github.com/Haris131/e3372
clear
human_print(){
while read B dummy; do
[ $B -lt 1024 ] && echo ${B} B && break
KB=$(((B+512)/1024))
[ $KB -lt 1024 ] && echo ${KB} KB && break
MB=$(((KB+512)/1024))
[ $MB -lt 1024 ] && echo ${MB} MB && break
GB=$(((MB+512)/1024))
[ $GB -lt 1024 ] && echo ${GB} GB && break
echo $(((GB+512)/1024)) terabytes
done
}
service(){
case $1 in
"00")
echo -e "Auto"
;;
"03")
echo -e "4G Only"
;;
esac
}
network() {
case $1 in
"0")
echo -e 'No service'
;;
"1")
echo -e 'GSM (2G)'
;;
"2")
echo -e 'GPRS (2G)'
;;
"3")
echo -e 'EDGE (2G)'
;;
"21")
echo -e 'IS95A'
;;
"22")
echo -e 'IS95B'
;;
"23")
echo -e 'CDMA 1X'
;;
"24")
echo -e 'EVDO rev.0'
;;
"25")
echo -e 'EVDO rev.A'
;;
"26")
echo -e 'EVDO rev.B'
;;
"27")
echo -e 'HYBRID CDMA 1X'
;;
"28")
echo -e 'HYBRID EVDO rev.0'
;;
"29")
echo -e 'HYBRID EVDO rev.A'
;;
"30")
echo -e 'HYBRID EVDO rev.B'
;;
"31")
echo -e 'eHRPD rel.0'
;;
"32")
echo -e 'eHRPD rel.A'
;;
"33")
echo -e 'eHRPD rel.B'
;;
"34")
echo -e 'HYBRID eHRPD rel.0'
;;
"35")
echo -e 'HYBRID eHRPD rel.A'
;;
"36")
echo -e 'HYBRID eHRPD rel.B'
;;
"41")
echo -e 'UMTS (3G)'
;;
"42")
echo -e 'HSDPA (3G)'
;;
"43")
echo -e 'HSUPA (3G)'
;;
"44")
echo -e 'HSPA (3G)'
;;
"45")
echo -e 'HSPA+ (3.5G)'
;;
"46")
echo -e 'DC-HSPA+ (3.5G)'
;;
"61")
echo -e 'TD-SCDMA (3G)'
;;
"62")
echo -e 'TD-HSDPA (3G)'
;;
"63")
echo -e 'TD-HSUPA (3G)'
;;
"64")
echo -e 'TD-HSPA (3G)'
;;
"65")
echo -e 'TD-HSPA+ (3.5G)'
;;
"81")
echo -e '802.16E'
;;
"101")
echo -e 'LTE (4G)'
;;
"1011")
echo -e 'LTE CA (4G+)'
;;
"111")
echo -e 'NR (5G)'
;;
esac
}
pilih(){
while true; do
read -p "Mode IP Hunter or Manual (y/n) ? " ymn
clear
case $ymn in
[Yy]* )
read -p "IP Hunter (ex: 10.22;10.11) : " cari
c=0
while [[ $c -le $(echo $cari|awk -F ";" '{print NF-1}') ]]; do
b=$(echo $cari|awk -F ";" -v x=$(($c+1)) '{print $x}')
if [[ $b =~ ^[0-9]+$ ]] || [[ $b =~ ^[0-9]+\.[0-9]+$ ]] || [[ $b =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || [[ $b =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo -n ""
else
exit
fi
((c++))
done
break
;;
[Nn]* )
read -p "Masukkan Bug (ex: bug1;bug2;bug3 max 10 bug): " list
read -p "Masukkan Secret Openclash: " auth
break
;;
* )
echo -e "Please answer yes or no."
exit
;;
esac
done
}
ipmod(){
while true; do
case $1 in
[Yy]* )
yn="y"
;;
* )
echo -e "---- Menu ----"
echo -e "Y or y : Auto Detect IP Modem"
echo -e "N or n : Manual Input IP Modem"
read -p "Enter Choice : " yn
;;
esac
clear
case $yn in
[Yy]* )
ipmodem=$(route -n|awk '{print $2}'|grep 192.168|head -n1)
if [[ $ipmodem =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo -n ""
else
echo -e "IP Modem Tidak Ditemukan";exit
fi
break
;;
[Nn]* )
read -p "IP MODEM : " ipmodem
if [[ $ipmodem =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo -n ""
else
echo -e "IP Modem Tidak Ditemukan";exit
fi
break
;;
* )
echo -e "Please answer yes or no."
exit
;;
esac
done
}
bughunter(){
c=0
while [[ $c -le $(echo $list|awk -F ";" '{print NF-1}') ]]; do
bug=$(echo $list|awk -F ";" -v x=$(($c+1)) '{print $x}')
cek=$(curl -m10 -s --interface eth1 -I --insecure $bug|grep Server|cut -d' ' -f2-2)
if [ $(echo $cek|grep cloudflare) ]; then
echo -e "Bug $bug = $cek"
ms=$(timeout 10 ping -c 1 -I eth1 $bug|awk "NR==2"|awk -F 'time=' '{print $2}'|awk -F. '{print $1}')
if [ -f $ms ]; then
ms=999999
fi
echo -e "Ping: $ms ms"
if [ $c = "0" ]; then
echo $ms > /tmp/pingbug
echo $bug > /tmp/bugping
else
echo $ms >> /tmp/pingbug
echo $bug >> /tmp/bugping
fi
fi
((c++))
done
satu=$(cat /tmp/pingbug|awk "NR==1")
dua=$(cat /tmp/pingbug|awk "NR==2")
tiga=$(cat /tmp/pingbug|awk "NR==3")
empat=$(cat /tmp/pingbug|awk "NR==4")
lima=$(cat /tmp/pingbug|awk "NR==5")
enam=$(cat /tmp/pingbug|awk "NR==6")
tujuh=$(cat /tmp/pingbug|awk "NR==7")
delapan=$(cat /tmp/pingbug|awk "NR==8")
sembilan=$(cat /tmp/pingbug|awk "NR==9")
sepuluh=$(cat /tmp/pingbug|awk "NR==10")
if [ $satu -lt $dua ]; then
ms=$satu;bug=$(cat /tmp/bugping|awk "NR==1")
else
ms=$dua;bug=$(cat /tmp/bugping|awk "NR==2")
fi
if [ $tiga ]; then
if [ $tiga -lt $ms ]; then
ms=$tiga;bug=$(cat /tmp/bugping|awk "NR==3")
else
ms=$ms;bug=$bug
fi
fi
if [ $empat ]; then
if [ $empat -lt $ms ]; then
ms=$empat;bug=$(cat /tmp/bugping|awk "NR==4")
else
ms=$ms;bug=$bug
fi
fi
if [ $lima ]; then
if [ $lima -lt $ms ]; then
ms=$lima;bug=$(cat /tmp/bugping|awk "NR==5")
else
ms=$ms;bug=$bug
fi
fi
if [ $enam ]; then
if [ $enam -lt $ms ]; then
ms=$enam;bug=$(cat /tmp/bugping|awk "NR==6")
else
ms=$ms;bug=$bug
fi
fi
if [ $tujuh ]; then
if [ $tujuh -lt $ms ]; then
ms=$tujuh;bug=$(cat /tmp/bugping|awk "NR==7")
else
ms=$ms;bug=$bug
fi
fi
if [ $delapan ]; then
if [ $delapan -lt $ms ]; then
ms=$delapan;bug=$(cat /tmp/bugping|awk "NR==8")
else
ms=$ms;bug=$bug
fi
fi
if [ $sembilan ]; then
if [ $sembilan -lt $ms ]; then
ms=$sembilan;bug=$(cat /tmp/bugping|awk "NR==9")
else
ms=$ms;bug=$bug
fi
fi
if [ $sepuluh ]; then
if [ $sepuluh -lt $ms ]; then
ms=$sepuluh;bug=$(cat /tmp/bugping|awk "NR==10")
else
ms=$ms;bug=$bug
fi
fi
echo -e "---------------------------"
if [ $ms ]; then
echo "IP Ditemukan : $ipp";
echo "Bug: $bug dipilih"
echo "Ping: $ms ms"
find=$(cat /etc/openclash/proxy_provider/universal.yaml | grep "server: " |awk '{print $2}'|head -n1)
sed -i "s/server: $find/server: $bug/g" /etc/openclash/proxy_provider/universal.yaml
sleep 1
upd=$(curl -s http://0.0.0.0:9090/proxies -H "Host: 0.0.0.0:9090" -H "Connection: keep-alive" -H "Authorization: Bearer $auth" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/json" -H "Accept: */*" -H "Origin: http://0.0.0.0" -H "Referer: http://0.0.0.0/" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: id,en-US;q=0.9,en;q=0.8,zh-CN;q=0.7,zh;q=0.6")
ate=$(curl -s http://0.0.0.0:9090/providers/proxies -H "Host: 0.0.0.0:9090" -H "Connection: keep-alive" -H "Authorization: Bearer $auth" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/json" -H "Accept: */*" -H "Origin: http://0.0.0.0" -H "Referer: http://0.0.0.0/" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: id,en-US;q=0.9,en;q=0.8,zh-CN;q=0.7,zh;q=0.6")
co=$(echo $ate|awk -F ':\\{"name":"' '{print NF}')
for ((i=0;i<$co;i++)); do
tt=$(echo $ate|awk -F '\\{"name":"' -v a=$i '{print $a}'|awk -F '","proxies"' '{print $1}')
if [ -f $(echo $tt|grep '"') ]; then
upe=$(curl -X PUT -s http://0.0.0.0:9090/providers/proxies/$tt -H "Host: 0.0.0.0:9090" -H "Connection: keep-alive" -H "Authorization: Bearer $auth" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/json" -H "Accept: */*" -H "Origin: http://0.0.0.0" -H "Referer: http://0.0.0.0/" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: id,en-US;q=0.9,en;q=0.8,zh-CN;q=0.7,zh;q=0.6" -w "%{http_code}")
sleep 1
health=$(curl -X OPTIONS -s http://0.0.0.0:9090/providers/proxies/$tt/healthcheck -H "Host: 0.0.0.0:9090" -H "Connection: keep-alive" -H "Accept: */*" -H "Access-Control-Request-Method: GET" -H "Access-Control-Request-Headers: authorization,content-type" -H "Origin: http://0.0.0.0" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Sec-Fetch-Mode: cors" -H "Referer: http://0.0.0.0/" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: id,en-US;q=0.9,en;q=0.8,zh-CN;q=0.7,zh;q=0.6" -w "%{http_code}")
sleep 1
fi
done
echo -e "---------------------------"
exit
fi
}
login(){
echo -e "---------------------------"
read -p "Password Login: " pass
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
check=$(curl -s http://$ipmodem/api/user/state-login -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
state=$(echo $check|awk -F "<State>" '{print $2}'|awk -F "</State>" '{print $1}')
type=$(echo $check|awk -F "<password_type>" '{print $2}'|awk -F "</password_type>" '{print $1}')
if [ $state = "0" ]; then
echo "Activated Successfully";
else
if [ $type = "4" ]; then
pass1=$(echo -n "$pass"|sha256sum|head -c 64|base64 -w 0)
pass1=$(echo -n "admin$pass1$token"|sha256sum|head -c 64|base64 -w 0)
pass1=$(echo -n "$pass1</Password><password_type>4</password_type>")
else
pass1=$(echo -n "$pass"|base64 -w 0)
pass1=$(echo -n "$pass1</Password>")
fi
login=$(curl -s -D- -o/dev/null -X POST http://$ipmodem/api/user/login -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "Origin: http://$ipmodem" -H "X-Requested-With: XMLHttpRequest" -H "__RequestVerificationToken: $token" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi" -d '<?xml version="1.0" encoding="UTF-8"?><request><Username>admin</Username><Password>'$pass1'</request>')
scoki=$(echo "$login"|grep [Ss]et-[Cc]ookie|cut -d':' -f2|cut -b 1-138)
if [ $scoki ]; then
echo -e "Login Success"
else
echo -e "Login Failed"
exit
fi
fi
}
info(){
clear
ipmod $1
login
clear
echo -e "---------------------------"
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $scoki")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
oper=$(curl -s http://$ipmodem/api/net/current-plmn -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
operator=$(echo $oper|awk -F "<FullName>" '{print $2}'|awk -F "</FullName>" '{print $1}')
echo -e "Operator : $operator"
ip=$(curl -s http://$ipmodem/api/device/information -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
ipp=$(echo $ip|awk -F "<WanIPAddress>" '{print $2}'|awk -F "</WanIPAddress>" '{print $1}')
tp=$(echo $ip|awk -F "<DeviceName>" '{print $2}'|awk -F "</DeviceName>" '{print $1}')
echo -e "Device : $tp"
echo -e "Wan IP : $ipp"
dns=$(curl -s http://$ipmodem/api/monitoring/status -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
dns1=$(echo $dns|awk -F "<PrimaryDns>" '{print $2}'|awk -F "</PrimaryDns>" '{print $1}')
dns2=$(echo $dns|awk -F "<SecondaryDns>" '{print $2}'|awk -F "</SecondaryDns>" '{print $1}')
net=$(echo $dns|awk -F "<CurrentNetworkTypeEx>" '{print $2}'|awk -F "</CurrentNetworkTypeEx>" '{print $1}')
echo -e "DNS 1 : $dns1"
echo -e "DNS 2 : $dns2"
echo -ne "Network : ";network $net
td=$(curl -s http://$ipmodem/api/monitoring/traffic-statistics -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
tup=$(echo $td|awk -F "<TotalUpload>" '{print $2}'|awk -F "</TotalUpload>" '{print $1}'|human_print)
tdd=$(echo $td|awk -F "<TotalDownload>" '{print $2}'|awk -F "</TotalDownload>" '{print $1}'|human_print)
echo -e "Total Upload : $tup"
echo -e "Total Download : $tdd"
echo -e "---------------------------"
par=$(curl -s http://$ipmodem/config/deviceinformation/add_param.xml -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
band=$(echo $par|awk -F "<band>" '{print $2}'|awk -F "</band>" '{print $1}')
dlfreq=$(echo $par|awk -F "<freq1>" '{print $2}'|awk -F "</freq1>" '{print $1}')
upfreq=$(echo $par|awk -F "<freq2>" '{print $2}'|awk -F "</freq2>" '{print $1}')
echo -e "Band : $band"
dvi=$(curl -s http://$ipmodem/api/device/signal -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
pci=$(echo $dvi|awk -F "<pci>" '{print $2}'|awk -F "</pci>" '{print $1}')
cellid=$(echo $dvi|awk -F "<cell_id>" '{print $2}'|awk -F "</cell_id>" '{print $1}')
echo -e "PCI : $pci"
echo -e "Cell ID : $cellid"
echo -e "DL Frequency : $dlfreq"
echo -e "UP Frequency : $upfreq"
echo -e "---------------------------"
}
iphunter(){
pilih
clear
ipmod
login
clear
while true; do
echo -e "---------------------------"
# Ganti Mode Jaringan 4G Only or Auto
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $scoki")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
grs=$(curl -s http://$ipmodem/api/net/net-mode -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
srg=$(echo $grs|awk -F "<NetworkMode>" '{print $2}'|awk -F "</NetworkMode>" '{print $1}')
echo -n "Check Service : ";service $srg
case $srg in
"00")
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $scoki")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
forgonly=$(curl -s -X POST http://$ipmodem/api/net/net-mode -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Content-Length: 158" -H "Accept: */*" -H "Origin: http://$ipmodem" -H "X-Requested-With: XMLHttpRequest" -H "__RequestVerificationToken: $token" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi" -d '<?xml version="1.0" encoding="UTF-8"?><response><NetworkMode>03</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></response>')
forg=$(echo $forgonly|awk -F "<response>" '{print $2}'|awk -F "</response>" '{print $1}')
echo "Set 4G Only : $forg"
sleep 1
grs=$(curl -s http://$ipmodem/api/net/net-mode -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
srg=$(echo $grs|awk -F "<NetworkMode>" '{print $2}'|awk -F "</NetworkMode>" '{print $1}')
echo -n "Service : ";service $srg
;;
"03")
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $scoki")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
auto=$(curl -s -X POST http://$ipmodem/api/net/net-mode -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Content-Length: 158" -H "Accept: */*" -H "Origin: http://$ipmodem" -H "X-Requested-With: XMLHttpRequest" -H "__RequestVerificationToken: $token" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi" -d '<?xml version="1.0" encoding="UTF-8"?><response><NetworkMode>00</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></response>')
uto=$(echo $auto|awk -F "<response>" '{print $2}'|awk -F "</response>" '{print $1}')
echo -e "Set Auto : $uto"
sleep 1
res=$(curl -s http://$ipmodem/api/net/net-mode -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
ser=$(echo $res|awk -F "<NetworkMode>" '{print $2}'|awk -F "</NetworkMode>" '{print $1}')
echo -n "Service : ";service $ser
;;
esac
sleep 1
echo -e "---------------------------"
oper=$(curl -s http://$ipmodem/api/net/current-plmn -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
operator=$(echo $oper|awk -F "<FullName>" '{print $2}'|awk -F "</FullName>" '{print $1}')
echo -ne "Operator : $operator"
par=$(curl -s http://$ipmodem/config/deviceinformation/add_param.xml -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
band=$(echo $par|awk -F "<band>" '{print $2}'|awk -F "</band>" '{print $1}')
echo -e " | B$band"
ip=$(curl -s http://$ipmodem/api/device/information -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi")
ipp=$(echo $ip|awk -F "<WanIPAddress>" '{print $2}'|awk -F "</WanIPAddress>" '{print $1}')
tp=$(echo $ip|awk -F "<DeviceName>" '{print $2}'|awk -F "</DeviceName>" '{print $1}')
echo -e "Device : $tp"
echo -e "Wan IP : $ipp"
echo -e "---------------------------"
# IP Hunter or Manual
case $ymn in
[Yy]* )
c=0
while [[ $c -le $(echo $cari|awk -F ";" '{print NF-1}') ]]; do
b=$(echo $cari|awk -F ";" -v x=$(($c+1)) '{print $x}')
if [ $(echo $ipp|grep $b) ]; then
echo "IP Ditemukan : $ipp";exit
fi
((c++))
done
;;
[Nn]* )
bughunter
#echo -e "";echo -n "Reconnect Lagi (PRESS ENTER) !? ";read x
;;
esac
sleep 2
done
}
restart() {
clear
ipmod
login
clear
# cookie
data=$(curl -s http://$ipmodem/api/webserver/SesTokInfo -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $scoki")
sesi=$(echo "$data" | grep "SessionID=" | cut -b 10-147)
token=$(echo "$data" | grep "TokInfo" | cut -b 10-41)
# restart modem
res=$(curl -s -X POST http://$ipmodem/api/device/control -H "Host: $ipmodem" -H "Connection: keep-alive" -H "Accept: */*" -H "Origin: http://$ipmodem" -H "X-Requested-With: XMLHttpRequest" -H "__RequestVerificationToken: $token" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://$ipmodem/html/home.html" -H "Accept-Encoding: gzib, deflate" -H "Accept-Language: id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7" -H "Cookie: $sesi" -d '<?xml version="1.0" encoding="UTF-8"?><request><Control>1</Control></request>')
ress=$(echo $res|awk -F "<response>" '{print $2}'|awk -F "</response>" '{print $1}')
if [ "$ress" = "OK" ]; then
echo -e "Rebooting..."
else
echo -e "Reboot Error"
fi
}
lock() {
clear
ipmod
clear
echo -e "---------------------------"
echo -e "Connecting to $ipmodem"
sleep 1
adb kill-server > /dev/null 2>&1
adb connect "$ipmodem" > /dev/null 2>&1
sleep 2
cek=$(adb devices -l|grep $ipmodem:5555|awk -F ":" '{print $1}')
if [ "$cek" = "$ipmodem" ]; then
echo -e "Device connected!"
sleep 1
else
echo -e "Device not connected!"
sleep 1
echo -e "Press enter to back in menu..."
read
lock
fi
echo -e "---------------------------"
read -p "BAND : " band
read -p "PCI : " pci
read -p "DL Frequency : " dlfreq
echo -e "---------------------------"
bandx=$(printf "%X" $band)
if [ "${#bandx}" = "8" ]; then
bandx="$bandx"
elif [ "${#bandx}" = "7" ]; then
bandx="0$bandx"
elif [ "${#bandx}" = "6" ]; then
bandx="00$bandx"
elif [ "${#bandx}" = "5" ]; then
bandx="000$bandx"
elif [ "${#bandx}" = "4" ]; then
bandx="0000$bandx"
elif [ "${#bandx}" = "3" ]; then
bandx="00000$bandx"
elif [ "${#bandx}" = "2" ]; then
bandx="000000$bandx"
elif [ "${#bandx}" = "1" ]; then
bandx="0000000$bandx"
fi
bandx1=$(echo $bandx|cut -b 7-8)
pcix=$(printf "%X" $pci)
if [ "${#pcix}" = "8" ]; then
pcix="$pcix"
elif [ "${#pcix}" = "7" ]; then
pcix="0$pcix"
elif [ "${#pcix}" = "6" ]; then
pcix="00$pcix"
elif [ "${#pcix}" = "5" ]; then
pcix="000$pcix"
elif [ "${#pcix}" = "4" ]; then
pcix="0000$pcix"
elif [ "${#pcix}" = "3" ]; then
pcix="00000$pcix"
elif [ "${#pcix}" = "2" ]; then
pcix="000000$pcix"
elif [ "${#pcix}" = "1" ]; then
pcix="0000000$pcix"
fi
pcix1=$(echo $pcix|cut -b 7-8)
pcix2=$(echo $pcix|cut -b 5-6)
dlfreqx=$(printf "%X" $dlfreq)
if [ "${#dlfreqx}" = "8" ]; then
dlfreqx="$dlfreqx"
elif [ "${#dlfreqx}" = "7" ]; then
dlfreqx="0$dlfreqx"
elif [ "${#dlfreqx}" = "6" ]; then
dlfreqx="00$dlfreqx"
elif [ "${#dlfreqx}" = "5" ]; then
dlfreqx="000$dlfreqx"
elif [ "${#dlfreqx}" = "4" ]; then
dlfreqx="0000$dlfreqx"
elif [ "${#dlfreqx}" = "3" ]; then
dlfreqx="00000$dlfreqx"
elif [ "${#dlfreqx}" = "2" ]; then
dlfreqx="000000$dlfreqx"
elif [ "${#dlfreqx}" = "1" ]; then
dlfreqx="0000000$dlfreqx"
fi
dlfreqx1=$(echo $dlfreqx|cut -b 7-8)
dlfreqx2=$(echo $dlfreqx|cut -b 5-6)
adb push balong-nvtool / > /dev/null 2>&1
adb shell chmod 777 /balong-nvtool > /dev/null 2>&1
adb shell "/balong-nvtool -m 53810:03:00:00:00:$bandx1:01:$bandx1:01:$pcix1:$pcix2:$dlfreqx1:$dlfreqx2:00:00:00:00 > /dev/null 2>&1"
echo -e "Finish Locking Cell ID..."
sleep 1
echo -e "Rebooting..."
screen -dmS res adb shell "atc AT^RESET > /dev/null 2>&1"
sleep 2
kill $(screen -list|grep res|awk -F '[.]' '{print $1}') > /dev/null 2>&1
adb kill-server > /dev/null 2>&1
echo -e "Closing..."
echo -e "---------------------------"
}
unlock() {
clear
ipmod
clear
echo -e "---------------------------"
echo -e "Connecting to $ipmodem"
sleep 2
adb kill-server > /dev/null 2>&1
adb connect "$ipmodem" > /dev/null 2>&1
sleep 2
cek=$(adb devices -l|grep $ipmodem:5555|awk -F ":" '{print $1}')
if [ "$cek" = "$ipmodem" ]; then
echo -e "Device connected!"
sleep 2
else
echo -e "Device not connected!"
sleep 2
echo -e "Press enter to back in menu..."
read
unlock
fi
echo -e "---------------------------"
adb push balong-nvtool / > /dev/null 2>&1
adb shell chmod 777 /balong-nvtool > /dev/null 2>&1
adb shell "/balong-nvtool -m 53810:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 > /dev/null 2>&1"
echo -e "Finish Unlocking Cell ID..."
sleep 2
echo -e "Rebooting..."
screen -dmS res adb shell "atc AT^RESET > /dev/null 2>&1"
sleep 2
kill $(screen -list|grep res|awk -F '[.]' '{print $1}') > /dev/null 2>&1
adb kill-server > /dev/null 2>&1
echo -e "Closing..."
echo -e "---------------------------"
}
if [ $(opkg list-installed|grep adb|awk 'NR==1'|awk '{print $1}') != "adb" ]; then
opkg update && opkg install adb
clear
fi
if [ -f $(opkg list-installed|grep screen|awk '{print $1}') ]; then
opkg update && opkg install screen
clear
fi
case $1 in
"info")
info $2;exit
;;
"iphunter")
iphunter;exit
;;
"reboot")
restart;exit
;;
"lock")
lock;exit
;;
"unlock")
unlock;exit
;;
esac
echo -e "\e[38;3m modem iphunter\e[0m \e[34;1m(IP Hunter)\e[0m"
echo -e "\e[38;3m modem info\e[0m \e[34;1m(Device Information)\e[0m"
echo -e "\e[38;3m modem reboot\e[0m \e[34;1m(Restart Modem)\e[0m"
echo -e "\e[38;3m modem lock\e[0m \e[34;1m(Lock Cell ID)\e[0m"
echo -e "\e[38;3m modem unlock\e[0m \e[34;1m(Unlock Cell ID)\e[0m"