The simple answer is: there exists a way without knowing the position of your target and you still could build the oracle. This is exactly where Grover's algorithm is useful. An example is: M=pq$M=pq$ (p<q$p<q$), you don't know what p$p$ or q$q$ is, but you could try from 1$1$ to sqrt(M)$\sqrt M$ to see if one divides M$M$. So the oracle is simply a function: bool f(y){ if(y|M) return 1 else return 0 } you
bool f(y){ if(y|M) return 1 else return 0 } you could build it without knowing p$p$ or q$q$. and of course f(p)=1$f(p)=1$ and otherwise 0$0$. This is exactly what grover's algorithm needed. Please refer to Nielsen & Chuang for details.