With this Firmware you can pimp you 7170 Fritzbox 🙂

Mirror Download: 7170_04-88-freetz-2-0-13964-de_20161029-102000-image-tar.gz

sha512sum: cd5a94a3c54fd76f81236d040f952481c2b2e5d29113513737e5009e4d32b4be6a5947adaae7ae2f674f83fd3f27e4870c452a0eff98d906633416619af0b09f

This Firmware was successfully uploaded to a „Fritzbox 7170 Fon Wlan“.

The hardware is VERY SOLID. I have 3 7170 running and none failed in the last 10 years.

The question is: Will/can this alternative firmware patch potential security flaws that might be there?

After flashing the firmware you can login to the alternative web interface via:

usr: admin
pwd: freetz


it is amazing how much hardware is supported…












thanks to the developers ! 🙂







FRITZ!Box running as LAMP-server (Linux, Apache, MySQL and PHP)

Leave a comment

FRITZ!Box 7360In this tutorial you will learn how to run a complete LAMP-configuration (Apache, MySQL and PHP) at your FRITZ!Box. In this article a ‘FRITZ!Box 7360’ is used. However you can follow the same steps for other types when it is supported by Freetz besides of that, there must be enough memory and CPU-power available in the FRITZ!Box. Freetz is used to create an image which contains a BusyBox version with CHROOT-support. When you have another way to give your box CHROOT-support, you can skip the Freetz-steps.

First you will learn how to set up your Freetz-build environment, configure Freetz and build your custom FRITZ!Box image. Next this image will be installed at your box. After that a ‘debootstrap’ is prepared at your Debian-based workstation. Here you can use the virtual machine which was configured while building Freetz or your own Debian/Ubuntu system. After that the second stage debootstrap is run at the FRITZ!Box itself. A minimal Debian (Wheezy) system will be configured at your USB-stick or USB-harddisk. Now you can start the CHROOTed-environment at the FRITZ!Box and install/configure Apache, MySQL and PHP. Creating and testing some PHP-scripts will conclude this tutorial. For most of these steps you do need a working Internet connection.

DISCLAIMER: I’m not responsible for any damage you cause at your FRITZ!Box or any service interruptions.

Reading assistance

Watch out, we use different environments to accomplish our goals. Please don’t get confused.

  • Debian based workstation
  • Freetz virtual machine, which is started at a Linux or MS Windows host using VirtualBox and can also be used as Debian based workstation. Always accessed via SSH or SCP.
  • FRITZ!Box webinterface (http://fritz.box:80)
  • Freetz webinterface (http://fritz.box:81)
  • Apache webserver in CHROOTed environment (http://fritz.box:83)
  • FRITZ!Box telnet
  • CHROOTed environment at FRITZ!Box, started within telnet session

Configure your Freetz-build-environment

I decided to build Freetz in a virtual machine running in VirtualBox, but you can build Freetz also at a native Linux-system.

  1. Download the freetz-linux VirtualBox image from:

    wget „http://downloads.sourceforge.net/project/freetz-linux/freetz-linux-1.3.1/freetz-linux-1.3.1.ova?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffreetz-linux%2F&ts=1384081012&use_mirror=netcologne“ O freetzlinux1.3.1.ova
  2. Import virtual machine ‘freetz-linux’ into VirtualBox
    1. Start VirtualBox
    2. File->Import Appliance…
    3. Open Appliance…
    4. Select the OVA-file you downloaded: ‘freetz-linux-1.3.1.ova’
    5. Click next
    6. Click Import
    7. Select the imported virtual machine (freetz-linux) and press ‘Start’
  3. Login into console of virtual machine
    Username: freetz
    Password: freetz

    Hint: It’s a German keyboard mapping, so press the Y when you want to type a Z.

  4. Find the IP-address for eth0. It’s on the screen as welcome message or you can query it by executing the command:

    Notice: The virtual network interface card is configured in bridged mode and the IP-settings are obtained from your router by DHCP. Make sure your router is configured as DHCP-server.

  5. Grab your mouse pointer again by pressing the right CTRL-key.
  6. Optional: Now you can move the GUI of VirtualBox and the console of the virtual machine to another workspace, so they no longer bothers you.
  7. Login into the virtual machine by SSH. In my case this is:

    Password is: freetz

  8. Make sure you are running an up-to-date system by executing the command:
  9. After reboot of virtual machine (some seconds to minutes) login again using SSH.

Build your Freetz based image

  1. Checkout Freetz
  2. Go to the Freetz-directory
  3. Configure Freetz

    Configure Freetz by using the arrow- and enter-keys. ‘Hardware type’ and ‘Firmware language’ must of course reflect your particular FRITZ!Box.

    • Level of user competence->Expert
    • Hardware type->7360
    • Firmware language->en – international
    • Firmware version->FRITZ!OS 05.5x
    • Other patches->
      –Automount filesystems
      — ext3
      — fat
    • Busybox applets->Applets->Coreutils->chroot

    Exit – Do you wish to save your new configuration ? -> Yes

  4. Start the make process.
  5. Take a coffee
  6. In case you get the error: ‘image too big’, check the tips-section at the end of this article.
  7. After a while a brand new custom image for your FRITZ!Box is ready. Find it in:
  8. Exit the SSH-session to the virtual machine (


Flash the FRITZ!Box with the custom image

WARNING: Don’t power off your FRITZ!Box during these steps!

  1. Download your custom Fritzbox image from the virtual machine to your workstation. Execute at your workstation:

    Password: freetz

  2. Now access the webinterface of your FRITZ!Box using a browser:
    Point your browser to: http://fritz.box (and login)
  3. Select menu: Overview->System->Firmware Update
  4. Select ‘Firmware File’
  5. Click button: ‘Saving Settings’ Make sure you know where these settings are saved and store them at a safe location.
  6. Click ‘Browse’ and select your custom image
  7. Click ‘Start Update’
  8. After a while you will see this message in your browser:
    “Attention! – The specified file does not contain firmware released for this device by AVM.”
    Click ‘Continue Update’
  9. Now wait till the Info-LED at the FRITZ!Box is not blinking any more.
  10. Check the versions running at your FRITZ!Box:
    • Login into the FRITZ!Box using your browser: http://fritz.box
      Check in the right corner in the Overview pane the version: ‘FRITZ!OS 05.51’. Click it to check the firmware version: ‘111.05.51’.
    • You can access the Freetz webinterface in your browser at port 81 of the FRITZ!Box: http://fritz.box:81
      Username: admin
      Password: freetz
      Here you will find the Freetz version: ‘Freetz: 2.0-11219’ and again the firmware version: ‘111.05.51 rev25025’.

Congratulations you are running your custom FRITZ!Box image with built-in Freetz webinterface and chroot-support at this moment!

Create CHROOTed-environment

Now you are ready to create your Debian based chrooted-environment. To do so, execute these steps on a Debian based system (Debian/Ubuntu):

  1. apt-get install debootstrap
  2. Insert USB-stick in Debian-system
  3. Type the command:

    to find the device binding of the USB-stick. In my case this was: /dev/sdc Use this in the next steps.

  4. Format USB-stick as Ext3:
    mkfs.ext3 /dev/sdc
  5. Mount USB-stick
  6. Put Debian-debootstrap on stick
  7. Umount USB-stick:
  8. Remove USB-stick from Debian-system
  9. Insert the Ext3 formated USB-stick with first stage debootstrap into FRITZ!Box
  10. Telnet into FRITZ!Box
    telnet fritz.box

    Username: root
    Password: Use password which was set by webinterface at FRITZ!Box (port 80)

  11. Find where USB-stick is mounted:

    Output contains i.e.: /var/media/ftp/uStor00

  12. Now start second stage of ‘debootstrap’ Use path to USB-stick which was found in previous step, supplemented with ‘debian’:
  13. Take your second coffee, this can take a while!
  14. Start the chrooted-environment:

Next steps are executed from within the CHROOTed environment.

Update CHROOTed-environment

  1. Create a new file /etc/apt/sources.list containing these entries:
  2. Do the update:

Install Apache, MySQL and PHP into the CHROOTed-environment

  1. Install the packages:

    Use as password for the MySQL root user:


    . We will only allow database connections from localhost so this is safe enough. Installation of Apache2 will fail because port 80 is in use already. Later we will configure Apache so it will run at another port. Installation of MySQL will fail because of memory problems. In the next step we will disable InnoDB-storage engine and use the MyISAM as engine. So for now, ignore these errors and just continue the installation.

  2. Configure MySQL: Disable InnoDB and use MyISAM as storage engine. Create/edit the file local.cnf

    Add these lines to it:

    Now let MySQL finish the installation

  3. Configure Apache
    As we told before you have to change the port of Apache from the default one: 80 to another one which is free, like 83. In the next steps we assume you use 83. Edit the files ‘ports.conf’ and ‘000-default’. Replace in these file the port 80 with 83.

  4. (Re)start apache using:
  5. Test the Apache webserver from your home-network. Use a browser to navigate to: http://fritz.box:83/ You must see a page containing the text: ‘It works!’
  6. Test PHP
    1. Create a new file:
    2. Access this file using your browser:
      http://fritz.box:83/test.php Now you must see a page starting with: ‘PHP Version’ and a lot of information about your Apache/PHP installation.
  7. Test MySQL + PHP
    1. Create a new file in /var/www/testDatabase.php containing these contents:
    2. Access this file using your browser:
      http://fritz.box:83/testDatabase.php When everything runs smoothly, you must see now some information from table ‘db’ in database ‘mysql’.
  8. Configure the FRITZ!Box firewall
    When you would like to access the webserver from the Internet, you have to punch a hole in your firewall. We will open TCP port 83 for incoming traffic.Hint: When you don’t have any forward rule configured in your FRITZ!Box, create a dummy one and remove it after this step. In that case it is easier for you to add your custom forward-rule because you can lookup: ‘forwardrules’ in the firewall configuration and append your rule.’

    1. Create a forward rule using the webinterface of the FRITZ!Box: Internet->Permit Access->Port Forwarding
    2. Click button: ‘New Port Forwarding’
    3. Create a temporary entry.

    Create the ‘permanent’ forward from the public Internet port 83 to your Apache server which is running in the CHROOTed-environment. Do this by editing the file ar7.cfg by using the telnet connection to the FRITZ!Box.

    1. nvi /var/flash/ar7.cfg
    2. Find line:
      forwardrules =
    3. Add a line like this, please check the format of the file, keep using the same syntax (!):
    4. Reboot FRITZ!Box
  9. Start CHROOTed-environment – It’s good practice to put these lines in a script (chroot.sh) in the root-directory of the USB-stick so you only have to execute that script.
  10. Start servers
    • Apache server: /etc/init.d/apache2 start
    • MySQL server: /etc/init.d/mysql start
  11. Access HTTP-Server from the Internet or from inside your home network
  12. Create your files at /var/www

Congratulations your basic LAMP-configuration is ready!

Next step is to design a (dynamic) website using HTML, CSS, PHP and MySQL. You also have to fine tune your configuration (number of running Apache servers, memory, security). Unfortunately these things are out of scope of this article.


In this paragraph you will find some miscellaneous tips for the FRITZ!Box and Freetz:

      • Logging – When logged into the FRITZ!Box using telnet you can use these commands to receive some logging:
        cat /dev/debug
      • Recover FRITZ!Box – In case your box won’t boot any more, you can try to push a recover image from the Freetz-working-directory to your FRITZ!Box. This is without the MS Windows-recover tool. The computer containing the Freetz software must be configured so it is connected to the same subnet as the FRITZ!Box. Execute this command:
        make recover RECOVER=eva

        to push the recover image to the FRITZ!Box running a 2.6. For older boxes (kernel 2.4), execute the command:

        make recover RECOVER=adam


      • After ‘making’ Freetz, I get the error (Fehler): “ERROR: kernel image is xxxxx bytes too big. See http://freetz.org/wiki/FAQ#Filesystemimagetoobig for details.” Solution is to remove some unneeded packages from your Freetz-build.
        Execute the command:

        make menuconfig

        and enable some settings like:

        • Removal patches
        • Remove AURA (AVM USB Remote-Architecture)
        • Remove help
        • Remove kids (usermand/contfiltd)

        Try again to build the Freetz image:


        , hopefully it is sufficiently shrunken so it will fit at the FRITZ!Box.

      • Enable telnet – In case telnet is not enabled by default at your FRITZ!Box, you can use a to the box connected phone and dial:

        this will start the telnet-daemon.

      • Capture network traffic in Wireshark format:

Read more