probability of guessing a k-digit number sequentially from n trials
Let $\ G_i\ $ be the number of guesses taken to determine the $\ i^\text{th}\ $ digit. Then $\ G_1,G_2,\dots\ $ are independent discrete random variables, all uniformly distributed over the integers $\ 1,2,\dots,10\ $, and the total number of guesses taken to determine every one of $\ k\ $ digits is $\ \displaystyle T_k=\sum_{i=1}^kG_i\ $. The probability mass function $\ p_{T_k}\ $of $\ T_k\ $ is therefore the $\ k-$fold convolution of the uniform distribution over the integers $\ 1,2,\dots,10\ $: \begin{align} p_{T_j}(h)&=\sum_{i=1}^{10}\frac{p_{T_{j-1}}(h-i)}{10}\\ &=\sum_{i=\max(1,h-10(j-1))}^{\min(10,h+1-j)}\frac{p_{T_{j-1}}(h-i)}{10}\ , \end{align} because $\ p_{T_{j-1}}(s)=0\ $ for $\ s<j-1\ $ or $\ s> 10(j-1)\ $.
If you're allowed $\ n\ $ guesses to to get all $\ k\ $ digits correct, then your probability of success is $$ \sum_{i=1}^nT_k(i)=\sum_{i=k}^nT_k(i)\ . $$ One convenient way of obtaining $\ p_{T_k}\ $ is to use generating functions. The generating function $\ g_0(x)\ $ of the uniform distribution over the integers $\ 1,2,\dots,10\ $ is given by $$ g_0(x)=\frac{1}{10}\sum_{i=1}^{10}x^i\ , $$ and the generating function of the convolution of two probability mass functions is the product of their generating functions. The generating function $\ g_k(x)\ $ of $\ p_{T_k}\ $ is therefore given by $$ g_k(x)=g_0(x)^k=\frac{1}{10^k}\left(\sum_{i=1}^{10}x^i\right)^k\ . $$ The generating function of $\ p_{T_5}\ $ is \begin{align} \frac{1}{10^5}\big(x^{50}&+5x^{49}+15x^{48}+35x^{47}+70x^{46}+126x^{45}\\ &+210x^{44}+330x^{43}+495x^{42}+715x^{41}+996x^{40}\\ &+1340x^{39}+1745x^{38}+2205x^{37}+2710x^{36}+3246x^{35}\\ &+3795x^{34}+4335x^{33}+4840x^{32}+5280x^{31}+5631x^{30}\\ &+5875x^{29}+6000x^{28}+6000x^{27}+5875x^{26}+5631x^{25}\\ &+5280x^{24}+4840x^{23}+4335x^{22}+3795x^{21}+3246x^{20}\\ &+2710x^{19}+2205x^{18}+1745x^{17}+1340x^{16}+996x^{15}\\ &+715x^{14}+495x^{13}+330x^{12}+210x^{11}+126x^{10}\\ &+70x^9+35x^8+15x^7+5x^6+x^5\big)\ . \end{align} Therefore, the probability of determining $5$ digits with $25$ or fewer guesses is \begin{align} \frac{1}{10^5}\big(1&+5+15+35+70+126+210+330+495+715\\ &+996+1340+1745+2205+2710+3246\\ &+3795+4335+4840+5280+5631\big)\\ &=\frac{38125}{10^5}\ . \end{align}