更新adobe协议
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
package adobe
|
package adobe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/rand"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -81,9 +82,12 @@ func decodeJWTPayload(token string) map[string]any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildARPSessionID() string {
|
func buildARPSessionID() string {
|
||||||
|
// Every field is randomized per request: no embedded process pid or
|
||||||
|
// hardcoded constant suffix (those would make all requests from this
|
||||||
|
// install share a static feature — a cross-account correlation point).
|
||||||
raw := map[string]any{
|
raw := map[string]any{
|
||||||
"sid": uuid.NewString(),
|
"sid": uuid.NewString(),
|
||||||
"ftr": randomHex(16) + "_" + strconv.FormatInt(time.Now().UnixMilli(), 10) + "_" + strconv.Itoa(os.Getpid()) + "_dUAL43-mnts-ants-d4_31ck__tt",
|
"ftr": randomHex(16) + "_" + strconv.FormatInt(time.Now().UnixMilli(), 10) + "_" + strconv.Itoa(randomInt(1000, 999999)) + "_" + randomHex(8),
|
||||||
}
|
}
|
||||||
b, _ := json.Marshal(raw)
|
b, _ := json.Marshal(raw)
|
||||||
return base64.StdEncoding.EncodeToString(b)
|
return base64.StdEncoding.EncodeToString(b)
|
||||||
@@ -94,13 +98,26 @@ func randomHex(n int) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
buf := make([]byte, n)
|
buf := make([]byte, n)
|
||||||
now := time.Now().UnixNano()
|
if _, err := rand.Read(buf); err != nil {
|
||||||
for i := range buf {
|
now := time.Now().UnixNano()
|
||||||
buf[i] = byte(now >> ((i % 8) * 8))
|
for i := range buf {
|
||||||
|
buf[i] = byte(now >> ((i % 8) * 8))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return hex.EncodeToString(buf)
|
return hex.EncodeToString(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func randomInt(min, max int) int {
|
||||||
|
if max <= min {
|
||||||
|
return min
|
||||||
|
}
|
||||||
|
n, err := rand.Int(rand.Reader, big.NewInt(int64(max-min+1)))
|
||||||
|
if err != nil {
|
||||||
|
return min
|
||||||
|
}
|
||||||
|
return min + int(n.Int64())
|
||||||
|
}
|
||||||
|
|
||||||
func intOrNil(v any) any {
|
func intOrNil(v any) any {
|
||||||
switch x := v.(type) {
|
switch x := v.(type) {
|
||||||
case nil:
|
case nil:
|
||||||
|
|||||||
Reference in New Issue
Block a user