The best thing you can do when you discover that you are in a bad work situation is to first, learn from it and second, start looking for another job. With regard to the first point, I mean learn everything: policy, practices, process, management, politics and coworkers that contributed to the bad experience. All of this will come in handy later on. It is not enough to recognize that you were bored and not challenged enough. You have to figure out why the situation you are in is as bad as it is. Just doing the analysis puts you more in control of your current situation. You might find you can improve your work environment and turn a bad job into an acceptable one (and you get to ignore my second recommendation).
One very important point: when in a lousy work environment, it doesn't help to complain. It does help to point out problems and recommend solutions.