Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 179a6ed

Browse files
committed
Implements swagger API specs (#4746)
1 parent 8af87c7 commit 179a6ed

2 files changed

Lines changed: 231 additions & 1 deletion

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.5.7.6"
23+
VERSION = "1.5.7.7"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

sqlmapapi.yaml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
openapi: 3.0.1
2+
info:
3+
title: sqlmapapi OpenAPI/Swagger specification
4+
version: '0.1'
5+
paths:
6+
/version:
7+
get:
8+
description: Fetch server version
9+
responses:
10+
'200':
11+
description: OK
12+
/task/new:
13+
get:
14+
description: Create a new task
15+
responses:
16+
'200':
17+
description: OK
18+
content:
19+
application/json:
20+
schema:
21+
type: object
22+
properties:
23+
taskid:
24+
type: string
25+
example: "fad44d6beef72285"
26+
success:
27+
type: boolean
28+
/scan/{taskid}/start:
29+
post:
30+
description: Launch a scan
31+
parameters:
32+
- in: path
33+
name: taskid
34+
required: true
35+
schema:
36+
type: string
37+
description: Scan task ID
38+
requestBody:
39+
content:
40+
application/json:
41+
schema:
42+
type: object
43+
properties:
44+
url:
45+
type: string
46+
examples:
47+
'0':
48+
value: '{"url":"http://testphp.vulnweb.com/artists.php?artist=1"}'
49+
responses:
50+
'200':
51+
description: OK
52+
content:
53+
application/json:
54+
schema:
55+
type: object
56+
properties:
57+
engineid:
58+
type: integer
59+
example: 19720
60+
success:
61+
type: boolean
62+
/scan/{taskid}/stop:
63+
get:
64+
description: Stop a scan
65+
parameters:
66+
- in: path
67+
name: taskid
68+
required: true
69+
schema:
70+
type: string
71+
description: Scan task ID
72+
responses:
73+
'200':
74+
description: OK
75+
content:
76+
application/json:
77+
schema:
78+
type: object
79+
properties:
80+
success:
81+
type: boolean
82+
example: true
83+
/scan/{taskid}/status:
84+
get:
85+
description: Fetch status of a scan
86+
parameters:
87+
- in: path
88+
name: taskid
89+
required: true
90+
schema:
91+
type: string
92+
description: Scan task ID
93+
responses:
94+
'200':
95+
description: OK
96+
content:
97+
application/json:
98+
schema:
99+
type: object
100+
properties:
101+
status:
102+
type: string
103+
example: terminated
104+
returncode:
105+
type: integer
106+
example: 0
107+
success:
108+
type: boolean
109+
example: true
110+
/scan/{taskid}/list:
111+
get:
112+
description: List options for a given task ID
113+
parameters:
114+
- in: path
115+
name: taskid
116+
required: true
117+
schema:
118+
type: string
119+
description: Scan task ID
120+
responses:
121+
'200':
122+
description: OK
123+
content:
124+
application/json:
125+
schema:
126+
type: object
127+
properties:
128+
success:
129+
type: boolean
130+
example: true
131+
options:
132+
type: array
133+
items:
134+
type: object
135+
/scan/{taskid}/data:
136+
get:
137+
description: Retrieve the scan resulting data
138+
parameters:
139+
- in: path
140+
name: taskid
141+
required: true
142+
schema:
143+
type: string
144+
description: Scan task ID
145+
responses:
146+
'200':
147+
description: OK
148+
content:
149+
application/json:
150+
schema:
151+
type: object
152+
properties:
153+
data:
154+
type: array
155+
items:
156+
type: object
157+
success:
158+
type: boolean
159+
example: true
160+
error:
161+
type: array
162+
items:
163+
type: object
164+
/scan/{taskid}/log:
165+
get:
166+
description: Retrieve the log messages
167+
parameters:
168+
- in: path
169+
name: taskid
170+
required: true
171+
schema:
172+
type: string
173+
description: Scan task ID
174+
responses:
175+
'200':
176+
description: OK
177+
content:
178+
application/json:
179+
schema:
180+
type: object
181+
properties:
182+
log:
183+
type: array
184+
items:
185+
type: object
186+
success:
187+
type: boolean
188+
example: true
189+
/scan/{taskid}/kill:
190+
get:
191+
description: Kill a scan
192+
parameters:
193+
- in: path
194+
name: taskid
195+
required: true
196+
schema:
197+
type: string
198+
description: Scan task ID
199+
responses:
200+
'200':
201+
description: OK
202+
content:
203+
application/json:
204+
schema:
205+
type: object
206+
properties:
207+
success:
208+
type: boolean
209+
example: true
210+
/task/{taskid}/delete:
211+
get:
212+
description: Delete an existing task
213+
parameters:
214+
- in: path
215+
name: taskid
216+
required: true
217+
schema:
218+
type: string
219+
description: Scan task ID
220+
responses:
221+
'200':
222+
description: OK
223+
content:
224+
application/json:
225+
schema:
226+
type: object
227+
properties:
228+
success:
229+
type: boolean
230+
example: true

0 commit comments

Comments
 (0)