Long story short, I've got an Ubuntu server box that was recently compromised (I believe through a known exploit of an older version of Tomcat, which has already been updated). Part of the exploit set the permissions on pretty much everything to 777.
In attempting to fix the incorrect permissions I inadvertently set /lib to 644 instead of 755 as it should have been. As a result of this, no programs can be run (including but not limited to chmod), and the system cannot fully boot (either normally or into recovery mode).
Is there any way to gracefully recover from this mistake, or do I basically have to reinstall Ubuntu from scratch at this point?
The one thing I can do is access a limited command prompt through grub. Using this I can browse the machine's filesystem, but I haven't found any way to use it to modify any permissions. Is there a a way to do this using grub's command prompt?