dementor 1.0.0.dev10__tar.gz → 1.0.0.dev12__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 (68) hide show
  1. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/PKG-INFO +18 -1
  2. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/README.md +1 -0
  3. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/__init__.py +1 -1
  4. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/assets/Dementor.toml +202 -3
  5. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/assets/banner.txt +3 -3
  6. dementor-1.0.0.dev12/dementor/assets/www/upnp-default/dd.xml +32 -0
  7. dementor-1.0.0.dev12/dementor/assets/www/upnp-default/present.html +84 -0
  8. dementor-1.0.0.dev12/dementor/assets/www/upnp-default/scpd.xml +3 -0
  9. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/config/session.py +13 -0
  10. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/config/toml.py +6 -5
  11. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/config/util.py +8 -3
  12. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/database.py +11 -5
  13. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/loader.py +0 -2
  14. dementor-1.0.0.dev12/dementor/log/__init__.py +24 -0
  15. {dementor-1.0.0.dev10/dementor → dementor-1.0.0.dev12/dementor/log}/logger.py +10 -28
  16. dementor-1.0.0.dev12/dementor/log/stream.py +214 -0
  17. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/paths.py +10 -1
  18. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/ftp.py +1 -1
  19. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/http.py +1 -2
  20. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/imap.py +1 -1
  21. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/ipp.py +1 -1
  22. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/kerberos.py +1 -1
  23. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/ldap.py +2 -2
  24. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/llmnr.py +15 -18
  25. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/mdns.py +20 -20
  26. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/msrpc/rpc.py +6 -2
  27. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/mssql.py +35 -25
  28. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/mysql.py +3 -3
  29. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/netbios.py +10 -5
  30. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/pop3.py +1 -1
  31. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/quic.py +8 -6
  32. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/smb.py +2 -2
  33. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/smtp.py +1 -1
  34. dementor-1.0.0.dev12/dementor/protocols/ssdp.py +392 -0
  35. dementor-1.0.0.dev12/dementor/protocols/upnp.py +214 -0
  36. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/x11.py +1 -1
  37. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/servers.py +19 -1
  38. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/standalone.py +60 -11
  39. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/PKG-INFO +18 -1
  40. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/SOURCES.txt +9 -8
  41. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/requires.txt +1 -0
  42. dementor-1.0.0.dev12/docs/README.pypi.md +58 -0
  43. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/pyproject.toml +3 -2
  44. dementor-1.0.0.dev10/docs/README.pypi.md +0 -42
  45. dementor-1.0.0.dev10/test/test_dcerpc.py +0 -15
  46. dementor-1.0.0.dev10/test/test_dcom.py +0 -51
  47. dementor-1.0.0.dev10/test/test_epm.py +0 -40
  48. dementor-1.0.0.dev10/test/test_mssql_auth.py +0 -56
  49. dementor-1.0.0.dev10/test/test_ssl_client.py +0 -29
  50. dementor-1.0.0.dev10/test/test_ssl_server.py +0 -31
  51. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/LICENSE +0 -0
  52. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/__main__.py +0 -0
  53. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/assets/www/error_page.html +0 -0
  54. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/assets/www/wpad.dat +0 -0
  55. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/config/__init__.py +0 -0
  56. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/config/attr.py +0 -0
  57. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/filters.py +0 -0
  58. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/__init__.py +0 -0
  59. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/msrpc/__init__.py +0 -0
  60. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/msrpc/dcom.py +0 -0
  61. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/msrpc/epm.py +0 -0
  62. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/msrpc.py +0 -0
  63. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/ntlm.py +0 -0
  64. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor/protocols/spnego.py +0 -0
  65. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/dependency_links.txt +0 -0
  66. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/entry_points.txt +0 -0
  67. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/dementor.egg-info/top_level.txt +0 -0
  68. {dementor-1.0.0.dev10 → dementor-1.0.0.dev12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dementor
3
- Version: 1.0.0.dev10
3
+ Version: 1.0.0.dev12
4
4
  Summary: LLMNR/NBT-NS/mDNS Poisoner and rogue service provider
5
5
  Author: MatrixEditor
6
6
  Maintainer: MatrixEditor
@@ -53,6 +53,7 @@ Requires-Dist: aioquic
53
53
  Requires-Dist: typer
54
54
  Requires-Dist: jinja2
55
55
  Requires-Dist: caterpillar-py
56
+ Requires-Dist: pyipp
56
57
  Dynamic: license-file
57
58
 
58
59
  # Dementor
@@ -66,6 +67,7 @@ on the [Documentation](https://matrixeditor.github.io/dementor/) page.
66
67
  - Fine-grained, per-protocol configuration using a modular system (see [Docs - Configuration](https://matrixeditor.github.io/dementor/config/index.html))
67
68
  - Near-complete protocol parity with Responder (see [Docs - Compatibility](https://matrixeditor.github.io/dementor/compat.html))
68
69
  - Easy integration of new protocols via the extension system
70
+ - A lot of new protocols (e.g. IPP, MySQL, X11, ...)
69
71
 
70
72
  ## Installation
71
73
 
@@ -88,6 +90,21 @@ Let's take a look.
88
90
 
89
91
  ![index_video](https://raw.githubusercontent.com/MatrixEditor/dementor/refs/heads/master/docs/source/_static/images/index-video.gif)
90
92
 
93
+ ### CLI Options
94
+
95
+ ```
96
+ Usage: Dementor [OPTIONS]
97
+
98
+ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────╮
99
+ │ * --interface -I NAME Network interface to use (required for poisoning) [required] │
100
+ │ --analyze -A Only analyze traffic, don't respond to requests │
101
+ │ --config -c PATH Path to a configuration file (otherwise standard path is used) │
102
+ │ --option -O KEY=VALUE Add an extra option to the global configuration file. │
103
+ │ --yes -y Do not ask before starting attack mode. │
104
+ │ --quiet -q Don't print banner at startup │
105
+ │ --help Show this message and exit. │
106
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
107
+ ```
91
108
 
92
109
  ## You need more?
93
110
 
@@ -9,6 +9,7 @@ on the [Documentation](https://matrixeditor.github.io/dementor/) page.
9
9
  - Fine-grained, per-protocol configuration using a modular system (see [Docs - Configuration](https://matrixeditor.github.io/dementor/config/index.html))
10
10
  - Near-complete protocol parity with Responder (see [Docs - Compatibility](https://matrixeditor.github.io/dementor/compat.html))
11
11
  - Easy integration of new protocols via the extension system
12
+ - A lot of new protocols (e.g. IPP, MySQL, X11, ...)
12
13
 
13
14
  ## Installation
14
15
 
@@ -18,5 +18,5 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
20
 
21
- __version__ = "1.0.0.dev10"
21
+ __version__ = "1.0.0.dev12"
22
22
  __author__ = "MatrixEditor"
@@ -60,7 +60,12 @@ LLMNR = true
60
60
 
61
61
  NBTNS = true
62
62
 
63
- # Enables theMSSQL Browser service. Does not require superuser privileges.
63
+ # Enables SSDP multicast poisoning. Does not require superuser privileges.
64
+ # The default value is: true
65
+
66
+ SSDP = true
67
+
68
+ # Enables the MSSQL Browser service. Does not require superuser privileges.
64
69
  # The default value is: true
65
70
 
66
71
  SSRP = true
@@ -134,6 +139,24 @@ POP3 = true
134
139
 
135
140
  IMAP = true
136
141
 
142
+ # Enables X11 TCP servers. Requires no special privileges by default (depends on
143
+ # port configuration)
144
+ # The default value is: true
145
+
146
+ X11 = true
147
+
148
+ # Enables an IPP server. Requires root privileges by default (also depends on
149
+ # port configuration)
150
+ # The default value is: true
151
+
152
+ IPP = true
153
+
154
+ # Enables the UPnP web server.Requires no special privileges by default (depends on
155
+ # port configuration)
156
+ # The default value is: true
157
+
158
+ UPnP = true
159
+
137
160
 
138
161
  # =============================================================================
139
162
  # Globals
@@ -685,7 +708,7 @@ AuthMechanisms = ["PLAIN", "LOGIN", "NTLM"]
685
708
 
686
709
  # default plaintext server
687
710
  [[IMAP.Server]]
688
- Port = 110
711
+ Port = 143
689
712
 
690
713
  # Example TLS server
691
714
  # [[POP3.Server]]
@@ -724,6 +747,136 @@ ServerVersion = "8.0.42"
724
747
  # Key = "/path/to/key"
725
748
 
726
749
 
750
+ # =============================================================================
751
+ # X11
752
+ # =============================================================================
753
+ [X11]
754
+
755
+ # Defines the port range the server will listen on. By default, five ports are opened
756
+ # (for displays 0 through 4). Inclusive start and exclusive end.
757
+
758
+ # PortRange = "6000-6005"
759
+
760
+ # Custom message returned to the client after authentication completes.
761
+
762
+ # ErrorMessage = "Access Denied"
763
+
764
+
765
+ # =============================================================================
766
+ # IPP
767
+ # =============================================================================
768
+ [IPP]
769
+
770
+ # Specifies the port used by the IPP server instance.
771
+
772
+ Port = 631
773
+
774
+ # Defines the server name returned in the Server header.The value can be a formatted
775
+ # string, supporting templating (Jinja2)
776
+
777
+ # ServerType = "IPP/1.1 UNIX-{{ random(5) }}"
778
+
779
+ # Specifies additional headers to include in all server responses. Each entry must be
780
+ # a fully qualified HTTP header line without CRLF at the end.
781
+
782
+ # ExtraHeaders = []
783
+
784
+ # Specifies additional attributes to include in the get-printer-attributes response.
785
+ # Each new attribute requires the following fields:
786
+ # - name: e.g. "printer-device-id"
787
+ # - value: e.g. "1234567890"
788
+ # - tag: e.g. "TEXT" (optional, if type alredy known)
789
+ # # The default attribute settings below can be overridden using this options.
790
+
791
+ # Attributes = []
792
+
793
+ # Default attributes:
794
+
795
+ # PrinterName = "Printer Info"
796
+ # PrinterLocation = "outside"
797
+ # PrinterModel = "HP 8.0"
798
+ # DriverUri =
799
+ # DocumentFormats = []
800
+ # DefaultDocumentFormat = "text/plain"
801
+ # SupportedVersions = ["1.0", "1.1", "2.0", "2.1", "2.2"]
802
+ # SupportedOperations = []
803
+
804
+ # The following settings can be used to trigger CVE-2024-47175 / CVE-2024-47076.
805
+
806
+ # Specifies the command to inject into the generated PPD. (CVE-2024-47175) Any
807
+ # extra hyphens will NOT get escaped.
808
+
809
+ # RemoteCmd =
810
+
811
+ # Specifies the printer attribute that stores the malformed text. (CVE-2024-47176)
812
+
813
+ # RemoteCmdAttr =
814
+
815
+ # Specifies the printer attribute that stores the malformed text. (CVE-2024-47176).
816
+ # "foomatic-rip" must be present in this filter string to correctly interpolate
817
+ # the FoomaticRIPCommandLine.
818
+
819
+ # RemoteCmdCupsFilter =
820
+
821
+
822
+ # =============================================================================
823
+ # SSDP
824
+ # =============================================================================
825
+
826
+ # Specifies the target location of the UPnP webserver. This value will point to
827
+ # the current host if not explicitly set
828
+
829
+ # Location =
830
+
831
+ # Specifies the server type (``Server`` header) that will be returned in SSDP
832
+ # M-SEARCH responses
833
+
834
+ Server = "OS/1.0 UPnP/1.0 Dementor/1.0"
835
+
836
+ # Defines the duration a response to a multicast search should be valid. Maximum
837
+ # cche time.
838
+
839
+ MaxAge = 1800
840
+
841
+ # Specifies additional headers to include in all server responses. Each entry must
842
+ # be a fully qualified SSDP header line without CRLF at the end.
843
+
844
+ ExtraHeaders = ["BOOTID.UPNP.ORG: 1", "CONFIGID.UPNP.ORG: 1337"]
845
+
846
+
847
+ # =============================================================================
848
+ # UPnP
849
+ # =============================================================================
850
+ [UPnP]
851
+
852
+ # Port for the UPnP web server.
853
+
854
+ Port = 50001
855
+
856
+ # A list of directories that store extra UPnP profiles to be used by the web server. Note that
857
+ # only the target directory specified in "Template" will be used.
858
+
859
+ # TemplatesPath = ["/path/to/templates"]
860
+
861
+ # The directory name under one of the template directories specified in "TemplatesPath"
862
+ # that stores the device description, service description and presentation HTML.
863
+
864
+ Template = "upnp-default"
865
+
866
+ # URI and path to the local device description template.
867
+
868
+ DDUri = "/dd.xml"
869
+
870
+ # URI and path to the local service control description template. The file will
871
+ # be empty by default.
872
+
873
+ SCPDUri = "/scpd.xml"
874
+
875
+ # URI and path to the presentation page template.
876
+
877
+ PresentationUri = "/present.html"
878
+
879
+
727
880
  # =============================================================================
728
881
  # Logging
729
882
  # =============================================================================
@@ -740,4 +893,50 @@ Enabled = false
740
893
  # List of debug loggers to enable for troubleshooting. Those won't be visible in
741
894
  # file output and only affect the terminal output.
742
895
 
743
- DebugLoggers = ["asyncio", "mail.log", "impacket.smbserver", "impacket", "quic"]
896
+ DebugLoggers = [
897
+ "asyncio",
898
+ "mail.log",
899
+ "impacket.smbserver",
900
+ "impacket",
901
+ "quic",
902
+ "pyipp.parser",
903
+ ]
904
+
905
+
906
+ [Log.Stream.Hosts]
907
+
908
+ # Uncommenting the Path variable will enable logging all identified clients
909
+ # within the network that either (1) establish a direct connection to dementor,
910
+ # or (2) via multicast/broadcast messages.
911
+
912
+ # Path = "./client_hosts.txt"
913
+
914
+ # Enables/Disables logging IPv4/v6 addresses
915
+
916
+ # IPv6 = true
917
+ # IPv4 = true
918
+
919
+ [Log.Stream.DNS]
920
+
921
+ # Uncommenting the Path variable will enable logging all multicast or broadcast
922
+ # name queries (currently: mDNS, LLMNR and NetBIOS).
923
+
924
+ # Path = "/absolute/path"
925
+
926
+ [Log.Stream.Hashes]
927
+
928
+ # Enables logging captured hashes either to a single output file or into
929
+ # separate files.
930
+
931
+ # Path = "./hash-collections"
932
+
933
+ # "Splits" the collected hashes into separate files.
934
+
935
+ # Split = true
936
+
937
+ # File prefix (dynamic string) and suffix to apply when writeing hashes to
938
+ # separate files.
939
+
940
+ # FilePrefix = "{{ hash_type }}-capture"
941
+ # FileSuffix = ".txt"
942
+
@@ -6,11 +6,11 @@
6
6
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010405][/#000101] [#020405][/#010405] [#04090b][/#020405] [#050e0f][/#04090b] [#0a181a][/#050e0f] [#090f12][/#0a181a] [#111d25][/#090f12].[#00000f][/#111d25] [#688b89][/#00000f]+[#54adaf][/#688b89]+[#8cc1b6][/#54adaf]*[#263647][/#8cc1b6]:[#303046][/#263647].[#040724][/#303046] [#0c0f29][/#040724] [#2d2d44][/#0c0f29].[#50656d][/#2d2d44]-[#7bc0b9][/#50656d]*[#66b9b9][/#7bc0b9]*[#4e5a5a][/#66b9b9]-[#00030e][/#4e5a5a] [#121e24][/#00030e].[#081013][/#121e24] [#0b1a1b][/#081013] [#040a0b][/#0b1a1b] [#030809][/#040a0b] [#010203][/#030809] [#010304][/#010203] [#000001][/#010304] [#000000][/#000001] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
7
7
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000001][/#000000] [#010303][/#000001] [#091615][/#010303] [#0a1414][/#091615] [#0a1d21][/#0a1414] [#12282f][/#0a1d21].[#113342][/#12282f].[#03223d][/#113342].[#345265][/#03223d]:[#73b7b0][/#345265]*[#8bcbc6][/#73b7b0]#[#374755][/#8bcbc6]:[#040723][/#374755] [#141d34][/#040723].[#0f162c][/#141d34] [#11172d][/#0f162c] [#131a32][/#11172d].[#000520][/#131a32] [#55777d][/#000520]=[#a5ead7][/#55777d]%[#76a2a0][/#a5ead7]+[#204159][/#76a2a0]:[#012842][/#204159].[#133440][/#012842].[#13262b][/#133440].[#0a191d][/#13262b] [#0a1515][/#0a191d] [#091514][/#0a1515] [#000001][/#091514] [#000101][/#000001] [#000000][/#000101] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
8
8
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#020404][/#000000] [#020506][/#020404] [#0a1e1e][/#020506] [#040608][/#0a1e1e] [#091115][/#040608] [#152935][/#091115].[#00223c][/#152935].[#466e7c][/#00223c]-[#77b3af][/#466e7c]*[#94decf][/#77b3af]#[#6bcfc7][/#94decf]*[#7ba3a5][/#6bcfc7]+[#16384d][/#7ba3a5].[#0b152d][/#16384d] [#0b142c][/#0b152d] [#0c132a][/#0b142c] [#0c142a][/#0c132a] [#0d142a][/#0c142a] [#06142d][/#0d142a] [#355366][/#06142d]:[#7fbbb9][/#355366]*[#7ad9cf][/#7fbbb9]#[#91d4c8][/#7ad9cf]#[#7baca9][/#91d4c8]*[#2c5466][/#7baca9]:[#012037][/#2c5466].[#152a33][/#012037].[#050a0d][/#152a33] [#080d0e][/#050a0d] [#0c1c1b][/#080d0e] [#010303][/#0c1c1b] [#020404][/#010303] [#000000][/#020404] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] [bold]Using Libraries[/bold]
9
- [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010505][/#000101] [#174c4b][/#010505]:[#0b1f25][/#174c4b].[#11273a][/#0b1f25].[#0f455b][/#11273a]:[#2f7181][/#0f455b]-[#a7d6cb][/#2f7181]#[#a0f4db][/#a7d6cb]%[#84ead2][/#a0f4db]#[#4fb0b1][/#84ead2]+[#408b96][/#4fb0b1]=[#579aa2][/#408b96]+[#223b50][/#579aa2]:[#070520][/#223b50] [#0d152c][/#070520] [#0c122a][/#0d152c] [#0d0822][/#0c122a] [#264759][/#0d0822]:[#568d94][/#264759]=[#338996][/#568d94]=[#67cdc3][/#338996]*[#8debd3][/#67cdc3]%[#baeed7][/#8debd3]%[#86b7b4][/#baeed7]*[#236579][/#86b7b4]-[#0c3d53][/#236579].[#112334][/#0c3d53].[#0e3032][/#112334].[#124242][/#0e3032]:[#000000][/#124242] [#000102][/#000000] [#000000][/#000102] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]Scapy[/b] : [white]{scapy_version}[/white]
10
- [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010303][/#000101] [#010303][/#010303] [#04080a][/#010303] [#0d1f25][/#04080a].[#1d5560][/#0d1f25]:[#075a70][/#1d5560]:[#5ba6ab][/#075a70]+[#a8eed8][/#5ba6ab]%[#82e2d0][/#a8eed8]#[#81d9cb][/#82e2d0]#[#76d3c6][/#81d9cb]#[#7ad2c6][/#76d3c6]#[#21677c][/#7ad2c6]-[#398492][/#21677c]=[#4a9faa][/#398492]+[#224a5c][/#4a9faa]:[#0d0e27][/#224a5c] [#0d132c][/#0d0e27] [#265e6f][/#0d132c]-[#428693][/#265e6f]=[#33707f][/#428693]-[#378790][/#33707f]=[#81ddca][/#378790]#[#83d0c1][/#81ddca]#[#76cabc][/#83d0c1]*[#94ecd4][/#76cabc]%[#b9ecd8][/#94ecd4]%[#49929c][/#b9ecd8]=[#0a5768][/#49929c]:[#1a4b51][/#0a5768]:[#060f10][/#1a4b51] [#030c0e][/#060f10] [#010303][/#030c0e] [#000203][/#010303] [#000000][/#000203] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]Impacket[/b] : [white]{impacket_version}[/white]
9
+ [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010505][/#000101] [#174c4b][/#010505]:[#0b1f25][/#174c4b].[#11273a][/#0b1f25].[#0f455b][/#11273a]:[#2f7181][/#0f455b]-[#a7d6cb][/#2f7181]#[#a0f4db][/#a7d6cb]%[#84ead2][/#a0f4db]#[#4fb0b1][/#84ead2]+[#408b96][/#4fb0b1]=[#579aa2][/#408b96]+[#223b50][/#579aa2]:[#070520][/#223b50] [#0d152c][/#070520] [#0c122a][/#0d152c] [#0d0822][/#0c122a] [#264759][/#0d0822]:[#568d94][/#264759]=[#338996][/#568d94]=[#67cdc3][/#338996]*[#8debd3][/#67cdc3]%[#baeed7][/#8debd3]%[#86b7b4][/#baeed7]*[#236579][/#86b7b4]-[#0c3d53][/#236579].[#112334][/#0c3d53].[#0e3032][/#112334].[#124242][/#0e3032]:[#000000][/#124242] [#000102][/#000000] [#000000][/#000102] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]scapy[/b] : [white]{scapy_version}[/white]
10
+ [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010303][/#000101] [#010303][/#010303] [#04080a][/#010303] [#0d1f25][/#04080a].[#1d5560][/#0d1f25]:[#075a70][/#1d5560]:[#5ba6ab][/#075a70]+[#a8eed8][/#5ba6ab]%[#82e2d0][/#a8eed8]#[#81d9cb][/#82e2d0]#[#76d3c6][/#81d9cb]#[#7ad2c6][/#76d3c6]#[#21677c][/#7ad2c6]-[#398492][/#21677c]=[#4a9faa][/#398492]+[#224a5c][/#4a9faa]:[#0d0e27][/#224a5c] [#0d132c][/#0d0e27] [#265e6f][/#0d132c]-[#428693][/#265e6f]=[#33707f][/#428693]-[#378790][/#33707f]=[#81ddca][/#378790]#[#83d0c1][/#81ddca]#[#76cabc][/#83d0c1]*[#94ecd4][/#76cabc]%[#b9ecd8][/#94ecd4]%[#49929c][/#b9ecd8]=[#0a5768][/#49929c]:[#1a4b51][/#0a5768]:[#060f10][/#1a4b51] [#030c0e][/#060f10] [#010303][/#030c0e] [#000203][/#010303] [#000000][/#000203] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]impacket[/b] : [white]{impacket_version}[/white]
11
11
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#040609][/#000000] [#11202d][/#040609].[#072d47][/#11202d].[#337c8c][/#072d47]=[#9de3d5][/#337c8c]%[#81e2cf][/#9de3d5]#[#67d5c8][/#81e2cf]#[#4dc7c3][/#67d5c8]*[#41a2a7][/#4dc7c3]+[#66c0b8][/#41a2a7]*[#69ccc4][/#66c0b8]*[#21677e][/#69ccc4]-[#2c798c][/#21677e]-[#39a1a9][/#2c798c]+[#101732][/#39a1a9] [#193b52][/#101732]:[#3197a4][/#193b52]=[#265f76][/#3197a4]-[#358290][/#265f76]=[#7fe3d2][/#358290]#[#4a9c9e][/#7fe3d2]+[#50b4b4][/#4a9c9e]+[#52c7c1][/#50b4b4]*[#74ddcb][/#52c7c1]#[#9dedd5][/#74ddcb]%[#acdcce][/#9dedd5]%[#115268][/#acdcce]:[#0c2035][/#115268].[#0e1a20][/#0c2035] [#020406][/#0e1a20] [#000000][/#020406] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]aiosmtpd[/b] : [white]{aiosmtpd_version}[/white]
12
12
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#081d1d][/#000000] [#030609][/#081d1d] [#0f2136][/#030609].[#0d3f57][/#0f2136].[#84b2aa][/#0d3f57]*[#6dd0c7][/#84b2aa]*[#8eddcc][/#6dd0c7]#[#63cec7][/#8eddcc]*[#2e9daa][/#63cec7]=[#4db2b4][/#2e9daa]+[#2d6e7b][/#4db2b4]-[#5bcfc7][/#2d6e7b]*[#5bd0c9][/#5bcfc7]*[#26758b][/#5bd0c9]-[#25657e][/#26758b]-[#111e3a][/#25657e].[#16314d][/#111e3a].[#1d5776][/#16314d]:[#2b8696][/#1d5776]=[#6ae2d4][/#2b8696]#[#47a4a3][/#6ae2d4]+[#317981][/#47a4a3]-[#37a3ae][/#317981]+[#2a9aa8][/#37a3ae]=[#79dece][/#2a9aa8]#[#7fd4c8][/#79dece]#[#8fe5d4][/#7fd4c8]#[#618b8f][/#8fe5d4]=[#052c47][/#618b8f].[#0d1724][/#052c47] [#020506][/#0d1724] [#071718][/#020506] [#000000][/#071718] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]aioquic[/b] : [white]{aioquic_version}[/white]
13
- [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#000000][/#000101] [#0f3433][/#000000].[#153f3e][/#0f3433].[#00040e][/#153f3e] [#396a75][/#00040e]-[#64beb6][/#396a75]*[#3fb7b7][/#64beb6]+[#56a8ac][/#3fb7b7]+[#62d4cc][/#56a8ac]*[#238095][/#62d4cc]=[#2d8294][/#238095]=[#388e99][/#2d8294]=[#17425d][/#388e99]:[#40b1b7][/#17425d]+[#3aa9b3][/#40b1b7]+[#183d59][/#3aa9b3]:[#12243f][/#183d59].[#101f3a][/#12243f].[#206077][/#101f3a]-[#3db9bd][/#206077]+[#298894][/#3db9bd]=[#184057][/#298894]:[#3b99a2][/#184057]=[#21667c][/#3b99a2]-[#2592a5][/#21667c]=[#7fd7cc][/#2592a5]#[#4ca0a5][/#7fd7cc]+[#53cbc8][/#4ca0a5]*[#64b7b5][/#53cbc8]*[#1e4b5d][/#64b7b5]:[#00030c][/#1e4b5d] [#144848][/#00030c]:[#092424][/#144848].[#000000][/#092424] [#000101][/#000000] [#000000][/#000101] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
13
+ [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#000000][/#000101] [#0f3433][/#000000].[#153f3e][/#0f3433].[#00040e][/#153f3e] [#396a75][/#00040e]-[#64beb6][/#396a75]*[#3fb7b7][/#64beb6]+[#56a8ac][/#3fb7b7]+[#62d4cc][/#56a8ac]*[#238095][/#62d4cc]=[#2d8294][/#238095]=[#388e99][/#2d8294]=[#17425d][/#388e99]:[#40b1b7][/#17425d]+[#3aa9b3][/#40b1b7]+[#183d59][/#3aa9b3]:[#12243f][/#183d59].[#101f3a][/#12243f].[#206077][/#101f3a]-[#3db9bd][/#206077]+[#298894][/#3db9bd]=[#184057][/#298894]:[#3b99a2][/#184057]=[#21667c][/#3b99a2]-[#2592a5][/#21667c]=[#7fd7cc][/#2592a5]#[#4ca0a5][/#7fd7cc]+[#53cbc8][/#4ca0a5]*[#64b7b5][/#53cbc8]*[#1e4b5d][/#64b7b5]:[#00030c][/#1e4b5d] [#144848][/#00030c]:[#092424][/#144848].[#000000][/#092424] [#000101][/#000000] [#000000][/#000101] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000] - [b]pyipp[/b] : [white]{pyipp_version}[/white]
14
14
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#000000][/#000101] [#103c3a][/#000000].[#2d5255][/#103c3a]:[#62b2af][/#2d5255]*[#3daeb1][/#62b2af]+[#3ea7b0][/#3daeb1]+[#2a8093][/#3ea7b0]=[#54a4a7][/#2a8093]+[#3db2ba][/#54a4a7]+[#163d57][/#3db2ba]:[#246679][/#163d57]-[#2f7d8d][/#246679]=[#1b4b64][/#2f7d8d]:[#339aa6][/#1b4b64]=[#173a51][/#339aa6].[#111f38][/#173a51].[#0f1935][/#111f38] [#1f576d][/#0f1935]:[#2e8794][/#1f576d]=[#1a4860][/#2e8794]:[#27818d][/#1a4860]=[#124252][/#27818d]:[#185062][/#124252]:[#4fc2c5][/#185062]*[#48828c][/#4fc2c5]=[#2b98a5][/#48828c]=[#44b4b9][/#2b98a5]+[#4ec0bf][/#44b4b9]*[#58a4a5][/#4ec0bf]+[#1d464a][/#58a4a5]:[#0f3e3d][/#1d464a].[#000000][/#0f3e3d] [#000101][/#000000] [#000000][/#000101] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
15
15
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#000000][/#000101] [#183034][/#000000].[#58a8a7][/#183034]+[#3daeb3][/#58a8a7]+[#2aa7b1][/#3daeb3]+[#1f5772][/#2aa7b1]:[#288698][/#1f5772]=[#276477][/#288698]-[#39a4ad][/#276477]+[#248790][/#39a4ad]=[#0e0e27][/#248790] [#1d4056][/#0e0e27]:[#245e76][/#1d4056]-[#1e4664][/#245e76]:[#173049][/#1e4664].[#152843][/#173049].[#0f1b35][/#152843].[#112842][/#0f1b35].[#1b4e68][/#112842]:[#236f7c][/#1b4e68]-[#091722][/#236f7c] [#0f1825][/#091722] [#35aab1][/#0f1825]+[#328894][/#35aab1]=[#1a5e71][/#328894]:[#258599][/#1a5e71]=[#226c84][/#258599]-[#2eb2ba][/#226c84]+[#4bb8ba][/#2eb2ba]+[#5ea9a6][/#4bb8ba]+[#111e21][/#5ea9a6].[#000000][/#111e21] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
16
16
  [#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000101][/#000000] [#010304][/#000101] [#132b2f][/#010304].[#092b2c][/#132b2f].[#123e4a][/#092b2c]:[#278496][/#123e4a]=[#22677f][/#278496]-[#20506b][/#22677f]:[#266b7d][/#20506b]-[#1a5c71][/#266b7d]:[#2d9fac][/#1a5c71]=[#173547][/#2d9fac].[#103640][/#173547].[#0c1d2b][/#103640].[#122a45][/#0c1d2b].[#183655][/#122a45].[#13203b][/#183655].[#13223f][/#13203b].[#163252][/#13223f].[#153650][/#163252].[#0c2830][/#153650].[#103344][/#0c2830].[#24566b][/#103344]:[#30a1ad][/#24566b]+[#12435b][/#30a1ad]:[#256f81][/#12435b]-[#27657f][/#256f81]-[#257b90][/#27657f]-[#217c8c][/#257b90]-[#0b3037][/#217c8c].[#0c2c2c][/#0b3037].[#14282b][/#0c2c2c].[#000101][/#14282b] [#000101][/#000101] [#000000][/#000101] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [#000000][/#000000] [/#000000]
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0"?>
2
+ <root xmlns="urn:schemas-upnp-org:device-1-0" configId="1337">
3
+ <specVersion>
4
+ <major>1</major>
5
+ <minor>0</minor>
6
+ </specVersion>
7
+ <device>
8
+ <deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
9
+ <friendlyName>Dementor</friendlyName>
10
+ <manufacturer>Manufacturer</manufacturer>
11
+ <manufacturerURL>http://{{session.ipv4}}/manufacturer/</manufacturerURL>
12
+ <modelDescription>user-friendly computer</modelDescription>
13
+ <modelName>Office Computer</modelName>
14
+ <modelNumber>COM{{ random(5) }}</modelNumber>
15
+ <modelURL>http://{{session.ipv4}}/model</modelURL>
16
+ <serialNumber>{{ random(10) }}</serialNumber>
17
+ <UDN>uuid:{{uuid}}</UDN>
18
+ <UPC>00000000000</UPC>
19
+ <serviceList>
20
+ <service>
21
+ <serviceType>urn:schemas-upnp-org:service:Dummy:1</serviceType>
22
+ <serviceId>urn:upnp-org:serviceId:Dummy</serviceId>
23
+ <SCPDURL>/{{uuid}}/{{config.upnp_scpd_path}}</SCPDURL>
24
+ <controlURL>/{{uuid}}/{{config.upnp_scpd_path}}</controlURL>
25
+ <eventSubURL>/{{uuid}}/{{config.upnp_scpd_path}}</eventSubURL>
26
+ </service>
27
+ </serviceList>
28
+ <deviceList>
29
+ </deviceList>
30
+ <presentationURL>http://{{session.ipv4}}:{{config.upnp_port}}/present.html</presentationURL>
31
+ </device>
32
+ </root>
@@ -0,0 +1,84 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6
+ <title>404 - Not Found</title>
7
+ <style type="text/css">
8
+ <!--
9
+ body {
10
+ margin: 0;
11
+ font-size: .7em;
12
+ font-family: Verdana, Arial, Helvetica, sans-serif;
13
+ background: #EEEEEE;
14
+ }
15
+
16
+ fieldset {
17
+ padding: 0 15px 10px 15px;
18
+ }
19
+
20
+ h1 {
21
+ font-size: 2.4em;
22
+ margin: 0;
23
+ color: #FFF;
24
+ }
25
+
26
+ h2 {
27
+ font-size: 1.7em;
28
+ margin: 0;
29
+ color: #CC0000;
30
+ }
31
+
32
+ h3 {
33
+ font-size: 1.2em;
34
+ margin: 10px 0 0 0;
35
+ color: #000000;
36
+ }
37
+
38
+ #header {
39
+ width: 96%;
40
+ margin: 0 0 0 0;
41
+ padding: 6px 2% 6px 2%;
42
+ font-family: "trebuchet MS", Verdana, sans-serif;
43
+ color: #FFF;
44
+ background-color: #555555;
45
+ }
46
+
47
+ #content {
48
+ margin: 0 0 0 2%;
49
+ position: relative;
50
+ }
51
+
52
+ .content-container {
53
+ background: #FFF;
54
+ width: 96%;
55
+ margin-top: 8px;
56
+ padding: 10px;
57
+ position: relative;
58
+ }
59
+ -->
60
+ </style>
61
+ </head>
62
+
63
+ <body>
64
+ <div id="header">
65
+ <h1>Server Error</h1>
66
+ </div>
67
+ <div id="content">
68
+ <div class="content-container">
69
+ <fieldset>
70
+ <h2>HTTP Error 404 - File or directory not found</h2>
71
+ <h3>
72
+ The resource you are looking for may have been removed, had its name changed or is temporarily
73
+ unavailable.
74
+ {% if session.http_enabled %}
75
+ Maybe you were looking for <a
76
+ href="http://{{ session.ipv4 }}:{{ config.http_port }}/">/index.html</a>
77
+ {% endif %}
78
+ </h3>
79
+ </fieldset>
80
+ </div>
81
+ </div>
82
+ </body>
83
+
84
+ </html>
@@ -0,0 +1,3 @@
1
+ {# here is space for your custom service description #}
2
+ <root>
3
+ </root>
@@ -21,6 +21,8 @@ import asyncio
21
21
 
22
22
  from typing import Any, List
23
23
 
24
+ from pathlib import Path
25
+
24
26
  from dementor.config.toml import TomlConfig, Attribute
25
27
  from dementor.config.util import is_true
26
28
  from dementor.paths import DEMENTOR_PATH
@@ -56,6 +58,8 @@ class SessionConfig(TomlConfig):
56
58
  "MySQL",
57
59
  "X11",
58
60
  "IPP",
61
+ "SSDP",
62
+ "UPnP",
59
63
  )
60
64
  ]
61
65
 
@@ -100,3 +104,12 @@ class SessionConfig(TomlConfig):
100
104
  @property
101
105
  def ipv6_support(self) -> bool:
102
106
  return bool(self.ipv6) and not getattr(self, "ipv4_only", False)
107
+
108
+ def resolve_path(self, path: str | Path) -> Path:
109
+ raw_path = str(path)
110
+ if raw_path[0] == "/":
111
+ return Path(raw_path)
112
+ elif raw_path.startswith("./") or raw_path.startswith("../"):
113
+ return Path(raw_path).resolve()
114
+
115
+ return (Path(self.workspace_path) / raw_path).resolve()
@@ -51,12 +51,13 @@ class TomlConfig:
51
51
  if hasattr(self, key):
52
52
  return getattr(self, key)
53
53
 
54
- for attrname, qname, _ in getattr(self, "_fields_", []):
55
- if "." in qname:
56
- _, qname = qname.rsplit(".", 1)
54
+ for attr in getattr(self, "_fields_", []):
55
+ name = attr.qname
56
+ if "." in name:
57
+ _, name = name.rsplit(".", 1)
57
58
 
58
- if key == qname:
59
- return getattr(self, attrname)
59
+ if key == name:
60
+ return getattr(self, attr.attr_name)
60
61
 
61
62
  raise KeyError(f"Could not find config with key {key!r}")
62
63
 
@@ -17,6 +17,7 @@
17
17
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
+ import datetime
20
21
  import random
21
22
  import string
22
23
  import secrets
@@ -38,7 +39,7 @@ def get_value(section: str, key: str | None, default=None) -> Any:
38
39
  else:
39
40
  target = config
40
41
  for section in sections:
41
- target = target[section]
42
+ target = target.get(section, {})
42
43
 
43
44
  if key is None:
44
45
  return target
@@ -77,11 +78,15 @@ def random_value(size: int) -> str:
77
78
  return "".join(random.choice(string.ascii_letters) for _ in range(size))
78
79
 
79
80
 
80
- def format_string(value: str) -> str:
81
+ def format_string(value: str, locals: dict | None = None) -> str:
81
82
  config = _get_global_config()
82
83
  try:
83
84
  template = _SANDBOX.from_string(value)
84
- return template.render(config=config, random=random_value)
85
+ return template.render(config=config, random=random_value, **(locals or {}))
85
86
  except Exception as e:
86
87
  # TODO: log that
87
88
  return value
89
+
90
+
91
+ def now() -> str:
92
+ return datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
@@ -32,8 +32,10 @@ from sqlalchemy import sql
32
32
  from sqlalchemy.exc import NoSuchTableError, NoInspectionAvailable, OperationalError
33
33
 
34
34
 
35
- from dementor.logger import dm_logger, dm_console_lock
35
+ from dementor.log.logger import dm_logger
36
+ from dementor.log import dm_console_lock
36
37
  from dementor.config.toml import TomlConfig, Attribute as A
38
+ from dementor.log.stream import log_to
37
39
 
38
40
 
39
41
  class DatabaseConfig(TomlConfig):
@@ -69,6 +71,8 @@ def init_dementor_db(session) -> str:
69
71
  # commit and save changes
70
72
  conn.commit()
71
73
  conn.close()
74
+
75
+ dm_logger.debug("Using database at: %s", db_path)
72
76
  return db_path
73
77
 
74
78
 
@@ -134,7 +138,7 @@ class DementorDB:
134
138
  "password" TEXT
135
139
  )"""
136
140
  )
137
-
141
+ # TODO: still unused
138
142
  cursor.execute(
139
143
  """CREATE TABLE "hosts" (
140
144
  "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -171,7 +175,7 @@ class DementorDB:
171
175
  if not logger and not protocol:
172
176
  dm_logger.error(
173
177
  f"Failed to add {credtype} for {username} on {client[0]}:{client[1]}: "
174
- "Protocol must be present either in the logger or as a parameter!"
178
+ + "Protocol must be present either in the logger or as a parameter!"
175
179
  )
176
180
  return
177
181
 
@@ -182,7 +186,7 @@ class DementorDB:
182
186
 
183
187
  target_logger.debug(
184
188
  f"Adding {credtype} for {username} on {client_address}: "
185
- f"{logger} | {protocol} | {domain} | {hostname} | {username} | {password}"
189
+ + f"{logger} | {protocol} | {domain} | {hostname} | {username} | {password}"
186
190
  )
187
191
 
188
192
  q = sql.select(self.CredentialsTable).filter(
@@ -211,6 +215,8 @@ class DementorDB:
211
215
  full_name = ""
212
216
 
213
217
  if not results or self.config.db_config.db_duplicate_creds:
218
+ if credtype != _CLEARTEXT:
219
+ log_to("hashes", type=credtype, value=password)
214
220
  # just insert a new row
215
221
  q = sql.insert(self.CredentialsTable).values(
216
222
  {
@@ -231,7 +237,7 @@ class DementorDB:
231
237
  if "readonly database" in str(e):
232
238
  dm_logger.warning(
233
239
  f"Failed to add {credtype} for {username} on {client_address}: "
234
- "Database is read-only! (maybe restart in sudo mode?)"
240
+ + "Database is read-only! (maybe restart in sudo mode?)"
235
241
  )
236
242
  else:
237
243
  raise
@@ -17,8 +17,6 @@
17
17
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
- import argparse
21
- from ntpath import isfile
22
20
  import types
23
21
  import os
24
22
  import dementor
@@ -0,0 +1,24 @@
1
+ import threading
2
+ from rich.console import Console
3
+
4
+ dm_console = Console(
5
+ soft_wrap=True,
6
+ tab_size=4,
7
+ highlight=False,
8
+ highlighter=None,
9
+ )
10
+
11
+ dm_console_lock = threading.Lock()
12
+
13
+
14
+ def dm_print(msg: str, *args, **kwargs) -> None:
15
+ # If someone has a better idea I'll be open for it. This is just
16
+ # here to synchronize the logging output
17
+ if kwargs.pop("locked", False):
18
+ dm_console.print(msg, *args, **kwargs)
19
+ else:
20
+ with dm_console_lock:
21
+ dm_console.print(msg, *args, **kwargs)
22
+
23
+
24
+ __all__ = ["dm_console", "dm_console_lock", "dm_print"]