The boy named only as Aril, was bitten on the arm by the pet snake while trying to take a picture of it at his home in Bundung Regency in Indonesia's West Java province.
The 14-year-old posted the first of two images to his WhatsApp account at 9.50am local time, showing the snake spreading its hood moments before striking.
According to Mailonline, the photo, on December 11, was captioned 'Why not smile a little' and has been reported as Aril's attempt to photograph his cobra after having given it a bath.
The second picture at 9.54am showed blood on the boy's right arm, and he had also attempted to tie a shoelace around his limb to stop the venom from spreading to the rest of his body.
Between life and death' was the caption that came with the picture.
'Aril's status wasn't to boast [about his injury] but to ask his friends for help,' the boy's mother, Neuis Marpuah, was quoted as saying, adding that her son had been at home alone at the time of the incident.
Reports said the boy later also wrote: 'If anyone considers themselves my friend, please take me to the hospital.'
Someone arrived to take Aril to a hospital an hour later, but he was declared dead by medics at 10pm the same day, with emergency treatment failing to revive him.
According to local reports, Aril owned more than a dozen snakes.