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.

Afghan security forces arrive at the site of an explosion and attack by gunmen, in Kabul, Afghanistan, Monday, Dec. 24, 2018. (AP Photo/Rahmat Gul)

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.

Security forces inspect the site of a deadly blast near a demonstration by hundreds of minority Shiites, in the center of Kabul, Afghanistan, Monday, Nov. 12, 2018. Afghan officials confirmed several people were killed in the explosion near a high school and about 500 meters (yards) from where people gathered to denounce Taliban attacks in Jaghuri and Malistan districts of eastern Ghazni province. (AP Photo/Massoud Hossaini)

“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.

A long way from the beach or a July 4th barbecue a U.S. Air Force pararescueman, assigned to the 83rd Expeditionary Rescue Squadron, communicates with a U.S. Army Task Force Brawler CH-47F Chinook during a training exercise at an undisclosed location in the the mountains of Afghanistan, March 14, 2018. (U.S. Air Force Photo by Tech. Sgt. Gregory Brook)

"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.