The cubes were billions of devices used by the Shakri in order to confuse, observe, and ultimately attack the Human race.
Properties
Each cube had its own unique function when they were activated for a total of forty-seven minutes after a dormant total time of a year.
They were extremely resilient. During tests, UNIT had cubes subjected to temperatures of plus and minus 200 Celsius, simulated a water depth of five miles, dropped one out of a helicopter at 10,000 feet and rolled their best tank over it.
History
The cubes arrived on Earth overnight and were investigated by UNIT to be found dormant and un-moving. The Doctor wanted them to be vulnerable, but nothing happened until precisely one year had passed. By this time, the cubes had become commonplace to the Human race, and could be found in almost every single house and place of work in the world.
While in his kitchen, Rory Williams found a cube opening and closing at the sides. His wife, Amy Pond, found a cube that began to move. She touched it and spikes stabbed at her palm, apparently taking a reading of her pulse. While playing on a Wii videogame console, the Doctor found a cube hovering near him, which deployed a laser and attacked him. Brian Williams, meanwhile, found "his" cube shuffling across the table in front of him. Later, the cube that attacked the Doctor was seen rapidly browsing random information on the Internet.
While visiting UNIT headquarters, the Doctor and Amy were told by new leader Kate Stewart that all cubes displayed unique characteristics. One in captivity caused mood swings in the nearest human, another emitted fire for no discernible reason, and still another played music, specifically an endless loop of the "Chicken Dance" song, which lead UNIT to store it in a soundproof container.
After forty-seven minutes of this random activity, the cubes all simultaneously shut down, then displayed a countdown in glowing numerals. The Doctor watched one as it reached zero. The cube opened to reveal... absolutely nothing. But when exiting and looking at one of the UNIT consoles he discovered people around the world were being affected by some hidden phenomenon, dropping to the ground in pain. He then realised, while he suffered a pain in his chest, that it turned off hearts. Although he was able to survive with one of his two hearts still going, the other victims of the cubes were dying of spontaneous heart attacks.
A second wave of cubes were commissioned to the Earth, but the Doctor changed their function to restart the hearts of the people who had been killed while on the Shakri Ship. (TV: The Power of Three)