The orphan blocks are stored within the Bitcoin database. Parse the database and you should be able to sieve them out.
only when your Node receives this block while running.
if you download the database from another node that only the valid blocks are transferred
correct me if I'm wrong.