I am creating a website that is using a perl script, PHP, a MySQL database, and HTML. My main concern is making sure there is not anyway someone can gain access to anything that give them access to my information. I mean is there anyway for someone to get my perl script and see my database information. I know about sql injection but I have no forms for information to be entered into. Is there anything I should keep in mind with this stuff.
Share
This will only happen when the webserver doesn’t parse/process the script and returns it as plaintext. Usually this parsing/processing only happens on specific file extensions like
.plfor perl files and.phpfor PHP files. If you (or the hacker) renames it to.txt, the client will be able to obtain the entire script as plaintext. Nevertheless, if a hacker is able to rename it, it has access to the whole script anyway. This would then be done by a security hole in FTP or CMS.Further, I’ve seen scripts which reads files (usually images or other static files) from (outside) the webapp context based on the path as a parameter. E.g.
download.php?filename.extIf such a script doesn’t do any sanity checks on the file path, a smart hacker may be able to obtain scripts as plaintext bydownload.php?%2Fserver%2Fhtdocs%2Fscript.php.