By 'attack' do you mean anything dangerous, or just being a pest? If anything dangerous, I would think you need to bring in a handful of treats and then have a come to J meeting, and repeat until he learns better if you can do so safely. If it's something dangerous, that a whole different issue all together.
If it's the run of the mill searching and nosing, ignore him and wait until he stops and stands (yes, it may take a while), then, the moment he stops and stands (ie, all four hooves on the floor and not moving, and face not touching you or about to touch you, or if he offers/does it accidentally, when he turns his head away from you), click and treat (CT). As soon as you do that, he will get all excited again and try to get more treats like when you first started. That is expected- he doesn't know the game yet. Repeat the standing and ignoring until he settles down, then, the moment he's standing quietly, CT again.
Each time, he will most likely take slightly less time to settle down, and eventually the lightbulb will go on for the following 1) the click means I am about to get a treat and 2) I can only get her to make the click by standing here looking cute. Do these session in very short increments. Maybe four or five treats until he's got the concept that standing quietly equals treats. Don't start this when he's anxious right before a meal.
Once you've got that, you can get his breakfast ready, then go do some CT for treats, followed by feeding as normal. Once that is easy and he's standing well for the treats, let him see you bring his meal bucket over and again practice CT for treats. Once he can do that with his meal bucket sitting just outside the stall, just grab it and dump it in his bucket one time after clicking rather than giving him a treat.
The goal is to teach him he can "make" you give him treats/meals by standing quietly. It gives him a job and a way to get what he wants rather than being an anxious nutso about food. There was a darn good thread on CT here not too long ago, I'll see if I can find it.
It is not dangerous behavior exactly, but the potential is there for it to become dangerous pretty quick. I have been avoiding giving him treats unless they are placed in his food bucket. It kind of goes back to the whole subject of this thread, and me making my new goal just for him to respect my space even when I have food.
He will push, shove, and blindly try to force you to give him whatever you have in your hand. Obviously this goes back to his lack of respect for me and my personal space. We have a lot of come to Jesus meetings over this, but until he gets consistent with respect I am wary of bringing something like clicker training into the picture.
One of the unfortunate things about Whiskey is that he was taught (unintentionally I am sure) by his previous owner that it is REALLY easy to push past a person when they are trying to get you to do something you don't want to do. Like stand still, or stand in the cross ties, or not get a treat.
We have been working on this issue, and he is less pushy but he is still pushy at times. I am ashamed to say it but I get after him with my crop a lot. But its because I personally feel like a horse who knows he can shove me around is dangerous and 5'2 me isnt going to win a battle I start with him by myself.