"This isn't the Islam I know," Rabbani thought at first.
But Rabbani began reading articles and watching videos produced by Islamic State online, and he continued to turn to Saleh for advice, nicknaming him "Mufti," a Muslim legal expert.
"I've been looking more into it ... we should talk in person," Rabbani texted Saleh one evening, according to court documents. Islamic State's ideology, he added, "just makes sense."
"You mean establishing Islam the same way the Prophet ... did? We can meet up whenever your free," Saleh replied.
"Yeah and dude it's like their doing it step by step and perfectly ... the exact ways and rules of the prophet," Rabbani texted back.
Unbeknownst to Rabbani, federal agents had been tracking him and Saleh for months. They listened to Rabbani's conversations, followed his moves, monitored his internet searches and bank statements.
They learned Saleh was meeting up with four friends in Staten Island, where they discussed Islamic State teachings and possible locations for an attack, such as Times Square. Rabbani said he never attended those meetings and didn't know Saleh was planning an attack.
In May 2015, Rabbani and some friends were heading to a mosque in Brooklyn when they spotted a car following them. After they arrived at the mosque, Rabbani and his friends approached the vehicle, but before they could challenge the driver, he drove off. Thinking it might have to do with his religious beliefs, Rabbani called 911.
After weeks of being followed, Rabbani grew frustrated. One evening after prayer services, Rabbani, Saleh and another friend were in the friend's Jeep Cherokee when they noticed they were being tailed. When they came to a stoplight, Rabbani and Saleh got out and ran toward the car to confront the driver.
The vehicle reversed and within moments several federal law enforcement cars raced up. When agents searched Rabbani and Saleh, they found knives, according to court documents, and the two were arrested. Rabbani maintains it was normal for him to carry a knife.