wpterm error
-
dear all,
I’ve a problem with this plugin. When I run php and other commands, for example “ls -l”, I always received “Wpterm erorr”
My WP is 6.7.2. Any ideas ?
Thanks a lot
-Willy-
-
WpTerm check:
-= WPTerm compatibility check version 1.1 =-
-PHP version: OK (7.4.33 – LITESPEED).
-Operating system: OK (Linux).
-safe_mode: OK, disabled.
-Testing PHP program execution functions: 1. shell_exec: OK 2. system: OK 3. passthru: OK 4. exec: OK 5. popen: OK Your server meets all the requirements to run WPTerm!
It looks like there’s an issue with the AJAX response. The plugin uses the /wp-admin/admin-ajax.php endpoint.
You can try this:
1. Go to WPTerm.
2. Open your browser dev tools console by pressingF12
3. Select the “Network” tab.
4. Enter your command in WPTerm.
5. Click on the /wp-admin/admin-ajax.php entry in the dev tools network list, and check the “Response” tab to see what was returned by the AJAX endpoint.Dear @bruandet
If you can see these screenshots I’m quite sure that you will hunderstand the problem:
“PHP -v” doesn’t work but some months ago it run without any problem.
Thanks a lot for you reply
Best Regards
-Willy-
I make another test with “echo $?” command with the same negative result:
There are some commands that doesn’t work but other commands works fine, “ls” “cd” and so con.
Bye
-Willy-
There’s likely a security application installed either on the server (e.g., ModSecurity etc) or on your blog (e.g., a plugin) that blocked the request because it detected that you are sending shell commands other AJAX.
Hi @bruandet
I’ve just one security plugin installed
Limit Login Attempts Reloaded
and I can’t having any others access to server.
Thanks for you attention.
Regards
-Willy-
You can try to encode the data in Base64. Some security applications don’t decode it. Others like ModSecurity or NinjaFirewall will decode it and block the request.
- Open this file :
wpterm/wpterm-terminal.js
- Line 414 you will see:
'cmd': command,
Replace it with:'cmd': btoa( command ),
- Save the file.
- Open this file:
wpterm/wpterm.php
- Line 994 you will see:
$cmd = stripslashes( trim( $_POST['cmd'] ) );
Replace it with:$cmd = stripslashes( base64_decode( trim( $_POST['cmd'] ) ) );
- Save the file.
Go to WPTerm, make sure to reload the page to refresh the JS code, then try to run a command.
If it works, I’ll apply the same patch in the next version.dear @bruandet
I’ve changed wpterm.php and wpterm-terminal.js
after that I make some commands
I hope that this output is useful to understand what it happen.
Thanks again for your help
Bye
-Willy-
wpterm.php
//$cmd = stripslashes( trim( $_POST['cmd'] ) ); $cmd = stripslashes( base64_decode( trim( $_POST['cmd'] ) ) );
wpterm-terminal.js
//'cmd': command, 'cmd': btoa( command ),
You need to refresh the page (or clear your browser’s cache), because it looks like the JS file was cached and not reloaded by your browser since you made the change.
-
This reply was modified 3 months ago by
bruandet.
@bruandet you are a genius, your path works!
Do you also have skills with CSS ?
Always for the same non-profit project I would like to create a box similar to this:there is an image, a logo and some information inserted in various elements.
I can’t realize it with Elementor , what do you suggest?
is there a software that can help me generate the CSS to create that scheme?Thanks
-Willy-
Sorry, I have no idea about CSS and Elementor. You may want to ask your question in a more general forum: https://wordpress.org/support/forums/
- Open this file :
- You must be logged in to reply to this topic.