Perusing the release notes for the latest Linksys WRT120N firmware, one of the more interesting comments reads:

Firmware 1.0.07 (Build 01) 
- Encrypts the configuration file.

Having previouslyreversedtheir firmware obfuscation andpatchedtheir code to re-enable JTAG debugging, I thought that surely I would be able to use this access to reverse this new encryption algorithm used to secure their backup configuration files.

Boy was I giving them way too much credit.

Here’s a diff of two backup configuration files from the WRT120N. The only change made between backups was that the administrator password was changed from “admin” in backup_config_1.bin to “aa” in backup_config_2.bin:

OFFSET        backup_config_1.bin              backup_config_2.bin
----------------------------------------------------------------------------------------
0x00001468 9E 9B 92 96 91 FF FF FF |........| / 9E 9E FF FF FF FF FF FF |........|

Two things to note here:

  • The first letter of each password (“a”) is encrypted to the same value (0x9E)
  • The same letter (“a”) is encrypted to the same value (0x9E), regardless of its position in the password

I immediately suspected some sort of simple single-byte XOR encryption. If true, then XORing the known plain text (“a”, aka, 0×61) with the known cipher text (0x9E) should produce the XOR key:

0x61 ^ 0x9E = 0xFF

Applying the XOR key of 0xFF to the other characters in the password gives us:

0x9E ^ 0xFF = a
0x9B ^ 0xFF = d
0x92 ^ 0xFF = m
0x96 ^ 0xFF = i
0x91 ^ 0xFF = n

And XORing every byte in the config file with 0xFF gives us a decrypted config file:

00000000  33 34 35 36 00 01 df 60  00 00 46 ec 76 31 2e 30  |3456...`..F.v1.0|
00000010 2e 30 37 00 00 00 00 00 00 00 00 00 00 00 00 00 |.07.............|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 57 52 54 31 |............WRT1|
00000030 32 30 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 |20N.............|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000080 61 64 6d 69 6e 00 00 00 00 00 00 00 00 00 00 00 |admin...........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 00 00 00 00 00 00 00 00 61 64 6d 69 6e 00 00 00 |........admin...|
000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000100 00 00 00 00 00 00 00 00 30 2e 30 2e 30 2e 30 00 |........0.0.0.0.|
00000110 00 00 00 00 00 00 00 00 01 01 01 00 00 00 00 01 |................|
00000120 00 00 00 01 00 00 00 00 00 00 00 08 32 39 34 38 |............2948|
00000130 33 31 30 35 00 01 00 00 00 31 39 32 2e 31 36 38 |3105.....192.168|
00000140 2e 31 2e 31 00 00 00 00 00 32 35 35 2e 32 35 35 |.1.1.....255.255|
00000150 2e 32 35 35 2e 30 00 00 00 00 00 00 04 00 02 00 |.255.0..........|
00000160 01 00 00 00 00 00 00 00 00 00 00 00 00 00 4c 4f |..............LO|
00000170 4f 50 42 41 43 4b 00 00 00 00 31 32 37 2e 30 2e |OPBACK....127.0.|
00000180 30 2e 31 00 00 00 00 00 00 00 32 35 35 2e 32 35 |0.1.......255.25|
00000190 35 2e 32 35 35 2e 32 35 35 00 00 00 00 00 00 00 |5.255.255.......|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 49 52 51 3d 30 20 50 4f 52 54 3d 30 |....IRQ=0 PORT=0|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...

This is truly atrocious. Given that “encrypting” the backup configuration files is done presumably to protect end users, expecting this to thwart any attacker and touting it as a product feature is unforgivable.

OK, I don’t really care that much. I’m just disappointed that it took longer to write this blog post than it did to break their “crypto”.

原文  http://www.devttys0.com/2014/02/cracking-linksys-crypto/

Linksys WRT120N路由器备份文件解析的更多相关文章

  1. itunes备份文件解析入门

    itunes提供给设备备份的功能,不知道怎么备份的话可以戳一下这个看一下:http://jingyan.baidu.com/article/92255446ea8f46851648f4a4.html ...

  2. 思科模拟器之路由器-RIP-DNS解析server

    思科三层交换机之下的局域网搭建,请看这. 接下来将解说怎样通过路由器的RIP协议来连接多个局域网. 并设置DNSserver. 1.路由器RIP配置 RIP协议有个非常致命的缺点:就是它是依据路径长短 ...

  3. TPLink 备份文件bin文件解析

    TPLink 路由器备份文件bin文件 测试路由器 WR885,备份文件加密方式DES,密钥:478DA50BF9E3D2CF linux端: openssl enc -d -des-ecb -nop ...

  4. NAT原理简介、各种 ADSL Modem 及路由器的端口映射方法

    NAT原理简介 NAT英文全称是“Network Address Translation”,中文意思是“网络地址转换”,它是一个IETF(Internet Engineering Task Force ...

  5. CISCO实验记录二:路由器基本操作

    一.路由器基本操作要求 1.设置路由器本地时间 2.启用光标跟随 3.设置路由器标语信息和描述信息 4.为接口配置描述信息 5.快速恢复接口到出厂设置 二.路由器基本操作命令 1.设置路由器本地时间 ...

  6. 网速慢?NO可能是路由器的原因?

    先排除DNS的问题:看这个! 为什么我家300M的网,而且wifi信号满格,还是网速很慢? 这时候不排除是路由器的原因! 第一步首先我们要知道自己家的网关IP: 什么是网关? 网关(Gateway)又 ...

  7. 浅入ARP

    1.ARP的工作原理 IP层协议ARP的核心功能就是通过目的主机IP地址得到主机的硬件地址,然后通过硬件地址进行通信.和计算机网络中的很多技术一样,ARP协议也是使用了建立一个缓存表的思想.它规定每个 ...

  8. TCP/IP协议栈 --- 网络层(IP 首部 和分片)

    IP 是TCP/IP协议栈中重要的层次, TCP UDP ICMP IGMP都是依赖IP层进行传输的.首先它是一种不可靠,无连接的协议.不可靠:它不保证IP包能正确到达目的地,无连接:表示IP并不会维 ...

  9. Angular路由——路由基础

    一.路由相关对象 Router和RouterLink作用一样,都是导航.Router是在Controller中用的,RouterLink是在模版中用到. 二.路由对象的位置 1.Routes对象 配置 ...

随机推荐

  1. webpack安装配置使用教程详解

    webpack安装配置使用教程详解 www.111cn.net 更新:2015-09-01 编辑:swteen 来源:转载 本文章来为各位详细的介绍一下关于webpack安装配置使用教程吧,这篇文章对 ...

  2. 【转】实现RTP协议的H.264视频传输系统

    1.  引言       随着信息产业的发展,人们对信息资源的要求已经逐渐由文字和图片过渡到音频和视频,并越来越强调获取资源的实时性和互动性.但人们又面临着另外一种不可避免的尴尬,就是在网络上看到生动 ...

  3. python 练习 27

    ython continue 语句跳出本次循环,而break跳出整个循环. continue 语句用来告诉Python跳过当前循环的剩余语句,然后继续进行下一轮循环. continue语句用在whil ...

  4. robotframework笔记11

    测试用例的语法 基本语法 测试用例构造测试用例表中可用 关键词. 关键字可以进口 测试库 或 资源 文件 或创建的 关键字表 的测试用例文件 本身. 测试用例表中第一列包含测试用例的名称. 一个 测试 ...

  5. call(京基填小票拍照片)

    同事的写的函数结构,先是几个函数表达式var a = function(){},里面再是函数声明function a(){} 里面用了好多call,网上搜了一下call的用途: 1. http://w ...

  6. Qt之资源系统

    简述 Qt 的资源系统用于存储应用程序的可执行二进制文件,它采用平台无关的机制.当你的程序总需要这样的一系列文件(图标.翻译文件等)并且不想冒丢失某些文件的风险时,这就显得十分有用. 资源系统基于 q ...

  7. ARM汇编中的标号

    标号(LABEL)是为一组机器指令所起名字,表示程序中的指令或者数据地址的符号.标号可有可无,只有当需要用符号地址来访问该语句时,才给此语句赋予标号.通过在目标地址的前面放上一个标号,可以在指令中使用 ...

  8. SecureCRT中的ftp文件上传

    原文地址:http://www.blogbus.com/jjuan-flake-logs/59745331.html SecureCRT与SshClient不同的就是,SecureCRT没有图形化的文 ...

  9. ORACLE 日期比较

    oracle sql日期比较:在今天之前: select * from up_date where update < to_date('2007-09-07 00:00:00','yyyy-mm ...

  10. FZU 2032 Log函数问题 模拟小数加法

    题目链接:Log函数问题 2 / 49 Problem G FZU 2032 Log函数问题 不知道为什么...比赛时高精度难倒了一票人...成功搞出大新闻... 试了一下直接double相加超时,然 ...