Chatterbox - A modern message spammer

If you're anything like me, one of your favorite pranks growing up was SMS spamming (also known as an SMS Bomber). Nothing better than freezing your friends iPhone with a steady stream of SMS messages. Fast forward to last Spring, my friend Justin shows me an email spammer that he had written to get back at some guys in our fraternity. All you needed was some payload text, a bit of anti-spam, and a target. Simple but fun!

(Un?)fortunately I've been an avid iPhone user since 2012 and I prefer not to jailbreak my phones. Normally, that means I don't get to have as much fun as my Android counterparts. It hit us, though, that iMessage on a Mac seemed relatively unrestricted. Send unlimited SMS, MMS, iMessage--whatever you want. Add some AppleScript and you might be able to automate the whole thing...

Chatterbox

Throw in a lazy Christmas afternoon, and you've got a working iMessage spammer that's capable of as much fun (annoyance?) as you please. All you need is a Mac, iMessage, and an Apple address book. The code behind the monster is pretty simple. Sprintf the user input into a string representation of some AppleScript, instantiate an NSAppleScript object, and execute!

NSString *payload = [NSString stringWithFormat:@"\
                         repeat %li times\n\
                         set rnd to (random number from 1 to 200)\n\
                         set rnd to rnd as string\n\
                         tell application \"Messages\" to send \"%@\" & %@ to buddy \"%@\" of %@ \n\
                         delay %@ \n\
                         end repeat", self.quantity, self.messageTextField.stringValue, randPortion, self.phoneNumberTextField.stringValue, serviceType, self.delayTextField.stringValue];
    
    NSLog(@"Payload: %@", payload);
    
    self.scriptObject = [[NSAppleScript alloc] initWithSource: payload];

If you're interested, here's the source code: https://github.com/PhilipBale/chatterbox

I've included a download link below if you want to play around with it. SMS messages need a bit of delay inbetween so as to allow the messages time to send. I found about a half second delay works well for iMessages. I've tested it quite a bit on my little brother :P
-Philip