The Iranian flag hangs outside the Iranian embassy in central London on February 20, 2014. Iran and Britain officially resumed Thursday diplomatic relations severed by London after students stormed its Tehran embassy in 2011, a senior Iranian official said.
CARL COURT/AFP/Getty Images
The Iranian flag hangs outside the Iranian embassy in central London on February 20, 2014. Iran and Britain officially resumed Thursday diplomatic relations severed by London after students stormed its Tehran embassy in 2011, a senior Iranian official said.
Now playing
01:57
Iranians hack New York dam in 2013
5 ways us can stop hackers orig nws_00010722.jpg
5 ways us can stop hackers orig nws_00010722.jpg
Now playing
01:37
5 ways the US can stop hackers
Now playing
04:21
GPS spoofing: Russia's new cyberweapon?
russia DNC hacking RON 2_00000808.jpg
russia DNC hacking RON 2_00000808.jpg
Now playing
02:30
US blames Russia for power grid cyberattacks
Photo of North Korean leader Kim Jong Un taken from the front page of the state paper Rodong Sinmun on Friday September 22.
Rodong Sinmun/KCNA
Photo of North Korean leader Kim Jong Un taken from the front page of the state paper Rodong Sinmun on Friday September 22.
Now playing
02:28
US blames North Korea for cyberattack
The Kremlin wall and towers dominate the skyline at the Red Square in Moscow, on March 2, 2012. Russia on March 4 votes in presidential elections expected to send Vladimir Putin back to the Kremlin after his four year stint as prime minister.  AFP PHOTO / SERGEI SUPINSKY        (Photo credit should read SERGEI SUPINSKY/AFP/Getty Images)
SERGEI SUPINSKY/AFP/AFP/Getty Images
The Kremlin wall and towers dominate the skyline at the Red Square in Moscow, on March 2, 2012. Russia on March 4 votes in presidential elections expected to send Vladimir Putin back to the Kremlin after his four year stint as prime minister. AFP PHOTO / SERGEI SUPINSKY (Photo credit should read SERGEI SUPINSKY/AFP/Getty Images)
Now playing
03:34
NYT: US spies paid Russian who promised cyberweapons, Trump intel
BERLIN, GERMANY - DECEMBER 28: A participant sits with a laptop computer as he attends the annual Chaos Communication Congress of the Chaos Computer Club at the Berlin Congress Center on December 28, 2010 in Berlin, Germany. The Chaos Computer Club is Europe's biggest network of computer hackers and its annual congress draws up to 3,000 participants. (Photo by Sean Gallup/Getty Images)
Sean Gallup/Getty Images
BERLIN, GERMANY - DECEMBER 28: A participant sits with a laptop computer as he attends the annual Chaos Communication Congress of the Chaos Computer Club at the Berlin Congress Center on December 28, 2010 in Berlin, Germany. The Chaos Computer Club is Europe's biggest network of computer hackers and its annual congress draws up to 3,000 participants. (Photo by Sean Gallup/Getty Images)
Now playing
01:47
NYT: NSA hack bigger than Snowden
A roll of "I Voted" stickers, which are handed out to residents after they vote, sit on an election officials table at a polling place on November 4, 2014 in Ferguson, Missouri.  In last Aprils election only 1,484 of Ferguson's 12,096 registered voters cast ballots. Community leaders are hoping for a much higher turnout for this election. Following riots sparked by the August 9 shooting death of Michael Brown by Darren Wilson, a Ferguson police officer, residents of this majority black community on the outskirts of St. Louis have been forced to re-examine race relations in the region and take a more active role in the region's politics. Two-thirds of Fergusons population is African American yet five of its six city council members are white, as is its mayor, six of seven school board members and 50 of its 53 police officers.  (Photo by Scott Olson/Getty Images)
Scott Olson/Getty Images
A roll of "I Voted" stickers, which are handed out to residents after they vote, sit on an election officials table at a polling place on November 4, 2014 in Ferguson, Missouri. In last Aprils election only 1,484 of Ferguson's 12,096 registered voters cast ballots. Community leaders are hoping for a much higher turnout for this election. Following riots sparked by the August 9 shooting death of Michael Brown by Darren Wilson, a Ferguson police officer, residents of this majority black community on the outskirts of St. Louis have been forced to re-examine race relations in the region and take a more active role in the region's politics. Two-thirds of Fergusons population is African American yet five of its six city council members are white, as is its mayor, six of seven school board members and 50 of its 53 police officers. (Photo by Scott Olson/Getty Images)
Now playing
03:15
Homeland Security Chief: Hackers targeting voting systems
CNN/File
Now playing
02:17
Source ties Russia to Wikileaks emails
Reuters
Now playing
02:21
Putin ally warns of 'war' if US elects Hillary Clinton
Getty Images
Now playing
02:30
Hackers playing US for entertainment?
Russian President Vladimir Putin visits a polling station during parliamentary elections in Moscow on September 18, 2016. / AFP / POOL / GRIGORY DUKOR        (Photo credit should read GRIGORY DUKOR/AFP/Getty Images)
AFP/AFP/AFP/Getty Images
Russian President Vladimir Putin visits a polling station during parliamentary elections in Moscow on September 18, 2016. / AFP / POOL / GRIGORY DUKOR (Photo credit should read GRIGORY DUKOR/AFP/Getty Images)
Now playing
02:15
Is hacking group tied to Russian intelligence?
A man walks to use a voting booth March 1, 2016, at one of the Virginia primary election polling stations at Colin Powell Elementary School, in Centreville, Virginia.
Voters in a dozen states will take part in "Super Tuesday" -- a series of primaries and caucuses in states ranging from Alaska to Virginia, with Virginia the first to open its polling stations at 6:00 am (1100 GMT).  / AFP / PAUL J. RICHARDS        (Photo credit should read PAUL J. RICHARDS/AFP/Getty Images)
PAUL J. RICHARDS/AFP/Getty Images
A man walks to use a voting booth March 1, 2016, at one of the Virginia primary election polling stations at Colin Powell Elementary School, in Centreville, Virginia. Voters in a dozen states will take part in "Super Tuesday" -- a series of primaries and caucuses in states ranging from Alaska to Virginia, with Virginia the first to open its polling stations at 6:00 am (1100 GMT). / AFP / PAUL J. RICHARDS (Photo credit should read PAUL J. RICHARDS/AFP/Getty Images)
Now playing
01:52
US officially blames Russia for political hacks
FBI Director James Comey (R) speaks as Assistant Attorney General for National Security John Carlin (L) listens during a news conference for announcing a law enforcement action March 24, 2016 in Washington, DC.
Alex Wong/Getty Images
FBI Director James Comey (R) speaks as Assistant Attorney General for National Security John Carlin (L) listens during a news conference for announcing a law enforcement action March 24, 2016 in Washington, DC.
Now playing
04:31
Assistant attorney general to hackers: We'll find you
Hillary Clinton and Donald Trump shake hands following the first presidential debate moderated by NBC host Lester Holt(bottom L) at Hofstra University in Hempstead, New York on September 26, 2016.
PAUL J. RICHARDS/AFP/Getty Images
Hillary Clinton and Donald Trump shake hands following the first presidential debate moderated by NBC host Lester Holt(bottom L) at Hofstra University in Hempstead, New York on September 26, 2016.
Now playing
01:27
Fact check: Was Russia behind the DNC cyberattacks?
WESTBURY, NY - SEPTEMBER 26:  Democratic presidential nominee Hillary Clinton speaks during a debate-watch party at The Space at Westbury on September 26, 2016 in Westbury, New York. Tonight was the first of four debates for the 2016 election - three presidential and one vice presidential.  (Photo by Justin Sullivan/Getty Images)
Justin Sullivan/Getty Images North America/Getty Images
WESTBURY, NY - SEPTEMBER 26: Democratic presidential nominee Hillary Clinton speaks during a debate-watch party at The Space at Westbury on September 26, 2016 in Westbury, New York. Tonight was the first of four debates for the 2016 election - three presidential and one vice presidential. (Photo by Justin Sullivan/Getty Images)
Now playing
01:50
Clinton's Wall Street speeches leaked?

Story highlights

The breach occurred during the same time frame that Iranian hackers were targeting U.S. financial institutions

Hackers are often able to use tools to scan the Internet for networks that are vulnerable

(CNN) —  

Iranian hackers breached a dam outside of New York in 2013, according to a former official, managing to get control of the flood gates.

The previously undisclosed cyberattack was first reported by The Wall Street Journal on Monday.

According to a former official familiar with the 2013 investigation into the attack, the hack of Bowman Avenue Dam near Rye Brook, New York, was not a sophisticated intrusion, but a test by Iranian hackers to see what they could access.

The breach occurred during the same time frame that Iranian hackers were targeting U.S. financial institutions.

The attackers were unable to get into the full dam system, but could take control of the flood gates. The incident remains classified, the official said.

Rye Brook Mayor Paul Rosenberg said the dam is used to control water flow when it rains to prevent flooding downstream. The dam is managed by a piece of software that Rosenberg told CNN was “industry standard” and “very common.”

He said he doubted the hackers could have wreaked heavy damage or that Rye was a substantial target, but it worries him that hackers are looking for any opportunity they can find to cause damage.

RELATED: Obama signs cybersecurity bill

“I think one of the great things here is that the federal government stepped in and stopped what could have been something bad from happening,” Rosenberg said. “We appreciate that, but it makes me wonder about what would be potentially next, and that makes me concerned. I think in this day and age all municipalities needs to look at our infrastructure and see where are our soft targets, where should we be prepared.”

News of the attack illustrates what has long been a fear of cyber experts: that overseas hackers can easily get into pieces of old critical infrastructure running on retro-fitted software that is connected to the Internet. U.S. susceptibility to an attack on its electrical grid or industrial control systems by terrorists or other nations has been a concern of security experts, lawmakers and academics alike.

Hackers are often able to use tools to scan the Internet for networks that are vulnerable, and generic software makes that even easier. Software used across many different entities can often have the same weaknesses and may not be kept up to date, and users sometimes keep in place default passwords and settings for convenience.

To make matters worse, most of the critical infrastructure in the U.S. is privately owned, making it difficult for governments to harden the systems against attack.

The news also comes on the heels of another major breach – a flaw in software from computer network company Juniper Networks that would have allowed sophisticated hackers to install backdoors into computer networks potentially allowing them to spy on the encrypted communications of the U.S. government and private companies for the past three years.

RELATED: Hack has U.S fearing foreign infiltration

The Department of Homeland Security would not comment on the dam intrusion, but did note in a statement that its cybersecurity center serves as a hub for monitoring and mitigating to attacks. DHS also maintains the Industrial Control Systems Cyber Emergency Response Team (ICS-CERT) to respond to such attacks.

“The Department of Homeland Security continues to coordinate national efforts to strengthen the security and resilience of critical infrastructure, working with our federal and industry partners across the country to raise awareness about evolving threats and promote measures to reduce risks to systems we all rely on,” the department said.

New York lawmakers cited the news as an example of the need for greater attention on cybersecurity.

“Iran is the leading state sponsor of terrorism around the globe, so this sort of behavior is par for the course. An Iranian cyber-attack on a small dam in Rye is reason enough for concern, but when we look at other potential targets … it’s clear that we must do more to assess and address potential vulnerabilities to a cyberattack,” Democratic Rep. Eliot Engel said in a statement.

“Reports of Iranian hackers infiltrating the control system of a Rye dam in 2013 underscore the urgent need for a national cybersecurity strategy that protects individuals, businesses, and our communities,” said Democratic Rep. Nita Lowey. “I will continue working to ensure Iran – the number one state-sponsor of terrorism – is held accountable for its actions, and that my constituents in Westchester and Rockland, as well as all Americans, can live in safe and secure communities.”

According to ICS-CERT, in 2014 the team responded to 245 cyber incidents reported by critical infrastructure operators, 32% of which were in the energy sector and 27% of which were in critical manufacturing.

Many of the compromises were carried about by simple “spearphishing” attacks – where employees are duped into clicking a malicious link by an email.

CNN’s Rene Marsh contributed to this report.