The main challenge is interplanetary navigation, to actually be able to hit Mars. Spacecraft do not navigate by themselves - navigation is done on the ground, with help of Deep Space Network(s), precisely timing the radio signals and calculating the trajectories correspondingly.
Normally, a launch vehicle upper stage sends a spacecraft en route to Mars, ground tracking determines the trajectory and calculates the necessary corrections. Hence, your spacecraft needs a radio to be trackable. Radio needs power as well, normally solar power, so you need to add some solar panels. In theory, it would be possible to carefully calculate power required for every communication session and just use primary batteries, which might further simplify things, but it would be quite risky.
Next, you need to be able to perform a few trajectory correction maneuvers. For that you need a propulsion system with enough delta-V budget to perform the corrections, which regularly is 3-4 maneuvers in total. With precise insertion, good tracking, the trajectory corrections should be limited to tens of meters/second of delta-V total, so the propulsion system does not need to be big or powerful. To correctly perform TCMs, you do need attitude control with fairly accurate pointing capability, which you likely need for radio communications anyway.
This should be sufficient to make something impact Mars, and if you add it all up, you are going to find that a regular 1U cubesat, weighing 1Kg is not enough to fit everything in. You'll need something bigger, on the order of a hundred or few hundred kilograms, or with really advanced design maybe a 12U cubesat. There are multiple teams around the world trying to figure out how to make something as small work for interplanetary flight, and it's going to be a few years at least before this can happen. And even then, these will first use a "mothership" approach, where a bigger spacecraft takes the smaller ones to the target orbit first. Note that there are even some rare commercial opportunities available to launch interplanetary cubesats in up to 12U sizes, but not on a Mars-bound trajectory.
To detect if the impact took place, you'll know exactly how Shiaparelli team learned about it - radio transmission will terminate, abruptly.
For some examples of how such mission might be accomplished, you can look at early history of interplanetary flights. Mariner 2 weighed about 200 kilograms and was the first probe to make it to another planet. Some of the more modern small spacecraft in the same weight class have been SMART-1 and Lunar prospector. Also Japanese Sagigake and it's sister Suisei, weighing in at only 140kg.
Interestingly enough, there is an extra barrier for hitting Mars: planetary protection. Whatever you intend to impact on Mars, needs to adhere to some agreed upon cleanliness requirements. For more info, you can refer to this paper titled Interplanetary Cubesat Navigational Challenges