Skip to content

Commit 904e518

Browse files
authored
Merge pull request #14861 from projectdiscovery/FIX-ISSUE]-postgres-history-exposure
[FIX ISSUE FALSE-POSITIVE] postgres-history-exposure.yaml
2 parents c01de8b + 49a604c commit 904e518

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

http/exposures/files/postgres-history-exposure.yaml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id: postgres-history-exposure
22

33
info:
44
name: PostgreSQL History - Exposure
5-
author: theamanrawat
5+
author: theamanrawat,0x_Akoko
66
severity: low
77
description: |
88
Exposed PostgreSQL history files (.psql_history) were detected. These files contain a record of executed SQL commands and may disclose sensitive information like passwords, database schemas, and query logic.
@@ -21,24 +21,12 @@ http:
2121
- "{{BaseURL}}/.postgresql_history"
2222

2323
stop-at-first-match: true
24-
matchers-condition: and
2524
matchers:
26-
- type: regex
27-
part: body
28-
regex:
29-
- '(?m)^\\(q|h|\?|g|d|dt|du|l|c|connect|copy)'
30-
- '(?i)(SELECT|INSERT|UPDATE|DELETE|CREATE|ALTER|DROP)\s+'
31-
32-
- type: word
33-
part: body
34-
words:
35-
- "select"
36-
- "from"
37-
- "\\connect"
38-
- "\\d"
39-
condition: or
40-
41-
- type: status
42-
status:
43-
- 200
44-
# digest: 490a00463044022007c85a7dc13df8edea4b338a5d21408d15d952eb6388d312c8acc9c6e3c4629d0220720781a08304301c247a898868a40da60417ade0d970d373ec84857255dddb11:922c64590222798bb761d5b6d8e72950
25+
- type: dsl
26+
dsl:
27+
- 'status_code == 200'
28+
- '!contains(content_type, "text/html")'
29+
- 'contains_all(to_lower(body), "select", "from", "where")'
30+
- 'contains_any(body, "select * from", "SELECT * FROM", "insert into", "INSERT INTO", "update ", "UPDATE ")'
31+
- 'regex("(?m)^\\\\(q|h|\\?|g|d|dt|du|l|c|connect|copy)", body)'
32+
condition: and

0 commit comments

Comments
 (0)