You should file your taxes. If you do not have a valid SS# then get a TIN and use that. Always good to file your taxes... While I can't make promises, that should not send ICE to your door. Good Luck.
Massachusetts Immigration Attorney
Presumably you do not have an cannot get a lawful social security number. Unless you have work authorization and a social security number, you are not legally authorized to work. An ITIN does not give you work authorization. However, it does give you the ability to file taxes, which could be a point in your favor if you do later qualify for some immigration benefit. In my experience, the IRS is happy that you are reporting your income and filing taxes and this information is not shared with other sections of the government.
This general information does not establish any attorney-client relationship. There may well be factors not mentioned in the question which could and should be addressed in an attorney consultation.
An illegal immigrant who is working in the US must file a US tax return and to do so must request an ITIN (individual taxpayer identification number) from the IRS using Form W7. What your friend must definitely not do is obtain a social security number by fraud or theft.
That being said, simply getting an ITIN will not give your friend permission or authorization to work in the US.
If your friend really wants to work in the US then he should do it the proper way, by leaving and then obtaining a proper visa to work in the US. To not do so is illegal, selfish, irresponsible, and amounts to spitting in the face of every other immigrant who did the right thing and followed the law in obtaining permission to work in the US.