For older devices (primarily iPhone 4s through iPhone X), tools like and MagicCFG offer the ability to permanently write new serial numbers and, in some cases, IMEIs using a DCSD cable. These tools put the iPhone into DFU (Device Firmware Upgrade) mode and then into Purple Mode, allowing direct writes to the NAND's SysCfg partition.

Is your iPhone currently , or has it been blacklisted/blocked ? What iPhone model and iOS version are you using?