I've had messages like that from people randomly out of the blue as well before asking to do their quiz or help with exam questions, not for HSC but at uni, but it's still the same kind of thing in terms of someone asking you to do something that they should be doing. It can be awkward saying no to someone that you know like a friend, but if it's something that you are uncomfortable with morally or for whatever other reason it's not something you should engage in.
In terms of morally speaking, it's bad to be trying to cheat an exam for someone (it's essentially like doing plagiarism on a hand in report). It is unfair to other students in that class as their rankings might be impacted and as a past HSC student you can probably understand how hard it is to get a good atar.
It's already obvious from the message you wrote that you are in a dilemma and not comfortable with the situation. It is okay to say no to someone, you don't have to always do what people ask you, which is something you will learn as you do more stuff in life. Aside from that someone who just messages you like that out of the blue who isn't even close with you, is not someone I would personally associate with being a friend. They are not messaging you because they are your friend but because they want to take advantage of you and your potential willingness to help and I doubt you are the only one they have messaged asking for this. Already sounds sus at the point of messaging out of nowhere and is further sus by not actually disclosing what they wanted help in the first place. So you probably ended up replying saying yeah I can help and then they drop the do my assessment for me, which is quite manipulative behaviour in my opinion. Also, later on probably they will keep asking for stuff and it won't end when you've done it once, because that's what the kind of people who cheat do, they will keep pushing it and make you do other things.
The way I handled this is not to straight up say those things to them, even if you might think that because it's not your responsibility to outline to them why you don't want to do it and creates unnecessary drama. I just said to them something like I am too busy at the moment and then just list x,y,z random reasons.