Closed huan closed 3 years ago
$ 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
PASSWDS.2020
is the latest password file, with the current userec
structure. (but we only left less than 200 users...)zixia2020.c
can read PASSWDS.2020
with the right structure, which is the latest version of the source code.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/kbsbbs/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
The right userec
structure for the PASSWDS.2016 need to be found.
PASSWDS.2005.old是可以使用的用户数据库。问题在于这个备份文件userec结构只有204字节,但当前的结构有320字节。 目前看到的差距:
大部分用户的home mail目录应该已经被删除了。需要修复的时候建立,内容肯定没了
备份文件看起来是32位系统编译的,time_t的大小只有32位。
这可能就是我怎么都搞不定的主要原因了。。。能通过 time_t 的数据看出是否 64 位架构编译,上帝威武!
43,171 zixia bbs users restored from 2006!
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
备份文件的结构如下,已经恢复完毕:
#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];
};
The latest backup of the .PASSWD file only contains no more than 180 bbs users who have permanent life, which is really sad for the 斧头帮🪓 ... (we have lost almost all our members!)
So we need a 波若波罗密 via 月光宝盒!
Current <200 users .PASSWDS
The Hope: a
.PASSWDS
file from 2006What We Have
It seems there's a very high probability that the old/new
.PASSWDS
file is converted by the following source code: https://github.com/zixia/bbs.zixia.net/blob/main/kbs_bbs/contrib/convert/cnv_passwd.c, to be confirmed.Todo
Find the right struct & maxuser for the backup file from 2006, and then convert it to match our latest version of code!