The companies taking advantage rely on their marks/employees being naive, so you'll be fine once you know to be careful:
1) Get direct employment with a reputable US company instead of via a contracting company.
2) Don't sign any contracts that have any penalty for quitting. You may want to hire a lawyer to review any contracts.
3) If you are in a bad contract and your employer sues you, make sure you hire a decent lawyer. The biggest victims were those that ignored the suits or tried to represent themselves and lost their cases by default.
I have been passively following this subject for past 10 years (since I graduated college). Your suggestions are all valid and with good intent. However, 'one' group of workers these labor shops exploit are in a vicious cycle and are looking for ways to escape.
The following is typical scenario for this group: A student is enrolled in a university with average or poor CS program. There is no funding/scholarship or good on-campsu jobs. So, student works, often bending the laws, off-campus for more than 60 hours to pay for college. Obviously, education takes a backseat and somehow student graduates with huge debt. They struggle to find job and due to time restrictions on F1 visa, they are forced to find an employment and hence sign for these labor shops who give them employment letter (and apply for H1B visa) and securing students stay in US. So, initially, its a mutually beneficial arrangement.
Once workers realize they are being exploited, the struggle to get out starts.
I signed up for one of these contracting companies and they were paying me $48K when most of my fellow new graduates were making over $72K. I got out after 2.5 years, but fortunately, it was hassle free.
This is a very complex web of fraud, exploitation, bending the rules, and what not. IMO, it starts with mutual agreement/need on both sides, but descends in to the scenarios the post has brought to light.
You'll be fine. Most of the time, especially if you get a MS in CS, you'll be hired directly by the employer (Apple, MS, Yahoo et al). You'll probably get a higher salary than a contractor at your level (because the staffing company doesn't eat into it). You have all the problems that comes with a H1B (like a short grace period in case you're laid off, etc), but that will be all.
SOME of these people willingly get into these situations because living in the US for a while improves their social standing (for marriage, dowry, etc) a lot. Others believe in the American dream and come here at any cost and fall into that trap. There is a large group that just cares about getting to the US, and then thinks the salary plus Amway will make them rich.
I did a MS in CS, and got a few jobs (mostly big corps, one of them Cisco, all of which offered to sponsor H1B). I now hate the bay area and its really low quality of life and am tied here only because I love my job. Just keep aiming for excellence, instead of hook or crook, that will mostly help you. The US visa situation is screwed up though, you'll find a lot of articles about it here on HN.
You can easily avoid that fate by avoiding USA. Most other countries don't pull that crap. I don't think Canada behave like this, and most or all of northern Europe is also pretty simple (or extremely simple, in some cases) to get into.
1) Get direct employment with a reputable US company instead of via a contracting company.
2) Don't sign any contracts that have any penalty for quitting. You may want to hire a lawyer to review any contracts.
3) If you are in a bad contract and your employer sues you, make sure you hire a decent lawyer. The biggest victims were those that ignored the suits or tried to represent themselves and lost their cases by default.