Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import time
- def check_wp_rocket_version(url):
- version_url = url + "/wp-rocket/css/rocket.css"
- try:
- response = requests.get(version_url)
- version = response.headers["X-Powered-By"]
- if "WP Rocket/" in version:
- version = version.split("/")[1]
- return version
- except Exception as e:
- print(f"Error occurred while fetching WP Rocket version: {e}")
- return None
- def test_wp_rocket_lfi_bug(url):
- lfi_url = url + "/wp-rocket/inc/vendor/composer/installed.json"
- try:
- response = requests.get(lfi_url)
- if response.status_code == 200:
- return True
- except Exception as e:
- print(f"Error occurred while testing LFI: {e}")
- return False
- def main():
- url = "http://arvatools.com"
- wp_rocket_version = check_wp_rocket_version(url)
- if wp_rocket_version:
- print(f"WP Rocket Version: {wp_rocket_version}")
- if wp_rocket_version in ["2.10.0", "2.10.1", "2.10.2", "2.10.3"]:
- result = test_wp_rocket_lfi_bug(url)
- if result:
- print("LFI vulnerability found in WP Rocket")
- else:
- print("LFI vulnerability not found in WP Rocket")
- else:
- print("WP Rocket version is not affected by the LFI bug")
- else:
- print("Unable to fetch WP Rocket version")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement