Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-akm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
lcc-akm
Commits
847aec98
Commit
847aec98
authored
Mar 17, 2023
by
王明明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nk 转换测试
0317 17:56
parent
23c968c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
29 deletions
+25
-29
event.go
src/sensor/event.go
+4
-4
testnk.go
src/test/testnk.go
+21
-25
No files found.
src/sensor/event.go
View file @
847aec98
...
...
@@ -161,24 +161,24 @@ type AkmEvent struct {
}
func
(
akm
*
AkmEvent
)
ActivateRandomEvent
()
{
if
rand
.
Float64
()
>
0.
4
{
if
rand
.
Float64
()
>
0.
1
{
for
i
:=
0
;
i
<
int
(
math
.
Floor
(
rand
.
Float64
()
*
10
+
rand
.
Float64
()
*
10
));
i
++
{
akm
.
ActivateKeyEvent
(
"a"
)
}
}
if
rand
.
Float64
()
>
0.
4
{
if
rand
.
Float64
()
>
0.
2
{
for
i
:=
0
;
i
<
int
(
math
.
Floor
(
rand
.
Float64
()
*
5
+
rand
.
Float64
()
*
10
));
i
++
{
akm
.
ActivateDeviceMotionEvent
()
}
}
if
rand
.
Float64
()
>
0.
4
{
if
rand
.
Float64
()
>
0.
1
{
for
i
:=
0
;
i
<
int
(
math
.
Floor
(
rand
.
Float64
()
*
5
+
rand
.
Float64
()
*
10
));
i
++
{
akm
.
ActivateOrientationEvent
()
}
}
if
rand
.
Float64
()
>
0.
4
{
if
rand
.
Float64
()
>
0.
1
{
for
i
:=
0
;
i
<
int
(
math
.
Floor
(
rand
.
Float64
()
*
5
+
rand
.
Float64
()
*
10
));
i
++
{
akm
.
ActivatePointerEvent
()
...
...
src/test/testnk.go
View file @
847aec98
...
...
@@ -10,7 +10,6 @@ import (
"net/url"
"strings"
"sync"
sensor2
"test/sensor"
)
func
getCookie
(
client
tls_client
.
HttpClient
)
(
string
,
string
)
{
...
...
@@ -29,16 +28,17 @@ func getCookie(client tls_client.HttpClient) (string, string) {
return
abck
,
bm_sz
}
func
abckSensor
(
client
tls_client
.
HttpClient
,
sensorurl
string
)
{
func
abckSensor
(
client
tls_client
.
HttpClient
,
sensorurl
string
)
string
{
ua
:=
""
for
i
:=
0
;
i
<
5
;
i
++
{
abck
,
bm_sz
:=
getCookie
(
client
)
//
datas := fmt.Sprintf("times=%d&abck=%s&bm_sz=%s&url=%s", i, abck, bm_sz, "https://www.spirit.com/")
//
//r, _ := http.Post("http://127.0.0.1:3033/akm2t", "application/x-www-form-urlencoded", strings.NewReader(datas)
)
//rs, _ := io.ReadAll(r.Body
)
rs
:=
sensor2
.
GenData
(
i
,
abck
,
bm_sz
,
"Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36"
,
"https://www.spirit.com/"
)
datas
:=
fmt
.
Sprintf
(
"times=%d&abck=%s&bm_sz=%s&url=%s"
,
i
,
abck
,
bm_sz
,
"https://www.spirit.com/"
)
r
,
_
:=
http
.
Post
(
"http://127.0.0.1:3033/akm2t"
,
"application/x-www-form-urlencoded"
,
strings
.
NewReader
(
datas
))
rs
,
_
:=
io
.
ReadAll
(
r
.
Body
)
rsss
:=
strings
.
Split
(
string
(
rs
),
"|||||"
)
//
rs := sensor2.GenData(i, abck, bm_sz, "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36", "https://www.spirit.com/")
sensor
:=
"{
\"
sensor_data
\"
:
\"
"
+
string
(
rs
)
+
"
\"
}"
sensor
:=
"{
\"
sensor_data
\"
:
\"
"
+
rsss
[
0
]
+
"
\"
}"
req
,
_
:=
http
.
NewRequest
(
"POST"
,
"https://www.spirit.com"
+
sensorurl
,
strings
.
NewReader
(
sensor
))
req
.
Header
.
Set
(
"authority"
,
"www.spirit.com"
)
req
.
Header
.
Set
(
"accept"
,
"*/*"
)
...
...
@@ -48,21 +48,21 @@ func abckSensor(client tls_client.HttpClient, sensorurl string) {
req
.
Header
.
Set
(
"origin"
,
"https://www.spirit.com"
)
req
.
Header
.
Set
(
"pragma"
,
"no-cache"
)
req
.
Header
.
Set
(
"referer"
,
"https://www.spirit.com/"
)
req
.
Header
.
Set
(
"user-agent"
,
"Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36"
)
req
.
Header
.
Set
(
"user-agent"
,
rsss
[
1
]
)
resp
,
_
:=
client
.
Do
(
req
)
readBytes
,
_
:=
io
.
ReadAll
(
resp
.
Body
)
fmt
.
Println
(
string
(
readBytes
))
for
_
,
cookie
:=
range
resp
.
Cookies
()
{
fmt
.
Println
(
cookie
.
Name
,
len
(
cookie
.
Value
),
cookie
.
Value
)
}
ua
=
rsss
[
1
]
}
return
ua
}
func
main
()
{
wg
:=
sync
.
WaitGroup
{}
for
i
:=
0
;
i
<
1
;
i
++
{
wg
:=
&
sync
.
WaitGroup
{}
for
i
:=
0
;
i
<
10
;
i
++
{
wg
.
Add
(
1
)
go
func
()
{
jar
:=
tls_client
.
NewCookieJar
()
...
...
@@ -83,8 +83,8 @@ func main() {
tls_client
.
WithClientProfile
(
tls_client
.
Chrome_110
),
tls_client
.
WithNotFollowRedirects
(),
tls_client
.
WithCookieJar
(
jar
),
// create cookieJar instance and pass it as argument
//
tls_client.WithProxyUrl("http://127.0.0.1:8890"),
tls_client
.
WithProxyUrl
(
"http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"
),
tls_client
.
WithProxyUrl
(
"http://127.0.0.1:8890"
),
//
tls_client.WithProxyUrl("http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"),
//tls_client.WithProxyUrl(px),
tls_client
.
WithInsecureSkipVerify
(),
}
...
...
@@ -115,17 +115,16 @@ func main() {
panic
(
err
)
}
fmt
.
Println
(
sensorurl
)
abckSensor
(
client
,
sensorurl
)
nk
(
client
)
ua
:=
abckSensor
(
client
,
sensorurl
)
nk
(
client
,
ua
)
wg
.
Done
()
}()
}
wg
.
Wait
()
}
func
nk
(
client
tls_client
.
HttpClient
)
{
func
nk
(
client
tls_client
.
HttpClient
,
ua
string
)
{
//t1 := time.Now()
////resp, err := http.Post("http://lcc.unififi.com/akamai/gen",
//resp, err := http.Post("http://127.0.0.1:59001/akamai/gen",
...
...
@@ -147,7 +146,7 @@ func nk(client tls_client.HttpClient) {
req
.
Header
.
Set
(
"authority"
,
"www.spirit.com"
)
req
.
Header
.
Set
(
"accept"
,
"application/json, text/plain, */*"
)
req
.
Header
.
Set
(
"accept-language"
,
"
zh-CN,zh;
q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
)
req
.
Header
.
Set
(
"accept-language"
,
"q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
)
req
.
Header
.
Set
(
"cache-control"
,
"no-cache"
)
req
.
Header
.
Set
(
"content-type"
,
"application/json"
)
req
.
Header
.
Set
(
"origin"
,
"https://www.spirit.com"
)
...
...
@@ -155,11 +154,8 @@ func nk(client tls_client.HttpClient) {
req
.
Header
.
Set
(
"referer"
,
"https://www.spirit.com/"
)
req
.
Header
.
Set
(
"sec-ch-ua-mobile"
,
"?0"
)
req
.
Header
.
Set
(
"ocp-apim-subscription-key"
,
"dc6844776fe84b1c8b68affe7deb7916"
)
req
.
Header
.
Set
(
"x-dtpc"
,
"4$572764892_654h11vJJGIVPCDDJUIBEMACTPMIGRSISICHWMU-0e0"
)
req
.
Header
.
Set
(
"sec-fetch-dest"
,
"empty"
)
req
.
Header
.
Set
(
"sec-fetch-mode"
,
"cors"
)
req
.
Header
.
Set
(
"sec-fetch-site"
,
"same-origin"
)
req
.
Header
.
Set
(
"user-agent"
,
"Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36"
)
//req.Header.Set("user-agent", "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36")
req
.
Header
.
Set
(
"user-agent"
,
ua
)
resp
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
panic
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment