You're right, that's totally doable.
However supply chains to that Gaza aren't exactly robust, they can barely get enough food to survive. It's unlikely an AliExpress package full of PIR sensors is going to make it's way through the blockade.
Yeah, but guns absolutely can. Iran is pretty good at supplying Hamas with everything they need to maintain control over the population - you might expect that after three years of absolutely brutal warfare Hamas would be beaten into submission, but clearly they are not.