Looks like something that crawled out from a swamp. Sunken in a swamp from previous war, forgotten but not dead. Years have not been kind and the robotic brain has become old and corrupt, it's Friend or Foe identification gone haywire, attacking everything in sight.
more or less, it's stuck on a junkyard for many years and for some reason awakened by its purpose. So seek and destroy