Well, Kerry could have been lying to score points with his audience of the moment. This is the most likely explanation.
Or, he could have whatever license it takes in MA to own an "assault rifle" and keeps it in a safe somewhere, and renews the lic whenever it expires (you need to take a course of some sort, right?). This is very unKerrylike. Someone should ask him what type of licence he has and in what city it was issued.
He could have had a real Chinese Full-Auto AK47 with bayonet and so on, demilled and is a wallhanger souvenir to remind people that he served. This is Kerrylike, especially if he forgets to tell people it is demilled and he bought it at Cabelas on sale. "There I was, standing in the steaming jungle, when up comes this Cong general yelling at the top of his lungs. I unslung my Huey and fired a single shot over his head, and he surrendered, handing me the rifle you see now on the wall."
Hehehe. He's got it hanging right next to the 18 point buck he got on Boston Common from 700 yards.