Oh no, you shouldn’t use this replacement, since you are assigning the training set to the test set and will see a major data leakage in your experiments.
I would suggest to extend the attack_map table with all missing mappings.
I.e. since the test set contains more unique classes, you would have to add e.g. the mapping {'worm': 'U2R'}. Note that I don’t know how the additional classes should be mapped so this is just an example, since I’m not familiar in this domain.