Tabela de conteúdos

Sagemcom F@st 2764 GV

Informações sobre o PowerBox GVT Sagemcom F@st 2764GV. Teardown, hacking, unlocking (desbloqueio), firmwares, custom images, recuperação, bridge.

Description

Teardown

Interfaces

Serial

JTAG

TFTP

Quando uma firmware é transferida via TFTP para o modem ela é executada mas não é salva na memória flash. É preciso acessar o console dele para salvá-la na ROM. Windows

Para fazer o upload da firmware via TFTP, pode ser utilizado o programa “tftpd64” ou “tftpd32” (a depender da sua versão do Windows)

Para esse método funcionar, você deve ligar o cabo de rede DIRETAMENTE no seu computador. A utilização de um router no meio do computador e do modem pode resultar em falha no processo!

Ajustando o servidor TFTP

Configure o seu computador para IP fixo e abra o tftpd. Clique em settings. Marque as caixas: TFTP Server DHCP Server

Na aba TFTP: O diretorio base é onde está sua firmware Não precisa mudar nenhuma opção. So verifique se o IP em BIND IP está setado para seu ip fixo.

Na aba DHCP: coloque “./nomedafirmware.bin”

sem as aspas em “boot file”

Verifique que o seu ip fixo está em BIND DHCP to this address.

Coloque seu modem na tomada segurando o botao vermelho RESET embaixo do aparelho. As luzes deverão piscar de uma maneira diferente. Aguarde que a firwmare deverá ser passada para o aparelho.

Bootlog

Firmware

Format

sagemcom_header + uimage

uImage is a typical U-boot uImage, created by mkimage. The kernel also contains a simple initramfs and the main rootfs, in CramFS format, using LZMA for compression. It's linked at compile time.

The sagemcom_header is shown below:

// big endian, total size = 0x140
struct _image_header {
    /* size_until_now */
    uint32_t magic;		// 0x604c51ea
    char maybe_dsa_stuff[0x28];
    uint32_t header_crc;	// crc32 from offset 0x30 +0x7c (e.g.: on 8388 = 7D F1 77 9C)
    char dunno[8];
    char image_name[0x14];
    char dunno2[0x48];
    uint32_t image_size;
    uint32_t ac?
    uint32_t ac2
    uint32_t 86
    uint32_t header_size;	// 0x140
    uint32_t data_size;		// from header_end
    uint32_t zero;
    uint32_t zero;
    uint32_t zero;
    uint32_t zero;
    /* size_until_now = 0xac */
    char boot_args[header_size - size_until_now];
} __attribute__((packed));
 
char uimage_data[data_size];
 
// total size must be flash sector size aligned (128 KB)

Custom Firmware

Modify the device only if you own it. Most of these are provided by your ISP as part of your internet package, you just “borrowed” it. Do not install these if you don't own it.

Signed images, DSA. Impossible to generate custom ones without private part. The key lives in a secure bootloader. To circumvent this, we could:

The second option works fine and has been tested.

Patching U-boot

To remove the signature check, read the paragraph below, and if you agree, run the tool inside your modem.

Running this tool will modify the bootloader sector of your device's flash memory. This is risky, and while the code has been tested and some checks are done at runtime, it may hard brick the modem. The only way to recover it would be via JTAG. Ensure there is no risk of power outage while running it.

Run the tool with argument 0 (disable) or 1 (enable). Running without any will show the current mode.

E.g.: will disable the signature (you want this if running custom firmware images):

# ./permstpatch 0

Download permstpatch (SHA-1: 8dd5345024ba872788040eb51b5a1d2ad9f145b0)

AC Series

The AC Series1) (vAC01, vAC02, …) are modified versions based on stock images, either to remove useless stuff or add new features, without having to resort to compile everything again. The sources are available 2), but getting them to work properly wouldn't be easy.

These will only run after patching the u-boot. With your patched bootloader, you can either boot this image via TFTP (not permanent, for testing only) or burn it permanently to your flash. Remember, there is always a risk on every flash write operation.

Some stuff from the original package needs to be removed to make room for the new files. No, it can't grow bigger than what the original FS was.

vAC01

Download (SHA-1: 5439718359e2b696665affcf2657934c67386d25)

vAC02

Download (SHA-1: 9faeb96f4b0624017a9e576c2bc7dc357da6c6aa)

Installation

Portuguese only for now.

Substitua vACxx pela versão que estiver utilizando (e.g.: vAC01).

  1. Baixe o permstpatch e a imagem vACxx mais recente (FAST2764_vACxx.img);
  2. Coloque uma cópia destes dois arquivos no diretório raiz de um pen-drive formatado em FAT32 ou ext2/3. Estes serão levados para o modem;
  3. Baixe e execute o flashcustom em seu PC (por ora, somente Windows);
  4. Siga os passos na ferramenta para habilitar imagens custom no modem. Quando a ferramenta solicitar para conectar o disco removível e aguardar, plugue o pen-drive do passo 2 no modem;
  5. Havendo sucesso, envie a imagem vACxx que baixou anteriormente via TFTP;
  6. Após a carga e o modem iniciar, já estará com a versão custom! Porém, é temporário, e voltará ao normal quando reiniciar o modem.

Caso queira torná-la permanente:

  1. Conecte via SSH no modem com PuTTY ou outro cliente (porta 8022, root:root);
  2. Acesse a pasta onde está o pen-drive:
      cd /mnt/usb/*/
  1. Grave a imagem com os seguintes comandos (alguns podem levar cerca de 30 s para terminar, é normal):
      dd if=FAST2764_vACxx.img of=/dev/mtdblock0 bs=128k
      sync
      reboot
Acknowledgment

People involved in discussions, tips, help or general chat. List in alphabetical order.

facsi, Jonathan Amend, navossoc, ofumeta, woytekm.
1)
named after my cute girl, btw