This commit is contained in:
Maximilian Hils 2021-01-06 10:45:06 +01:00
parent 4909198da7
commit ff624d0b87
3 changed files with 187 additions and 3 deletions

View File

@ -55,8 +55,8 @@ def flowdetails(state, flow: mitmproxy.flow.Flow):
common.format_keyvals(parts, indent=4)
)
if sc.certificate_list:
c = sc.certificate_list[0]
if c:
text.append(urwid.Text([("head", "Server Certificate:")]))
parts = [
("Type", "%s, %s bits" % c.keyinfo),

View File

@ -0,0 +1,183 @@
3408:7:version;2:11#4:mode;7:regular;8:response;1859:6:reason;2:OK,11:status_code;3:200#13:timestamp_end;18:1609926103.4004369^15:timestamp_start;17:1609926103.397407^8:trailers;0:~7:content;1256:<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
,7:headers;417:25:13:Accept-Ranges,5:bytes,]15:3:Age,6:503737,]35:13:Cache-Control,14:max-age=604800,]44:12:Content-Type,24:text/html; charset=UTF-8,]40:4:Date,29:Wed, 06 Jan 2021 09:41:44 GMT,]23:4:Etag,12:"3147526947",]43:7:Expires,29:Wed, 13 Jan 2021 09:41:44 GMT,]50:13:Last-Modified,29:Thu, 17 Oct 2019 07:18:26 GMT,]27:6:Server,14:ECS (dcb/7F5C),]26:4:Vary,15:Accept-Encoding,]16:7:X-Cache,3:HIT,]25:14:Content-Length,4:1256,]]12:http_version;8:HTTP/1.1,}7:request;355:4:path;1:/,9:authority;0:,6:scheme;4:http,6:method;3:GET,4:port;2:80#4:host;11:example.com;13:timestamp_end;17:1609926103.167786^15:timestamp_start;18:1609926103.1665907^8:trailers;0:~7:content;0:,7:headers;116:22:4:Host,11:example.com,]29:10:User-Agent,11:curl/7.58.0,]15:6:Accept,3:*/*,]34:16:Proxy-Connection,10:Keep-Alive,]]12:http_version;8:HTTP/1.1,}8:metadata;0:}6:marked;5:false!9:is_replay;0:~11:intercepted;5:false!4:type;4:http;11:server_conn;519:4:via2;0:~11:cipher_list;0:]11:cipher_name;0:~11:alpn_offers;0:]16:certificate_list;0:]3:tls;5:false!5:error;0:~5:state;1:0#3:via;0:~11:tls_version;0:~15:tls_established;5:false!19:timestamp_tls_setup;0:~19:timestamp_tcp_setup;18:1609926103.2838876^15:timestamp_start;18:1609926103.1691897^13:timestamp_end;18:1609926103.4084682^14:source_address;26:14:192.168.188.20;5:64277#]3:sni;4:true!10:ip_address;22:13:93.184.216.34;2:80#]2:id;36:06792cc9-f59c-42bf-af9e-a099d6fd722f;4:alpn;0:~7:address;20:11:example.com;2:80#]}11:client_conn;432:11:cipher_list;0:]11:alpn_offers;0:]16:certificate_list;0:]3:tls;5:false!5:error;0:~8:sockname;19:9:127.0.0.1;4:8080#]5:state;1:0#11:tls_version;0:~14:tls_extensions;0:]15:tls_established;5:false!19:timestamp_tls_setup;0:~15:timestamp_start;18:1609926103.1628306^13:timestamp_end;18:1609926103.4074135^3:sni;0:~8:mitmcert;0:~2:id;36:d82d5110-b98f-45a3-bede-5a393c588484;11:cipher_name;0:~4:alpn;0:~7:address;20:9:127.0.0.1;5:64276#]}5:error;0:~2:id;36:e4feb334-2cb3-457e-87ac-c15b1501b1b0;}9040:7:version;2:11#4:mode;7:regular;8:response;1834:6:reason;0:,11:status_code;3:200#13:timestamp_end;17:1609926104.846938^15:timestamp_start;18:1609926104.8459897^8:trailers;0:~7:content;1256:<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
,7:headers;394:15:3:age,6:105194,]35:13:cache-control,14:max-age=604800,]44:12:content-type,24:text/html; charset=UTF-8,]40:4:date,29:Wed, 06 Jan 2021 09:41:45 GMT,]29:4:etag,18:"3147526947+ident",]43:7:expires,29:Wed, 13 Jan 2021 09:41:45 GMT,]50:13:last-modified,29:Thu, 17 Oct 2019 07:18:26 GMT,]27:6:server,14:ECS (dcb/7F38),]26:4:vary,15:Accept-Encoding,]16:7:x-cache,3:HIT,]25:14:content-length,4:1256,]]12:http_version;8:HTTP/2.0,}7:request;305:4:path;1:/,9:authority;11:example.com,6:scheme;5:https,6:method;3:GET,4:port;3:443#4:host;11:example.com;13:timestamp_end;18:1609926104.3971684^15:timestamp_start;18:1609926104.3962648^8:trailers;0:~7:content;0:,7:headers;52:29:10:user-agent,11:curl/7.58.0,]15:6:accept,3:*/*,]]12:http_version;8:HTTP/2.0,}8:metadata;0:}6:marked;5:false!9:is_replay;0:~11:intercepted;5:false!4:type;4:http;11:server_conn;6150:4:via2;0:~11:cipher_list;0:]11:cipher_name;22:TLS_AES_256_GCM_SHA384;11:alpn_offers;16:2:h2,8:http/1.1,]16:certificate_list;5552:2431:-----BEGIN CERTIFICATE-----
MIIG1TCCBb2gAwIBAgIQD74IsIVNBXOKsMzhya/uyTANBgkqhkiG9w0BAQsFADBP
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSkwJwYDVQQDEyBE
aWdpQ2VydCBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTAeFw0yMDExMjQwMDAwMDBa
Fw0yMTEyMjUyMzU5NTlaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv
cm5pYTEUMBIGA1UEBxMLTG9zIEFuZ2VsZXMxPDA6BgNVBAoTM0ludGVybmV0IENv
cnBvcmF0aW9uIGZvciBBc3NpZ25lZCBOYW1lcyBhbmQgTnVtYmVyczEYMBYGA1UE
AxMPd3d3LmV4YW1wbGUub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
AQEAuvzuzMoKCP8Okx2zvgucA5YinrFPEK5RQP1TX7PEYUAoBO6i5hIAsIKFmFxt
W2sghERilU5rdnxQcF3fEx3sY4OtY6VSBPLPhLrbKozHLrQ8ZN/rYTb+hgNUeT7N
A1mP78IEkxAj4qG5tli4Jq41aCbUlCt7equGXokImhC+UY5IpQEZS0tKD4vu2ksZ
04Qetp0k8jWdAvMA27W3EwgHHNeVGWbJPC0Dn7RqPw13r7hFyS5TpleywjdY1nB7
ad6kcZXZbEcaFZ7ZuerA6RkPGE+PsnZRb1oFJkYoXimsuvkVFhWeHQXCGC1cuDWS
rM3cpQvOzKH2vS7d15+zGls4IwIDAQABo4IDaTCCA2UwHwYDVR0jBBgwFoAUt2ui
6qiqhIx56rTaD5iyxZV2ufQwHQYDVR0OBBYEFCYa+OSxsHKEztqBBtInmPvtOj0X
MIGBBgNVHRE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8cvpOp/2PV5Adg
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----
,]3:tls;4:true!5:error;0:~5:state;1:0#3:via;0:~11:tls_version;7:TLSv1.3;15:tls_established;4:true!19:timestamp_tls_setup;18:1609926104.7426085^19:timestamp_tcp_setup;18:1609926104.5170736^15:timestamp_start;18:1609926104.3983395^13:timestamp_end;18:1609926104.8558016^14:source_address;26:14:192.168.188.20;5:64279#]3:sni;11:example.com;10:ip_address;23:13:93.184.216.34;3:443#]2:id;36:38a80638-d004-47ed-aeac-7d3520134248;4:alpn;2:h2,7:address;21:11:example.com;3:443#]}11:client_conn;507:11:cipher_list;0:]11:alpn_offers;16:2:h2,8:http/1.1,]16:certificate_list;0:]3:tls;4:true!5:error;0:~8:sockname;19:9:127.0.0.1;4:8080#]5:state;1:0#11:tls_version;7:TLSv1.3;14:tls_extensions;0:]15:tls_established;4:true!19:timestamp_tls_setup;16:1609926104.39355^15:timestamp_start;17:1609926104.376415^13:timestamp_end;18:1609926104.8540437^3:sni;11:example.com;8:mitmcert;0:~2:id;36:046c6963-3583-4a1f-9f92-36f435ee5858;11:cipher_name;22:TLS_AES_256_GCM_SHA384;4:alpn;2:h2,7:address;20:9:127.0.0.1;5:64278#]}5:error;0:~2:id;36:7d276248-68ec-4aac-89d1-7eef5d222f38;}

View File

@ -40,5 +40,6 @@ def console(monkeypatch):
def test_integration(tdata, console):
console.type(f":view.flows.load {tdata.path('mitmproxy/data/dumpfile-018.bin')}<enter>")
console.type(f":view.flows.load {tdata.path('mitmproxy/data/dumpfile-7.bin')}<enter>")
console.type("<enter><tab><tab>")
console.type("<space><tab><tab>") # view second flow