First, we must realize that the answer to this question could vary to a significant degree depending on the circumstances. For one thing, different states have different laws regarding liability. More importantly, there are any number of possible permutations to this situation. It is possible to imagine many different scenarios for how the person trespassing on the other’s property came to be hurt. However, in general, it is safe to say that the owner of the property is much less likely to “get in trouble” than the person who trespassed on their property and then tried to assault them.
In general, a person who trespasses on another’s property gives up many of their rights to be protected. This is not a blanket statement, however. A property owner cannot typically get away with intentionally hurting someone just because they are trespassing. They have to take reasonable steps to protect even a trespasser. Again, much depends on the situation. A trespasser who took out a knife to menace the homeowner, then tripped on the stairs and fell on the knife is very unlikely to be able to claim the homeowner was negligent. Furthermore, the act of the attempted assault brings into play issues of self-defense. An attempted assault on the homeowner with a deadly weapon gives that homeowner a significant right to defend themselves and absolves them of liability for injuries to the assailant in most cases.
In general, then, the trespasser/assailant is much more likely to get in trouble than the property owner, but this is only a general statement made without knowledge of all the facts in this hypothetical.