textpattern / textpattern.github.io

Textpattern CMS user documentation.
https://docs.textpattern.com
GNU General Public License v2.0
15 stars 17 forks source link

Relocating site issue #110

Closed NerijusNoreika closed 5 years ago

NerijusNoreika commented 6 years ago

Hey,

This is more of an isssue from the user side, I believe, but I hope you can give a bit support on this :)

My client asked me to relocate his Textpattern site to another server. This is my first time having any exposure to textpattern websites, so I went to read the docs on how to do this.

Found out that the steps needed to be taken are not that different for other sites. Move db, move files, change configuration (and I noticed _CACHE folder so clear cache as well, I guess). I made sure that the PHP version is the same on both servers, i.e. 5.6.

The error I get is Fatal error: Call to undefined function create_includes() in /html/textpattern/publish/taghandlers.php(4035) : eval()'d code on line 1

To me it seems that this is a problem with misconfigured path somewhere, but the only place I found where to set it is in textpattern/config.php and there I set it correctly.

Thanks for the help.

philwareham commented 6 years ago

@bloke @petecooper @bloatware any thoughts on what's happened here? Thanks. If something missed in our docs, then it'd be good to catch it and document it.

bloatware commented 6 years ago

Hi, welcome to txp. What is your Textpattern version? There is no trace of create_includes() function in txp core, so either yours is very outdated or it's some plugins effect. Try disabling plugins/php on Preferences/Publish admin tab.

petecooper commented 6 years ago

and I noticed _CACHE folder

Hmm. Hacked site? Web server cache files? That's not normal - I wonder if there's something shady in there that's no longer present, and that's a factor in the error.

NerijusNoreika commented 6 years ago

Thanks for the quick replies! I don't now know exact version; perhaps there is some constant in a code, where it's written?

Only clue I found is in index.php - " Copyright (C) 2015 The Textpattern Development Team". So the website is at least 3 years old. :)

@bloatware I did some grepping around, and found that the create_includes() function is in /home/_FUNCTION/b_core.functions.php file.

petecooper commented 6 years ago

I did some grepping around, and found that the create_includes() function is in /home/_FUNCTION/b_core.functions.php file.

That's not a Textpattern-native file, so I'm erring toward a) compromised site or b) plugin territory.

@NerijusNoreika - can you go to this URL on the site, please: /textpattern/index.php?event=diag This will give you some background info on what we're dealing with version-wise.

NerijusNoreika commented 6 years ago

@petecooper It ignores the get argument and just opens up backend login screen.

petecooper commented 6 years ago

@NerijusNoreika - that's expected, do you have a login for the site? There's something strange going on and that page will list some useful info which may help explain what's going on.

Aside: there's an administrator/user forum here https://forum.textpattern.io that might be more useful to post in - GitHub tends to be mostly developer/design types and keen testers only, whereas there's a more critical mass of eyeballs and brains on the forum, which might lead to a quicker resolution.

NerijusNoreika commented 6 years ago

@petecooper Thanks for the link, I will write there if I don't resolve this in matter of an hour.

I do not have the logins at the moment, but I have access to database and it's test only, so I can inject a new password for already existing user. Since it's older version, I tried hashing the password with md5, but it doesn't seem to work. Perhaps there is some internal function I can to make a proper hash?

petecooper commented 6 years ago

@NerijusNoreika - try this:

INSERT INTO `txp_users` (`user_id`, `name`, `pass`, `RealName`, `email`, `privs`, `last_access`, `nonce`)
VALUES
    (100, 'nerijus', PASSWORD('passwordgoeshere'), 'Nerijus Noreika', 'email@example.com', 1, NOW(), '681327f2f335265698fcf76da8f273bd')

Where I have 100, change that for the next available user_id value from the txp_users table. That should make you a user account with a password you set, and the nonce will reset when you log in properly.

NerijusNoreika commented 6 years ago

Thanks 👍

Upon loging I get Fatal error: Call to undefined function get_auto_keywords() in /html/textpattern/include/txp_article.php on line 1639

I found the definition on plugin/bb_article_edit_auto_keywords.php This is a plugin, right? Or does Textpattern stores both system plugins and client plugins in the same folder?

So I think there is definitely some problems with include paths. Thanks for the help, I appreciate the time you spend on this issue. I don't want to bother you guys too much. ;) Will either write to the forum of Textpattern or do some digging on my own. Of course if you guys will come up with some additional things to check, will be welcome.

bloatware commented 6 years ago

No worries, wish we could help, but the setup definitely seems customized. You can try to search for name LIKE '%plugin%' in txp_prefs table, disable admin-side plugins and/or check plugin_cache_dir path. But if the core has been modified, this might not suffice.

Try disabling %php\_scripting% prefs too in txp_prefs.

petecooper commented 6 years ago

Another aside: if you bundle up all the files (including the cache files) from the old server into a .zip archive, remove the textpattern/config.php file and then upload the .zip to https://www.virustotal.com/ does it report back anything suspicious? My gut feeling here is that something suspicious is trying to hide itself.