From the Super Mario Wiki
Ka-Thunks are invincible enemies who appear only in the courses King Ka-Thunk's Castle and Bowser's Lava Lake Keep in Super Mario 3D World. Ka-Thunks resemble spiky blue squares which hurt the player upon contact. They usually spawn in small crevices and move along a set path until they fall into an abyss. The boss of World 5, King Ka-Thunk, is their leader. They cannot be defeated by any means, including invincibility, excepting the pair of Ka-Thunks in Bowser's Lava Lake Keep defeated by defeating a pair of Hammer Bros.