Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hex show problem when use zero rootkit #1

Open
shotgunner opened this issue Sep 10, 2017 · 0 comments
Open

hex show problem when use zero rootkit #1

shotgunner opened this issue Sep 10, 2017 · 0 comments

Comments

@shotgunner
Copy link

shotgunner commented Sep 10, 2017

In normal /dev/random I see this :
root@system ~> head -c200 /dev/urandom | hexdump
0000000 712d 53c2 690c 1e43 ede6 db4a bc81 dff7
0000010 c3c5 569e 93dc 22bc c0af 8c82 848d c62e
0000020 d7ec 379c e214 cb97 5b5e 6897 5bb2 ac72
0000030 303d 9545 12d7 4dbf 3667 f774 432f f31a
0000040 bfa9 a4fa d3d6 7625 25e9 97c6 1769 af17
0000050 df94 1b1e 4cdf a46a bd14 45e1 85ff 29e8
0000060 c501 ebd1 bd51 bd13 610f 0760 b037 8b2c
0000070 00de 25aa 8c5f 5320 ff96 62f9 2d9c af2b
0000080 065d a70b 88f9 a077 476c 3bb0 c84c 42f9
0000090 7256 1380 6bc4 66ec eaac ac0b 9e5d 8afa
00000a0 6ae9 aa52 08a2 4742 75a6 2fcc 6ede d2ce
00000b0 0238 2450 4cc2 aa43 a7d9 754e a114 7f18
00000c0 0fd1 ad6f a904 4695
00000c8

after I enable the zero rootkit my hex output is incomplete :

root@system ~> head -c200 /dev/urandom | hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00000c8

I can't cat /dev/urandom and cat /dev/random but for xor and other it is worked.
also when activate the zero module, chrome and some programs (i.e: visual studio code) crashes :))

I want to know why when use the same pattern for entropy pool, /dev/random doesn't work correctly ?
and how to fix it ?

I changed this code :

static u32 rk_xor128(void) {
    unsigned long flags;
    u32 t;

    spin_lock_irqsave(&rk_spinlock, flags);
    t = rk_state.x ^ (rk_state.x << 11);

    rk_state.x = rk_state.y;
    rk_state.y = rk_state.z;
    rk_state.z = rk_state.w;

    rk_state.w = (rk_state.w ^ (rk_state.w >> 19)) ^ (t ^ (t >> 8));
    spin_unlock_irqrestore(&rk_spinlock, flags);

    return rk_state.w;
}

to this one :

static u32 rk_xor128(void) {
    return 1;
}

the second one cause hanging when cat /dev/random what is the problem for same sequences ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant