Title: Exception when setting boolean option `False` or integer `0` value in Module Option · Issue #39 · dhondta/python-sploitkit · GitHub
Open Graph Title: Exception when setting boolean option `False` or integer `0` value in Module Option · Issue #39 · dhondta/python-sploitkit
X Title: Exception when setting boolean option `False` or integer `0` value in Module Option · Issue #39 · dhondta/python-sploitkit
Description: Description Sploitkit throws an exception when setting the boolean value False or integer 0 for Module Option. When setting True it works correctly. Sploitkit version: sploitkit==0.6.0 Python version: 3.12+ Exceptions % python -B main.py...
Open Graph Description: Description Sploitkit throws an exception when setting the boolean value False or integer 0 for Module Option. When setting True it works correctly. Sploitkit version: sploitkit==0.6.0 Python versi...
X Description: Description Sploitkit throws an exception when setting the boolean value False or integer 0 for Module Option. When setting True it works correctly. Sploitkit version: sploitkit==0.6.0 Python versi...
Opengraph URL: https://github.com/dhondta/python-sploitkit/issues/39
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exception when setting boolean option `False` or integer `0` value in Module Option","articleBody":"### Description\r\nSploitkit throws an exception when setting the boolean value `False` or integer `0` for Module Option. When setting `True` it works correctly.\r\nSploitkit version: `sploitkit==0.6.0`\r\nPython version: 3.12+\r\n\r\n### Exceptions\r\n```python\r\n% python -B main.py\r\nTraceback (most recent call last):\r\n File \".../main.py\", line 28, in \u003cmodule\u003e\r\n main()\r\n File \".../main.py\", line 23, in main\r\n test.config['SEND_PAYLOAD'] = False\r\n ~~~~~~~~~~~^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 481, in __setitem__\r\n return c.__setitem__(key, value)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 67, in __setitem__\r\n key = self._setkey(key, value)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 159, in _setkey\r\n raise ValueError(f\"Invalid value '{value}' for key '{key.name}'\")\r\nValueError: Invalid value 'False' for key 'SEND_PAYLOAD'\r\n\r\n############################################################################################\r\n\r\nTraceback (most recent call last):\r\n File \".../main.py\", line 28, in \u003cmodule\u003e\r\n main()\r\n File \".../main.py\", line 23, in main\r\n test.config['SEND_PAYLOAD'] = 0\r\n ~~~~~~~~~~~^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 481, in __setitem__\r\n return c.__setitem__(key, value)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 67, in __setitem__\r\n key = self._setkey(key, value)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \".../venv_macos31244/lib/python3.12/site-packages/sploitkit/core/components/config.py\", line 159, in _setkey\r\n raise ValueError(f\"Invalid value '{value}' for key '{key.name}'\")\r\nValueError: Invalid value '0' for key 'SEND_PAYLOAD'\r\n\r\n```\r\n\r\n### Code\r\n```python\r\nfrom pprint import pprint\r\n\r\nfrom sploitkit import Config, Module, Option\r\n\r\n\r\nclass TestModule(Module):\r\n config = Config(\r\n {\r\n Option(\r\n name='SEND_PAYLOAD',\r\n description='Boolean or integer value',\r\n required=True,\r\n ): None,\r\n }\r\n )\r\n\r\n def run(self, *args, **kwargs) -\u003e None:\r\n pprint(dict(self.config))\r\n\r\n\r\ndef main() -\u003e None:\r\n test = TestModule()\r\n test.config['SEND_PAYLOAD'] = False # or 0\r\n test.run()\r\n\r\n\r\nif __name__ == '__main__':\r\n main()\r\n```","author":{"url":"https://github.com/tterletskyy","@type":"Person","name":"tterletskyy"},"datePublished":"2024-09-11T10:31:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/39/python-sploitkit/issues/39"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fb0e63f3-1bff-106c-9ec7-d536285328e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9CC:181A3F:2C15E8A:38B0C0A:69903C01 |
| html-safe-nonce | 8dbef4954bdf336ec217cbfbb066d81bed8264c23dedc952d28a7feca126dac9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUNDOjE4MUEzRjoyQzE1RThBOjM4QjBDMEE6Njk5MDNDMDEiLCJ2aXNpdG9yX2lkIjoiNTcxNTUzNjk5OTQ2MjQ4NDk5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 006107ab3350a322111375369f65150efe36ac56245b7f9a40052bde07fa2d4d |
| hovercard-subject-tag | issue:2519350163 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/dhondta/python-sploitkit/39/issue_layout |
| twitter:image | https://opengraph.githubassets.com/060f9efa376f67c44741732562c3edd1761352d7c80993451dc416fcc132bc8a/dhondta/python-sploitkit/issues/39 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/060f9efa376f67c44741732562c3edd1761352d7c80993451dc416fcc132bc8a/dhondta/python-sploitkit/issues/39 |
| og:image:alt | Description Sploitkit throws an exception when setting the boolean value False or integer 0 for Module Option. When setting True it works correctly. Sploitkit version: sploitkit==0.6.0 Python versi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tterletskyy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/dhondta/python-sploitkit git https://github.com/dhondta/python-sploitkit.git |
| octolytics-dimension-user_id | 9108102 |
| octolytics-dimension-user_login | dhondta |
| octolytics-dimension-repository_id | 184007095 |
| octolytics-dimension-repository_nwo | dhondta/python-sploitkit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 184007095 |
| octolytics-dimension-repository_network_root_nwo | dhondta/python-sploitkit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width