예제 #1
0
 def do_broadcast(self, ignore):
     '''
     Send a broadcast notification
     Usage: broadcast
     '''
     title = raw_input(PROMPT + "Title: ")
     message = raw_input(PROMPT + "Message: ")
     Notifier.broadcast_success(title, message)
예제 #2
0
 def create_cracked_password_events(self, cracker, victim, password, value):
     user_msg = "Your password '%s' was cracked by %s." % (password, cracker.handle)
     evt_id = Notifier.user_warning(victim, "Security Breach", user_msg)
     event1 = (self.push_user_notification, {"event_uuid": evt_id, "team_id": victim.team.id, "user_id": victim.id})
     message = "%s hacked %s's bank account and stole $%d" % (cracker.handle, victim.team.name, value)
     evt_id = Notifier.broadcast_custom("Password Cracked", message, cracker.avatar)
     event2 = (self.push_broadcast_notification, {"event_uuid": evt_id})
     return event1, event2
예제 #3
0
 def do_broadcast(self, ignore):
     '''
     Send a broadcast notification
     Usage: broadcast
     '''
     title = raw_input(PROMPT + "Title: ")
     message = raw_input(PROMPT + "Message: ")
     Notifier.broadcast_success(title, message)
예제 #4
0
 def create_purchased_item_event(self, user, item):
     """ Callback when a team purchases an item """
     self.refresh_scoreboard()
     message = "%s purchased %s from the black market." % (user.handle, item.name)
     evt_id = Notifier.team_success(user.team, "Upgrade Purchased", message)
     self.push_broadcast_notification(evt_id)
     message2 = "%s unlocked %s." % (user.team.name, item.name)
     evt_id2 = Notifier.broadcast_warning("Team Upgrade", message2)
     return (self.push_broadcast_notification, {"event_uuid": evt_id2})
예제 #5
0
 def purchased_item(self, user, item):
     ''' Callback when a team purchases an item '''
     self.refresh_scoreboard()
     message = "%s purchased %s from the black market." % (
         user.handle, item.name,
     )
     evt_id = Notifier.team_success(user.team, "Upgrade Purchased", message)
     self.push_broadcast_notification(evt_id)
     message2 = "%s unlocked %s." % (user.team.name, item.name,)
     evt_id2 = Notifier.broadcast_warning("Team Upgrade", message2)
     self.push_broadcast_notification(evt_id2)
예제 #6
0
def score_team(box, team):
    ''' Executed as a thread: scores a single team '''
    auth = AuthenticateReporter(box, team)
    auth.check_validity()
    if auth.confirmed_access is not None:
        award_money(box, team, auth)
    else:
        team.boxes.remove(box)
        dbsession.add(team)
        dbsession.flush()
        message = "Lost communication with bot on %s." % box.name
        Notifier.team_warning("Lost Access", message)
예제 #7
0
 def cracked_password(self, cracker, victim, password, value):
     user_msg = "Your password '%s' was cracked by %s." % (
         password, cracker.handle,
     )
     evt_id = Notifier.user_warning(victim, "Security Breach", user_msg)
     self.push_user_notification(evt_id, victim.team.id, victim.id)
     message = "%s hacked %s's bank account and stole $%d" % (
         cracker.handle, victim.team.name, value,
     )
     evt_id = Notifier.broadcast_custom("Password Cracked",
         message, cracker.avatar
     )
     self.push_broadcast_notification(evt_id)
예제 #8
0
 def cracked_password(self, cracker, victim, password, value):
     user_msg = "Your password '%s' was cracked by %s." % (
         password,
         cracker.handle,
     )
     evt_id = Notifier.user_warning(victim, "Security Breach", user_msg)
     self.push_user_notification(evt_id, victim.team.id, victim.id)
     message = "%s hacked %s's bank account and stole $%d" % (
         cracker.handle,
         victim.team.name,
         value,
     )
     evt_id = Notifier.broadcast_custom("Password Cracked", message,
                                        cracker.avatar)
     self.push_broadcast_notification(evt_id)
예제 #9
0
 def create_purchased_item_event(self, user, item):
     ''' Callback when a team purchases an item '''
     self.refresh_scoreboard()
     message = "%s purchased %s from the black market." % (
         user.handle,
         item.name,
     )
     evt_id = Notifier.team_success(user.team, "Upgrade Purchased", message)
     self.push_broadcast_notification(evt_id)
     message2 = "%s unlocked %s." % (
         user.team.name,
         item.name,
     )
     evt_id2 = Notifier.broadcast_warning("Team Upgrade", message2)
     return (self.push_broadcast_notification, {'event_uuid': evt_id2})
예제 #10
0
 def swat_player(self, user, target):
     message("%s called the SWAT team on %s." % (
         user.handle,
         target.handle,
     ))
     evt_id = Notifier.broadcast_warning("Player Arrested!", message)
     self.push_broadcast_notification(evt_id)
예제 #11
0
 def team_file_share(self, user, file_upload):
     ''' Callback when a team file share is created '''
     message = "%s has shared a file called '%s'" % (
         user.handle, file_upload.file_name,
     )
     evt_id = Notifier.team_success(user.team, "File Share", message)
     self.push_team_notification(evt_id, user.team.id)
예제 #12
0
 def create_flag_capture_event(self, user, flag):
     ''' Callback for when a flag is captured '''
     self.refresh_scoreboard()
     evt_id = Notifier.broadcast_success("Flag Capture", 
         "%s has captured '%s'." % (user.team.name, flag.name,)
     )
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #13
0
 def flag_capture(self, user, flag):
     ''' Callback for when a flag is captured '''
     self.refresh_scoreboard()
     evt_id = Notifier.broadcast_success("Flag Capture", 
         "%s has captured '%s'." % (user.team.name, flag.name,)
     )
     self.push_broadcast_notification(evt_id)
예제 #14
0
 def create_swat_player_event(self, user, target):
     message("%s called the SWAT team on %s." % (
         user.handle,
         target.handle,
     ))
     evt_id = Notifier.broadcast_warning("Player Arrested!", message)
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #15
0
 def create_joined_team_event(self, user):
     ''' Callback when a user joins a team'''
     message = "%s has joined your team." % user.handle
     evt_id = Notifier.team_success(user.team, "New Team Member", message)
     return (self.push_team_notification, {
         'event_uuid': evt_id, 
         'team_id': user.team.id
     })
예제 #16
0
 def create_paste_bin_event(self, user, paste):
     ''' Callback when a pastebin is created '''
     message = "%s posted to the team paste-bin" % user.handle
     evt_id = Notifier.team_success(user.team, "Text Share", message)
     return (self.push_team_notification, {
         'event_uuid': evt_id, 
         'team_id': user.team.id
     })
예제 #17
0
 def create_paste_bin_event(self, user, paste):
     ''' Callback when a pastebin is created '''
     message = "%s posted to the team paste-bin" % user.handle
     evt_id = Notifier.team_success(user.team, "Text Share", message)
     return (self.push_team_notification, {
         'event_uuid': evt_id,
         'team_id': user.team.id
     })
예제 #18
0
 def team_file_share(self, user, file_upload):
     ''' Callback when a team file share is created '''
     message = "%s has shared a file called '%s'" % (
         user.handle,
         file_upload.file_name,
     )
     evt_id = Notifier.team_success(user.team, "File Share", message)
     self.push_team_notification(evt_id, user.team.id)
예제 #19
0
 def create_joined_team_event(self, user):
     ''' Callback when a user joins a team'''
     message = "%s has joined your team." % user.handle
     evt_id = Notifier.team_success(user.team, "New Team Member", message)
     return (self.push_team_notification, {
         'event_uuid': evt_id,
         'team_id': user.team.id
     })
예제 #20
0
 def create_flag_capture_event(self, user, flag):
     ''' Callback for when a flag is captured '''
     self.refresh_scoreboard()
     evt_id = Notifier.broadcast_success(
         "Flag Capture", "%s has captured '%s'." % (
             user.team.name,
             flag.name,
         ))
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #21
0
 def create_unlocked_level_event(self, user, level):
     ''' Callback for when a team unlocks a new level '''
     self.refresh_scoreboard()
     message = "%s unlocked level #%d." % (
         user.team.name,
         level.number,
     )
     evt_id = Notifier.broadcast_success("Level Unlocked", message)
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #22
0
 def unlocked_level(self, user, level):
     ''' Callback for when a team unlocks a new level '''
     self.refresh_scoreboard()
     message = "%s unlocked level #%d." % (
         user.team.name,
         level.number,
     )
     evt_id = Notifier.broadcast_success("Level Unlocked", message)
     self.push_broadcast_notification(evt_id)
예제 #23
0
 def flag_capture(self, user, flag):
     ''' Callback for when a flag is captured '''
     self.refresh_scoreboard()
     evt_id = Notifier.broadcast_success(
         "Flag Capture", "%s has captured '%s'." % (
             user.team.name,
             flag.name,
         ))
     self.push_broadcast_notification(evt_id)
예제 #24
0
 def create_team_file_share_event(self, user, file_upload):
     ''' Callback when a team file share is created '''
     message = "%s has shared a file called '%s'" % (
         user.handle, file_upload.file_name,
     )
     evt_id = Notifier.team_success(user.team, "File Share", message)
     return (self.push_team_notification, {
         'event_uuid':evt_id, 
         'team_id':user.team.id
     })
예제 #25
0
 def create_cracked_password_events(self, cracker, victim, password, value):
     user_msg = "Your password '%s' was cracked by %s." % (
         password,
         cracker.handle,
     )
     evt_id = Notifier.user_warning(victim, "Security Breach", user_msg)
     event1 = (self.push_user_notification, {
         'event_uuid': evt_id,
         'team_id': victim.team.id,
         'user_id': victim.id
     })
     message = "%s hacked %s's bank account and stole $%d" % (
         cracker.handle,
         victim.team.name,
         value,
     )
     evt_id = Notifier.broadcast_custom("Password Cracked", message,
                                        cracker.avatar)
     event2 = (self.push_broadcast_notification, {'event_uuid': evt_id})
     return event1, event2
예제 #26
0
 def create_team_file_share_event(self, user, file_upload):
     ''' Callback when a team file share is created '''
     message = "%s has shared a file called '%s'" % (
         user.handle,
         file_upload.file_name,
     )
     evt_id = Notifier.team_success(user.team, "File Share", message)
     return (self.push_team_notification, {
         'event_uuid': evt_id,
         'team_id': user.team.id
     })
예제 #27
0
 def paste_bin(self, user, paste):
     ''' Callback when a pastebin is created '''
     message = "%s posted to the team paste-bin" % user.handle
     evt_id = Notifier.team_success(user.team, "Text Share", message)
     self.push_team_notification(evt_id, user.team.id)
예제 #28
0
 def create_unlocked_level_event(self, user, level):
     ''' Callback for when a team unlocks a new level '''
     self.refresh_scoreboard()
     message = "%s unlocked level #%d." % (user.team.name, level.number,)
     evt_id = Notifier.broadcast_success("Level Unlocked", message)
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #29
0
 def create_swat_player_event(self, user, target):
     message("%s called the SWAT team on %s." % (user.handle, target.handle,))
     evt_id = Notifier.broadcast_warning("Player Arrested!", message)
     return (self.push_broadcast_notification, {'event_uuid': evt_id})
예제 #30
0
 def lost_bot(self, bot):
     message = "Lost communication with bot on %s" % (bot.box.name,)
     evt_id = Notifier.team_warning(bot.team, "Botnet", message)
     self.push_team_notification(evt_id)
예제 #31
0
 def new_bot(self, bot):
     message = "New bot connected to botnet from %s " % (bot.box.name,)
     evt_id = Notifier.team_success(bot.team, "Botnet", message)
     self.push_team_notification(evt_id)
예제 #32
0
 def joined_team(self, user):
     ''' Callback when a user joins a team'''
     message = "%s has joined your team." % user.handle
     evt_id = Notifier.team_success(user.team, "New Team Member", message)
     self.push_team_notification(evt_id, user.team.id)
예제 #33
0
 def unlocked_level(self, user, level):
     ''' Callback for when a team unlocks a new level '''
     self.refresh_scoreboard()
     message = "%s unlocked level #%d." % (user.team.name, level.number,)
     evt_id = Notifier.broadcast_success("Level Unlocked", message)
     self.push_broadcast_notification(evt_id)
예제 #34
0
 def swat_player(self, user, target):
     message("%s called the SWAT team on %s." % (user.handle, target.handle,))
     evt_id = Notifier.broadcast_warning("Player Arrested!", message)
     self.push_broadcast_notification(evt_id)
예제 #35
0
 def paste_bin(self, user, paste):
     ''' Callback when a pastebin is created '''
     message = "%s posted to the team paste-bin" % user.handle
     evt_id = Notifier.team_success(user.team, "Text Share", message)
     self.push_team_notification(evt_id, user.team.id)
예제 #36
0
 def joined_team(self, user):
     ''' Callback when a user joins a team'''
     message = "%s has joined your team." % user.handle
     evt_id = Notifier.team_success(user.team, "New Team Member", message)
     self.push_team_notification(evt_id, user.team.id)