The enemy of my enemy is my enemy's enemy, nothing more. Just because they all hate us doesn't mean they can't hate each other more.
Suppose some of the smaller players in our various proxy wars -- Kurds, Turks, Syrians, etc. -- decide it's time to make a move regionally. They might decide that the U.S. is too distracted to respond forcefully, so they go after one of our bases that's there to keep a lid on things.
Their thinking could be, "If we take out the Americans, we can consolidate power before they can respond. By the time they get their act together, we'll already be the defacto power and can assert our rights in the U.N."
It's not about attacking the U.S. in order to defeat the U.S. It's about attacking the U.S. to defeat your enemy who the U.S. is protecting.