Article View: pl.comp.lang.python
Article #28531amfast - serialising deserialised - trying to produce same output
From: Rafał Rajko-Nenow
Date: Mon, 27 Jul 2015 11:39
Date: Mon, 27 Jul 2015 11:39
41 lines
2925 bytes
2925 bytes
Hi, I think it's really amfast issue, and has not much in common with mitmproxy, but last days this problem became urgent to me so I'm asking here hoping that anyone succeeded this before. I am using mitmdump with some inline scripts to track AMF serialised flex remoting traffic. As I'm deserialising big amounts od data, I'm using amfast instead of slower pyamf, trying to avoid performance issues. One way used to limit amount of data I need to deserialize was to look for existence of some particular patterns (eg. variable names) in serialized binary data, and deserializing only payloads who match. as cons of this approach I can't provide amfast decoder with data context, and this forced me to deserialize payloads using amfast.decoder.decode_packet() nowadays I am struggling trying to alter AMF data passing by. I've tried decoding traffic and then encoding it again as described here https://code.google.com/p/amfast/wiki/EncodeAndDecode but each time I tried, originally serialised (untouched) payloads differs from those serialised by me. (even without applying any changes to data) ############# EXAMPLE: coded_content = just_captured_untouched_allready_serialised_payload from amfast.decoder import Decoder from amfast.encoder import Encoder # Decode an AMF Packet... dec = Decoder(amf3=True) packet_obj = dec.decode_packet(coded_content) # ...and encode it again enc = Encoder(amf3=True) encoded_back = encoder.encode_packet(packet_obj) ######## now, suprisingly, 'coded_content' differs from 'encoded_back' a bit any ideas? I'm looking forward to your reply. Ralph Rajko-Nenow
Technical Details
Message-ID:
<94518699-52d5-43af-8441-ec3d4202c570@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!feeder.erje.net!1.eu.feeder.erje.net!newspeer1.nac.net!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!pg9no4362913igb.0!news-out.google.com!b31ni803qge.0!nntp.google.com!z61no3564795qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Received: by 10.66.142.7 with SMTP id rs7mr18000277pab.12.1437997160409; Mon, 27 Jul 2015 04:39:20 -0700 (PDT) X-Received: by 10.140.85.232 with SMTP id n95mr455147qgd.21.1437997160170; Mon, 27 Jul 2015 04:39:20 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!feeder.erje.net!1.eu.feeder.erje.net!newspeer1.nac.net!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!pg9no4362913igb.0!news-out.google.com!b31ni803qge.0!nntp.google.com!z61no3564795qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.python Date: Mon, 27 Jul 2015 04:39:20 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.193.149.43; posting-account=xPwbfAoAAAAstngIO-uWAeVF6093B6e6 NNTP-Posting-Host: 85.193.149.43 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <94518699-52d5-43af-8441-ec3d4202c570@googlegroups.com> Subject: amfast - serialising deserialised - trying to produce same output From: Rafał Rajko-Nenow <ralph.rajko.nenow@gmail.com> Injection-Date: Mon, 27 Jul 2015 11:39:20 +0000 Lines: 40 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit