From the Super Mario Wiki
Ka-Thunks are obstacles that 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. They cannot be destroyed 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.
King Ka-Thunk uses one of these during his battle.