The three terrorists indicted for the deadly shooting attack at Tel Aviv's Sarona Market last month had allegedly first planned a train massacre, but changed their plans due to security procedures at train stations. Their original plans were detailed in the indictment, filed at the Tel Aviv District Court Monday against cousins Muhammad and Khalid Muhamra, both 21, and their friend Younis Zayn, 22. The cousins carried out the shooting attack while Zayn served as an accomplice in its planning, apparently because he was in financial debt, which, the cousins said, would have prevented him from becoming a martyr, according to Muslim beliefs. All three terrorists are from the Palestinian village of Yatta, near the city of Hebron in Judea. They were indicted on four charges of murder and a series of attempted murder charges. Prosecutor Tamar Anis stated at the opening of the indictment that the accused had decided to carry out the attack last July, after the firebombing of the Dawabsha family home in Duma, suspected to have been carried out by Jewish extremists. While planning, they also gathered knives, preparing for the possibility that their weapons would fail during the attack. They also bought rat poison in which to dip the knives, increasing the severity of the injuries they would be able to inflict. Prior to the attack, they were photographed in front of an Islamic State group flag printed with the phrase, "There is no god but Allah, and Muhammad is his messenger." The Shin Bet security agency said the two Palestinian gunmen drew inspiration from the Islamic State group, but were not recruited by Islamic State nor received training from the group. The cousins' lawyer, Khaled Mahagna, said both Muhamras had confessed to the attack. "Regarding Khalid and Muhammad -- the two were at the scene, they confessed to the crimes, they implicated themselves. There is no dispute over this," Mahagna said. "The first defendant, Khalid Muhamra, he argued that in the 1990s they demolished the house of his father, and also given what has been seen in Hebron, what has been seen in the West Bank in the recent period, he wanted to do something," the lawyer added, dismissing the likelihood of Islamic State inspiration. On the day of the attack, the brothers, who wore suits while on their shooting rampage, got haircuts to help complete their look as Israeli businessmen. Afterwards, they went to Zayn's home to pick up the weapons, knives and poison that they had stored there. The pair infiltrated into Israel through a gap in the security fence near Metzudat Yehuda in the South Hebron Hills. They were met there by Yatta resident Salim Mugnam, 23, who was also arrested after bringing the terrorists to the Bedouin town of Segev Shalom, where there was an apartment for people residing illegally in Israel. A few hours later, after being deterred by the security at the Beersheba train station, the terrorists took a taxi to Tel Aviv. Had they been able to easily enter the train station, they would have carried out their shooting attack aboard a train, the Shin Bet revealed. The taxi driver who drove them was interrogated, but released after it became clear that he had no knowledge of his passengers' intentions. He told Israel Hayom, "I am broken. I went through a really difficult time after I realized that I had unknowingly driven the terrorists. It was a difficult trauma for me and I am not interested in saying more than that." The driver will serve as a prosecutor's witness in the trial. When the two arrived in Tel Aviv, they searched for a busy area to carry out the attack, asking passersby where there were restaurants and cafes. At around 9 p.m., they entered the Max Brenner restaurant at Sarona Market, deciding a few minutes later to begin shooting indiscriminately, murdering four people and injuring several more. The Shin Bet further announced that, in working together with the IDF and Judea and Samaria District Police, they had arrested the cousins' accomplices. According to a Shin Bet statement, "Security forces arrested 10 accomplices, each one of them having had one role or another in assisting the terrorists to get to Tel Aviv. "It became clear in the investigation that Muhammad Muhamra studied in Jordan, where he began to grow closer to the Islamic State group's positions. According to the findings from the investigation, the two [terrorists] decided to carry out the attack with Islamic State group inspiration, but without being officially recruited by the organization or receiving any kind of assistance or guidance. The 10 accomplices will soon be indicted at the Samaria Military Court."