All four options share the same matrix pattern $A = \begin{pmatrix}0&0&b_1\\1&0&b_2\\0&1&b_3\end{pmatrix}$ for different values of $b_1,b_2,b_3$, so instead of recalling the companion matrix formula, compute the characteristic polynomial of this general shape directly and match coefficients.
$xI - A = \begin{pmatrix}x&0&-b_1\\-1&x&-b_2\\0&-1&x-b_3\end{pmatrix}$
Expanding along the first row:
\[\det(xI-A) = x\big(x(x-b_3) - b_2\big) - 0 + (-b_1)(1 - 0) = x^3 - b_3x^2 - b_2x - b_1.\]
This must equal $p(x) = x^3 - 8x^2 + 5x + 7$, so matching coefficients:
\[-b_3 = -8 \implies b_3 = 8, \qquad -b_2 = 5 \implies b_2 = -5, \qquad -b_1 = 7 \implies b_1 = -7.\]
So the required matrix is $\begin{pmatrix}0&0&-7\\1&0&-5\\0&1&8\end{pmatrix}$, which is exactly option (C); substituting the $(b_1,b_2,b_3)$ triples of the other three options into $x^3-b_3x^2-b_2x-b_1$ never reproduces $p(x)$, so none of them work.
\[\boxed{\begin{pmatrix}0&0&-7\\1&0&-5\\0&1&8\end{pmatrix}}\]