def test_validate_killdate(): assert not validate_killdate("0123-45-67") assert not validate_killdate("0000-00-0") assert not validate_killdate("bad") assert not validate_killdate("") assert not validate_killdate("2020-01-45") assert not validate_killdate("2020-13-01") assert validate_killdate("2020-01-01") assert validate_killdate(" 2020-01-01 ")
def do_set_killdate(user, command): new_killdate = command.replace("set-killdate ", "") new_killdate = new_killdate.replace("set-killdate", "").strip() if not validate_killdate(new_killdate): print_bad("Invalid killdate format, please specify a killdate in format yyyy-MM-dd") else: update_item("KillDate", "C2Server", new_killdate) print_good("Updated KillDate (Remember to generate new payloads and get new implants): %s\r\n" % new_killdate) input("Press Enter to continue...") clear()