{"id":297847,"date":"2020-01-28T21:00:13","date_gmt":"2020-01-28T21:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297847"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297847","title":{"rendered":"\u0420\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 ngrok v2"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485564\/\">\n<h1>\u0420\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 Ngrok v2<\/h1>\n<hr>\n<p><a href=\"https:\/\/ngrok.com\">ngrok<\/a> &mdash; \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0438 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441 2016 \u0433\u043e\u0434\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <a href=\"https:\/\/github.com\/inconshreveable\/ngrok\">open-source \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (ngrok v1)<\/a> \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0430, \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (ngrok v2), \u0447\u0442\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c, \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0410 \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043e\u043d\u043e? \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b ngrok<\/h2>\n<hr>\n<p>\u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0443 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e, \u0442\u0440\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/serveo.net\">serveo.net<\/a>. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 SSH reverse port forwarding, \u0430 \u043d\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442 \u0437\u0430\u043a\u0440\u044b\u0442.<\/p>\n<blockquote>\n<h3>Serveo is temporarily disabled due to phishing.<\/h3>\n<p>Serveo will return in a few days with a few new restrictions to help dissuade abuse. Thanks for your patience!<\/p>\n<\/blockquote>\n<\/li>\n<li><a href=\"https:\/\/localtunnel.me\">localtunnel.me<\/a>. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e HTTP-\u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 Host, \u043f\u0440\u0438\u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 HTTPS \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0438\u0434\u0443\u0442 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u0439\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.<\/li>\n<li><a href=\"https:\/\/pagekite.net\">pagekite.net<\/a>. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 HTTP- \u0438 TLS-\u0442\u0443\u043d\u043d\u0435\u043b\u0438. \u041f\u043e\u0441\u043b\u0435 30-\u0434\u043d\u0435\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0437\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>Naive attempt #1: mitmproxy<\/h2>\n<hr>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mitmproxy:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ mitmproxy $ http_proxy=http:\/\/127.0.0.1:8080 https_proxy=http:\/\/127.0.0.1:8080 ngrok http 8080 # \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u043a\u043d\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e ngrok \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0440\u0435\u0437\u043e\u043b\u0432\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 tunnel.us.ngrok.com \u0447\u0435\u0440\u0435\u0437 DNS-over-HTTPS:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Get https:\/\/dns.google.com\/resolve?cd=true&amp;name=tunnel.us.ngrok.com&amp;type=AAAA: x509: certificate signed by unknown authority<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u043c tunnel.us.ngrok.com:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ curl https:\/\/tunnel.us.ngrok.com\/ curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https:\/\/curl.haxx.se\/docs\/sslcerts.html  curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. <\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0438\u0434\u0438\u043c\u043e, \u043a\u043b\u0438\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 certificate pinning \u0441 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ curl -k https:\/\/tunnel.us.ngrok.com Warning: Binary output can mess up your terminal. Use &quot;--output -&quot; to tell  Warning: curl to output it to your terminal anyway, or consider &quot;--output  Warning: &lt;FILE&gt;&quot; to save to a file. $ curl -k --output - https:\/\/tunnel.us.ngrok.com \ufffd\ufffd\ufffd\ufffd-illegal WNDINC frame length: 0x474554 <\/code><\/pre>\n<p>  <\/p>\n<p>Google \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u00abillegal WNDINC frame length\u00bb \u0432\u044b\u0434\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/inconshreveable\/muxado\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f Go<\/a> \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u042d\u0442\u0430 \u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/inconshreveable\/ngrok\/issues\/255\">issue<\/a> \u0441 \u043f\u0440\u0438\u0437\u044b\u0432\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 ngrok v2.<\/p>\n<p>  <\/p>\n<h2>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 muxado<\/h2>\n<hr>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 ngrok \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 muxado:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ nm .\/ngrok | grep muxado 00000000008ae2c0 T github.com\/inconshreveable\/muxado.(*addr).Network 00000000008ae2e0 T github.com\/inconshreveable\/muxado.(*addr).String 0000000000e31b40 B github.com\/inconshreveable\/muxado.bufferClosed 0000000000e31b50 B github.com\/inconshreveable\/muxado.bufferFull 00000000008ad430 T github.com\/inconshreveable\/muxado.Client 0000000000e31b60 B github.com\/inconshreveable\/muxado.closeError 00000000008b4c00 T github.com\/inconshreveable\/muxado.(*condWindow).Broadcast 00000000008b2ed0 T github.com\/inconshreveable\/muxado.(*condWindow).Decrement 00000000008b2da0 T github.com\/inconshreveable\/muxado.(*condWindow).Increment 00000000008b2d30 T github.com\/inconshreveable\/muxado.(*condWindow).Init ... <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0432\u043e\u0434\u043e\u0432 (\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u0437\u0430 \u0442\u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u044e):<\/p>\n<p>  <\/p>\n<ol>\n<li>ngrok \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/li>\n<li>\u0410\u0432\u0442\u043e\u0440 \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043d\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u044b.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u043f\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u043c\u0443 (TLS) \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b muxado \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <b>\u0432\u043d\u0443\u0442\u0440\u0438<\/b> TLS-\u0441\u0435\u0441\u0441\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0432\u0435\u0440\u0445 muxado \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043d\u044f\u0442\u044c \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0430\u043c\u043f \u0442\u0440\u0430\u0444\u0444\u0438\u043a\u0430, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b (*stream).Read \u0438 (*stream).Write.<\/p>\n<p>  <\/p>\n<h2>ABI<\/h2>\n<hr>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 Go, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c netcat):<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">package main  import &quot;net&quot; import &quot;github.com\/inconshreveable\/muxado&quot;  func main() {     var conn net.Conn     conn, _ = net.Dial(&quot;tcp&quot;, &quot;127.0.0.1:1234&quot;)     sess := muxado.Client(conn, &amp;muxado.Config{})     conn, _ = sess.Open()     data := []byte(&quot;Hello, world!&quot;)     conn.Write(data) } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0442\u0440\u0430\u0444\u0444\u0438\u043a\u0430 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0442\u043e\u043a\u0430 (\u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432).<\/li>\n<li>\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0443\u0444\u0435\u0440 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/li>\n<li>\u0414\u043b\u0438\u043d\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0432\u044b\u0432\u043e\u0434\u0435 objdump \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 github.com\/inconshreveable\/muxado.(*stream).Write (\u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Go, \u043f\u043e\u0445\u043e\u0436\u0435, \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 name mangling.) \u043e\u0442\u0447\u0435\u0442\u043b\u0438\u0432\u043e \u0432\u0438\u0434\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e \u0441\u0442\u0435\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  4de2d6:       48 8b 44 24 58          mov    0x58(%rsp),%rax   4de2db:       48 89 44 24 08          mov    %rax,0x8(%rsp)   4de2e0:       48 8b 44 24 60          mov    0x60(%rsp),%rax   4de2e5:       48 89 44 24 10          mov    %rax,0x10(%rsp)   4de2ea:       48 8b 44 24 68          mov    0x68(%rsp),%rax   4de2ef:       48 89 44 24 18          mov    %rax,0x18(%rsp) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u043b\u0435\u0436\u0430\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f gdb \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Thread 1 &quot;test&quot; hit Breakpoint 1, github.com\/inconshreveable\/muxado.(*stream).Write (buf=..., err=..., n=&lt;optimized out&gt;, s=&lt;optimized out&gt;)     at \/home\/sergey\/muxado\/src\/github.com\/inconshreveable\/muxado\/stream.go:81 81\tfunc (s *stream) Write(buf []byte) (n int, err error) { (gdb) set language c Warning: the current language does not match this frame. (gdb) p {char*[4]}$rsp $1 = {   0x4e0cbf &lt;main.main+319&gt; &quot;H\\213l$XH\\203\\304`\\303\\350\\002A\\367\\377\\351\\255\\376\\377\\377&quot;, '\\314' &lt;repeats 13 times&gt;, &quot;dH\\213\\f%\\370\\377\\377\\377H;a\\020vKH\\203\\354\\bH\\211,$H\\215,$\\017\\266\\005k\\003\\025&quot;, 0xc0000b4000 &quot;&quot;, 0xc000014300 &quot;Hello, world!&quot;, 0xd &lt;error: Cannot access memory at address 0xd&gt;} <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 &mdash; \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430, \u0438 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u0414\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0443; \u0442\u0430\u043a \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043f\u043e\u0442\u043e\u043a \u0438\u0434\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0432\u044b\u043c, \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e (\u0441 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0430\u043c\u0438) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0442\u043e\u043a\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (*stream).Write (\u0434\u043b\u044f (*stream).Read \u0432\u0441\u0451 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f). \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442.<\/p>\n<p>  <\/p>\n<h2>Naive attempt #2: runtime function hooks<\/h2>\n<hr>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b (*stream).Write \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043f\u0440\u043e\u043a\u0441\u0438:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">unsigned long long write_hook() {     volatile long long* rsp = RSP();     void* stream = (void*)rsp[1];     char* buf = (char*)rsp[2];     long long len = rsp[3];     UNSET_HOOK();     unsigned long long ans;     PUSH(rsp[3]);     PUSH(rsp[2]);     PUSH(rsp[1]);     CALL(syscall_write);     POP(24, ans);     SET_HOOK();     return ans; } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c ngrok \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0445\u0443\u043a\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0440\u0430\u0448 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">unexpected fault address 0x0 fatal error: fault [signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x4a2dc6]  goroutine 1 [running]: runtime.throw(0xac7ca8, 0x5) \t\/usr\/local\/Cellar\/go\/1.8.3\/libexec\/src\/runtime\/panic.go:596 +0x95 fp=0xc42016f9f0 sp=0xc42016f9d0 runtime.sigpanic() ... <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u043d\u0430\u0441 \u0436\u0434\u0435\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043b\u0438\u0446\u0435 goroutines. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0435\u043a \u043f\u043e\u0434 \u0433\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438: \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0441\u0442\u0435\u043a\u0435 \u043e\u043d \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 gcc, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043a\u0430 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 rbp (\u0442.\u043d. frame pointer), \u0438 \u043f\u0440\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0435 \u0438\u0437 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0443\u0436\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u0442\u0435\u043a (use-after-free). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, C \u0442\u0443\u0442 \u043d\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a.<\/p>\n<p>  <\/p>\n<h2>Attempt #3: gdb script<\/h2>\n<hr>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f gdb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">set language c break github.com\/inconshreveable\/muxado.(*stream).Write commands     set $stream={void*}($rsp+8)     set $buf={char*}($rsp+16)     set $len={long long}($rsp+24)     p $stream     p (*$buf)@$len     p $len     cont end  run tcp 8080 -log stdout -log-format logfmt -log-level debug <\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0430\u043c\u043f\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0418 \u0442\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 breakpoint&#8217;\u0430 \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e ret.<\/li>\n<li>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0439\u0442 &mdash; \u043e\u0434\u043d\u043e \u0438\u0437 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. (\u0422\u0430\u043a\u0436\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0441\u0442\u0435\u043a \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0443\u0436\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043b\u0435\u0436\u0438\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 $rsp+48).<\/li>\n<li>\u0422\u0440\u0435\u0442\u044c\u044f, \u0438 \u0441\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412\u044b\u0432\u043e\u0434 gdb \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043c. \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u043a\u0443 \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 ABI), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u0430\u043c\u043f\u044b \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. (\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430).<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>Attempt #4: assembly<\/h2>\n<hr>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a ngrok objdump&#8217;\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u043a\u0446\u0438\u044f\u043c\u0438 .text \u0438 .rodata \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0437\u043e\u0440 \u0432 0xc10=3088 \u0431\u0430\u0439\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  9773eb:       e9 50 ff ff ff          jmpq   977340 &lt;type..eq.[2]github.com\/kevinburke\/cli.Flag&gt;  \u0414\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 .rodata:  0000000000978000 &lt;type.*&gt;: <\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u0437\u043e\u0440 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0442\u0430\u043c \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0431\u0430\u0439\u0442\u0430\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0441\u0435\u043a\u0446\u0438\u044e .text (\u043f\u043e\u0438\u0441\u043a\/\u0437\u0430\u043c\u0435\u043d\u0430 \u0432 hex-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435), \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u0434 \u0434\u043b\u044f \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432.<\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 x86_64 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 5 \u0431\u0430\u0439\u0442: \u043e\u043f\u043a\u043e\u0434 (E9) + \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 (signed int). \u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 ngrok \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 2 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442, \u044d\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043b\u044e\u0431\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441\u0435\u043a\u0446\u0438\u0438 .text, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432 \u043d\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043e\u0431\u043e\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 9 \u0431\u0430\u0439\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0435 5 \u0431\u0430\u0439\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  8b0e70:       64 48 8b 0c 25 f8 ff    mov    %fs:0xfffffffffffffff8,%rcx   8b0e77:       ff ff  <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 func+9<\/p>\n<p>\u0421 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 ret \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (*stream).Read \u0432\u0441\u0435 \u043a\u0443\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  8b0f6d:       7f 22                   jg     8b0f91 &lt;github.com\/inconshreveable\/muxado.(*stream).Read+0xa1&gt; ...   8b0f8c:       48 83 c4 58             add    $0x58,%rsp   8b0f90:       c3                      retq      8b0f91:       48 8b 5c 24 60          mov    0x60(%rsp),%rbx <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f ret (\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043a\u0430\u043a retq, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0432\u0435\u0441 retf) \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e 1 \u0431\u0430\u0439\u0442, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0437\u0430 \u043d\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f jump target&#8217;\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0435 \u043d\u0435\u043b\u044c\u0437\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0430\u043c\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e ret \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 (\u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c).<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043b\u043e\u0433\u0433\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">section .text org 0x9773f0 use64  write_pre_hook: ; \u0441\u044e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (*stream).Write push dword 0x74697277 call log add rsp, 8 mov rcx, [fs:-8] ; \u043f\u0435\u0440\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f (*stream).Write \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 jmp 0x8b0e79  read_post_hook: ; \u0441\u044e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 0x8b0f8c add rsp, 0x58 ; \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434 ret, \u0441\u043c. \u0432\u044b\u0448\u0435 push dword 0x64616572 call log add rsp, 8 ret  log: ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0430\u0439 \u0411\u043e\u0433 \u043d\u0435 \u0437\u0430\u0442\u0435\u0440\u0435\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u0430\u0436\u043d\u043e\u0433\u043e push rdi push rsi push rdx push rax ;; stack layout: ;; rsp+32 ret ;; rsp+40 kind ('read' or 'writ') ;; rsp+48 ret0 ;; rsp+56 &amp;stream ;; rsp+64 buf ;; rsp+72 len ;; rsp+80 unknown ;; rsp+88 n ;; rsp+96 err ; \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0431\u0443\u0444\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mmap mov rax, 9 mov rdi, 0 mov rsi, 44 add rsi, [rsp+72] mov rdx, 3 push r10 push r8 push r9 mov r10, 34 mov r8, -1 mov r9, 0 syscall test rax, rax js segfault pop r9 pop r8 pop r10 ; \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e \u0441\u0442\u0435\u043a\u0430 mov edi, [rsp+40] mov [rax], edi lea rdi, [rax+4] lea rsi, [rsp+56] push rcx mov rcx, 40 ;up to rsp+96 rep movsb ; \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c \u0431\u0443\u0444\u0435\u0440 mov rsi, [rsp+72] ;rsp+64 mov rcx, [rsp+80] ;rsp+72 rep movsb pop rcx ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c write mov rdi, 3 mov rsi, rax mov rdx, 44 add rdx, [rsp+72] push rax call writeall ; \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c pop rdi mov rsi, 44 add rsi, [rsp+72] mov rax, 11 syscall test rax, rax jnz segfault ; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 pop rax pop rdx pop rsi pop rdi ret  writeall: mov rax, 1 syscall test rax, rax js segfault add rsi, rax sub rdx, rax test rdx, rdx jnz writeall ret  segfault: ; \u0441\u044e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 mov [0], rax <\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 Python \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043b\u043e\u0433\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import sys  stream = sys.stdin.buffer  while True:     chunk = stream.read(44)     if not chunk: break     assert len(chunk) == 44     kind = chunk[:4].decode('ascii')     assert kind in ('read', 'writ')     str_id = hex(int.from_bytes(chunk[4:12], 'little'))     l = int.from_bytes(chunk[20:28], 'little')     n = int.from_bytes(chunk[36:], 'little') if kind == 'read' else l     buf = stream.read(l)     assert len(buf) == l     if '--full-data' not in sys.argv: buf = buf[:n]     print('((%r, %s, %d), (%r, %d))'%(kind, str_id, l, buf, n)) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u043d\u044f\u0442\u0438\u044f \u0434\u0430\u043c\u043f\u043e\u0432 \u0442\u0440\u0430\u0444\u0444\u0438\u043a\u0430 \u0441 ngrok. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0435\u0433\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438!<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0430\u043c\u043f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">(('writ', 0xc420326600, 4), (b'\\x00\\x00\\x00\\x00', 4)) (('writ', 0xc420148e00, 4), (b'\\xff\\xff\\xff\\xff', 4)) (('writ', 0xc420326600, 227), (b'{&quot;Version&quot;:[&quot;2&quot;],&quot;ClientId&quot;:&quot;&quot;,&quot;Extra&quot;:{&quot;OS&quot;:&quot;linux&quot;,&quot;Arch&quot;:&quot;amd64&quot;,&quot;Authtoken&quot;:&quot;3FjYRxVDd2QvNkX13h82k_6Thwfp93PUZEpsz3vYe5v&quot;,&quot;Version&quot;:&quot;2.2.8&quot;,&quot;Hostname&quot;:&quot;tunnel.us.ngrok.com&quot;,&quot;UserAgent&quot;:&quot;ngrok\/2&quot;,&quot;Metadata&quot;:&quot;&quot;,&quot;Cookie&quot;:&quot;&quot;}}\\n', 227)) (('read', 0xc420326600, 512), (b'{&quot;Version&quot;:&quot;2&quot;,&quot;ClientId&quot;:&quot;df05b949e58359ea6901cff60935531d&quot;,&quot;Error&quot;:&quot;&quot;,&quot;Extra&quot;:{&quot;Version&quot;:&quot;prod&quot;,&quot;Cookie&quot;:&quot;lh7YagbqJ9ixLYyE05ZDMPvaYNVm5isu$xF1Mp8fDc689269YUGlGNAV\/0XRyrEH390rwGqILZqYS5+qDUNbMn2l4puKD2CJHAgI83yo49aopujf0uhPBm4t997BTBvpFSg+zrgnrW9cRNuO8ApSe2+OPpUuPK0GZYZ1bpbz7Pod7cJycwVIgDFZZXLxEeNdXylQxSax9YOxgxcHeLBa79OjqrJpEUUWYtTNiMa5wxkr0AwKh&quot;,&quot;AccountName&quot;:&quot;\\xd0\\xa1\\xd0\\xb5\\xd1\\x80\\xd0\\xb3\\xd0\\xb5\\xd0\\xb9 \\xd0\\x9b\\xd0\\xb8\\xd1\\x81\\xd0\\xbe\\xd0\\xb2&quot;,&quot;SessionDuration&quot;:0,&quot;PlanName&quot;:&quot;Free&quot;}}', 430)) (('read', 0xc420148a00, 4), (b'\\xff\\xff\\xff\\xff', 4)) (('writ', 0xc420148200, 4), (b'\\x00\\x00\\x00\\x01', 4)) (('writ', 0xc420148200, 111), (b'{&quot;Id&quot;:&quot;&quot;,&quot;Proto&quot;:&quot;https&quot;,&quot;Opts&quot;:{&quot;Hostname&quot;:&quot;&quot;,&quot;Auth&quot;:&quot;&quot;,&quot;Subdomain&quot;:&quot;&quot;},&quot;Extra&quot;:{&quot;Balance&quot;:false,&quot;Token&quot;:&quot;&quot;}}\\n', 111)) (('read', 0xc420148200, 512), (b'{&quot;Id&quot;:&quot;39b1e32e134eff8671b02268945643f9&quot;,&quot;URL&quot;:&quot;https:\/\/deb82e2e.ngrok.io&quot;,&quot;Proto&quot;:&quot;https&quot;,&quot;Opts&quot;:{&quot;Hostname&quot;:&quot;deb82e2e.ngrok.io&quot;,&quot;Auth&quot;:&quot;&quot;,&quot;Subdomain&quot;:&quot;&quot;,&quot;HostHeaderRewrite&quot;:false,&quot;LocalURLScheme&quot;:&quot;&quot;},&quot;Error&quot;:&quot;&quot;,&quot;Extra&quot;:{&quot;Token&quot;:&quot;WUiWWfM9kRbpFpXoEOCydiJdEob7BKN0$EHrXSWq\/fY\/mRDRSTNqkVWEVCDJUyBdMSU5uSEMH5RHq5D9W1gA1BTWTUEUbltyhQIlhTJvGxezhDeOYqGe5CwNFHnIOVNidToULds48FCVdWc0zRC3Djyack74P9mQ11VHKQKAXPzXUXlUbo6TRkwMWKrpN0q93pmL3fQamRP6cREZTl2YMdnFUZtwHwyh4LGacxGAvdCP867rTKBL\/3eWLdkcF2lSPdHuH8V51RzCMWMIbvmtyySzE', 512)) (('read', 0xc420148200, 1024), (b'cOIiZ09W6pMPTHoTcih0&quot;}}', 23)) (('writ', 0xc4200ea200, 4), (b'\\x00\\x00\\x00\\x01', 4)) (('writ', 0xc4200ea200, 127), (b'{&quot;Id&quot;:&quot;&quot;,&quot;Proto&quot;:&quot;http&quot;,&quot;Opts&quot;:{&quot;Hostname&quot;:&quot;deb82e2e.ngrok.io&quot;,&quot;Auth&quot;:&quot;&quot;,&quot;Subdomain&quot;:&quot;&quot;},&quot;Extra&quot;:{&quot;Balance&quot;:false,&quot;Token&quot;:&quot;&quot;}}\\n', 127)) (('read', 0xc4200ea200, 512), (b'{&quot;Id&quot;:&quot;9714ddd4cb111adf6599f099cec98482&quot;,&quot;URL&quot;:&quot;http:\/\/deb82e2e.ngrok.io&quot;,&quot;Proto&quot;:&quot;http&quot;,&quot;Opts&quot;:{&quot;Hostname&quot;:&quot;deb82e2e.ngrok.io&quot;,&quot;Auth&quot;:&quot;&quot;,&quot;Subdomain&quot;:&quot;&quot;,&quot;HostHeaderRewrite&quot;:false,&quot;LocalURLScheme&quot;:&quot;&quot;},&quot;Error&quot;:&quot;&quot;,&quot;Extra&quot;:{&quot;Token&quot;:&quot;G4nIrca8GTvq4H62sTmqdb144FmhMgrg$U6TwkKWafv\/3+bFM5AP7xIFfkWqx+HUsYWhkYXivrtMfcqan0mKZx99LHGI7mm5lOMmvI+Kdy7WF\/GnwrMDXrRFwhYowczaWKRKnUimnNtndq7rdttMevFabwe5WSzwf+IZhWzQ2yvcW31+qVuS7F6uykUSw+mnBNtsdXFSNpToagqQOM66A8LT+l3f3OOHKrWpdq39Bz2RfoRmXaRpkDrdfT6vPUQd6S8uVUnv3t2173Ik7AgT9PlzOMJ', 512)) (('read', 0xc4200ea200, 1024), (b'hhVDbeM2HP+qV6S5I=&quot;}}', 21)) (('writ', 0xc420148e00, 4), (b'\\x00ys7', 4)) (('writ', 0xc420148e00, 4), (b'\\x00ys7', 4)) (('read', 0xc420148a00, 4), (b'\\x00ys7', 4)) (('writ', 0xc420148a00, 4), (b'\\x00ys7', 4)) (('read', 0xc420148e00, 4), (b'\\x00ys7', 4)) (('writ', 0xc420148e00, 4), (b'\\x11|\\xb9\\x99', 4)) (('read', 0xc420148a00, 4), (b'\\x11|\\xb9\\x99', 4)) (('writ', 0xc420148a00, 4), (b'\\x11|\\xb9\\x99', 4)) (('read', 0xc420148e00, 4), (b'\\x11|\\xb9\\x99', 4)) (('read', 0xc4200ea200, 4), (b'\\x00\\x00\\x00\\x03', 4)) (('read', 0xc4200ea200, 8), (b'M\\x00\\x00\\x00\\x00\\x00\\x00\\x00', 8)) (('read', 0xc4200ea200, 77), (b'{&quot;Id&quot;:&quot;9714ddd4cb111adf6599f099cec98482&quot;,&quot;ClientAddr&quot;:&quot;***.***.**.***:17815&quot;}', 77)) (('read', 0xc4200ea200, 32768), (b'GET \/ HTTP\/1.1\\r\\nHost: deb82e2e.ngrok.io\\r\\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8\\r\\nUpgrade-Insecure-Requests: 1\\r\\nUser-Agent: Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/13.0 Safari\/605.1.15 Midori\/6\\r\\nAccept-Encoding: gzip, deflate\\r\\nAccept-Language: ru-RU\\r\\nX-Forwarded-For: ***.***.**.***\\r\\n\\r\\n', 359)) (('writ', 0xc420148e00, 4), (b'\\x0e\\xb2\\xc0\\x01', 4)) (('read', 0xc420148a00, 4), (b'\\x0e\\xb2\\xc0\\x01', 4)) (('writ', 0xc420148a00, 4), (b'\\x0e\\xb2\\xc0\\x01', 4)) (('read', 0xc420148e00, 4), (b'\\x0e\\xb2\\xc0\\x01', 4)) (('writ', 0xc420148e00, 4), (b'X\\xa3?+', 4)) (('read', 0xc420148a00, 4), (b'X\\xa3?+', 4)) (('writ', 0xc420148a00, 4), (b'X\\xa3?+', 4)) (('read', 0xc420148e00, 4), (b'X\\xa3?+', 4)) (('read', 0xc4200ea200, 32768), (b'', 0)) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u043c\u043f\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c, \u0430 \u043f\u043e\u0442\u043e\u043a\u0438 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 &mdash; \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u042d\u0442\u043e\u0433\u043e \u043d\u0435\u0442 \u0432 \u043b\u043e\u0433\u0430\u0445, \u043d\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0437\u0434\u0440\u0430\u0432\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430.<\/li>\n<li>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &mdash; \u0442\u0438\u043f \u043f\u043e\u0442\u043e\u043a\u0430. \u042d\u0442\u043e 0 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, 1 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0438 3 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.<\/li>\n<li>\u041f\u043e\u0442\u043e\u043a \u0441 \u0442\u0438\u043f\u043e\u043c -1 &mdash; heartbeet. \u0418\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0443\u0434\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0436\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435. \u0422\u0430\u043a\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f 2 \u0432 \u043e\u0431\u043e\u0438\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445.<\/li>\n<li>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f 32-\u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0438\u043f 3, 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e L (little-endian) \u0438 JSON-\u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u0438\u043d\u044b L \u0431\u0430\u0439\u0442, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<hr>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a muxado &mdash; open-source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043f\u043e <a href=\"https:\/\/github.com\/inconshreveable\/muxado\/tree\/master\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c<\/a>. \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0435\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0442\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430 Python \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c ngrok, \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. <a href=\"https:\/\/github.com\/sleirsgoevy\/ngrok-free\">GitHub<\/a><\/p>\n<p>P.S. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/485564\/\"> https:\/\/habr.com\/ru\/post\/485564\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485564\/\">\n<h1>\u0420\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 Ngrok v2<\/h1>\n<hr>\n<p><a href=\"https:\/\/ngrok.com\">ngrok<\/a> &mdash; \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0438 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441 2016 \u0433\u043e\u0434\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <a href=\"https:\/\/github.com\/inconshreveable\/ngrok\">open-source \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (ngrok v1)<\/a> \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0430, \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (ngrok v2), \u0447\u0442\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c, \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297847"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297847\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}