Two alleged would-be thieves are in custody following a bashing and attempted robbery in Sydney's west.

Bachar Raad and Joshua Kent allegedly broke into a car at a Condell Park property and attacked Mustapha Mohamed so hard with a baseball bat that it broke.

However they left behind crucial evidence, including their wallets and a phone with selfies on it, after crashing their alleged getaway car.

View photos The two men left a selfie behind at the scene. Source: 7 News. More

Mohamed, 48, approached the men after he was woken by noises outside his Condell Park home around 12.30am on Tuesday.

The men, who are believed to be known to him, had allegedly been rifling through Mustapha's BMW, before they allegedly attacked him.

"It was a very brave thing for him to do to keep trying to carry on and get as much information as possible," acting inspector Jason McEvoy said.

View photos Police carry out their investigation at the Condell Park home. Source: 7 News. More

Mr Mohamed’s son Josh El Mohamed told 7 News that his mother found his dad lying on the ground.

"My mum's screaming, I come out, she tells me my dad's on the ground,” he told 7 News.

"They're just scums,” he added.

View photos The photo and license were found in this Astra which was crashed into a tree at Condell Park. Source:7 News. More

While fleeing the scene after allegedly bashing the 48-year-old, the pair crashed their car into a tree at Condell Park.

Mr Mohamed’s sons gave chase with a neighbour and found the photo and an ID.

One of the men was arrested in a nearby street and taken to Bankstown Police Station, while the second man was later arrested at Bass Hill after police raided the Bass Hill motel.

Story continues