The first iPhone software update, 1.0.1, released on July 31, 2007 patches an exploit, discovered on July 23, 2007. The exploit allowed hackers to take complete control of the iPhone via Wi-Fi connection or by luring a person to a website with that included malicious code. Once the hacker had control of the iPhone they could download the entire content of the iPhone, make phone calls, or turn the phone into a covert listening device.
The update is installed via iTunes.