Kamkar also must pay an undisclosed amount of restitution to MySpace, and he is banned from accessing the internet for personal reasons for an unknown amount of time, according to the statement.
Kamkar, using a programming technique known as Asynchronous JavaScript and XML(AJAX) that permitted browsers to execute malicious code, was able to circumvent MySpace’s strong JavaScript filters.
The infection spread like wildfire, adding one million "friends" to Kamkar’s profile within several hours, in addition to placing the string "but most of all, Samy is my hero" on each of his victims’ profiles.
MySpace filed a lawsuit against Kamkar, one of a slew of civil actions the company is taking against criminals who exploit the site’s tens of millions of users.
"MySpace is committed to protecting our community from any abusive misuse of the site," the company said in the statement.
Kamkar could not be reached for comment today.
Click here to email reporter Dan Kaplan.