Often when it is a class project the department or the professor's lab can collect the payment as a sponsorship instead of the students. Still sketch, but arguably at least the company is forced to pay someone for the labor, and arguably better than the company getting work for free.