<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pentagrid AG (Posts about Transport Encoding)</title><link>https://www.pentagrid.ch/</link><description></description><atom:link href="https://www.pentagrid.ch/en/categories/transport-encoding.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 Pentagrid AG </copyright><lastBuildDate>Wed, 17 Jun 2026 19:14:51 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Teaching Burp a new HTTP Transport Encoding</title><link>https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/</link><dc:creator>Pentagrid AG</dc:creator><description>&lt;p&gt;Today we would like to talk about Burp Suite Professional and extensions again. In this blog post we explain how we can teach Burp Suite to handle a custom Transport Encoding that is spoken between an HTTP client and a server by using Burp extensions.&lt;/p&gt;
&lt;!-- TEASER_END --&gt;
&lt;section id="introduction"&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Burp has many nice features, but sometimes it lacks a feature we would like to have or our target application is customized so that it is necessary to teach Burp new things. More specifically:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Burp has &lt;a class="reference external" href="https://forum.portswigger.net/thread/brotli-compression-is-not-supported-988bf33f"&gt;no support for the standard HTTP brotli Transport-Encoding&lt;/a&gt;, but all modern browsers do. This problem is handled by Burp by removing brotli from the Accept-Encoding request header (see Proxy - Options - Miscellaneous - Remove unsupported encodings from Accept-Encoding headers in incoming requests), which works for modern browsers. However, we encountered situations during tests where a non-browser HTTP client software required brotli and refused to talk to the server when brotli encoding is missing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java fat clients sometimes zlib-encode the entire HTTP body when talking to a server and vice-versa. They also often refuse to speak non-zlib and do not signal it at all in an HTTP header, therefore it is necessary to implement zlib-decoding and encoding to be able to use Burp properly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a website uses JavaScript to encrypt all HTTP bodies when talking to a server and vice-versa, we also would like to implement a decryption and encryption routing to use the Burp tools. We also encountered the same situation with other HTTP clients that used additional transport encryption, such as mobile banking apps.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The biggest issue for us was to figure out how we approach these situations consistently and we show our approach in this blog post.&lt;/p&gt;
&lt;p&gt;In this blog post we often refer to "encoding" or "encrypting", which obviously is not the same, but both operations have to be done at the same place inside Burp. Encryption or encoding is merely an implementation detail in this blog post. Also "cleartext" is used to indicate decoded or decrypted content.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="why-are-you-doing-all-of-this"&gt;
&lt;h2&gt;Why are you doing all of this?&lt;/h2&gt;
&lt;p&gt;If Burp is not seeing decoded messages for one of the reasons above, it won't work properly. Tools such as Burp Scanner, Repeater, Intruder and other extensions will often fail to interpret the encoded HTTP content and will for sure fail with encrypted content. It won't matter if you use the scanner or not, in many cases it won't do anything useful if you don't implement this custom decoder/encoder. On the contrary, very often a tester's task is to make their tools work. This might be rewarded in the end by simply pressing the active scan button in Burp and then finding security issues. To us, this is a huge difference between a good and a bad security analysis.&lt;/p&gt;
&lt;p&gt;Usually we would suggest to solve this problem with features or extensions that are already present, for example the Hackvertor extension would be a good candidate. However, Hackvertor won't modify responses, so this isn't an option here.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="burp-s-api-for-extensions"&gt;
&lt;h2&gt;Burp's API for extensions&lt;/h2&gt;
&lt;p&gt;Burp provides several &lt;a class="reference external" href="https://portswigger.net/burp/extender/api/"&gt;APIs an extension can use&lt;/a&gt;. The API code didn't get much love in the last few years, but this is hopefully changing when Burp releases the &lt;a class="reference external" href="https://portswigger.net/blog/burp-suite-roadmap-for-2022"&gt;New API and multi-language extensibility&lt;/a&gt;. Let's hope for the best, but for now we're stuck with the API we have. There are two main API hooks that matter in the situation of a missing Transport Encoding. We'll use the name of the function name in the rest of this blog post, but the interfaces that provide the functionality are called:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://portswigger.net/burp/extender/api/burp/IProxyListener.html"&gt;IProxyListener&lt;/a&gt;, which means you have to implement the function &lt;code class="docutils literal"&gt;processProxyMessage&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://portswigger.net/burp/extender/api/burp/IHttpListener.html"&gt;IHttpListener&lt;/a&gt;, which means you have to implement the function &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While both interfaces sound similar, the proxy listener will only see requests and responses going through the proxy (e.g. from the browser), whereas the HTTP listener will see the requests and responses of all tools (Proxy, Crawler, Scanner, Repeater, Intruder, other extensions, etc.). However, there's one little detail that is important to mention: If you want to change messages going throught the proxy, you have to do that in the &lt;code class="docutils literal"&gt;processProxyMessage&lt;/code&gt; function and you can't do that in the &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt;. It's just a Burp API limitation that you can't modify messages from TOOL_PROXY in the &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt;. That means we have to get around this limitation by choosing the correct API.&lt;/p&gt;
&lt;p&gt;While we think it is better to use Kotlin to write large Burp extensions nowadays, rapid prototyping is still quicker with Python. Therefore we use Python (or rather, Jython 2.7 in Burp) in this blog post.&lt;/p&gt;
&lt;p&gt;Here's a little Python sample extension that handles the API confusion of &lt;code class="docutils literal"&gt;processProxyMessage&lt;/code&gt; and &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt;, so we don't need to care about it anymore and can just modify messages in the newly created &lt;code class="docutils literal"&gt;processMessage&lt;/code&gt; function:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_773268b73f2b497380611e55069e938d-1" name="rest_code_773268b73f2b497380611e55069e938d-1" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-1"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtender&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-2" name="rest_code_773268b73f2b497380611e55069e938d-2" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-2"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-3" name="rest_code_773268b73f2b497380611e55069e938d-3" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-3"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-4" name="rest_code_773268b73f2b497380611e55069e938d-4" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-4"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-5" name="rest_code_773268b73f2b497380611e55069e938d-5" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-6" name="rest_code_773268b73f2b497380611e55069e938d-6" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-6"&gt;&lt;/a&gt;&lt;span class="n"&gt;NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Pentagrid Extension Template"&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-7" name="rest_code_773268b73f2b497380611e55069e938d-7" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-8" name="rest_code_773268b73f2b497380611e55069e938d-8" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-8"&gt;&lt;/a&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;BurpExtender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-9" name="rest_code_773268b73f2b497380611e55069e938d-9" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-10" name="rest_code_773268b73f2b497380611e55069e938d-10" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-10"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;registerExtenderCallbacks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-11" name="rest_code_773268b73f2b497380611e55069e938d-11" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-11"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# keep a reference to our callbacks object&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-12" name="rest_code_773268b73f2b497380611e55069e938d-12" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-12"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_callbacks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-13" name="rest_code_773268b73f2b497380611e55069e938d-13" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-13"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-14" name="rest_code_773268b73f2b497380611e55069e938d-14" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-14"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# set our extension name&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-15" name="rest_code_773268b73f2b497380611e55069e938d-15" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-15"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setExtensionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-16" name="rest_code_773268b73f2b497380611e55069e938d-16" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-16"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-17" name="rest_code_773268b73f2b497380611e55069e938d-17" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-17"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# register ourselves as an Proxy listener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-18" name="rest_code_773268b73f2b497380611e55069e938d-18" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-18"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerProxyListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-19" name="rest_code_773268b73f2b497380611e55069e938d-19" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-19"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-20" name="rest_code_773268b73f2b497380611e55069e938d-20" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-20"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# register ourselves as an HTTP listener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-21" name="rest_code_773268b73f2b497380611e55069e938d-21" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-21"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerHttpListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-22" name="rest_code_773268b73f2b497380611e55069e938d-22" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-22"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-23" name="rest_code_773268b73f2b497380611e55069e938d-23" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-23"&gt;&lt;/a&gt;        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Loaded "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;" successfully!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-24" name="rest_code_773268b73f2b497380611e55069e938d-24" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-24"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-25" name="rest_code_773268b73f2b497380611e55069e938d-25" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-25"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-26" name="rest_code_773268b73f2b497380611e55069e938d-26" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-26"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IHttpListener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-27" name="rest_code_773268b73f2b497380611e55069e938d-27" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-27"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-28" name="rest_code_773268b73f2b497380611e55069e938d-28" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-28"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-29" name="rest_code_773268b73f2b497380611e55069e938d-29" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-29"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processHttpMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-30" name="rest_code_773268b73f2b497380611e55069e938d-30" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-30"&gt;&lt;/a&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-31" name="rest_code_773268b73f2b497380611e55069e938d-31" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-31"&gt;&lt;/a&gt;            &lt;span class="c1"&gt;# DONT'T DO ANYTHING HERE&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-32" name="rest_code_773268b73f2b497380611e55069e938d-32" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-32"&gt;&lt;/a&gt;            &lt;span class="c1"&gt;# Instead, use processProxyMessage below&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-33" name="rest_code_773268b73f2b497380611e55069e938d-33" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-33"&gt;&lt;/a&gt;            &lt;span class="c1"&gt;# https://github.com/nccgroup/BurpSuiteLoggerPlusPlus/issues/42&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-34" name="rest_code_773268b73f2b497380611e55069e938d-34" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-34"&gt;&lt;/a&gt;            &lt;span class="k"&gt;return&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-35" name="rest_code_773268b73f2b497380611e55069e938d-35" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-35"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-36" name="rest_code_773268b73f2b497380611e55069e938d-36" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-36"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-37" name="rest_code_773268b73f2b497380611e55069e938d-37" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-37"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-38" name="rest_code_773268b73f2b497380611e55069e938d-38" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-38"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IProxyListener&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-39" name="rest_code_773268b73f2b497380611e55069e938d-39" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-39"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-40" name="rest_code_773268b73f2b497380611e55069e938d-40" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-40"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processProxyMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-41" name="rest_code_773268b73f2b497380611e55069e938d-41" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-41"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getMessageInfo&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-42" name="rest_code_773268b73f2b497380611e55069e938d-42" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-42"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-43" name="rest_code_773268b73f2b497380611e55069e938d-43" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-43"&gt;&lt;/a&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-44" name="rest_code_773268b73f2b497380611e55069e938d-44" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-44"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-45" name="rest_code_773268b73f2b497380611e55069e938d-45" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-45"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# TODO: Implement whatever you would like to do&lt;/span&gt;
&lt;a id="rest_code_773268b73f2b497380611e55069e938d-46" name="rest_code_773268b73f2b497380611e55069e938d-46" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_773268b73f2b497380611e55069e938d-46"&gt;&lt;/a&gt;        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As a bonus, the Burp UI will show the "Edited request" or "Edited response" option in the Proxy tool whenever we change a proxy message. However, for &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt; we are partially blind, the request and responses will simply be changed, but depending on where we measure we might see them in a different state in the UI (discussed in the next section).&lt;/p&gt;
&lt;/section&gt;
&lt;section id="burp-s-hooking-locations"&gt;
&lt;h2&gt;Burp's hooking locations&lt;/h2&gt;
&lt;p&gt;We would like to hook as early as possible and as late as possible. We would like to make sure that we decode or decrypt early, so that all other Burp tools can work with readable non-compressed HTTP requests and responses. We also want to encode or encrypt as late as possible, just before the request leaves Burp for the same reason. The problem here is that &lt;code class="docutils literal"&gt;processProxyMessage&lt;/code&gt; is called before &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt; for requests, but for responses &lt;code class="docutils literal"&gt;processHttpMessage&lt;/code&gt; is called before &lt;code class="docutils literal"&gt;processProxyMessage&lt;/code&gt;. When analysing the exact behavior, we saw it's a non-trivial setup. For example, the built-in Burp Logger is a tab in the Burp UI showing all requests/responses that flow through Burp. But the question is, where does the Burp Logger hook the API itself? Moreover, users who have advanced knowledge of Burp also know that the extension order in the loaded extension list matters. So where should we put our decoder or decrypter and where should we put our encoder or encrypter? This is not easy to explain and it took us a little trial and error, but we figured out that this diagram should be accurate:&lt;/p&gt;
&lt;figure class="align-center"&gt;
&lt;a class="reference external image-reference" href="https://www.pentagrid.ch/images/202204_burp_handling_of_messages.png"&gt;
&lt;img alt="Diagram showing how requests and responses are processed inside Burp when we load our Burp extensions. Green is for cleartext (decoded or decrypted) traffic, red for encoded or encrypted traffic." src="https://www.pentagrid.ch/images/202204_burp_handling_of_messages.thumbnail.png"&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;Diagram showing how requests and responses are processed inside Burp when we load our Burp extensions. Green is for cleartext (decoded or decrypted) traffic, red for encoded or encrypted traffic.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This diagram shows several interesting details:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;We achieve what we want: Target, Intruder, Repeater, Scanner and other extensions can deal with "cleartext" requests. However, we can't make it work with Proxy match/replace rules for requests (they are applied to the encoded content).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Burp's built-in Logger is not last in the chain for responses, it's possible that Burp extensions modify the responses. This means you don't necessarily see what was delivered to the client/server in Logger. You should better use Logger++ and put it last in the extension list to see which requests are sent to the server and which responses are returned after processing in Burp. Of course it depends on what you want to see, but that's what is the most logical setup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Our extension we would like to write for our purpose has to be first &lt;em&gt;and&lt;/em&gt; last (well, second-last before Logger++) to make sure it does its job well. This means we need to write two extensions, an early-decoder that is first in the list for requests (see DECRYPTER top left in the diagram) and responses (see DECRYPTER bottom right) and a late-reencoder that is last in the list for requests (see ENCRYPTER bottom left) and responses (see ENCRYPTER top right). So the order of the extensions has to be like in the following image:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="align-center"&gt;
&lt;a class="reference external image-reference" href="https://www.pentagrid.ch/images/202204_burp_extension_order.png"&gt;
&lt;img alt="Extension order is important to make sure all extensions see the correct traffic. Early decoder as the first extension, late encoder as the second-last." src="https://www.pentagrid.ch/images/202204_burp_extension_order.thumbnail.png"&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;Extension order is important to make sure all extensions see the correct traffic. Early decoder as the first extension, late encoder as the second-last.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Now that we know we need two extensions, how would the Python extensions look like? Here's the early decoder:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-1" name="rest_code_dfe7432a4980464381e3ff25cfac818b-1" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-1"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtender&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-2" name="rest_code_dfe7432a4980464381e3ff25cfac818b-2" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-2"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-3" name="rest_code_dfe7432a4980464381e3ff25cfac818b-3" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-3"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-4" name="rest_code_dfe7432a4980464381e3ff25cfac818b-4" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-4"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-5" name="rest_code_dfe7432a4980464381e3ff25cfac818b-5" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-6" name="rest_code_dfe7432a4980464381e3ff25cfac818b-6" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-6"&gt;&lt;/a&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Pentagrid early decoder"&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-7" name="rest_code_dfe7432a4980464381e3ff25cfac818b-7" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-8" name="rest_code_dfe7432a4980464381e3ff25cfac818b-8" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-8"&gt;&lt;/a&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;BurpExtender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-9" name="rest_code_dfe7432a4980464381e3ff25cfac818b-9" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-10" name="rest_code_dfe7432a4980464381e3ff25cfac818b-10" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-10"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;registerExtenderCallbacks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-11" name="rest_code_dfe7432a4980464381e3ff25cfac818b-11" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-11"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-12" name="rest_code_dfe7432a4980464381e3ff25cfac818b-12" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-12"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# keep a reference to our callbacks object&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-13" name="rest_code_dfe7432a4980464381e3ff25cfac818b-13" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-13"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_callbacks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-14" name="rest_code_dfe7432a4980464381e3ff25cfac818b-14" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-14"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-15" name="rest_code_dfe7432a4980464381e3ff25cfac818b-15" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-15"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# obtain an extension helpers object&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-16" name="rest_code_dfe7432a4980464381e3ff25cfac818b-16" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-16"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_helpers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getHelpers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-17" name="rest_code_dfe7432a4980464381e3ff25cfac818b-17" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-17"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-18" name="rest_code_dfe7432a4980464381e3ff25cfac818b-18" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-18"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# set our extension name&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-19" name="rest_code_dfe7432a4980464381e3ff25cfac818b-19" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-19"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setExtensionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-20" name="rest_code_dfe7432a4980464381e3ff25cfac818b-20" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-20"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-21" name="rest_code_dfe7432a4980464381e3ff25cfac818b-21" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-21"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# register ourselves as an HTTP listener&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-22" name="rest_code_dfe7432a4980464381e3ff25cfac818b-22" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-22"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerHttpListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-23" name="rest_code_dfe7432a4980464381e3ff25cfac818b-23" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-23"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerProxyListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-24" name="rest_code_dfe7432a4980464381e3ff25cfac818b-24" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-24"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-25" name="rest_code_dfe7432a4980464381e3ff25cfac818b-25" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-25"&gt;&lt;/a&gt;        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Loaded "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;" successfully!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-26" name="rest_code_dfe7432a4980464381e3ff25cfac818b-26" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-26"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-27" name="rest_code_dfe7432a4980464381e3ff25cfac818b-27" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-27"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-28" name="rest_code_dfe7432a4980464381e3ff25cfac818b-28" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-28"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IHttpListener&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-29" name="rest_code_dfe7432a4980464381e3ff25cfac818b-29" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-29"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-30" name="rest_code_dfe7432a4980464381e3ff25cfac818b-30" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-30"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-31" name="rest_code_dfe7432a4980464381e3ff25cfac818b-31" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-31"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processHttpMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-32" name="rest_code_dfe7432a4980464381e3ff25cfac818b-32" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-32"&gt;&lt;/a&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-33" name="rest_code_dfe7432a4980464381e3ff25cfac818b-33" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-33"&gt;&lt;/a&gt;            &lt;span class="c1"&gt;# Already processed in processProxyMessage&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-34" name="rest_code_dfe7432a4980464381e3ff25cfac818b-34" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-34"&gt;&lt;/a&gt;            &lt;span class="k"&gt;return&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-35" name="rest_code_dfe7432a4980464381e3ff25cfac818b-35" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-35"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-36" name="rest_code_dfe7432a4980464381e3ff25cfac818b-36" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-36"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-37" name="rest_code_dfe7432a4980464381e3ff25cfac818b-37" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-37"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-38" name="rest_code_dfe7432a4980464381e3ff25cfac818b-38" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-38"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IProxyListener&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-39" name="rest_code_dfe7432a4980464381e3ff25cfac818b-39" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-39"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-40" name="rest_code_dfe7432a4980464381e3ff25cfac818b-40" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-40"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processProxyMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-41" name="rest_code_dfe7432a4980464381e3ff25cfac818b-41" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-41"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# Responses are handled as early as possible in processHttpMessage&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-42" name="rest_code_dfe7432a4980464381e3ff25cfac818b-42" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-42"&gt;&lt;/a&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-43" name="rest_code_dfe7432a4980464381e3ff25cfac818b-43" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-43"&gt;&lt;/a&gt;            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getMessageInfo&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-44" name="rest_code_dfe7432a4980464381e3ff25cfac818b-44" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-44"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-45" name="rest_code_dfe7432a4980464381e3ff25cfac818b-45" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-45"&gt;&lt;/a&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-46" name="rest_code_dfe7432a4980464381e3ff25cfac818b-46" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-46"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-47" name="rest_code_dfe7432a4980464381e3ff25cfac818b-47" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-47"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# TODO: implement decoding&lt;/span&gt;
&lt;a id="rest_code_dfe7432a4980464381e3ff25cfac818b-48" name="rest_code_dfe7432a4980464381e3ff25cfac818b-48" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_dfe7432a4980464381e3ff25cfac818b-48"&gt;&lt;/a&gt;        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And here's the late encoder:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-1" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-1" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-1"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtender&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-2" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-2" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-2"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-3" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-3" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-3"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-4" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-4" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-4"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;burp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-5" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-5" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-6" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-6" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-6"&gt;&lt;/a&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Pentagrid late encoder"&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-7" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-7" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-8" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-8" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-8"&gt;&lt;/a&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;BurpExtender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IHttpListener&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IProxyListener&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-9" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-9" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-10" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-10" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-10"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;registerExtenderCallbacks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-11" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-11" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-11"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-12" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-12" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-12"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# keep a reference to our callbacks object&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-13" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-13" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-13"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_callbacks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-14" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-14" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-14"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-15" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-15" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-15"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# obtain an extension helpers object&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-16" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-16" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-16"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_helpers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getHelpers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-17" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-17" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-17"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-18" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-18" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-18"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# set our extension name&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-19" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-19" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-19"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setExtensionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-20" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-20" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-20"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-21" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-21" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-21"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# register ourselves as an HTTP listener&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-22" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-22" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-22"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerHttpListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-23" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-23" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-23"&gt;&lt;/a&gt;        &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registerProxyListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-24" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-24" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-24"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-25" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-25" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-25"&gt;&lt;/a&gt;        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Loaded "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;" successfully!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-26" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-26" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-26"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-27" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-27" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-27"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-28" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-28" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-28"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IHttpListener&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-29" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-29" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-29"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-30" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-30" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-30"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-31" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-31" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-31"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processHttpMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-32" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-32" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-32"&gt;&lt;/a&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-33" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-33" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-33"&gt;&lt;/a&gt;            &lt;span class="c1"&gt;# Requests are handled as late as possible in processProxyMessage&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-34" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-34" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-34"&gt;&lt;/a&gt;            &lt;span class="k"&gt;return&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-35" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-35" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-35"&gt;&lt;/a&gt;        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-36" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-36" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-36"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-37" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-37" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-37"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-38" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-38" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-38"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;# implement IProxyListener&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-39" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-39" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-39"&gt;&lt;/a&gt;    &lt;span class="c1"&gt;#&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-40" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-40" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-40"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;processProxyMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-41" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-41" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-41"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# Responses are handled as late as possible in processHttpMessage&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-42" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-42" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-42"&gt;&lt;/a&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-43" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-43" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-43"&gt;&lt;/a&gt;            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IBurpExtenderCallbacks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOOL_PROXY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getMessageInfo&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-44" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-44" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-44"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-45" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-45" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-45"&gt;&lt;/a&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-46" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-46" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-46"&gt;&lt;/a&gt;    &lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;filter_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolFlag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageIsRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messageInfo&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-47" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-47" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-47"&gt;&lt;/a&gt;        &lt;span class="c1"&gt;# TODO: implement encoding&lt;/span&gt;
&lt;a id="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-48" name="rest_code_a6988cdcaff644c6b73b98e3c1897e6e-48" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_a6988cdcaff644c6b73b98e3c1897e6e-48"&gt;&lt;/a&gt;        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="bonus"&gt;
&lt;h2&gt;Bonus&lt;/h2&gt;
&lt;p&gt;To make this a little more convenient for you, we've set up a &lt;a class="reference external" href="https://github.com/pentagridsec/PentagridBurpTransportEncoding"&gt;Github repository&lt;/a&gt; with all the examples from above (in the "minimal" subfolder). However, that's not all:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;A fully working example for the zlib-body encoding/decoding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A template that has some more helpful functions if you want to implement your own decoding/encoding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An additional extension that implements an IMessageEditorTabFactory, so if you encounter an encoded message in Burp you can click the message viewer option of the extension and will see it in decoded form.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;section id="more-advanced-examples"&gt;
&lt;h2&gt;More advanced examples&lt;/h2&gt;
&lt;p&gt;With the above examples it should be no problem for you to also create extensions that do decryption/encryption instead of decoding/encoding in more complicated setups. In one of our security analysis, we were able to implement the decryption/encryption and hardcoded the key at first. However, then we realised we could additionally inject a JavaScript tag into the HTML single-page response of the server to "steal" our own encryption key from our browser. This removed the requirement to hard-code the encryption key. We did this by replacing &lt;code class="docutils literal"&gt;&amp;lt;/body&amp;gt;&lt;/code&gt; with:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code html"&gt;&lt;a id="rest_code_7e2805ef1f8a40cdb3156ff57c596351-1" name="rest_code_7e2805ef1f8a40cdb3156ff57c596351-1" href="https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/#rest_code_7e2805ef1f8a40cdb3156ff57c596351-1"&gt;&lt;/a&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;lastKey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pentagrid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nowKey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;encryptionKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nowKey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nowKey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;lastKey&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="nx"&gt;lastKey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nowKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pentagrid2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;XMLHttpRequest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pentagrid2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/pentagridDiscloseKey="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nowKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pentagrid2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);}};&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pentagrid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This JavaScript extracted the encryption key from the browser DOM and sent it through Burp, so we could catch it in our decrypter/encrypter extensions and therefore fully intercept cleartext traffic.&lt;/p&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;
&lt;/section&gt;</description><category>API</category><category>Burp</category><category>Encryption</category><category>Extensions</category><category>Pentesting</category><category>Portswigger</category><category>Transport Encoding</category><guid>https://www.pentagrid.ch/en/blog/teaching_burp_a_new_http_transport_encoding/</guid><pubDate>Wed, 13 Apr 2022 10:42:00 GMT</pubDate></item></channel></rss>