Two men are facing a prison sentence after admitting their part in the recent TalkTalk data breach.

The attack saw the details of thousands of customers compromised, at a cost of around £42 million.

According to the BBC, Matthew Hanley, 22, pleaded guilty to compromising the security of the company's website between October 18 and 22 in 2015.

The Old Bailey in London, UK, also heard that Hanley had then passed on the details to Connor Allsopp, 20.  

The pair, who both herald from Tamworth, Staffordshire, were told they would be sentenced next May.

Hanley denied other cybercrime charges, which included allegedly hacking into NASA, the National Climatic Data Centre and another 23 websites including Spotify, Telstra, the RAC and The Eton Collection.

The upcoming sentence of the duo comes after a 17-year-old youth was given a 12-month rehabilitation order for posting details of a weakness in Talk Talk’s online security.

When appearing at Norwich Youth Court, he reportedly said he was just “showing off” to his friends.

That revelation fits in with the findings of a recent study by the UK government’s National Crime Agency, which found that many offenders commit cybercrime as a way of gaining a sense of notoriety and popularity among their peers.

The paper also warned that the average age of those involved in cybercrime (17) is significantly lower when compared to other offences, such as drugs (37).

In this case, the teenager’s actions reportedly paved the way for the attack, although the teenager in question was found to have uncovered a weakness in the company’s security by way of using completely legitimate software.

The TalkTalk website was reportedly targeted over 14,000 times after that vulnerability was exposed, with the company later claiming that the breach had cost it around £42 million, including a record £400,000 fine from the Information Commissioner’s Office.