With rattles it could be a slightly loose tuner head which vibrates at certain frequences, try holding the each tuner head (in turn) still and pluck a string or two. If it is a tuner head, there is a simple super glue trick to help.
Could also be a badly seated string, try loosening a string if the rattling happens on that one strings, turn the brass ball at the end of the string and re-tune.
Generally, if its a truss rod which is damaged it'll rattle, try tapping the back of the neck with the heel of your hand, if it rattles, then you may have a damaged or broken truss rod, if it doesn't it may be one of the two things above. Also, the nut could be cut too wide, so the string rattles in the nut.