Getting attacked when I don't have a bounty?
Solution 1:
You can try to use the command "paycrimegold" - simply use your curser and tap on a guard, then write this command. If this doesn't work, please say what is attacking you - normal guards, bandits, the emperor men(The Occuloti) because if they attack you you can kill them and the guards might even help you.
Solution 2:
Have you tried going to some far away place and rest for 30 days? This resets the quest area and NPCs and might fix the problem.
Alternately refer to this extensive answer regarding fixing quests.