Have you ever wondered what it would be like to have access to instant genius in the form of a little pill? In the run-up to last summer's exams, curiosity proved too great a temptation for a few of my mates. They got their hands on a substantial haul of Modafinil, a prescription-only drug normally used to treat narcolepsy.

Modafinil is one of a number of performance-enhancing smart drugs that can be found online. It gives a sensation of natural wakefulness for hours at a time, without the jittery buzz and disrupted sleep associated with caffeine.

It also sharpens the mind, boosts memory and aids problem-solving: the Ministry of Defence shipped thousands of pills to tired soldiers in Afghanistan and Iraq.

They certainly work. While I was dozing off, bored senseless by revision, my mates were more focused than a Buddhist monk mid-meditaton.

But Modafinil does more than just keep you awake. I asked a friend who tried it out to describe his experience.

"It messes with your mental reward system," he said. "It makes you desperate to do what you know you actually need to do. You just don't want to do anything else. I wanted to revise all the time, non-stop."

Professor Barbara Sahakian, a leading neuroscientist at the University of Cambridge, explained it to me in scientific terms: "Our recent study published in Neuropharmacology suggests that healthy people use smart drugs, like Modafinil, to get down to and complete tasks that they have been putting off, because these tasks seem more enjoyable when taking these drugs."

In short, drugs like Modafinil make revision seem fun. This might sound like everything a stressed student could want, but prospective pill-poppers should be warned – the pills come with a whole range of potential physical side-effects.

"At present there are no long-term safety studies of these drugs in healthy people," explains Professor Sahakian. "We know that the brain is in development into late adolescence. Therefore we do not know the long-term consequences of the effects of these drugs on a healthy developing brain."

Ordering online, she adds, is "a very dangerous way to obtain prescription-only drugs. You do not know what you're actually purchasing."

In my experience, Modafinil changes people's behaviour too. Over those weeks my friends became different people – in turn aggressive, cold and reclusive. Eating was "a waste of time" and so was conversation.

One friend, a world-class procrastinator, could be found swearing at anybody who interrupted his work flow, walking away from conversations mid-sentence. When I put it to another that using brain-enhancing drugs amounted to cheating, he turned on me, accusing me of wanting to ban revision. He apologised the next day. He said it was the drugs talking.

It's easy to see the appeal of Modafinil. It's readily available on the internet – a month's supply would set you back around $50, apparently – and unlike that other popular study drug Ritalin, possession without prescription isn't actually illegal.

A spokesperson for the charity DrugScope says Modafinil is a prescription-only medication but not a controlled substance, so it is not illegal to be caught in possession of it. However, under the Medicines act, it is an offence to supply, which includes everything from wholesale dealing to simply giving some to a friend.

Ritalin, however, is a controlled substance under the Misuse of Drugs act, the spokesperson says. Possession of it without a prescription is illegal and it is a Class B drug.

A BBC survey found that of those people who had tried smart drugs before, 92% would do so again. My friends say they'd happily do so, maintaining that they're not put off by the health risks.

Nor do they consider smart drugs a form of cheating, comparing the practice to paying for tutoring or private schooling.

I'll admit that I was intrigued – but not enough to try it. Having seen the bizarre behaviour of other users, I find the effects unsettling and, frankly, a little bit scary.

Modafinil may promise to change your grades, but it might also change the way you act. Don't say you haven't been warned.