Woocommerce posts and products links works only once and then get 404 error

I realized that some php code changes the content of .htaccess file. The php folder was in a directory named ‘securityl’. I’ve been removed that directory but whenever the website was refreshing the directory and also the php files inside it was recreating. In the end I discovered that some code in wp-include/load.php is creating the directory and I re-downloaded the wordpress and replaced the clean wp-include, then the problem solved and there was no code for creating securityl folder! . I don’t know how and why the contents of that files were changed.