From Mars: One 4K Netflix Movie per Unconditional Surrender
The real answer is provided in the next section, with the use of probes, but here is the physical reason why it is impossible to access the internet directly from Mars: signal strength loss.
Regardless of how the Aliens receive weak signals from Earth, the Aliens will still need to send signals to Earth to query from Google. They will need to use a high-gain directional antenna, which narrows the beam width to heighten the signal strength and reduce interference, to send their signals towards Earth.
If the signal is sent to an omni-directional source of a Wifi enabled device (roughly 2dbi) (since no sane person would point their directional wifi extender perfectly accurately into space and towards Mars instead of their router), and the aliens use a Nasa-grade high gain 48dbi antenna, with a signal frequency of 2.8GHz, like wifi, then the signal attenuation will be 200db (which is 1/1e20 of the signal strength). This high loss in signal strength is because of the distance, and we are forced to send signals to an omnidirectional receiver rather than a directional one (a difference of 20-50db).
The most reliable signal we can realistically send will have a signal loss sitting at roughly 37dBw (67dbBm). To achieve 37dBw signal strength, the aliens will need a signal of roughly 171 dBw due to 208dBi signal loss, which will mean a signal with 1.26e+17 watts worth of power.
This means, to send a single TCP packet of 65535 bytes or 524,200 bits at 2.8GHz, to try to initiate a search on Google from a device, will need 1.87e-4 seconds worth of a signal, or 23.6e12 joules. The energy equivalent of that is roughly one nuclear bomb.
Due to a mistake in signs, originally we had come to a conclusion that two google searches would be enough for a planet-wide extinction event. This is no longer possible with the current calculations, but, hypothetically what does this mean, in terms of planet-wide extinction events? The asteroid impact that wiped out the dinosaurs sits at roughly 4.2e23 joules, so transmission of 3/4ths of the 1,200 petabytes on the internet from Google, Amazon, Facebook, and Microsoft would be on the same scale as the next extinction of the entire human race.
Humanity's satellites would quickly notice if a few signals, each on the scale of a nuclear explosion, were sent from Mars, and large craters from each google search aftershock were to continuously blast open on Mars. If the aliens were capable of harnessing this level of power, all it would take is one 4K Netflix movie on Earth, and a few countries would be gone, the Earthlings cowed into surrender.
As such, due to the heavy loss of signal strength over the long distance between Earth and Mars, it is highly unlikely the aliens would attempt to send WiFi signals from Mars. (And even then, as in Renan's answer, they would be stopped by the latency).
From Earth Orbit: The More Efficient Way
Analysis and Simulation
The more efficient way would be to probe an internet satellite, from providers like xplornet. The aliens could send a probe near one of the internet satellites, and analyze or transmit signals to it.
If they are not familiar with satellites, they can gain knowledge about them by dissecting one of the many dead satellites in the graveyard orbit, or, with more risk, hijack/study a nearby Mars Rover or Orbiter, which have a ton of communication equipment.
The probe will analyze existing signals going into and out of the internet satellite, meaning there will be little risk of detection. Any encryption on the internet signals can be broken, or they can target strictly un-encrypted signals. Once they are familiar with the signals, they can simulate their own signals to the satellite, with an appropriate 'fake latency' to simulate it as coming from Earth.
The probe they send to hack the satellite will also have a two-way communication method that will send and receive signals to and from the aliens on Mars. Since the distance is far, the probe can use directional antennas to reduce signal loss, with a similar setup to how NASA handles transmission between Mars orbiters to Earth. They could also make use of alien transmission technologies, since there is no format requirement on this signal, allowing to pick techniques that are less noticeable or have a better transmission format.
Probe's Maximum Distance from Satellite
In terms of how far the beacon should be placed, if the aliens want to completely avoid their probe being caught, the United Space Surveillance Network tracks satellites in orbit around the Earth. A crucial part of this is the GEODSS system
the GEODSS system can track objects as small as a basketball more than
20,000 miles (30,000 km) in space or a chair at 35,000 miles (56,000
km), and is a vital part of USSPACECOM's Space Surveillance Network.
Distant Molniya orbiting satellites are often detected in elliptical
orbits that surpass the Moon and back (245,000 miles out).
This is to say, should a beacon be placed, and surveillance is to be completely avoided, the beacon should be located beyond 245,000 miles out from the Earth, to avoid detection by the GEODSS system. The speed of light in a vacuum is 186,282 miles per second, meaning, at this placement, the latency will be around 1.315 seconds. This is a fairly high latency, potentially causing file download/upload speeds to slow down to 0.5x-10x compared to 500-10 ping, due to handshakes being needed to confirm packets have been received (dependent on the size of the packet), but this will not affect browsing the internet.
Dealing with Latency and Packet Loss
The delay from latency won’t be a significant issue, as accessing the internet for information isn’t reliant on latency (think Netflix, Youtube, Wikipedia). To avoid timing out for requests, they can easily program the beacon to simulate handshakes and requests locally at the satellite, effectively appearing to have close to 0 ping (or, if they are avoiding the GEODSS, ~1300 ping). They can then stream out the data to mars at their leisure. Packet loss from the distance will be reliant on what technology they use for the beacon, but also shouldn’t be an issue, as they can resend requests.
They will, however, do terribly in World or Warcraft due to actual latency and packet loss from Mars, but that's what single player games are for. Perhaps they may come in peace after being unable to resist the temptation of playing such games with low ping.
Most likely, due to high traffic volume, google would be the first website they will analyze, and they will be able to quickly simulate internet requests to and from google.
With google, they will be able to easily obtain information like how to create an email account, gain access to Wikipedia, and watch online lecture videos from Youtube. This will allow them to quickly gain a general understanding of the human race and carry out their next plans.
Dealing with Potential Issues
Q: How would they gain the know how to work on satellites?
A: By analyzing and dissecting the dead satellites in the graveyard orbit
Q: Can probes they send completely avoid detection?
A: This depends primarily on how far ahead the aliens are in dealing with electromagnetic waves. Most likely they will have no issues easily dealing with any of our primitive surveillance systems, but even without such measures, by primarily staying out of our surveillance systems' maximum effective ranges (300,000+ miles), there is very little probability of detection. In fact, the European Space Agency alone has mapped 61-89% of Mars, and many other Space Administrations/Agencies are also constantly probing Mars for various other things. Without some kind of anti-surveillance tech, it is more likely that the alien spacecraft/base on Mars will eventually be caught than the relatively small beacon.
Q: Would the humans notice their satellite is being monitored by the aliens?
A: By first analyzing existing dead satellites, then analyzing only signals going in and out of an internet satellite, detection chance is very low.
Q: Would encryption prevent the aliens from accessing the internet at all?
A: No, only some 50% of the world’s total internet traffic is encrypted, with unencrypted HTTP traffic remaining high (20-40%) in the APAC region.
Q: Would encryption deter the aliens?
A: This is probably the biggest issue, all of this depends on the alien's level of computing technology. It should still be possible to break some of the less heavily encrypted transmissions, but breaking the more complicated encryption methods would require the use of a quantum computer or equivalent in processing power.
Q: How would they deal with the minutes high latency between Earth and Mars?
A: Simulate return responses at the satellite itself, effectively achieving near-0 ping from the perspective of the internet services.
Q: How would they deal with the massive signal loss from Earth to Mars?
A: By using two directional antennas, the signal loss from one point to the other is heavily reduced. They can use a setup like NASA's space orbiters, with one low-gain and one high-gain antenna on the probe.
Q: What if the aliens are not able to send out any probes?
A: Then barring the use of any space magic, the aliens would have no reasonable way to send and receive signals due to signal loss. If they had such space magic, actually accessing the internet from Mars and dealing with TCP would also be extremely difficult; @Renan provides an excellent answer.