On 4 September 1939, during the German invasion of Poland he reported to the Communication Battalion of the Polish Army in Zegrze as the reserve ("plutonowy"). Two weeks later, on the first day of the parallel Soviet invasion of Poland from the east, he was arrested in the village of Kołodno near Zbaraż and shipped to a Soviet POW camp. After two months, on 13 November 1939 Ząbecki was transferred to German jurisdiction in accordance with the Nazi-Soviet pact. He was sent to Parchim in Germany where he worked as a slave laborer on a farm in Klinken. He was released on 29 March 1941 for medical reasons and returned to Sokołów. Being a railwayman from before the invasion, he was put to work at the nearby Treblinka station on . There he secretly joined the resistance under the nom-de-guerre "Dawny" (the "old-timer" in Polish) and was asked by the Armia Krajowa (AK) to keep a watch on the German rail transports passing through the station. This intelligence became crucial following the German attack on Russian positions in occupied eastern Poland. Soon afterwards, Ząbecki was given the task of spying on the secretive Treblinka extermination camp for the AK. He kept cryptic notes with daily records of the extermination transports and also took the clandestine photograph of the burning Treblinka-II perimeter during the prisoner uprising.