You need an extension of Newton's method known as Hermite's method.
For that, you need to know that a divided difference with identical nodes is defined in terms of derivatives of $f$. In particular,
$$f[a,a]=f'(a)$$
and
$$f[a,a,a]=\frac{f''(a)}2.$$
In general, you'll have
$$f[a,\ldots,a]=\frac{f^{(n)}(a)}{n!}$$
if $a$ is repeated $n+1$ times.
So, you'll have the following formula for the polynomial you're looking for:
$$P(X)=f[1]+f[1,1](x-1)+f[1,1,1](x-1)^2+f[1,1,1,2](x-1)^3+f[1,1,1,2,2](x-1)^3(x-2)+f[1,1,1,2,2,2](x-1)^3(x-2)^2.$$
For a divided difference like $f[1,1,1,2]$, you have to use the inductive definition, so
$$f[1,1,1,2]=\frac{f[1,1,1]-f[1,1,2]}{1-2},$$
where $f[1,1,1]=\frac{f''(1)}{2!}$ and for $f[1,1,2]$ you have to use again the inductive definition, so
$$f[1,1,2]=\frac{f[1,1]-f[1,2]}{1-2}=\frac{f'(1)-\frac{f(1)-f(2)}{1-2}}{1-2},$$
and then
$$f[1,1,1,2]=\frac{\frac{f''(1)}2-\frac{f'(1)-\frac{f(1)-f(2)}{1-2}}{1-2}}{1-2}.$$
So in the end all the divided differences can be expressed in terms of $f$ and its derivatives.