webarx-security / wpbullet

A static code analysis for WordPress (and PHP)
GNU General Public License v2.0
229 stars 48 forks source link

SyntaxError: invalid syntax #2

Closed Naategh closed 5 years ago

Naategh commented 5 years ago

When I want to run the script by python wpbullet.py, I got this error: Traceback (most recent call last): File "wpbullet.py", line 2, in from core import scanner File "/home/root/Desktop/wpbullet/core/scanner.py", line 51 print('Checked files: ' + str(count_files), end="\r") ^ SyntaxError: invalid syntax

LukaSikic commented 5 years ago

Which python version you are using?

Naategh commented 5 years ago

Which python version you are using?

Python v2.7

r00tpgp commented 5 years ago

i solved it my using python3. Remember to install python3-pip too.

r00tpgp commented 5 years ago

i got this error when running wpbullet:

$ ./wpbullet.py --path="/home/liver/wpbullet/wp-content/plugins/buddypress-learndash/" Traceback (most recent call last): File "./wpbullet.py", line 35, in main() File "./wpbullet.py", line 31, in main scanner.scan(args) File "/home/liver/wpbullet/core/scanner.py", line 52, in scan check_file(file, r, modules) File "/home/liver/wpbullet/core/scanner.py", line 90, in check_file passive_check_processor(content, path) File "/home/liver/wpbullet/core/passive_check.py", line 21, in passive_check scope_ajax_hooks(content, path) File "/home/liver/wpbullet/core/passive_check.py", line 42, in scope_ajax_hooks user_inputs = function_has_user_input(content, functions, match[10]) File "/home/liver/wpbullet/core/passive_check.py", line 67, in function_has_user_input functions_and_content = scope_function_content(content, functions) File "/home/liver/wpbullet/core/passive_check.py", line 62, in scope_function_content results[function] = match[0] TypeError: '_sre.SRE_Match' object is not subscriptable

LukaSikic commented 5 years ago

@Naategh please use Python 3 as I haven't even tried it on v2.7. @r00tpgp I just pushed code what could possibly fix the above error as I couldn't replicate the issue you are facing. If you are still getting that error or similar, create another issue ticket with exact Python version, OS and download link of the plugin you are scanning