Satan never attacks directly, as he knows it is impossible for him to win in a head on fight, no, he prefers a more subtle approach, instead of attacking us, he simply steers us in the direction he wishes us to go, which is straight into his domain, but God allows this, because in order to prevent it, he would have to take away the free will which he gifted to angels and human beings, and that is something he will not do, for he wishes us to choose him, not to be forced to him
Believe me, if you're talking about that biblical satan, you wouldn't stand a chance if he attacked. He's not attacking. He's tempting. Just like our ego. I mean with that ego that we all have, satan doesn't even need to move a finger.
There are numberous reasons. It can be a testing of our faith. Another is to bring people to a point of decision. We all have to decide at one point or another whether we will receive Jesus as our Lord and Savior or reject Him.
The ultimate reality is that God controls everything in the universe, including Satan, and that "in all things God works for the good of those who love him, who have been called according to his purpose" (Romans 8:28).