A miniature "cyber-city" has been created in New Jersey, complete with a bank, hospital, water-tower, train system, power grid and a coffee shop.
The buildings are tiny - fitting into an area 6ft (1.8m) by 8ft - but the underlying computer systems mimic those in the real world.
The aim is to train US government "cyber-warriors" to fend off attacks.
Experts believe attacks on critical infrastructure are likely to become more widespread.
Developed in response to a challenge from the US military, the NetWars CyberCity was created by security training organisation the Sans Institute.
It will send government hackers on various missions, starting in December.
These will include fending off attacks on the city's power company, hospital, water system and transportation services.
CyberCity director Ed Skoudis said: "We've built over 18 missions, and each of them challenges participants to devise strategies and employ tactics to thwart computer attacks that would cause significant real-world damage."
The missions will typically last between a few hours and a few days.
Sans Institute director Eric Bassel said Greater understanding of a city's vulnerabilities could be critical as computer attacks from nation states became increasingly frequent and sophisticated.
"When you lose control of cyberspace, you lose control of the physical world," he said.
"We have seen detailed evidence of foreign nations deep inside the computer networks of our financial services companies, manufacturing companies and critical infrastructure," Mr Bassel added.
Such attacks had been going on for many years, he said, but efforts to fight them off had been limited.
"With NetWars CyberCity we hope to turn the tables by providing our first-line cyber-defenders with the necessary skills and hands-on training to fend off online attacks and regain control of cyberspace," he added.
For security consultant Alan Woodward, such cities perform a vital job.
"Dotted around Salisbury Plain there are loads of deserted villages that the army now uses for training, and this is the cyber-equivalent," he said.
He said such mock-ups would become increasingly sophisticated but would always be limited.
"All it will do is teach you have to defend and respond to a situation but it will never prevent attacks," he said.