The man used the official website of Polish president Lech Kaczyński for testing the software. When internet users typed "kutas" ["penis"] they got the official president's site. Furthermore - it was the first result. They played with this for couple of months - right up to March this year. That's when the 23 years old was traced by investigator from the Katowice police office.Link (via Ars Technica)
Finding him wasn't difficult - the man used his home computer, which police easily traced by its IP address. The computer amateur confirmed that he wrote the program. "I just wanted to verify my skills and check if the software works" was his his explanation during the hearings.