firegex 3.2.12__tar.gz → 3.2.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {firegex-3.2.12/firegex.egg-info → firegex-3.2.14}/PKG-INFO +13 -2
  2. {firegex-3.2.12 → firegex-3.2.14}/README.md +12 -1
  3. firegex-3.2.14/firegex/__init__.py +5 -0
  4. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/models/__init__.py +31 -6
  5. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/models/http.py +40 -4
  6. {firegex-3.2.12 → firegex-3.2.14/firegex.egg-info}/PKG-INFO +13 -2
  7. {firegex-3.2.12 → firegex-3.2.14}/setup.py +1 -1
  8. firegex-3.2.12/firegex/__init__.py +0 -5
  9. {firegex-3.2.12 → firegex-3.2.14}/MANIFEST.in +0 -0
  10. {firegex-3.2.12 → firegex-3.2.14}/fgex +0 -0
  11. {firegex-3.2.12 → firegex-3.2.14}/firegex/__main__.py +0 -0
  12. {firegex-3.2.12 → firegex-3.2.14}/firegex/cli.py +0 -0
  13. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/__init__.py +0 -0
  14. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/internals/__init__.py +0 -0
  15. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/internals/data.py +0 -0
  16. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/internals/exceptions.py +0 -0
  17. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/internals/models.py +0 -0
  18. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/models/tcp.py +0 -0
  19. {firegex-3.2.12 → firegex-3.2.14}/firegex/nfproxy/proxysim/__init__.py +0 -0
  20. {firegex-3.2.12 → firegex-3.2.14}/firegex.egg-info/SOURCES.txt +0 -0
  21. {firegex-3.2.12 → firegex-3.2.14}/firegex.egg-info/dependency_links.txt +0 -0
  22. {firegex-3.2.12 → firegex-3.2.14}/firegex.egg-info/requires.txt +0 -0
  23. {firegex-3.2.12 → firegex-3.2.14}/firegex.egg-info/top_level.txt +0 -0
  24. {firegex-3.2.12 → firegex-3.2.14}/requirements.txt +0 -0
  25. {firegex-3.2.12 → firegex-3.2.14}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: firegex
3
- Version: 3.2.12
3
+ Version: 3.2.14
4
4
  Summary: Firegex client
5
5
  Home-page: https://github.com/pwnzer0tt1/firegex
6
6
  Author: Pwnzer0tt1
@@ -82,7 +82,7 @@ def my_filter(raw_packet: RawPacket): #Logging filter
82
82
 
83
83
  ## Data handlers
84
84
 
85
- ### RawPacket
85
+ ### RawPacket
86
86
  ```python
87
87
  from firegex.nfproxy import RawPacket
88
88
  ```
@@ -143,6 +143,12 @@ from firegex.nfproxy import HttpRequestHeader
143
143
  ```
144
144
  This handler will be called only when the request headers are complete. It will receive a HttpRequestHeader object with the same properties as HttpRequest.
145
145
 
146
+ ### HttpFullRequest
147
+ ```python
148
+ from firegex.nfproxy import HttpFullRequest
149
+ ```
150
+ This handler will be called only when the request is complete. It will receive a HttpFullRequest object with the same properties as HttpRequest.
151
+
146
152
  ### HttpResponse
147
153
  ```python
148
154
  from firegex.nfproxy import HttpResponse
@@ -170,3 +176,8 @@ from firegex.nfproxy import HttpResponseHeader
170
176
  ```
171
177
  This handler will be called only when the response headers are complete. It will receive a HttpResponseHeader object with the same properties as HttpResponse.
172
178
 
179
+ ### HttpFullResponse
180
+ ```python
181
+ from firegex.nfproxy import HttpFullResponse
182
+ ```
183
+ This handler will be called only when the response is complete. It will receive a HttpFullResponse object with the same properties as HttpResponse.
@@ -50,7 +50,7 @@ def my_filter(raw_packet: RawPacket): #Logging filter
50
50
 
51
51
  ## Data handlers
52
52
 
53
- ### RawPacket
53
+ ### RawPacket
54
54
  ```python
55
55
  from firegex.nfproxy import RawPacket
56
56
  ```
@@ -111,6 +111,12 @@ from firegex.nfproxy import HttpRequestHeader
111
111
  ```
112
112
  This handler will be called only when the request headers are complete. It will receive a HttpRequestHeader object with the same properties as HttpRequest.
113
113
 
114
+ ### HttpFullRequest
115
+ ```python
116
+ from firegex.nfproxy import HttpFullRequest
117
+ ```
118
+ This handler will be called only when the request is complete. It will receive a HttpFullRequest object with the same properties as HttpRequest.
119
+
114
120
  ### HttpResponse
115
121
  ```python
116
122
  from firegex.nfproxy import HttpResponse
@@ -138,3 +144,8 @@ from firegex.nfproxy import HttpResponseHeader
138
144
  ```
139
145
  This handler will be called only when the response headers are complete. It will receive a HttpResponseHeader object with the same properties as HttpResponse.
140
146
 
147
+ ### HttpFullResponse
148
+ ```python
149
+ from firegex.nfproxy import HttpFullResponse
150
+ ```
151
+ This handler will be called only when the response is complete. It will receive a HttpFullResponse object with the same properties as HttpResponse.
@@ -0,0 +1,5 @@
1
+
2
+ __version__ = "3.2.14" if "{" not in "3.2.14" else "0.0.0"
3
+
4
+ #Exported functions
5
+ __all__ = []
@@ -1,5 +1,17 @@
1
- from firegex.nfproxy.models.tcp import TCPInputStream, TCPOutputStream, TCPClientStream, TCPServerStream
2
- from firegex.nfproxy.models.http import HttpRequest, HttpResponse, HttpRequestHeader, HttpResponseHeader
1
+ from firegex.nfproxy.models.tcp import (
2
+ TCPInputStream,
3
+ TCPOutputStream,
4
+ TCPClientStream,
5
+ TCPServerStream,
6
+ )
7
+ from firegex.nfproxy.models.http import (
8
+ HttpRequest,
9
+ HttpResponse,
10
+ HttpRequestHeader,
11
+ HttpResponseHeader,
12
+ HttpFullRequest,
13
+ HttpFullResponse,
14
+ )
3
15
  from firegex.nfproxy.internals.data import RawPacket
4
16
  from enum import Enum
5
17
 
@@ -17,15 +29,28 @@ type_annotations_associations = {
17
29
  HttpResponse: HttpResponse._fetch_packet,
18
30
  HttpRequestHeader: HttpRequestHeader._fetch_packet,
19
31
  HttpResponseHeader: HttpResponseHeader._fetch_packet,
20
- }
32
+ HttpFullRequest: HttpFullRequest._fetch_packet,
33
+ HttpFullResponse: HttpFullResponse._fetch_packet,
34
+ },
21
35
  }
22
36
 
37
+
23
38
  class Protocols(Enum):
24
39
  TCP = "tcp"
25
40
  HTTP = "http"
26
41
 
42
+
27
43
  __all__ = [
28
44
  "RawPacket",
29
- "TCPInputStream", "TCPOutputStream", "TCPClientStream", "TCPServerStream",
30
- "HttpRequest", "HttpResponse", "HttpRequestHeader", "HttpResponseHeader", "Protocols"
31
- ]
45
+ "TCPInputStream",
46
+ "TCPOutputStream",
47
+ "TCPClientStream",
48
+ "TCPServerStream",
49
+ "HttpRequest",
50
+ "HttpResponse",
51
+ "HttpRequestHeader",
52
+ "HttpResponseHeader",
53
+ "HttpFullRequest",
54
+ "HttpFullResponse",
55
+ "Protocols",
56
+ ]
@@ -73,6 +73,7 @@ class InternalCallbackHandler:
73
73
  messages: deque[InternalHTTPMessage] = deque()
74
74
  _ws_extentions = None
75
75
  _ws_raised_error = False
76
+ release_message_headers = True
76
77
 
77
78
  def reset_data(self):
78
79
  self.msg = InternalHTTPMessage()
@@ -604,6 +605,7 @@ class InternalBasicHttpMetaClass:
604
605
  if (
605
606
  not internal_data.call_mem["headers_were_set"]
606
607
  and parser.msg.headers_complete
608
+ and parser.release_message_headers
607
609
  ):
608
610
  messages_tosend.append(
609
611
  parser.msg
@@ -641,7 +643,7 @@ class HttpRequest(InternalBasicHttpMetaClass):
641
643
 
642
644
  @staticmethod
643
645
  def _parser_class() -> str:
644
- return "full_http"
646
+ return "http_module"
645
647
 
646
648
  def __repr__(self):
647
649
  return f"<HttpRequest method={self.method} url={self.url} headers={self.headers} body=[{0 if not self.body else len(self.body)} bytes] http_version={self.http_version} keep_alive={self.keep_alive} should_upgrade={self.should_upgrade} headers_complete={self.headers_complete} message_complete={self.message_complete} content_length={self.content_length} stream={self.stream} ws_stream={self.ws_stream}>"
@@ -664,12 +666,46 @@ class HttpResponse(InternalBasicHttpMetaClass):
664
666
 
665
667
  @staticmethod
666
668
  def _parser_class() -> str:
667
- return "full_http"
669
+ return "http_module"
668
670
 
669
671
  def __repr__(self):
670
672
  return f"<HttpResponse status_code={self.status_code} url={self.url} headers={self.headers} body=[{0 if not self.body else len(self.body)} bytes] http_version={self.http_version} keep_alive={self.keep_alive} should_upgrade={self.should_upgrade} headers_complete={self.headers_complete} message_complete={self.message_complete} content_length={self.content_length} stream={self.stream} ws_stream={self.ws_stream}>"
671
673
 
672
674
 
675
+ class HttpFullRequest(HttpRequest):
676
+ """
677
+ HTTP Request handler
678
+ This data handler will be called when the request data is complete
679
+ """
680
+
681
+ def _contructor_hook(self):
682
+ self._parser.release_message_headers = False
683
+
684
+ @staticmethod
685
+ def _parser_class() -> str:
686
+ return "http_full"
687
+
688
+ def __repr__(self):
689
+ return f"<HttpFullRequest method={self.method} url={self.url} headers={self.headers} body=[{0 if not self.body else len(self.body)} bytes] http_version={self.http_version} keep_alive={self.keep_alive} should_upgrade={self.should_upgrade} headers_complete={self.headers_complete} message_complete={self.message_complete} content_length={self.content_length} stream={self.stream} ws_stream={self.ws_stream}>"
690
+
691
+
692
+ class HttpFullResponse(HttpResponse):
693
+ """
694
+ HTTP Response handler
695
+ This data handler will be called when the response data is complete
696
+ """
697
+
698
+ def _contructor_hook(self):
699
+ self._parser.release_message_headers = False
700
+
701
+ @staticmethod
702
+ def _parser_class() -> str:
703
+ return "http_full"
704
+
705
+ def __repr__(self):
706
+ return f"<HttpFullResponse status_code={self.status_code} url={self.url} headers={self.headers} body=[{0 if not self.body else len(self.body)} bytes] http_version={self.http_version} keep_alive={self.keep_alive} should_upgrade={self.should_upgrade} headers_complete={self.headers_complete} message_complete={self.message_complete} content_length={self.content_length} stream={self.stream} ws_stream={self.ws_stream}>"
707
+
708
+
673
709
  class HttpRequestHeader(HttpRequest):
674
710
  """
675
711
  HTTP Request Header handler
@@ -681,7 +717,7 @@ class HttpRequestHeader(HttpRequest):
681
717
 
682
718
  @staticmethod
683
719
  def _parser_class() -> str:
684
- return "header_http"
720
+ return "http_header"
685
721
 
686
722
 
687
723
  class HttpResponseHeader(HttpResponse):
@@ -695,4 +731,4 @@ class HttpResponseHeader(HttpResponse):
695
731
 
696
732
  @staticmethod
697
733
  def _parser_class() -> str:
698
- return "header_http"
734
+ return "http_header"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: firegex
3
- Version: 3.2.12
3
+ Version: 3.2.14
4
4
  Summary: Firegex client
5
5
  Home-page: https://github.com/pwnzer0tt1/firegex
6
6
  Author: Pwnzer0tt1
@@ -82,7 +82,7 @@ def my_filter(raw_packet: RawPacket): #Logging filter
82
82
 
83
83
  ## Data handlers
84
84
 
85
- ### RawPacket
85
+ ### RawPacket
86
86
  ```python
87
87
  from firegex.nfproxy import RawPacket
88
88
  ```
@@ -143,6 +143,12 @@ from firegex.nfproxy import HttpRequestHeader
143
143
  ```
144
144
  This handler will be called only when the request headers are complete. It will receive a HttpRequestHeader object with the same properties as HttpRequest.
145
145
 
146
+ ### HttpFullRequest
147
+ ```python
148
+ from firegex.nfproxy import HttpFullRequest
149
+ ```
150
+ This handler will be called only when the request is complete. It will receive a HttpFullRequest object with the same properties as HttpRequest.
151
+
146
152
  ### HttpResponse
147
153
  ```python
148
154
  from firegex.nfproxy import HttpResponse
@@ -170,3 +176,8 @@ from firegex.nfproxy import HttpResponseHeader
170
176
  ```
171
177
  This handler will be called only when the response headers are complete. It will receive a HttpResponseHeader object with the same properties as HttpResponse.
172
178
 
179
+ ### HttpFullResponse
180
+ ```python
181
+ from firegex.nfproxy import HttpFullResponse
182
+ ```
183
+ This handler will be called only when the response is complete. It will receive a HttpFullResponse object with the same properties as HttpResponse.
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
6
6
  with open('requirements.txt', 'r', encoding='utf-8') as f:
7
7
  required = [ele.strip() for ele in f.read().splitlines() if not ele.strip().startswith("#") and ele.strip() != ""]
8
8
 
9
- VERSION = "3.2.12"
9
+ VERSION = "3.2.14"
10
10
 
11
11
  setuptools.setup(
12
12
  name="firegex",
@@ -1,5 +0,0 @@
1
-
2
- __version__ = "3.2.12" if "{" not in "3.2.12" else "0.0.0"
3
-
4
- #Exported functions
5
- __all__ = []
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes