File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,17 @@ module WPScan
38
38
include CMSScanner
39
39
40
40
APP_DIR = Pathname . new ( __FILE__ ) . dirname . join ( '..' , 'app' ) . expand_path
41
- DB_DIR = Pathname . new ( Dir . home ) . join ( '.wpscan' , 'db' )
41
+
42
+ # XDG support for DB_DIR
43
+ # If the legacy path exists, it will be used
44
+ # Otherwise, we'll use XDG_CACHE_HOME/wpscan/db or ~/.cache/wpscan/db if XDG_CACHE_HOME is not set
45
+ legacy_path = Pathname . new ( Dir . home ) . join ( '.wpscan' , 'db' )
46
+ xdg_path = Pathname . new ( ENV [ 'XDG_CACHE_HOME' ] || Pathname . new ( Dir . home ) . join ( '.cache' ) ) . join ( 'wpscan' , 'db' )
47
+ DB_DIR = if legacy_path . exist?
48
+ legacy_path
49
+ else
50
+ xdg_path
51
+ end
42
52
43
53
Typhoeus . on_complete do |response |
44
54
next if response . cached? || !response . from_vuln_api?
You can’t perform that action at this time.
0 commit comments