Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDG Support for wpscan db #1780

Closed
wants to merge 0 commits into from
Closed

Conversation

alichtman
Copy link

Fix #1586. This patch prefers the XDG path, and will only use the legacy path if it already exists on the machine. New installations will use XDG automatically, and doing the migration on your own is as simple as either:

$ mv ~/.wpscan $XDG_CACHE_HOME/wpscan

Demo

$ wpscan --update
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.22
       Sponsored by Automattic - https://automattic.com/
       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[i] Updating the Database ...
[i] Update completed.


$ ls -l $XDG_CACHE_HOME/wpscan/*
.rw-rw-r-- alichtman alichtman  25 B  Fri Apr 28 2023 07:28:52 PM  .last_update
.rw-rw-r-- alichtman alichtman 2.4 KB Fri Apr 28 2023 07:28:15 PM  config_backups.txt
.rw-rw-r-- alichtman alichtman 1.1 KB Fri Apr 28 2023 07:28:16 PM  db_exports.txt
.rw-rw-r-- alichtman alichtman 3.1 MB Fri Apr 28 2023 07:28:16 PM  dynamic_finders.yml
.rw-rw-r-- alichtman alichtman 3.3 KB Fri Apr 28 2023 07:28:17 PM  LICENSE
.rw-rw-r-- alichtman alichtman  12 MB Fri Apr 28 2023 07:28:14 PM  metadata.json
.rw-rw-r-- alichtman alichtman  49 B  Fri Apr 28 2023 07:28:17 PM  sponsor.txt
.rw-rw-r-- alichtman alichtman 123 KB Fri Apr 28 2023 07:28:15 PM  timthumbs-v3.txt
.rw-rw-r-- alichtman alichtman 4.2 MB Fri Apr 28 2023 07:28:14 PM  wp_fingerprints.json

$ ls -l ~/.wpscan
lsd: /home/alichtman/.wpscan: No such file or directory (os error 2).

Licensing

By submitting code contributions to the WPScan development team via Github Pull Requests, or any other method, it is understood that the contributor is offering the WPScan company (company number 83421476900012), which is registered in France, the unlimited, non-exclusive right to reuse, modify, and relicense the code.

Copy link
Contributor

@alexsanford alexsanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this and it seems to work well, except for one case noted below. @alichtman could you please test the case where the XDG_CACHE_HOME environment variable is not present, and make sure it works as expected?

lib/wpscan.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XDG Support
2 participants