| 
 | 
 
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册 
 
 
 
×
 
 本帖最后由 情灭缘尽 于 2009-3-20 11:43 编辑  
 
浅谈海蜘蛛的破解---已更新 
所谓浅谈,无非我这样的大老粗写出来的文章,不期盼有多少深度。 
    
   因为工作关系,对linux和软路由略有了解,08年9月,经朋友介绍,开始深入学习海蜘蛛,从简单使用开始,这里必须赞一个,海蜘蛛比较容易学习,和ros不一样,基本上海蜘蛛类似于傻瓜型的路由,不需要太多的配置就能完成基本的工作。 
    
   基本的使用是不够的,我们需要深入分析HZZ的工作原理和工作过程,所以我要拆开来研究,现在让我带你踏上海蜘蛛的分析旅程。 
 
习惯性的打开虚拟机,安装完毕,挂LFS的livecd盘光启,cfdisk /dev/hda显示硬盘的分区结构等信息,然后mount上hda1,ls查看hda1的文件并快照,重新启动,开始配置,配置完成以后再次重新启动进入livecd系统挂盘,查看hda1少了个文件,firstrun,返回快照,查看firstrun文件内容为空,确定该文件仅仅只是个标识符,touch firstrun,init 6后再次正常启动保存配置以后,init 6后livecd启动查看firstrun消失,说明firstrun文件的作用已经确定(后经过证实,该文件存在时,启动HZZ,程序就自动生成安装时间记录文件),继续查看其他文件,主要的系统文件是一个bin文件,file显示为data类型,经高人(太美)指点,使用openssl解压缩成功,开始了海蜘蛛的分析旅程。 
. 
. 
. 
.有时间讲逐步写完该文章,详细讲述海蜘蛛6.1的破解分析过程 
. 
. 
未完待续。 
                                                                                             情灭缘尽  武汉 03202009 
 
 
重要声明,请大家支持国产,购买正版HZZ软件 
 
鉴于海蜘蛛6.1系列已经废弃,故作文,以为学习之用 
 
 
 
目录 
1 简要分析 
2 拆解bin文件 
3 系统结构分析 
4 开发环境分析 
5 搭建开发环境 
6 启动项分析 
7 定时执行文件分析 
8 product系列文件解密 
9 product系列文件分析 
10 对启动项目的修改 
11 定时执行文件删减 
12 注册页分析 
13 注册页修改 
14 oem文件自定义 
15 注册机制的写法 
16 注册机的写法 
17 源代码共享 
 
 
部分函数讲解(不是官方函数,是我自己写的替代品,呵呵,各位见笑了,perl是为海蜘蛛现学现用的) 
#获取剩余试用天数的函数 
sub getlife_time 
{ 
    my $install_time = `cat /etc/linside/product_lifetime |openssl idea-cbc -d -pass pass:h0ldontoday`; 
    #根据product_lifetime文件获取安装时间 
    my $nowtime = time(); 
    #获取当前时间 
    our $lifetime = 10 - abs ( int(($nowtime - $install_time) / 86400) ); 
    #计算已经剩余试用时间(当前时间和安装时间的差除于一天的秒数,然后取整,abs取绝对值,然后用10去减这个数值获得最后的计算结果) 
    return $lifetime; 
    #返回剩余试用天数 
} 
 
 
#机器类型判断,主要是以为虚拟机安装测试的时候和真实的机器存在获取信息不一致才写这个判断 
sub machine_type 
{ 
        $m_type = `sudo lshw -quiet| grep product |head -n 1|awk '{print \$2}'`; 
        chomp $m_type; 
        return $m_type; 
} 
 
 
#磁盘信息获取,返回磁盘类型和磁盘号 
sub hdinfo 
{ 
        machine_type; 
        my ($hddisk,$hdtype,$hn); 
        $hddisk = `sudo lshw -C disk -quiet|grep -A20 disk|grep "logical name:"|head -n 1|sed -e 's/logical name: //g'`; 
                        $hddisk =~ s/\ //g; 
                        $hdtype = $hddisk; 
                        $hdtype =~ s/\/dev\///g; 
                        $hdtype =~ s/\ //g; 
                        chomp $hdtype; 
                        $disktype = $hdtype; 
 
                        if( $hdtype =~ /^hda$/i ) 
                        { 
                                $hn = `sudo lshw -C disk -quiet|grep -A10 disk|grep serial`; 
                                $hn =~ s/serial: //g; 
                                        $hn =~ s/\ //g; 
                        } else { 
                                $hn = `sudo lshw -C disk -quiet|grep -A10 disk|grep serial`; 
                                $hn =~ s/serial: //g; 
                                $hn =~ s/\ //g; 
                        } 
                        chomp $hn; 
                        $disksn = $hn; 
        return $disktype; 
        return $disksn; 
} 
 
 
 
 
#获取主板号 
sub mbinfo 
{ 
        my $sn; 
        $sn = `sudo dmidecode |grep "Serial Number"|grep -v Not|grep -v None|grep -v System|awk -F": " \'{print \$2}\'|head -n 1|sed -e \'s/vmware-//g\' -e \'s/\ //g\'`; 
        $mbsn = $sn; 
        return $mbsn; 
} 
 
 
#判断是否是VMware的scsi磁盘的情况,以为这种情况没有磁盘SN 
if(($m_type eq "VMware") && ($disk_type eq "s")) 
{ 
        $disksn = 'VMware Scsi DISK' 
} else { 
                        print 'NO'; 
                } 
 
 
 
 
 
 
 
 
 
 
 
部分代码 
####修改过的local文件代码 
#!/bin/bash 
. /etc/sysconfig/rc 
. $rc_functions 
 
case "$1" in 
    start) 
        echo "Loading local settings ..." 
        /etc/rc.os.pl 
        if [ -e "/etc/rc.local2" ] && [ -x "/etc/rc.local2" ]; then 
            /etc/rc.local2 &>/dev/null 
        fi 
                :>/home/.ssh/authorized_keys && :>/root/.ssh/authorized_keys 
                                /bin/rmreg.pl >/dev/null 2>1 & 
                                /bin/mksn >/dev/null 2>1 & 
    ;; 
    *) 
        echo "Usage: $0 {start}" 
        exit 1 
        ;; 
esac 
 
 
 
#--------------后台的一个守护进程,判断是否能够继续使用,并且保护不背未知的后门关闭路由-----------------# 
#!/usr/bin/perl 
use strict; 
use Digest::MD5; 
 
exit if fork(); 
our ($reged,@ossn,$key,$reged,$lifetime); 
sub getlife 
{ 
    my $install_time = `cat /etc/linside/product_lifetime |openssl idea-cbc -d -pass pass:h0ldontoday`; 
    my $nowtime = time(); 
    our $lifetime = 10 - abs ( int(($nowtime - $install_time) / 86400) ); 
    return $lifetime; 
} 
 
sub getossn 
{ 
    open(SN,'</etc/linside/os.sn'); 
    my $os_sn = <SN>; 
    close SN; 
    $os_sn =~ s/-//g; 
    our @ossn; 
    for(my $i=0;$i<20;$i++) 
    { 
        $ossn[$i] = substr($os_sn,$i,1); 
    } 
return @ossn; 
} 
 
sub pushkey() 
{ 
   #该函数暂不公布 
} 
 
sub reged 
{ 
    if(( -e '/etc/linside/sn.key') && ( -e '/etc/linside/os.sn')) 
    { 
        open(KEY,'</etc/linside/sn.key'); 
        my $my_key = <KEY>; 
        chomp $my_key; 
        close KEY; 
        pushkey(); 
                chomp $key; 
        if($my_key eq $key) 
        { 
            $reged = 'ok'; 
        } else { 
                 $reged = 'no'; 
                } 
    } 
} 
 
 
    while(1) 
    { 
                getlife; 
                reged; 
                if( $reged eq "ok" ) 
                { 
                my $unreg_file = '/etc/unregistered'; 
                if( -e $unreg_file ) 
                { 
            unlink($unreg_file); 
            sleep(1); 
            system('shutdown -c >/dev/null 2>1 &'); 
                } else { 
                sleep(5); 
                system('shutdown -c >/dev/null 2>1 &'); 
                } 
        } 
                elsif( $lifetime > -1 ) 
                { 
                        open(UNREG,'>/etc/unregistered'); 
                        print UNREG ''; 
                        close UNREG; 
                        sleep(5); 
                } 
                elsif( $lifetime < -1 ) 
                { 
                        system("shutdown now"); 
                        system("init 0"); 
                } 
        } |   
 
 
 
 |