Add mitmproxy

  • Open
  • quality assurance status badge
Details
One participant
  • phodina
Owner
unassigned
Submitted by
phodina
Severity
normal
P
P
phodina wrote on 3 Dec 2022 05:18
(name . Guix Patches)(address . guix-patches@gnu.org)
yw1DAISr0DutNGQWFNOC5s_7u_27bOvMN8ikKdt3qMinwG8FUAnn3X2LwZFRbu1DI2jaVFk53HlQAUFnM7p8TWJMNEhq7uNWxcBlBGo9eZI=@protonmail.com
Hello,

this patch series adds man-in-the-middle proxy.

----
Petr
Attachment: file
From 2b58b0d6d14893c7ecd9e80d94dd5a80d67e438d Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 22:29:22 +0100
Subject: [PATCH 3/7] gnu: Add python-kaitaistruct.

* gnu/pacakges/python-xyz.scm (python-kaitaistruct): New variable.

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 17fbd9de9e..f19a89cf47 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17112,6 +17112,26 @@ (define-public python-tabulate
data in Python.")
(license license:expat)))
+(define-public python-kaitaistruct
+ (package
+ (name "python-kaitaistruct")
+ (version "0.9")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "kaitaistruct" version))
+ (sha256
+ (base32
+ "1b97sfqqz34rq05mii29xr88h0qbayyi3k3r8d8db968gs0lan1x"))))
+ (build-system python-build-system)
+ (home-page "https://kaitai.io")
+ (synopsis
+ "Parsers for binary structure")
+ (description
+ "Kaitai Struct is a declarative language used to describe various
+binary data structures, laid out in files or in memory: i.e. binary file
+formats, network stream packet formats, etc.")
+ (license license:expat)))
+
(define-public python-kazoo
(package
(name "python-kazoo")
--
2.38.1
From ee0410728785aa21971a1224e7deaf7c33122bf0 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 22:30:16 +0100
Subject: [PATCH 6/7] gnu: python-ldap3: Update to 2.8.

* gnu/packages/python-xyz.scm (python-ldap3): Update to 2.8.

Toggle diff (24 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 41fecbf477..2e2e749225 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26515,7 +26515,7 @@ (define-public python-pymacaroons
(define-public python-ldap3
(package
(name "python-ldap3")
- (version "2.7")
+ (version "2.8")
(home-page "https://github.com/cannatag/ldap3")
(source
(origin
@@ -26524,7 +26524,7 @@ (define-public python-ldap3
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0xw9fkqld21xsvdpaqir8ccc2l805xnn9gxahsnl70xzp3mwl0xv"))))
+ (base32 "12yyrz1hr7j14i65hrzbppmcfcwjvwnnjcpwh3ylqsqdsxd13d8g"))))
(build-system python-build-system)
(arguments
'(#:tests? #f ;TODO: Tests need a real LDAP server to run
--
2.38.1
From a6bbd8712c70e132ddefaf2da34ce1ec959146ea Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 21:45:34 +0100
Subject: [PATCH 7/7] gnu: Add mitmproxy.

* gnu/packages/networking.scm (mitmproxy): New variable.

Toggle diff (78 lines)
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index f5276e330e..b3705df538 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -142,7 +142,9 @@ (define-module (gnu packages networking)
#:use-module (gnu packages protobuf)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-check)
+ #:use-module (gnu packages python-compression)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
@@ -161,6 +163,7 @@ (define-module (gnu packages networking)
#:use-module (gnu packages valgrind)
#:use-module (gnu packages web)
#:use-module (gnu packages wxwidgets)
+ #:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
#:use-module (ice-9 match))
@@ -1079,6 +1082,53 @@ (define-public miredo
residing in IPv4-only networks, even when they are behind a NAT device.")
(license license:gpl2+)))
+(define-public mitmproxy
+ (package
+ (name "mitmproxy")
+ (version "8.1.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/mitmproxy/mitmproxy/archive/refs/tags/v"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0al1d9x4b0lmrkxhcd6fkvki0k5rdsgvzg2xpcff8yf4mxlnm821"))))
+ (build-system python-build-system)
+ (native-inputs (list python-pytest))
+ (arguments
+ (list #:tests? #f)) ;Python error during test
+ (inputs (list python-publicsuffix2
+ python-wsproto-next
+ python-urwid
+ python-tornado-6
+ python-pyopenssl
+ python-protobuf
+ python-passlib
+ python-msgpack
+ python-ldap3
+ python-ruamel.yaml
+ python-pyperclip
+ python-pyopenssl
+ python-pyparsing
+ python-kaitaistruct
+ python-hyperframe
+ python-h2
+ python-flask
+ python-cryptography-next
+ python-brotli
+ python-blinker
+ python-typing-extensions-next
+ python-sortedcontainers
+ python-zstandard-0.15))
+ (home-page "https://mitmproxy.org/")
+ (synopsis "Interactive TLS-capable intercepting HTTP proxy")
+ (description "@code{mitmproxy} is your swiss-army knife for debugging,
+testing, privacy measurements, and penetration testing. It can be used to
+intercept, inspect, modify and replay web traffic such as HTTP/1, HTTP/2,
+WebSockets, or any other SSL/TLS-protected protocols.")
+ (license license:expat)))
+
(define-public ndisc6
(package
(name "ndisc6")
--
2.38.1
From a7b1cd2f9a8c3d0c52aec4e579710863b0bfb329 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 22:28:57 +0100
Subject: [PATCH 2/7] gnu: Add python-wsproto-next.

* gnu/packages/python-web.scm (python-wsproton-next): New variable.
(python-wsproto): Inherit from above.

Toggle diff (57 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4f3a587c6a..4c1b187509 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1993,8 +1993,33 @@ (define-public python-priority
set out in RFC 7540 Section 5.3 (Stream Priority).")
(license license:expat)))
+(define-public python-wsproto-next
+ (package
+ (name "python-wsproto")
+ (version "1.0.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "wsproto" version))
+ (sha256
+ (base32
+ "0f4cghvmjiljgw5jjnqvfn9r3gkbfhmk5xr0jw6sv5v98pw7d1w6"))))
+ (build-system python-build-system)
+ (arguments (list #:tests? #f)) ;; Python error during test
+ ;; https://github.com/python-hyper/wsproto/issues/179
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list python-h11))
+ (home-page "https://github.com/python-hyper/wsproto/")
+ (synopsis "WebSockets state-machine based protocol implementation")
+ (description
+ "@code{wsproto} is a pure-Python implementation of a WebSocket protocol
+stack. It's written from the ground up to be embeddable in whatever program you
+choose to use, ensuring that you can communicate via WebSockets, as defined in
+RFC6455, regardless of your programming paradigm.")
+ (license license:expat)))
+
(define-public python-wsproto
(package
+ (inherit python-wsproto-next)
(name "python-wsproto")
(version "0.15.0")
(source
@@ -2014,15 +2039,7 @@ (define-public python-wsproto
(native-inputs
(list python-pytest))
(propagated-inputs
- (list python-h11))
- (home-page "https://github.com/python-hyper/wsproto/")
- (synopsis "WebSockets state-machine based protocol implementation")
- (description
- "@code{wsproto} is a pure-Python implementation of a WebSocket protocol
-stack. It's written from the ground up to be embeddable in whatever program you
-choose to use, ensuring that you can communicate via WebSockets, as defined in
-RFC6455, regardless of your programming paradigm.")
- (license license:expat)))
+ (list python-h11))))
(define-public hypercorn
(package
--
2.38.1
From 68b1839b55d5dfe410424e86cb0d18aafd13bdec Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 23:02:13 +0100
Subject: [PATCH 4/7] gnu: python-typing-extensions: Update to 4.3.0.

* gnu/packages/python-xyz.scm (python-typing-extensions): Update to 4.3.0.
[arguments]: Remove enter-source-directory phase.

Toggle diff (35 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f19a89cf47..ffd3d16bb5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22324,16 +22324,21 @@ (define-public python-typing-extensions-next
(package
(inherit python-typing-extensions)
(name "python-typing-extensions")
- (version "4.2.0")
+ (version "4.3.0")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/python/typing")
- (commit version)))
- (file-name (git-file-name name version))
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/python/typing_extensions/archive/refs/tags/"
+ version ".tar.gz"))
(sha256
(base32
- "1bbry1rg7q5ppkgzdk4nwl7q1w8bbhajm4q68wb9dm6rf7hg1023"))))))
+ "0c6f8xd5hi6c3yc2py5vncx5ki5101vnj9h744ys4f98xn595g4x"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments
+ python-typing-extensions)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (delete 'enter-source-directory)))))))
(define-public bpython
(package
--
2.38.1
From 9a6346fa737e156dd80612adaa83232d1ee9bf36 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 22:28:10 +0100
Subject: [PATCH 1/7] gnu: Add python-zstandard.

* gnu/packages/python-compression.scm (python-zstandard): New variable.

Toggle diff (26 lines)
diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index c483d68b5f..6f179afb3d 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -561,6 +561,19 @@ (define-public python-zstandard
provided.")
(license license:bsd-3)))
+(define-public python-zstandard-0.15
+ (package
+ (inherit python-zstandard)
+ (name "python-zstandard")
+ (version "0.15.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "zstandard" version))
+ (sha256
+ (base32
+ "1mv80ai0vjain1p542sx3v7gyqnpkrrzizd4dlj25cpxpjbmwf92"))))))
+
(define-public python-pyzstd
(package
(name "python-pyzstd")
--
2.38.1
From e9dfd4a0e194dcf59bd5b387bb5d510b44583cdf Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 2 Dec 2022 22:29:59 +0100
Subject: [PATCH 5/7] gnu: python-sortedcontainers: Update to 2.3.0. Remove
input labels.

* gnu/packages/python-xyz.scm (python-sortedcontainers): Update to 2.3.0.
Remove input labels.

Toggle diff (37 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ffd3d16bb5..41fecbf477 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -23737,24 +23737,24 @@ (define-public python-sortedcollections
(define-public python-sortedcontainers
(package
(name "python-sortedcontainers")
- (version "2.1.0")
+ (version "2.3.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "sortedcontainers" version))
(sha256
(base32
- "0fm0w5id2yhqld95hg2m636vjgkz377rvgdfqaxc25vbylr9lklp"))))
+ "188h9d3f9qc6ixk1lz6g1656aq59i5y5jxb7q5vxcq6ga1v97k2r"))))
(build-system python-build-system)
(arguments
;; FIXME: Tests require many extra dependencies, and would introduce
;; a circular dependency on hypothesis, which uses this package.
'(#:tests? #f))
(propagated-inputs
- `(("python-appdirs" ,python-appdirs)
- ("python-distlib" ,python-distlib)
- ("python-filelock" ,python-filelock)
- ("python-six" ,python-six-bootstrap)))
+ (list python-appdirs
+ python-distlib
+ python-filelock
+ python-six-bootstrap))
(home-page "http://www.grantjenks.com/docs/sortedcontainers/")
(synopsis "Sorted List, Sorted Dict, Sorted Set")
(description
--
2.38.1
?