Re:Ask HN: My web app was hacked today – Bad experiences and...
by ryanmccullagh on Wednesday February 26, 2020 @11:27PM
(#22430447)
To maintain dev ops best practices such as prohibiting nginx from sending dotfiles (.env, .git, etc) takes time. It’s understandable that you made a mistake. But how did they get access to the actual dB? Did you expose it over the public internet?
[ Parent
| on HN ]
Re:Ask HN: My web app was hacked today – Bad experiences and...
by ngranja19 on Wednesday February 26, 2020 @11:34PM
(#22430487)
Exactly. You could access to it like viralquotesonline.com/.env. I did several mistakes for sure. It was my first project launched to the world and the first time I used Laravel, is a bit embarrassing to be honest, but hopefully helps other to realize that they are in a risk too.
Re:Ask HN: My web app was hacked today – Bad experiences and...
by jlis on Thursday February 27, 2020 @04:40AM
(#22431941)
What I don't get is how the .env file was even served when Laravel uses the public/index.php as starting point, so your root Folder should have been the public/ folder, not the application folder.
Mistakes like this happen, but it takes courage to post about it. Thanks for sharing it.
Re:Ask HN: My web app was hacked today – Bad experiences and...
by ngranja19 on Thursday February 27, 2020 @07:06AM
(#22432543)
I'm not totally sure I'm not a Laravel expert I just use it as a backend api so I believe I exposing the entire Laravel folder instead just the public. And yes is embarrassing haha.
Re:Ask HN: My web app was hacked today – Bad experiences and...
by saluki on Thursday February 27, 2020 @12:13PM
(#22435259)
I was curious too how this could happen, since the .env wouldn't normally be in the public folder.
Laravel is a great framework, check out Laracasts.com and forge.laravel.com, it's a deployment tool that will spin up a VPS on AWS, Digital Ocean, etc. with the proper configuration.
Re:Ask HN: My web app was hacked today – Bad experiences and...
by tluyben2 on Thursday February 27, 2020 @05:36AM
(#22432175)
But how did that work in the first place? Not that it is good practice etc however, normally your webserver for Laravel would be pointing to $MYSITE_DIR/public and .env would be $MYSITE_DIR/.env. So how did you end up getting it exposed there?
Re:Ask HN: My web app was hacked today – Bad experiences and...
by ryanmccullagh on Thursday February 27, 2020 @12:10AM
(#22430696)
Well it’s a good lesson and definitely don’t pay them. but I’m still not sure how they accessed the DB. Did you expose port 3306 over a public IP?
Small things like this are one of the reasons I founded the PHP hosting platform, Amezmo where secure production ready container instances can be launched in seconds.
Re:Ask HN: My web app was hacked today – Bad experiences and...
by ThePowerOfFuet on Saturday February 29, 2020 @02:48AM
(#22449511)
>And if you call in the next twenty minutes...