It can be calculated by simply raising the transition matrix that encodes the random walk by powers of n
So for the two steps forward, one step back process, with an absorbing barrier at 0 and another at 5, and p=1/2, you would have:
$ \begin{bmatrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 \\
\frac{1}{2} & 0 & 0 & \frac{1}{2} & 0 & 0 & 0 \\
0 & \frac{1}{2} & 0 & 0 & \frac{1}{2} & 0 & 0 \\
0 & 0 & \frac{1}{2} & 0 & 0 & \frac{1}{2} & 0 \\
0 & 0 & 0 & \frac{1}{2} & 0 & 0 & \frac{1}{2} \\
0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1
\end{bmatrix} $
The right most entries give the probabilities of being absorbed at the upper barrier at step 'n' assuming it has not been absorbed before. The left entry gives the probability of being absorbed at 0.
Nice, closed-form solutions do not exist though for uneven steps for arbitrarily high powers, but generating functions can be derived.
A closed form solution for a 2 step forward, 1-step back process, with a barrier at $m$ and zero, assuming the particle starts at $m-1$ is
$\frac{b+b^2}{z}$ where b is the series solution of the smallest root of $x^3-2x+z=0$ as a power series in terms of $z$, setting z=1 and summing the series gives the exact probability of absorption for the upper barrier at up to $m$ steps.