/*  check_rc_ports: v0.1
 *  Check all ports
 */
void check_rc_ports()
{
    int _errors = 0;
    int _total = 0;

    int i = 0;

    while(i<=65535)
    {
        total_ports_tcp[i] = 0;
        total_ports_udp[i] = 0;
        i++;
    }

    /* Trsting TCP ports */
    test_ports(IPPROTO_TCP, &_errors, &_total);

    /* Testing UDP ports */
    test_ports(IPPROTO_UDP, &_errors, &_total);

    if(_errors == 0)
    {
        char op_msg[OS_SIZE_1024 +1];
        snprintf(op_msg,OS_SIZE_1024,"No kernel-level rootkit hiding any port."
                 "\n      Netstat is acting correctly."
                 " Analyzed %d ports.", _total);
        notify_rk(ALERT_OK, op_msg);
    }

    return;
}
示例#2
0
文件: aftelsl.c 项目: jbailhache/log
main1 ()
{
char r[100];
char c;
int i;
	/* test_mtl(); */
    for (;;)
    {
	printf ("Commande ? ");
	scanf("%s",r);
	switch (r[0])
	{
	case 'q' : exit(0);
	case 'T' : test_mtl(); break;
	case 't' :
	test_ports();
		break;
	case 'c' :
	init_mtl();
		break;
	case 'b' :
	out_ch_mtl("Bonjour !\r\n");
		break;
	case 'o' :
		scanf("%x",&c);
		outp(0x3F8,c);
		break;
	case 'O' :
		c=0x20;
		loop:
			outp(0x3F8,c);
			for (i=0; i<delai; i++);
			outp(0x3F8,c|0x80);
			for (i=0; i<delai; i++);
			c++;
			if (c<0x7F) goto loop;
		break;
	case 'r' :
            while (!kbhit())
		outp(0x3F8,random(0x100));
	    break;
	case 'i' :
	in_ch_mtl(r);
	printf("Vous avez tape : <%s>\n",r);
		break;
	case 'I' :
		in_mtl(r);
		printf ("Vous avez tape : %X %X\n", r[0], r[1]);
		break;
	case 'd' :
		scanf ("%d",&delai);
		break;
	default:
		printf("q t c b o i d\n");
	}
    }
}