@@ -28,14 +28,14 @@ def commands
28
28
29
29
def cmd_sqlmap_connect ( *args )
30
30
if args . length == 0
31
- print_error ( " Need a host, and optionally a port" )
31
+ print_error ( ' Need a host, and optionally a port' )
32
32
return
33
33
end
34
34
35
35
@host , @port = args
36
36
37
37
if !@port
38
- @port = " 8775"
38
+ @port = ' 8775'
39
39
end
40
40
41
41
@manager = Sqlmap ::Manager . new ( Sqlmap ::Session . new ( @host , @port ) )
@@ -44,13 +44,13 @@ def cmd_sqlmap_connect(*args)
44
44
45
45
def cmd_sqlmap_set_option ( *args )
46
46
unless args . length == 3
47
- print_error ( " Usage:" )
48
- print_error ( " \t sqlmap_set_option <taskid> <option_name> <option_value>" )
47
+ print_error ( ' Usage:' )
48
+ print_error ( ' \tsqlmap_set_option <taskid> <option_name> <option_value>' )
49
49
return
50
50
end
51
51
52
52
unless @manager
53
- print_error ( " Please run sqlmap_connect <host> first." )
53
+ print_error ( ' Please run sqlmap_connect <host> first.' )
54
54
return
55
55
end
56
56
@@ -62,8 +62,8 @@ def cmd_sqlmap_set_option(*args)
62
62
63
63
def cmd_sqlmap_start_task ( *args )
64
64
if args . length == 0
65
- print_error ( " Usage:" )
66
- print_error ( " \t sqlmap_start_task <taskid> [<url>]" )
65
+ print_error ( ' Usage:' )
66
+ print_error ( ' \tsqlmap_start_task <taskid> [<url>]' )
67
67
return
68
68
end
69
69
@@ -76,7 +76,7 @@ def cmd_sqlmap_start_task(*args)
76
76
end
77
77
78
78
unless @manager
79
- print_error ( " Please run sqlmap_connect <host> first." )
79
+ print_error ( ' Please run sqlmap_connect <host> first.' )
80
80
return
81
81
end
82
82
@@ -86,13 +86,13 @@ def cmd_sqlmap_start_task(*args)
86
86
87
87
def cmd_sqlmap_get_log ( *args )
88
88
unless args . length == 1
89
- print_error ( " Usage:" )
90
- print_error ( " \t sqlmap_get_log <taskid>" )
89
+ print_error ( ' Usage:' )
90
+ print_error ( ' \tsqlmap_get_log <taskid>' )
91
91
return
92
92
end
93
93
94
94
unless @manager
95
- print_error ( " Please run sqlmap_connect <host> first." )
95
+ print_error ( ' Please run sqlmap_connect <host> first.' )
96
96
return
97
97
end
98
98
@@ -105,13 +105,13 @@ def cmd_sqlmap_get_log(*args)
105
105
106
106
def cmd_sqlmap_get_status ( *args )
107
107
unless args . length == 1
108
- print_error ( " Usage:" )
109
- print_error ( " \t sqlmap_get_status <taskid>" )
108
+ print_error ( ' Usage:' )
109
+ print_error ( ' \tsqlmap_get_status <taskid>' )
110
110
return
111
111
end
112
112
113
113
unless @manager
114
- print_error ( " Please run sqlmap_connect <host> first." )
114
+ print_error ( ' Please run sqlmap_connect <host> first.' )
115
115
return
116
116
end
117
117
@@ -122,23 +122,23 @@ def cmd_sqlmap_get_status(*args)
122
122
123
123
def cmd_sqlmap_get_data ( *args )
124
124
unless args . length == 1
125
- print_error ( " Usage:" )
126
- print_error ( " \t sqlmap_get_data <taskid>" )
125
+ print_error ( ' Usage:' )
126
+ print_error ( ' \tsqlmap_get_data <taskid>' )
127
127
return
128
128
end
129
129
130
130
@hid_tasks ||= { }
131
131
@tasks ||= { }
132
132
133
133
unless @manager
134
- print_error ( " Please run sqlmap_connect <host> first." )
134
+ print_error ( ' Please run sqlmap_connect <host> first.' )
135
135
return
136
136
end
137
137
138
138
@tasks [ @hid_tasks [ args [ 0 ] ] ] = @manager . get_options ( @hid_tasks [ args [ 0 ] ] ) [ 'options' ]
139
139
140
140
print_line
141
- print_status ( " URL: " + @tasks [ @hid_tasks [ args [ 0 ] ] ] [ 'url' ] )
141
+ print_status ( ' URL: ' + @tasks [ @hid_tasks [ args [ 0 ] ] ] [ 'url' ] )
142
142
143
143
res = @manager . get_task_data ( @hid_tasks [ args [ 0 ] ] )
144
144
@@ -162,28 +162,28 @@ def cmd_sqlmap_get_data(*args)
162
162
163
163
def cmd_sqlmap_save_data ( *args )
164
164
unless args . length == 1
165
- print_error ( " Usage:" )
166
- print_error ( " \t sqlmap_save_data <taskid>" )
165
+ print_error ( ' Usage:' )
166
+ print_error ( ' \tsqlmap_save_data <taskid>' )
167
167
return
168
168
end
169
169
170
170
unless framework . db && framework . db . usable
171
- print_error ( " No database is connected or usable" )
171
+ print_error ( ' No database is connected or usable' )
172
172
return
173
173
end
174
174
175
175
@hid_tasks ||= { }
176
176
@tasks ||= { }
177
177
178
178
unless @manager
179
- print_error ( " Please run sqlmap_connect <host> first." )
179
+ print_error ( ' Please run sqlmap_connect <host> first.' )
180
180
return
181
181
end
182
182
183
183
@tasks [ @hid_tasks [ args [ 0 ] ] ] = @manager . get_options ( @hid_tasks [ args [ 0 ] ] ) [ 'options' ]
184
184
185
185
print_line
186
- print_status ( " URL: " + @tasks [ @hid_tasks [ args [ 0 ] ] ] [ 'url' ] )
186
+ print_status ( ' URL: ' + @tasks [ @hid_tasks [ args [ 0 ] ] ] [ 'url' ] )
187
187
188
188
res = @manager . get_task_data ( @hid_tasks [ args [ 0 ] ] )
189
189
web_vuln_info = { }
@@ -214,20 +214,20 @@ def cmd_sqlmap_save_data(*args)
214
214
end
215
215
end
216
216
end
217
- print_good ( " Saved vulnerabilities to database." )
217
+ print_good ( ' Saved vulnerabilities to database.' )
218
218
end
219
219
220
220
def cmd_sqlmap_get_option ( *args )
221
221
@hid_tasks ||= { }
222
222
@tasks ||= { }
223
223
224
224
unless args . length == 2
225
- print_error ( " Usage:" )
226
- print_error ( " \t sqlmap_get_option <taskid> <option_name>" )
225
+ print_error ( ' Usage:' )
226
+ print_error ( ' \tsqlmap_get_option <taskid> <option_name>' )
227
227
end
228
228
229
229
unless @manager
230
- print_error ( " Please run sqlmap_connect <host> first." )
230
+ print_error ( ' Please run sqlmap_connect <host> first.' )
231
231
return
232
232
end
233
233
@@ -247,7 +247,7 @@ def cmd_sqlmap_new_task
247
247
@tasks ||= { }
248
248
249
249
unless @manager
250
- print_error ( " Please run sqlmap_connect <host> first." )
250
+ print_error ( ' Please run sqlmap_connect <host> first.' )
251
251
return
252
252
end
253
253
task_id = @manager . new_task
@@ -276,19 +276,19 @@ def initialize(framework, opts)
276
276
277
277
add_console_dispatcher ( SqlmapCommandDispatcher )
278
278
279
- print_status ( " Sqlmap plugin loaded" )
279
+ print_status ( ' Sqlmap plugin loaded' )
280
280
end
281
281
282
282
def cleanup
283
283
remove_console_dispatcher ( 'Sqlmap' )
284
284
end
285
285
286
286
def name
287
- " Sqlmap"
287
+ ' Sqlmap'
288
288
end
289
289
290
290
def desc
291
- " sqlmap plugin for Metasploit"
291
+ ' sqlmap plugin for Metasploit'
292
292
end
293
293
end
294
294
end
0 commit comments