scythe-ttp 0.17.3__tar.gz → 0.17.5__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.

Potentially problematic release.


This version of scythe-ttp might be problematic. Click here for more details.

Files changed (61) hide show
  1. {scythe_ttp-0.17.3/scythe_ttp.egg-info → scythe_ttp-0.17.5}/PKG-INFO +1 -1
  2. scythe_ttp-0.17.5/VERSION +1 -0
  3. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/auth/cookie_jwt.py +43 -14
  4. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5/scythe_ttp.egg-info}/PKG-INFO +1 -1
  5. scythe_ttp-0.17.3/VERSION +0 -1
  6. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/LICENSE +0 -0
  7. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/MANIFEST.in +0 -0
  8. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/README.md +0 -0
  9. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/pyproject.toml +0 -0
  10. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/requirements.txt +0 -0
  11. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/__init__.py +0 -0
  12. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/auth/__init__.py +0 -0
  13. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/auth/base.py +0 -0
  14. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/auth/basic.py +0 -0
  15. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/auth/bearer.py +0 -0
  16. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/__init__.py +0 -0
  17. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/base.py +0 -0
  18. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/default.py +0 -0
  19. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/human.py +0 -0
  20. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/machine.py +0 -0
  21. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/behaviors/stealth.py +0 -0
  22. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/cli/__init__.py +0 -0
  23. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/cli/main.py +0 -0
  24. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/core/__init__.py +0 -0
  25. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/core/executor.py +0 -0
  26. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/core/headers.py +0 -0
  27. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/core/ttp.py +0 -0
  28. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/journeys/__init__.py +0 -0
  29. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/journeys/actions.py +0 -0
  30. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/journeys/base.py +0 -0
  31. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/journeys/executor.py +0 -0
  32. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/orchestrators/__init__.py +0 -0
  33. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/orchestrators/base.py +0 -0
  34. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/orchestrators/batch.py +0 -0
  35. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/orchestrators/distributed.py +0 -0
  36. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/orchestrators/scale.py +0 -0
  37. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/payloads/__init__.py +0 -0
  38. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/payloads/generators.py +0 -0
  39. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/ttps/__init__.py +0 -0
  40. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/ttps/web/__init__.py +0 -0
  41. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/ttps/web/login_bruteforce.py +0 -0
  42. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/ttps/web/sql_injection.py +0 -0
  43. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe/ttps/web/uuid_guessing.py +0 -0
  44. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe_ttp.egg-info/SOURCES.txt +0 -0
  45. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe_ttp.egg-info/dependency_links.txt +0 -0
  46. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe_ttp.egg-info/entry_points.txt +0 -0
  47. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe_ttp.egg-info/requires.txt +0 -0
  48. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/scythe_ttp.egg-info/top_level.txt +0 -0
  49. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/setup.cfg +0 -0
  50. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_api_models.py +0 -0
  51. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_authentication.py +0 -0
  52. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_behaviors.py +0 -0
  53. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_cli.py +0 -0
  54. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_cookie_jwt_auth.py +0 -0
  55. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_executor_modes.py +0 -0
  56. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_expected_results.py +0 -0
  57. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_feature_completeness.py +0 -0
  58. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_header_extraction.py +0 -0
  59. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_journeys.py +0 -0
  60. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_orchestrators.py +0 -0
  61. {scythe_ttp-0.17.3 → scythe_ttp-0.17.5}/tests/test_ttp_api_mode.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scythe-ttp
3
- Version: 0.17.3
3
+ Version: 0.17.5
4
4
  Summary: An extensible framework for emulating attacker TTPs with Selenium.
5
5
  Author-email: EpykLab <cyber@epyklab.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -0,0 +1 @@
1
+ 0.17.5
@@ -49,10 +49,17 @@ class CookieJWTAuth(Authentication):
49
49
 
50
50
  Behavior:
51
51
  - In API mode: JourneyExecutor will call get_auth_cookies(); this class will
52
- perform a POST to login_url (if token not cached), parse JSON, extract the
53
- token via jwt_json_path, and return {cookie_name: token}.
52
+ perform a POST to login_url (if token not cached), extract the token, and
53
+ return {cookie_name: token}.
54
54
  - In UI mode: authenticate() will ensure the browser has the cookie set for
55
55
  the target domain.
56
+
57
+ Parameters:
58
+ - content_type: Either "json" (default) to send payload as JSON, or "form"
59
+ to send as application/x-www-form-urlencoded form data.
60
+ - jwt_source: Either "json" (default) to extract JWT from the JSON response body
61
+ using jwt_json_path, or "cookie" to extract it from the Set-Cookie response header
62
+ using cookie_name.
56
63
  """
57
64
 
58
65
  def __init__(self,
@@ -64,6 +71,8 @@ class CookieJWTAuth(Authentication):
64
71
  extra_fields: Optional[Dict[str, Any]] = None,
65
72
  jwt_json_path: str = "token",
66
73
  cookie_name: str = "stellarbridge",
74
+ content_type: str = "json",
75
+ jwt_source: str = "json",
67
76
  session: Optional[requests.Session] = None,
68
77
  description: str = "Authenticate via API and set JWT cookie"):
69
78
  super().__init__(
@@ -78,29 +87,49 @@ class CookieJWTAuth(Authentication):
78
87
  self.extra_fields = extra_fields or {}
79
88
  self.jwt_json_path = jwt_json_path
80
89
  self.cookie_name = cookie_name
90
+ self.content_type = content_type
91
+ self.jwt_source = jwt_source
81
92
  # Avoid importing requests in test environments; allow injected session
82
93
  self._session = session or (requests.Session() if requests is not None else None)
83
94
  self.token: Optional[str] = None
84
95
 
85
96
  def _login_and_get_token(self) -> str:
86
97
  payload: Dict[str, Any] = dict(self.extra_fields)
87
- if self.username is not None:
88
- payload[self.username_field] = self.username
89
- if self.password is not None:
90
- payload[self.password_field] = self.password
98
+ payload[self.username_field] = self.username
99
+ payload[self.password_field] = self.password
91
100
  try:
92
- resp = self._session.post(self.login_url, json=payload, timeout=15)
101
+ if self.content_type == "form":
102
+ resp = self._session.post(self.login_url, data=payload, timeout=15)
103
+ else:
104
+ resp = self._session.post(self.login_url, json=payload, timeout=15)
93
105
  # try json; raise on non-2xx to surface errors
94
106
  resp.raise_for_status()
95
- data = resp.json()
96
107
  except Exception as e:
97
108
  raise AuthenticationError(f"Login request failed: {e}", self.name)
98
- token = _extract_by_dot_path(data, self.jwt_json_path)
99
- if not token or not isinstance(token, str):
100
- raise AuthenticationError(
101
- f"JWT not found at path '{self.jwt_json_path}' in login response",
102
- self.name,
103
- )
109
+
110
+ # Extract token from either response cookies or JSON body
111
+ token = None
112
+ if self.jwt_source == "cookie":
113
+ # Extract from response cookies
114
+ token = resp.cookies.get(self.cookie_name)
115
+ if not token or not isinstance(token, str):
116
+ raise AuthenticationError(
117
+ f"JWT cookie '{self.cookie_name}' not found in login response",
118
+ self.name,
119
+ )
120
+ else:
121
+ # Extract from JSON response body
122
+ try:
123
+ data = resp.json()
124
+ except Exception as e:
125
+ raise AuthenticationError(f"Failed to parse JSON response: {e}", self.name)
126
+ token = _extract_by_dot_path(data, self.jwt_json_path)
127
+ if not token or not isinstance(token, str):
128
+ raise AuthenticationError(
129
+ f"JWT not found at path '{self.jwt_json_path}' in login response",
130
+ self.name,
131
+ )
132
+
104
133
  self.token = token
105
134
  self.store_auth_data('jwt', token)
106
135
  self.store_auth_data('login_time', time.time())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scythe-ttp
3
- Version: 0.17.3
3
+ Version: 0.17.5
4
4
  Summary: An extensible framework for emulating attacker TTPs with Selenium.
5
5
  Author-email: EpykLab <cyber@epyklab.com>
6
6
  Classifier: Programming Language :: Python :: 3
scythe_ttp-0.17.3/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.17.3
File without changes
File without changes
File without changes
File without changes
File without changes