Ciaran Barr wanted to see Afghanistan – and he wanted to do it in the most authentic way he thought possible. The Dutch tourist backpacked his way across the mountainous Asian country and turned to a social networking site to find locals to stay with for free.

“Things can go well nine out of 10 times,” Barr said. “It just takes that one time when things go wrong and so far nothing has gone wrong. We also have been lucky.”

TALIBAN PRISONERS EXPLOIT RELEASE LOOPHOLE WITH FAKE MEDICAL CLAIMS

Barr is among a growing group of Westerners who have been turning to Couchsurfing.com to travel to places like Afghanistan.

"You feel like you get a more authentic feel for the city so you don't get trapped in tourist hot spots," Barr, 24, told AFP in heavily-militarized Kabul, where he spent several nights sleeping on a thin mattress on the floor of his Afghan host's bedroom.

Despite the country’s serious security concerns and decaying infrastructure, nearly 2,000 Afghans have signed up to host tourists like Barr. In Afghanistan, the majority of those willing to open their doors to total strangers are men.

Even under the best circumstances, it’s hard to ignore the internal scars on the war-torn country. There was the Soviet invasion in 1979 which led to a decade-long war that killed two million people. The Taliban took its turn in 1994, taking over entirely from 1996 until 2001, when an American-led invasion toppled the regime for giving refuge to Al Qaeda and 9/11 mastermind Usama bin Laden. Since then, there has been constant civil unrest and instability.

RAND PAUL, AFTER WH MEETING ON SYRIA AND AFGHANISTAN, SUGGESTS TRUMP IS COMMITTED TO PULLOUT

On Wednesday, the U.S. embassy in Kabul confirmed that a California man was among those killed in a truck bomb attack on Monday against a heavily fortified foreign compound. The Taliban claimed responsibility for the attack that left four people dead and 113 others wounded.

Diplomats and other officials say aside from truck bombs, kidnappings remain rampant and foreigners are sought-after targets. They also caution that tourists have no real way of knowing if their host family is connected to criminals because the site doesn’t vet hosts who may have ulterior motives.

“You can end up with the Taliban,” a diplomat in Kabul, who has been involved in negotiations to rescue kidnap victims, told The Associated Press. “It’s naïve and reckless.”

That’s exactly what happened to Caitlan Coleman and Joshua Boyle who were kidnapped while backpacking in Afghanistan in 2012. They were eventually freed from the Taliban five years later, along with their three children who were born in captivity.

YOUNG AFGHAN MESSI FAN THREATENED BY CRIMINALS, TALIBAN

Norwegian tourist Jorn Bjorn Augestad, who has couchsurfed in Iraq and the Central African Republic, says government warnings are exaggerated.

"They are too careful. You have to be smart about a lot of things, having contact with a local is the best way to stay safe," said Augestad, who is on a mission to visit every country in the world, including Syria, before his 30th birthday this year. “This is part of the cultural experience, seeing how people live and hearing people’s life story and getting an understanding of the country that you are in.”

Barr and Augestad met through a local travel agent, who found them a taxi driver to take them more than 250 miles to the Afghan capital.

After reaching Kabul, the deadliest place in Afghanistan for civilians, Barr and Augestad stayed with Couchsurfing host Naser Majidi, 27, who works as a technical adviser for a water utility company.

For Afghans consumed by wanderlust, hosting a foreigner is a chance to travel vicariously through their experiences, as more and more countries make it all but impossible for Afghan passport holders to obtain a visa.

"I can make it easier for them to see the beauty of this country," says Majidi, who has hosted six guests since signing up to Couchsurfing in 2016. "It's a good experience for me - I get more friends and I know the world better."

CLICK HERE TO GET THE FOX NEWS APP

But his family worry that he is putting himself in danger.

"They have advised me many times that this is very risky for you and for them (guests)," Majidi says.

The Associated Press contributed to this report.