Portal Home > Knowledgebase > Articles Database > php script to search/scan all folders & files with chmod 777


php script to search/scan all folders & files with chmod 777




Posted by basketmen, 10-26-2013, 01:31 AM
Hi guys, i know ssh command to search/scan all folders & files with chmod 777 : search folder & file search folder only search file only but my shared host not allowing ssh, is there php script to do this? that i can upload & open the file in browser address bar

Posted by khunj, 10-26-2013, 02:21 AM
You can use in your PHP script: backticks (`command`), exec('command', $output), shell_exec('command'), system('command'), passthru('command'). Some hosts may block them.

Posted by Kailash12, 10-26-2013, 03:06 AM
Most hosts block system, shell_exec PHP functions. It's better you ask them to find such files in your account and provide you the list...

Posted by valley, 10-26-2013, 03:51 AM
You can try using fileperms() to check for the permissions and scandir() to list the file/folders in the directory. http://us1.php.net/fileperms - fileperms() http://php.net/manual/en/function.scandir.php - scandir()

Posted by basketmen, 10-26-2013, 04:25 AM
if its not possible or too hard, i have another question : if using ssh, how to search only inside /home/username/public_html/domain.com , so no search into the root, only inside a folder & the subfolder? i tried this, but this is not working : find /home/username/public_html/domain.com -perm 0777



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
opinion on my new site (Views: 675)
MSBill (Views: 674)


Language: