Ukraine's security service says the state-backed spy network sought to obtain information about military defences on its border with Hungary.