Reinstalling is probably the only way to be sure... but google shows
google: rpm set file permissions
http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html RPM syntax to fix permission To set permissions of files in a package, enter: rpm --setperms {packagename} Reset the permissions of the all installed RPM packages and You need to use combination of rpm and a shell for loop command as follows:
for p in $(rpm -qa); do rpm --setperms $p; done
That should fix a lot. ... but only files from a package. Other data... search for files with mode 777 and figure out what you need. For most maybe chmod o-w FILE would work. It's risky, it doesn't restore the permissions, but only changes them.
find / -perm -777 -exec chmod o-w {} \; # There are faster ways using xargs