I think "attractiveness" in characters comes from a mixture of them being moral, proactive and interesting.
"Moral" means that they want to do things that normal people would consider wholesome or sympathetic. Sometimes this is just "find out what's going on" or "be left alone", other times it might be "take down the entire drugs cartel". It tends to be stronger if they're motivated not just by general goodwill ("save the whales") but by specific ties to individuals ("save Benny, the whale who rescued me from pirates, and his family along the way") but this can vary.
"Proactive" means that the character takes decisive action or plays an important part in the story. Characters who just get pooped on are pitiful, but not engaging. Sometimes, the character can't do much, but still has an active mind. A character who is forced to work for a master criminal might have no choice but to do the work, but could still try to find out who the master criminal is, etc. Sometimes, you might have to fudge this a bit, where realistically the character would be laid low by terror, depression and so on but for whatever reason keeps going.
"Interesting" means that the character has some quirks that make them stand out a bit beyond his function in the story. Often these are things unrelated to the actual plot: a pet, an irritating brother, a collection of model spaceships, etc. Every main character I've written has one of these. Sometimes these could be strengths or weaknesses that the story might or might not exploit: vertigo, the stamina to run marathons, etc.
So you might have a character who is interesting and moral, but not proactive: a friendly scientist who tells the hero how to defeat a villain, for example. Or you might have a villain who is interesting and proactive, but evil. A lot of action movies have heroes who are moral and proactive, but not interesting - which works on film, but not as well in writing.