hardsploit_gui 2.0

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 (81) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +22 -0
  3. data/Rakefile +1 -0
  4. data/bin/hardsploit_gui +3 -0
  5. data/lib/Firmware/FPGA/I2C/I2C_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_I2C_INTERACT.rpd +0 -0
  6. data/lib/Firmware/FPGA/PARALLEL/NO_MUX_PARALLEL_MEMORY/HARDSPLOIT_FIRMWARE_FPGA_NO_MUX_PARALLEL_MEMORY.rpd +0 -0
  7. data/lib/Firmware/FPGA/SPI/SPI_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SPI_INTERACT.rpd +0 -0
  8. data/lib/Firmware/FPGA/SWD/SWD_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SWD_INTERACT.rpd +0 -0
  9. data/lib/Firmware/FPGA/TEST/TEST_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_TEST_INTERACT.rpd +0 -0
  10. data/lib/Firmware/FPGA/VersionFPGA.rb +5 -0
  11. data/lib/Firmware/UC/HARDSPLOIT_FIRMWARE_UC.bin +0 -0
  12. data/lib/Firmware/UC/VersionUC.rb +12 -0
  13. data/lib/HardsploitAPI/HardsploitAPI.rb +134 -0
  14. data/lib/HardsploitAPI/HardsploitAPI_CONSTANT.rb +145 -0
  15. data/lib/HardsploitAPI/HardsploitAPI_FIRMWARE.rb +311 -0
  16. data/lib/HardsploitAPI/HardsploitAPI_I2C.rb +218 -0
  17. data/lib/HardsploitAPI/HardsploitAPI_NO_MUX_PARALLELE_MEMORY.rb +229 -0
  18. data/lib/HardsploitAPI/HardsploitAPI_SPI.rb +179 -0
  19. data/lib/HardsploitAPI/HardsploitAPI_TEST_INTERACT.rb +98 -0
  20. data/lib/HardsploitAPI/HardsploitAPI_USB_COMMUNICATION.rb +149 -0
  21. data/lib/HardsploitAPI/LICENSE.txt +674 -0
  22. data/lib/HardsploitAPI/README.md +22 -0
  23. data/lib/HardsploitAPI/SWD/HardsploitAPI_SWD.rb +249 -0
  24. data/lib/HardsploitAPI/SWD/HardsploitAPI_SWD_DEBUG.rb +102 -0
  25. data/lib/HardsploitAPI/SWD/HardsploitAPI_SWD_MEM_AP.rb +78 -0
  26. data/lib/HardsploitAPI/SWD/HardsploitAPI_SWD_STM32.rb +104 -0
  27. data/lib/HardsploitAPI/TRADEMARK +3 -0
  28. data/lib/LICENSE.txt +674 -0
  29. data/lib/README.md +22 -0
  30. data/lib/TRADEMARK +3 -0
  31. data/lib/class/Chip_editor.rb +448 -0
  32. data/lib/class/Command_editor.rb +268 -0
  33. data/lib/class/Command_table.rb +239 -0
  34. data/lib/class/Console.rb +28 -0
  35. data/lib/class/Export_manager.rb +124 -0
  36. data/lib/class/Firmware.rb +29 -0
  37. data/lib/class/Generic_commands.rb +275 -0
  38. data/lib/class/HardsploitGUI.rb +462 -0
  39. data/lib/class/I2C/I2c_command.rb +48 -0
  40. data/lib/class/I2C/I2c_export.rb +121 -0
  41. data/lib/class/I2C/I2c_import.rb +92 -0
  42. data/lib/class/I2C/I2c_settings.rb +117 -0
  43. data/lib/class/PARALLEL/Parallel_export.rb +146 -0
  44. data/lib/class/PARALLEL/Parallel_import.rb +88 -0
  45. data/lib/class/PARALLEL/Parallel_settings.rb +102 -0
  46. data/lib/class/SPI/Spi_export.rb +141 -0
  47. data/lib/class/SPI/Spi_import.rb +112 -0
  48. data/lib/class/SPI/Spi_settings.rb +90 -0
  49. data/lib/class/Wire_helper.rb +246 -0
  50. data/lib/db/associations.rb +125 -0
  51. data/lib/db/hs.db +0 -0
  52. data/lib/gui/gui_chip_editor.rb +355 -0
  53. data/lib/gui/gui_chip_management.rb +372 -0
  54. data/lib/gui/gui_command_editor.rb +218 -0
  55. data/lib/gui/gui_export_manager.rb +93 -0
  56. data/lib/gui/gui_generic_commands.rb +164 -0
  57. data/lib/gui/gui_generic_export.rb +148 -0
  58. data/lib/gui/gui_generic_import.rb +126 -0
  59. data/lib/gui/gui_i2c_command.rb +115 -0
  60. data/lib/gui/gui_i2c_settings.rb +201 -0
  61. data/lib/gui/gui_parallel_settings.rb +194 -0
  62. data/lib/gui/gui_spi_import.rb +126 -0
  63. data/lib/gui/gui_spi_settings.rb +187 -0
  64. data/lib/gui/gui_wire_helper.rb +99 -0
  65. data/lib/gui_designer/gui_chip_editor.ui +553 -0
  66. data/lib/gui_designer/gui_chip_management.ui +842 -0
  67. data/lib/gui_designer/gui_command_editor.ui +347 -0
  68. data/lib/gui_designer/gui_export_manager.ui +115 -0
  69. data/lib/gui_designer/gui_generic_commands.ui +258 -0
  70. data/lib/gui_designer/gui_generic_export.ui +179 -0
  71. data/lib/gui_designer/gui_generic_import.ui +142 -0
  72. data/lib/gui_designer/gui_i2c_command.ui +145 -0
  73. data/lib/gui_designer/gui_i2c_settings.ui +261 -0
  74. data/lib/gui_designer/gui_parallel_settings.ui +244 -0
  75. data/lib/gui_designer/gui_processing.ui +81 -0
  76. data/lib/gui_designer/gui_spi_settings.ui +321 -0
  77. data/lib/gui_designer/gui_wire_helper.ui +117 -0
  78. data/lib/hardsploit.rb +122 -0
  79. data/lib/images/search.png +0 -0
  80. data/lib/logs/error.log +0 -0
  81. metadata +236 -0
data/lib/hardsploit.rb ADDED
@@ -0,0 +1,122 @@
1
+ #===================================================
2
+ # Hardsploit GUI - By Opale Security
3
+ # www.opale-security.com || www.hardsploit.io
4
+ # License: GNU General Public License v3
5
+ # License URI: http://www.gnu.org/licenses/gpl.txt
6
+ #===================================================
7
+
8
+ require 'Qt4'
9
+ require_relative 'gui/gui_chip_management'
10
+ require_relative 'class/HardsploitGUI'
11
+ require_relative 'class/Console'
12
+ require_relative 'class/Wire_helper'
13
+ require_relative 'class/Chip_editor'
14
+ require_relative 'class/Generic_commands'
15
+ require_relative 'class/Firmware'
16
+ require_relative 'class/PARALLEL/Parallel_settings'
17
+ require_relative 'class/PARALLEL/Parallel_import'
18
+ require_relative 'class/PARALLEL/Parallel_export'
19
+ require_relative 'class/SPI/Spi_settings'
20
+ require_relative 'class/SPI/Spi_import'
21
+ require_relative 'class/SPI/Spi_export'
22
+ require_relative 'class/I2C/I2c_settings'
23
+ require_relative 'class/I2C/I2c_import'
24
+ require_relative 'class/I2C/I2c_export'
25
+ require_relative 'db/associations'
26
+ require_relative 'HardsploitAPI/HardsploitAPI'
27
+ require_relative 'Firmware/UC/VersionUC'
28
+ require_relative 'Firmware/FPGA/VersionFPGA'
29
+ include VersionFPGA::VERSION_FPGA
30
+ include VersionUC::VERSION_UC
31
+
32
+ class Hardsploit_GUI
33
+ def initialize
34
+ # Launch API
35
+ hardAPI = HardsploitAPI.new(method(:callbackData),method(:callbackInfo),method(:callbackError),method(:callbackSpeedOfTransfert))
36
+ $file = nil
37
+ $currentFirmware = nil
38
+ $usbConnected = nil
39
+ $logFilePath = File.expand_path(File.dirname(__FILE__)) + "/logs/error.log"
40
+ $dbFilePath = File.expand_path(File.dirname(__FILE__)) + "/db/hs.db"
41
+
42
+ # Launch GUI
43
+ Qt::Application.new(ARGV) do
44
+ w = HardsploitGUI.new(hardAPI)
45
+ centerWindow(w)
46
+ w.show
47
+ exec
48
+ end
49
+ end
50
+
51
+ #
52
+ # CALLBACK
53
+ #
54
+ def callbackInfo(receiveData)
55
+ print receiveData + "\n"
56
+ end
57
+
58
+ def callbackError(receiveData)
59
+ print receiveData + "\n"
60
+ end
61
+
62
+ def callbackSpeedOfTransfert(receiveData)
63
+ puts receiveData
64
+ end
65
+
66
+ def callbackData(receiveData)
67
+ begin
68
+ $file.write(receiveData.pack('C*'))
69
+ rescue
70
+ Qt::MessageBox.new(Qt::MessageBox::Critical, "Critical error", "Error occured when opening the dump file. Consult the logs for more details").exec
71
+ end
72
+ end
73
+
74
+ def check_ReceivedData
75
+ result = hardAPI.receiveDATA(2000)
76
+ case result
77
+ when HardsploitAPI::USB_STATE::BUSY
78
+ puts "BUSY"
79
+ when HardsploitAPI::USB_STATE::TIMEOUT_RECEIVE
80
+ puts "TIMEOUT_RECEIVE\n"
81
+ else
82
+ puts "Received"
83
+ p result
84
+ end
85
+ end
86
+
87
+ def check_SendData(value)
88
+ case value
89
+ when HardsploitAPI::USB_STATE::SUCCESSFUL_SEND
90
+ puts "SUCCESSFUL_SEND"
91
+ when HardsploitAPI::USB_STATE::PACKET_IS_TOO_LARGE
92
+ puts "PACKET_IS_TOO_LARGE max: #{USB::USB_TRAME_SIZE}"
93
+ when HardsploitAPI::USB_STATE::ERROR_SEND
94
+ puts "ERROR_SEND\n"
95
+ else
96
+ puts "UNKNOWN SEND STATE"
97
+ end
98
+ end
99
+ end
100
+
101
+ def inputRestrict(lineEdit, type)
102
+ case type
103
+ when 0
104
+ reg = Qt::RegExp.new("[0-9]+")
105
+ when 1
106
+ reg = Qt::RegExp.new("^[a-zA-Z_@-]+( [a-zA-Z_@-]+)*$")
107
+ when 2
108
+ reg = Qt::RegExp.new("^[a-zA-Z0-9_@-]+( [a-zA-Z0-9_@-]+)*$")
109
+ when 3
110
+ reg = Qt::RegExp.new("^[A-Fa-f0-9]{2}")
111
+ end
112
+ regVal = Qt::RegExpValidator.new(reg, self)
113
+ lineEdit.setValidator(regVal)
114
+ end
115
+
116
+ def centerWindow(win)
117
+ desktop = Qt::DesktopWidget.new
118
+ rect = desktop.screenGeometry(desktop.primaryScreen)
119
+ centerX = (rect.width - win.width ) / 2
120
+ centerY = (rect.height - win.height) / 2
121
+ win.move(centerX,centerY)
122
+ end
Binary file
File without changes
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hardsploit_gui
3
+ version: !ruby/object:Gem::Version
4
+ version: '2.0'
5
+ platform: ruby
6
+ authors:
7
+ - OPALE SECURITY
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sqlite3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.0.0
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.0.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: activerecord
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.0.0.0
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.0.0.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: qtbindings
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '4.8'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 4.8.6.2
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '4.8'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 4.8.6.2
73
+ - !ruby/object:Gem::Dependency
74
+ name: libusb
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '0.5'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.5.1
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.5'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 0.5.1
93
+ - !ruby/object:Gem::Dependency
94
+ name: bundler
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1.10'
100
+ type: :development
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '1.10'
107
+ - !ruby/object:Gem::Dependency
108
+ name: rake
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '10.0'
114
+ type: :development
115
+ prerelease: false
116
+ version_requirements: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '10.0'
121
+ description: The essential security auditing tool for Internet of Things devices you'll
122
+ need in your toolbox
123
+ email:
124
+ - support@opale-security.com
125
+ executables:
126
+ - hardsploit_gui
127
+ extensions: []
128
+ extra_rdoc_files: []
129
+ files:
130
+ - README.md
131
+ - Rakefile
132
+ - bin/hardsploit_gui
133
+ - lib/Firmware/FPGA/I2C/I2C_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_I2C_INTERACT.rpd
134
+ - lib/Firmware/FPGA/PARALLEL/NO_MUX_PARALLEL_MEMORY/HARDSPLOIT_FIRMWARE_FPGA_NO_MUX_PARALLEL_MEMORY.rpd
135
+ - lib/Firmware/FPGA/SPI/SPI_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SPI_INTERACT.rpd
136
+ - lib/Firmware/FPGA/SWD/SWD_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SWD_INTERACT.rpd
137
+ - lib/Firmware/FPGA/TEST/TEST_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_TEST_INTERACT.rpd
138
+ - lib/Firmware/FPGA/VersionFPGA.rb
139
+ - lib/Firmware/UC/HARDSPLOIT_FIRMWARE_UC.bin
140
+ - lib/Firmware/UC/VersionUC.rb
141
+ - lib/HardsploitAPI/HardsploitAPI.rb
142
+ - lib/HardsploitAPI/HardsploitAPI_CONSTANT.rb
143
+ - lib/HardsploitAPI/HardsploitAPI_FIRMWARE.rb
144
+ - lib/HardsploitAPI/HardsploitAPI_I2C.rb
145
+ - lib/HardsploitAPI/HardsploitAPI_NO_MUX_PARALLELE_MEMORY.rb
146
+ - lib/HardsploitAPI/HardsploitAPI_SPI.rb
147
+ - lib/HardsploitAPI/HardsploitAPI_TEST_INTERACT.rb
148
+ - lib/HardsploitAPI/HardsploitAPI_USB_COMMUNICATION.rb
149
+ - lib/HardsploitAPI/LICENSE.txt
150
+ - lib/HardsploitAPI/README.md
151
+ - lib/HardsploitAPI/SWD/HardsploitAPI_SWD.rb
152
+ - lib/HardsploitAPI/SWD/HardsploitAPI_SWD_DEBUG.rb
153
+ - lib/HardsploitAPI/SWD/HardsploitAPI_SWD_MEM_AP.rb
154
+ - lib/HardsploitAPI/SWD/HardsploitAPI_SWD_STM32.rb
155
+ - lib/HardsploitAPI/TRADEMARK
156
+ - lib/LICENSE.txt
157
+ - lib/README.md
158
+ - lib/TRADEMARK
159
+ - lib/class/Chip_editor.rb
160
+ - lib/class/Command_editor.rb
161
+ - lib/class/Command_table.rb
162
+ - lib/class/Console.rb
163
+ - lib/class/Export_manager.rb
164
+ - lib/class/Firmware.rb
165
+ - lib/class/Generic_commands.rb
166
+ - lib/class/HardsploitGUI.rb
167
+ - lib/class/I2C/I2c_command.rb
168
+ - lib/class/I2C/I2c_export.rb
169
+ - lib/class/I2C/I2c_import.rb
170
+ - lib/class/I2C/I2c_settings.rb
171
+ - lib/class/PARALLEL/Parallel_export.rb
172
+ - lib/class/PARALLEL/Parallel_import.rb
173
+ - lib/class/PARALLEL/Parallel_settings.rb
174
+ - lib/class/SPI/Spi_export.rb
175
+ - lib/class/SPI/Spi_import.rb
176
+ - lib/class/SPI/Spi_settings.rb
177
+ - lib/class/Wire_helper.rb
178
+ - lib/db/associations.rb
179
+ - lib/db/hs.db
180
+ - lib/gui/gui_chip_editor.rb
181
+ - lib/gui/gui_chip_management.rb
182
+ - lib/gui/gui_command_editor.rb
183
+ - lib/gui/gui_export_manager.rb
184
+ - lib/gui/gui_generic_commands.rb
185
+ - lib/gui/gui_generic_export.rb
186
+ - lib/gui/gui_generic_import.rb
187
+ - lib/gui/gui_i2c_command.rb
188
+ - lib/gui/gui_i2c_settings.rb
189
+ - lib/gui/gui_parallel_settings.rb
190
+ - lib/gui/gui_spi_import.rb
191
+ - lib/gui/gui_spi_settings.rb
192
+ - lib/gui/gui_wire_helper.rb
193
+ - lib/gui_designer/gui_chip_editor.ui
194
+ - lib/gui_designer/gui_chip_management.ui
195
+ - lib/gui_designer/gui_command_editor.ui
196
+ - lib/gui_designer/gui_export_manager.ui
197
+ - lib/gui_designer/gui_generic_commands.ui
198
+ - lib/gui_designer/gui_generic_export.ui
199
+ - lib/gui_designer/gui_generic_import.ui
200
+ - lib/gui_designer/gui_i2c_command.ui
201
+ - lib/gui_designer/gui_i2c_settings.ui
202
+ - lib/gui_designer/gui_parallel_settings.ui
203
+ - lib/gui_designer/gui_processing.ui
204
+ - lib/gui_designer/gui_spi_settings.ui
205
+ - lib/gui_designer/gui_wire_helper.ui
206
+ - lib/hardsploit.rb
207
+ - lib/images/search.png
208
+ - lib/logs/error.log
209
+ homepage: http://www.hardsploit.io
210
+ licenses: []
211
+ metadata: {}
212
+ post_install_message: Thanks for installing! Please contact us at support@hardsploit.io
213
+ for any questions or training
214
+ rdoc_options: []
215
+ require_paths:
216
+ - lib
217
+ - lib/class
218
+ - lib/gui
219
+ required_ruby_version: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ requirements: []
230
+ rubyforge_project:
231
+ rubygems_version: 2.2.2
232
+ signing_key:
233
+ specification_version: 4
234
+ summary: The essential security auditing tool for Internet of Things devices you'll
235
+ need in your toolbox
236
+ test_files: []