I'm currently done writing a RAT in python. It comes with a lot of features, such as encryption, C extensions (ctypes), huge image libraries and more. If I convert it to an executable using Py2Exe or PyInstaller, the resulting EXE will have a size of 12 - 15 MB, which is obviously inappropriate.
I thought that there is no way of getting around that huge file size until I saw another RAT written in Python called Stitch. The Stitch payload has even more imports than my payload has and the generated binary's file size is 5 - 6 MB.
Now I'm wondering how that executable can be so small. After looking at the Stitch source code, I found out that they are using Py2Exe as well. That confused me a lot.
Maybe there is somebody that knows how to handle this problem. Thank you for taking the time to read it to the end!