Malpighian tubules:
Malpighian tubules are attached at the junctions of midgut and hindgut. Each tubule is lined by glandular and ciliated cells. They absorb nitrogenous wastes and convert them into uric acid, which is let into the hind gut and excreted out through the anus along with the feces