moloch-- / RootTheBox

A Game of Hackers (CTF Scoreboard & Game Manager)
http://root-the-box.com/
Apache License 2.0
935 stars 295 forks source link

Export and Import Flags XML #501

Closed PJNorrisS1 closed 2 years ago

PJNorrisS1 commented 2 years ago

I'm currently experiencing an issue. I have 3 identical RTB's. I use one of the boxes to edit my levels, flags and tokens. I then dump the XML from the backup/restore from my master RTB and import it in to my other two boxes.

The flags are not updating, despite a successful message from the import. I have also tried removing a flag from my slaves and importing the master, and it doesn't appear. Thoughts?

PJNorrisS1 commented 2 years ago

Update: I deleted the corporation from the slave. Tried the import and the boxes appeared, but no flags or hints at all.

eljeffeg commented 2 years ago

Yeah, I don't recall if the flags will "update" existing flags. It was designed as more of a clean restore, but deleting the flags or a box, should restore that flag or box on import, so the second comment is concerning.

EtheriousNight commented 2 years ago

Hi, found the Error in the XML. ^^'. In short: replace tag None to False I dunno how to fix it exactly, but i will try it :)

eljeffeg commented 2 years ago

Awesome.. if you want to share a snippet of the XML where you see those values, I can try to make sure the export generates it with false, or perhaps better, converting None to False on import.

EtheriousNight commented 2 years ago

This happens when you upgrade from an old version to the current version where flags can be locked. So all existing flags have the field value locked:"None". This is the XML snippet :)

100 None 1 0
eljeffeg commented 2 years ago

Odd, that's a non-nullable field. lol. Ok, I've pushed an update https://github.com/moloch--/RootTheBox/commit/3b87c0a5e2347176239995f585d89cb7a6887b28 that should fix exports to include False there. Not sure it will work on fixing an import as that's not field specific and I'm hesitant to try and define all None as False.

EtheriousNight commented 2 years ago

It worked on my side šŸ‘

PJNorrisS1 commented 2 years ago

Very well-done gents. Thank you for investigating. I concur with the statement, old up to new. I used to be able to backup flags and restore to another instance, but only recently were not able to do this.

Iā€™m on holiday at moment, but as soon as I get a chance, I will test this in my lab.

Great work!

PJ Norris Senior Sales Engineer D:

+44 (0) 7900 252512 E:

@.*** [https://storage-use.letsignit.com/6042656364700ae25217c225/logo_6042656364700ae25217c225_fa03e21bcf0cc534f9d05e35016cd4cf.png] [https://storage-use.letsignit.com/6042656364700ae25217c225/166303227511949583639494663333926190706.png]https://cloud.letsignit.com/collect/bc/6062173e702235c381d802fe?p=fAj6NwOlacXo2vxUN--ehTY9PdNOHtdn7EANtALoHt2NpLrBZEsCuRt3838qOPaCXkiVSQqtP83HKzz-bCOtBhqUZ5n-wh878kG0mKc-TDz5UNyOTEm_EvRFXdshn5-xqZZWmfJUN6qA-jTlBlZ9yMncO_sLSlCUhaNiE9vYwBJWTlG6KtPQ_5kB3XjlO70Z [https://storage-use.letsignit.com/6042656364700ae25217c225/240725482620916811082650507243669567221.png]https://cloud.letsignit.com/collect/bc/6062173e702235c381d802fe?p=fAj6NwOlacXo2vxUN--ehTY9PdNOHtdn7EANtALoHt2NpLrBZEsCuRt3838qOPaCXkiVSQqtP83HKzz-bCOtBhqUZ5n-wh878kG0mKc-TDyx9khXwNRYkEULRV4h2vkZrtqu5RwDZ7htPRsBbDFz_Z9BVzaWIh7icn2O-tML9PSoQPH0hdhFsDTu3osl-Z7y [https://storage-use.letsignit.com/6042656364700ae25217c225/117835749821618885143259468399304910275.png]https://cloud.letsignit.com/collect/bc/6062173e702235c381d802fe?p=fAj6NwOlacXo2vxUN--ehTY9PdNOHtdn7EANtALoHt2NpLrBZEsCuRt3838qOPaCXkiVSQqtP83HKzz-bCOtBhqUZ5n-wh878kG0mKc-TDyIo6EwBskR6pg3M12nuwExmg7t9g_4TrT4vRRohaxCCFQH7OnCNI_1n9Ws4rNQHJsY9By8HDBJGrozYqsKOtpg

From: Richard Mrosk @.> Date: Monday, 1 August 2022 at 16:53 To: moloch--/RootTheBox @.> Cc: PJ Norris @.>, Author @.> Subject: [EXT.MSG] Re: [moloch--/RootTheBox] Export and Import Flags XML (Issue #501)

It worked on my side šŸ‘

ā€” Reply to this email directly, view it on GitHubhttps://github.com/moloch--/RootTheBox/issues/501#issuecomment-1201384768, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZNZSTZ2WRAIWMFIN2VMOELVW7XGZANCNFSM54WXZL7A. You are receiving this because you authored the thread.Message ID: @.***>

eljeffeg commented 2 years ago

Pushed some additional checks on the import side to deal with the locked field better if it's None or 0.