Washington (CNN) ISIS' Afghanistan-based affiliate has emerged as a major threat capable of carrying out direct attacks on the US and is actively using its members' social media to acquire contacts in the United States, a US intelligence official in Afghanistan tells CNN.

"They are closest to having the capacity to attack the homeland from Afghanistan," the official said, saying the US believes ISIS is gathering this social media information to determine whom they can use and whom they could exploit in potential future attacks on the US.

"They represent a very sophisticated and dangerous threat that we have to stay focused on," Gen. Joseph Votel, the commander of US Central Command, told reporters Tuesday while on a visit to Afghanistan.

The terror group, known as ISIS-K, has been actively recruiting from schools and mosques and has been asking new recruits for their social media contacts and phone numbers of people they know in the US, to likely help their efforts to attack the US, according to the intelligence official.

The official said that this intelligence has been gained from ISIS-K fighters that have been captured on the battlefield and interrogated by Afghan security forces.

Read More