An attack spell (i.e. one with the type "Attack", where you do the attack sequence) does count as an attack. Note that this only applies to attack spells: a spell like Drain Life is not an attack despite it being able to do damage.
Damage from a Rot or Burn token is dealt by the token, not the attack, so it will not put a Rage token on. The attack from a card such as Hellfire Trap comes from the trap, not a creature, so it does not put a Rage token on. Similarly, the damage from a card like Ghoul Rot or from Malacoda's effect do not come from attacks, so they do not put a Rage token on.