So, having never heard of shellcode before, I assumed it was just another way of saying shell script. But I scroll to the bottom and see (*(void(*)()) shellcode)(); and suddenly this looks way more interesting. Is it really possible to literally just execute random bytes stored in a string like that? I mean, sure, you'd have to guarantee that it's running on the right platform with the right type of assembly, but sti…
This 'shell code' was the 'payload' of other code that exploited e.g. a buffer overflow; the goal of such an exploit was always to trick some program into executing that payload, i.e. the shell code. So there were/are essentially two parts to writing an exploit - first getting the software to actually execute random code, secondly (if you actually want to use the exploit) write shell code that does something useful to an attacker, like spawn a shell or (as in the OP) drop firewall rules.
As a less objective side note, writing 'shell code' was always considered (in the circles I hung around in) as being less honorable and prestigious. The 'exploit writers' (exploiting the primary bug) were the samurais, the shell code guys the ninjas, as it were. Writing shell code was considered a bit dirty grunt work, and only script kiddies needed it anyway, because after the PoC for the actual exploit was done, the 'interesting' part was over. (I never 100% agreed with this, for some exploits you need some serious trickery to make your PoC actually do something useful).