The cohomology of the degree-$n$ general linear group over a finite field of characteristic $p$, with coefficients also in characteristic $p$, remains poorly understood. For example, the lowest degree previously known to contain nontrivial elements is exponential in $n$. In this paper, we introduce a new system of characteristic classes for representations over finite fields, and use it to construct a wealth of explicit nontrivial elements in these cohomology groups. In particular we obtain nontrivial elements in degrees linear in $n$. We also construct nontrivial elements in the mod $p$ homology and cohomology of the automorphism groups of free groups, and the general linear groups over the integers. These elements reside in the unstable range where the homology and cohomology remain poorly understood.