亚洲免费人人妻人人,cao78在线视频,福建一级毛片,91精品视频免费观看,高清另类图片操逼,日本特黄特色大片免费看,超碰欧美人人澡曰曰澡夜夜泛

百度質(zhì)量部面試筆試體驗之—三面

時間:2024-09-22 08:43:36 資料大全 我要投稿
  • 相關(guān)推薦

百度質(zhì)量部面試筆試體驗之—三面

  1.有過什么實習(xí)經(jīng)歷啊?

百度質(zhì)量部面試筆試體驗之—三面

  1.1安天實驗室

  在哈爾濱安天實驗室,我在CERT組實習(xí),跟過兩個大神,一個是胡哥,部門技術(shù)經(jīng)理,在異常分析方面很犀利,

百度質(zhì)量部面試筆試體驗之—三面

。一個是swordlea,對李哥的印象就是C++大神,同時他也是CERT老大。當時的項目是做一個whois的查詢插件,VC++編寫。當然的組件功能是輸入一個IP地址,能夠查詢出它的whois信息,因為有點久了,當時也是借鑒網(wǎng)上代碼寫出來的,自己的代碼找不到了(當然怎么就沒備份呢),就拿網(wǎng)上的代碼湊合一下:

  /*

  * @brief

  * Whois client program

  *

  * @details

  * This program shall fetch whois data for a IPv4 address.

  *

  * @author Silver Moon ( m00n.silv3r@gmail.com )

  * */

  #include //scanf , printf

  #include //strtok

  #include //realloc

  #include //socket

  #include //sockaddr_in

  #include //getsockname

  #include //hostent

  #include //close

  int main(int argc , char *argv[])

  {

  char ip[100] , *data = NULL;

  printf("Enter ip address to whois : ");

  scanf("%s" , ip);

  get_whois(ip , &data);

  printf("\n\n");

  puts(data);

  free(data);

  return 0;

  }

  /**

  Get the whois content of an ip

  by Selecting the correct server

  */

  void get_whois(char *ip , char **data)

  {

  char *wch = NULL, *pch , *response = NULL;

  if(whois_query("whois.iana.org" , ip , &response))

  {

  printf("Whois query failed");

  }

  pch = strtok(response , "\n");

  while(pch != NULL)

  {

  //Check if whois line

  wch = strstr(pch , "whois.");

  if(wch != NULL)

  {

  break;

  }

  //Next line please

  pch = strtok(NULL , "\n");

  }

  if(wch != NULL)

  {

  printf("\nWhois server is : %s" , wch);

  whois_query(wch , ip , data);

  }

  else

  {

  *data = malloc(100);

  strcpy(*data , "No whois data");

  }

  return;

  }

  /*

  * Perform a whois query to a server an d record the response

  * */

  int whois_query(char *server , char *query , char **response)

  {

  char ip[32] , message[100] , buffer[1500];

  int sock , read_size , total_size = 0;

  struct sockaddr_in dest;

  sock = socket(AF_INET , SOCK_STREAM , IPPROTO_TCP);

  //Prepare connection structures :)

  memset( &dest , 0 , sizeof(dest) );

  dest.sin_family = AF_INET;

  printf("\nResolving %s..." , server);

  if(hostname_to_ip(server , ip))

  {

  printf("Failed");

  return 1;

  }

  printf("%s" , ip);

  dest.sin_addr.s_addr = inet_addr( ip );

  dest.sin_port = htons( 43 );

  //Now connect to remote server

  if(connect( sock , (const struct sockaddr*) &dest , sizeof(dest) ) < 0)

  {

  perror("connect failed");

  }

  //Now send some data or message

  printf("\nQuerying for ... %s ..." , query);

  sprintf(message , "%s\r\n" , query);

  if( send(sock , message , strlen(message) , 0) < 0)

  {

  perror("send failed");

  }

  //Now receive the response

  while( (read_size = recv(sock , buffer , sizeof(buffer) , 0) ) )

  {

  *response = realloc(*response , read_size + total_size);

  if(*response == NULL)

  {

  printf("realloc failed");

  }

  memcpy(*response + total_size , buffer , read_size);

  total_size += read_size;

  }

  printf("Done");

  fflush(stdout);

  *response = realloc(*response , total_size + 1);

  *(*response + total_size) = ”\”;

  close(sock);

  return 0;

  }

  /*

  * @brief

  * Get the ip address of a given hostname

  *

  * */

  int hostname_to_ip(char * hostname , char* ip)

  {

  struct hostent *he;

  struct in_addr **addr_list;

  int i;

  if ( (he = gethostbyname( hostname ) ) == NULL)

  {

  // get the host info

  herror("gethostbyname");

  return 1;

  }

  addr_list = (struct in_addr **) he->h_addr_list;

  for(i = 0; addr_list[i] != NULL; i++)

  {

  //Return the first one;

  strcpy(ip , inet_ntoa(*addr_list[i]) );

  return 0;

  }

  return 0;

  }

  1.2 大連東軟

【百度質(zhì)量部面試筆試體驗之—三面】相關(guān)文章:

百度質(zhì)量部測試開發(fā)面試筆試經(jīng)驗09-03

百度筆試題目10-26

百度校園招聘筆試題精選07-22

百度網(wǎng)絡(luò)筆試題目07-19

百度軟件測試常見筆試題09-06

百度上海產(chǎn)品運營筆試經(jīng)驗10-25

趨勢科技筆試面試08-31

TNT筆試面試歸來08-21

HuLu筆試面試經(jīng)驗06-13

電裝招聘筆試+面試05-20