(An internet connection is required, and 1 Gb of free space on the SD card is also needed)
First off, copy gateway's launcher.dat to the root of your SD card, then go to Cubic Ninja's menu and keep X Y L R pressed, a prompt will pop up asking if you want to delete CN's data, press yes. Then go to the QR scanner inside Cubic Ninja and scan the corresponding QR code for your N3DS. You can find it inside Gateway's .rar, at /Save Games for New 3DS/Cubic/*YourRegion*/qr.jpg. Once you've scanned it, Gateway launcher should pop up(if it doesn't, then restart your N3DS and boot Cubic Ninja, and do the steps that you would do to go to homebrew menu) , then go to Create NAND backup option, press it, and wait for a while. Once it's done you will find your NAND.bin at the root of your SD card.