"Well, now there’s a mod for that."
The following is unofficial/fan-made content.

A Turret as appearing in Portal 2.
Turrets are autonomous obstacles shooting deadly lead at the player, all mounted on a tripod. Serving as the only enemies in the Portal games, they are primarily defeated by placing portals out from under their metallic feet. They will deactivate if not standing in an upright position, but not without first firing one last volley.
Despite being in both Portal games—and most fangames—they don't officially appear in Mari0, simply because Maurice doesn't like them. They have been implemented unofficially as Custom Enemies, though without quite the same effect, and they appear in the popular mod, Alesan's Entities.
For more information about Turrets in the Portal series, please refer to the Portal Wiki.
Alesan's Entities[]

A shooting turret in Alesan's Entities
Turrets will shoot the player on sight. They can be killed by having them upside down with a portal.
The player will die if they are shot for a few seconds.