-
Notifications
You must be signed in to change notification settings - Fork 3
/
mitm-redirect.py
121 lines (113 loc) · 2.8 KB
/
mitm-redirect.py
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
from mitmproxy import ctx
import mitmproxy.http
methods = [
'GetRules',
'LoginParent',
'AuthenticateUser',
'RegisterParent',
'GetSubscriptionInfo',
'GetUserInfoByApiToken',
'IsValidApiToken_V2',
'ValidateName',
'GetDefaultNameSuggestion',
'RegisterChild',
'GetProfileByUserId',
'LoginChild',
'GetUserProfileByUserID',
'GetKeyValuePair',
'SetKeyValuePair',
'GetKeyValuePairByUserID',
'SetKeyValuePairByUserID',
'GetUserProfile',
'GetQuestions',
'GetCommonInventory',
'SetCommonInventory',
'GetItem',
'GetAuthoritativeTime',
'SetAvatar',
'GetPetAchievementsByUserID',
'GetDetailedChildList',
'GetStore',
'GetAllRanks',
'GetUserUpcomingMissionState',
'GetUserActiveMissionState',
'GetUserCompletedMissionState',
'SetTaskState',
'CreatePet',
'SetRaisedPet',
'SetSelectedPet',
'GetAllActivePetsByuserId',
'GetSelectedRaisedPet',
'SetImage',
'GetImage',
'GetImageByUserId',
'GetAchievementTaskInfo',
'GetAllRewardTypeMultiplier',
'GetBuddyList',
'GetRankAttributeData',
'GetUserMessageQueue',
'SendMessage',
'SaveMessage',
'GetMMOServerInfoWithZone',
'GetActiveChallenges',
'GetAchievementsByUserID',
'PurchaseItems',
'AcceptMission',
'GetUserMissionState',
'SetAchievementAndGetReward',
'SetUserAchievementTask',
'GetAnnouncementsByUser',
'GetUserRoomItemPositions',
'SetUserRoomItemPositions',
'GetAverageRatingForRoom',
'GetUserRoomList',
'GetUserActivityByUserID',
'SetNextItemState',
'SetUserRoom',
'GetChildList',
'GetUnselectedPetByTypes',
'GetUserGameCurrency',
'SetAchievementByEntityIDs',
'UseInventory',
'SellItems',
'FuseItems',
'RerollUserItem',
'AddBattleItems',
'ApplyRewards',
'DeleteProfile',
'DeleteAccountNotification',
'SetUserAchievementAndGetReward',
'ProcessRewardedItems',
'ApplyPayout',
'RedeemMysteryBoxItems',
'SendRawGameData',
'GetGameData',
'GetGameDataByGame',
'GetGameDataByUser',
'GetGameDataByGameForDateRange',
'GetTopAchievementPointUsers',
'SetDisplayName',
]
def routable(path):
for method in methods:
if method in path:
return True
return False
class LocalRedirect:
def __init__(self):
print('Loaded redirect addon')
def request(self, flow: mitmproxy.http.HTTPFlow):
if ('api.sodoff.spirtix.com' in flow.request.pretty_host or 'api.jumpstart.com' in flow.request.pretty_host) and routable(flow.request.path):
flow.request.host = "localhost"
flow.request.scheme = 'http'
flow.request.port = 5000
class RedirectMediaRequests:
def __init__(self):
print('Loaded media request redirector')
def request(self, flow: mitmproxy.http.HTTPFlow):
if "media.jumpstart.com" in flow.request.pretty_host:
flow.request.host = "media.sodoff.spirtix.com"
addons = [
LocalRedirect(),
RedirectMediaRequests()
]