To gain control over a target system, a reverse shell is an integral part of a hacking/pentesting process, it enables the attacker to execute system commands on the target machine. This python shell is a robust one, reconnecting to the attacker machine each time the connection is lost and an XOR encryption is implemented to encrypt the traffic sent between the two machines.
Full blogpost here.