Does a SIM card consist of only Flash memory or is there a microprocessor inside as well?
in fact many SIMs do contain a microprocessor for extra functionality (see SIM Application Toolkit).
Thank you Igor Skochinsky for the correction.
According to Karsten Nohl's presentation "Mobile Network Attack Evolution", SIM cards contain an embedded real-time operating system, a filesystem and a Java VM :
Here is a direct link to the presentation: https://www.slideshare.net/phdays/140521karsten-nohl-phdmobileattackevolution-35161629