That looks pretty nasty, you could just delete all those files (antivirus won't pick them up) but you'd risk leaving some behind. Personally I would backup the site content and rebuild them on new Wordpress installs, this time making sure you keep the Wordpress installs up to date (out of date Wordpress is notorious for these issues) and then ensure that you set up all access permissions.etc properly so this cannot happen again.