Giter Site home page Giter Site logo

Comments (6)

realkcn avatar realkcn commented on August 17, 2024 1

PASSWDS.2005.old是可以使用的用户数据库。问题在于这个备份文件userec结构只有204字节,但当前的结构有320字节。
目前看到的差距:

  1. 备份文件看起来是32位系统编译的,time_t的大小只有32位。
  2. MAXCLUB可能从128调整到了512.
    需要继续对齐其他字段确定字段的位置

from bbs.

realkcn avatar realkcn commented on August 17, 2024 1

备份文件的结构如下,已经恢复完毕:

#define IDLEN 12
#define IPLEN 16
#define NAMELEN 40
#define MAXCLUB 128
#define MD5PASSLEN      16
#pragma pack (4)

#define time_t unsigned int

struct userec {                 /* Structure used to hold information in */
    char userid[IDLEN + 2];     /* PASSFILE */
    char flags; /*一些标志,戒网,版面排序之类的*/
    unsigned char title; /*用户级别*/
    time_t firstlogin;
    char lasthost[16];
    unsigned int numlogins;
    unsigned int numposts;
    char username[NAMELEN];
    unsigned int club_read_rights[MAXCLUB>>5];
    unsigned int club_write_rights[MAXCLUB>>5];
    unsigned char md5passwd[MD5PASSLEN];
    unsigned userlevel;
    time_t lastlogin;
    time_t stay;
    int signature;
    unsigned int userdefine[2];
    time_t notedate;
    int noteline;
    int notemode;
    time_t exittime;
        /* 生日数据转移到 userdata 结构中 */
    unsigned int usedspace;     /* used space of user's mailbox, in bytes */
    char unused[28];
};

from bbs.

huan avatar huan commented on August 17, 2024

Update Jan 20, 2021

1. All files together

$ ls -l /bbs/tmp/convert/
-rwxr-xr-x 1 bbs bbs 12951300 Jan 18 19:10 PASSWDS.2005.new
-rwxr-xr-x 1 bbs bbs 30600000 Jan 18 19:10 PASSWDS.2005.old
-rwxr-xr-x 1 bbs bbs 22400000 Jan 18 18:19 PASSWDS.2020
-rw-r--r-- 1 bbs bbs     1618 Jan 18 19:03 zixia2020.c

Latest file & code

  • The PASSWDS.2020 is the latest password file, with the current userec structure. (but we only left less than 200 users...)
  • The zixia2020.c can read PASSWDS.2020 with the right structure, which is the latest version of the source code.

Old (2006) files

PASSWDS.2005.new & PASSWDS.2005.old are founded from the original backup files, can be located at /bbs/bak.20210105/src/kbs_bbs/contrib/convert/, which is original located at /bbs/src/kbs_bbs/contrib/convert/.

Some source code (utils) can be found in the same directory but I'm not sure which one is the right one. (I had tried the cnv_passwd.c & cnvclub.c

Progress

The right userec structure for the PASSWDS.2016 need to be found.

from bbs.

realkcn avatar realkcn commented on August 17, 2024

大部分用户的home mail目录应该已经被删除了。需要修复的时候建立,内容肯定没了

from bbs.

huan avatar huan commented on August 17, 2024

备份文件看起来是32位系统编译的,time_t的大小只有32位。

这可能就是我怎么都搞不定的主要原因了。。。能通过 time_t 的数据看出是否 64 位架构编译,上帝威武!

from bbs.

huan avatar huan commented on August 17, 2024

Update 6:07 pm, Jan 21, 2021

43,171 zixia bbs users restored from 2006!

image

K core V5! Orz

bbs@bbs:~$ ps axf
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     0:00 /bin/sh -c /entrypoint.sh
    6 ?        S      0:00 s6-svscan -t0 /var/run/s6/services
   32 ?        S      0:00  \_ s6-supervise s6-fdholderd
  227 ?        S      0:00  \_ s6-supervise kbs
  233 ?        Ss     0:00  |   \_ bash ./run
  241 ?        S      0:00  |       \_ sleep 3600
  228 ?        S      0:00  \_ s6-supervise apache
  232 ?        Ss     0:00  |   \_ bash ./run
  344 ?        S      0:00  |       \_ sleep 60
  229 ?        S      0:00  \_ s6-supervise sshd
  231 ?        Ss     0:00      \_ /usr/sbin/sshd -D -e -p 2222
  255 ?        Ss     0:00          \_ sshd: bbs [priv]               
  257 ?        S      0:00          |   \_ sshd: bbs@pts/0                
  258 pts/0    Ss     0:00          |       \_ -bash
  347 pts/0    R+     0:00          |           \_ ps axf
  281 ?        Ss     0:00          \_ sshd: bbs [priv]               
  283 ?        S      0:00          |   \_ sshd: bbs@pts/1                
  286 pts/1    Ss+    0:00          |       \_ -bash
  345 ?        Ss     0:00          \_ sshd: unknown [priv]           
  346 ?        S      0:00              \_ sshd: unknown [net]            
  198 ?        Ss     0:00 /kbs/bin/miscd timed 
  202 ?        S      0:00  \_ /kbs/bin/miscd killd 
  203 ?        S      0:00      \_ /kbs/bin/miscd userd 
  209 ?        S      0:00          \_ /kbs/bin/miscd flushd
  206 ?        S      0:00 /kbs/bin/bbslogd
  210 ?        S      0:00 /kbs/bin/bbsd -p 23
  263 ?        Ss     0:00  \_ bbsd:zixia sd -p 23
  276 ?        Ss     0:00  \_ bbsd:KCN bbsd -p 23
  323 ?        Ss     0:00  \_ /kbs/bin/bbsd -p 23
  211 ?        Ss     0:00 /kbs/bin/sshbbsd -p 22

from bbs.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.