forked from rastapasta/pokemon-go-mitm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.logTrafficFull.coffee
33 lines (24 loc) · 1.09 KB
/
example.logTrafficFull.coffee
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
###
Pokemon Go(c) MITM node proxy
by Michael Strassburger <codepoet@cpan.org>
This example just dumps all in-/outgoing messages and responses plus all envelopes and signatures
###
PokemonGoMITM = require './lib/pokemon-go-mitm'
pcrypt = require 'pcrypt'
# Uncomment if you want to filter the regular messages
# ignore = ['GetHatchedEggs', 'DownloadSettings', 'GetInventory', 'CheckAwardedBadges', 'GetMapObjects']
ignore = []
server = new PokemonGoMITM port: 8081, debug: true
.addRequestEnvelopeHandler (data) ->
console.log "[#] Request Envelope", JSON.stringify(data, null, 4)
false
.addResponseEnvelopeHandler (data) ->
console.log "[#] Response Envelope", JSON.stringify(data, null, 4)
false
.addRequestEnvelopeHandler (data) ->
# TODO: update once repeated field 6 is parsed
return false unless data.unknown6[0]?.unknown2?.encrypted_signature
buffer = pcrypt.decrypt data.unknown6[0]?.unknown2?.encrypted_signature
decoded = @parseProtobuf buffer, 'POGOProtos.Networking.Envelopes.Signature'
console.log "[@] Request Envelope Signature", JSON.stringify(decoded, null, 4)
false