diff options
| author | lishu <[email protected]> | 2019-01-05 11:57:15 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2019-01-05 11:57:15 +0800 |
| commit | 61a702bc6ecbf497a731c8c6e5348d52c5d92e2f (patch) | |
| tree | 3dd06b8a30c3e105ddb7814e7f7ac8e2a5a46b87 | |
| parent | 5c446067492e4f7a444c55bd955ad7f51946db37 (diff) | |
支持GET之后空格的处理
| -rw-r--r-- | readme.txt | 330 | ||||
| -rw-r--r-- | src/HTTP_Analyze.c | 11 |
2 files changed, 8 insertions, 333 deletions
diff --git a/readme.txt b/readme.txt deleted file mode 100644 index ede083b..0000000 --- a/readme.txt +++ /dev/null @@ -1,330 +0,0 @@ -20181113 -��bug��HTTP�쳣��������http��ʼ�п�����ж���������֮��buf���ͷţ�����ȷʶ����ʼ�� -************************************************************ -20170207 -1. û��host��URL=serverIP+URI -2. a_http->parser.p_urlֻ��������ȷ����URL��������URLƴ��֮ǰ���м�״̬ -************************************************************ -20161219 -1. Ӧ���б�ʶ��Ϊ�����С��п�����ƽ̨����data�������ӣ�S2C����Ϊ��C2S���¡���������������¼��־�� -************************************************************ -20160905 -1.���ֶ�Ҳ֧�������� -2.�Ƽ����δ�������� -3.�������� -ע�⣺��ʼ�����ݽ�����������ʱ��������ҵ��㣬���п��ܿ�������ݲ���ͷ�������ϸ��Ự��β�������Ƕ������ã������½��Ự�� -����tcp_seq.pcap -����Ϊ�˼��ٲ���Ҫ�Ļص�������ʼ�п��������ҵ���ص��� -************************************************************ -20160715 -1.�����ڶ����µ����� -2.g_http_prog_para.batch_field_maxnum������ҵ��������Ȥ������ -************************************************************ -201690701 -1. �ڴ�����չ�������£���չ��ʹ��hash����ʶ�� -2. ����tcp_http��ͳ�� -************************************************************ -20160620 V4 -1.���Ӱ�������ʱ��ͳ�� -************************************************************ -20160612 V4 -1.֧��\n�������д������������еĴ����� -************************************************************ -20160601 V4 -1. http_findtStartFlag http_judgeHttpMethod(method, (char*)tcp_detail->pdata, curdir)һֱ��tcp_detail->pdata����ȷ���ڴ��� -2. �����������GET֮ǰ��NULL -3. ʶ��httpflag֮�����pbuf,��Ϊ֮����Ҫ��ʼ�У�������ʱ��ʼ�д��� -4. ƽ̨C2S�ඪ���������ڶ���֮ǰS2C�ȵ���Ȼ��C2S�Ķ��������֪���� -����C2S��û�д����꣬������δ֪����S2C�͵����ˣ���ô��ʱhttp_state����C2S��״̬������S2C��������ġ�S2C��˳��C2S��״̬������ȥ�� -����Ӧ����S2C����ǰC2S��û�н�������resetC2S״̬�� -************************************************************ -20160526 -1. curdir=0 -ԭ�� -ͷ����������\r\n�������\r\n����Ϊ���µ�http_infor -chunk����Ϊ0����֮��\r\n\r\n,\r֮�������ͻ���Ϊ���µ�http_infor -����� -����http_session_seq���� -�ģ��μ��ĵ���������� -2. ��������������¼�ʱ�ͷ�http_infor�����ٵȵ�tcp��������ʱ����ͷ� -3. ��������£�����http_session_seq=-1 -4. ֧��http_batch��ʹ�òμ��ĵ� to do -5. ���������ѭ�������� to do -6. ѧ�����ֵ�Bug��tcpdata��GET URL����ҵ����õ�����content to do -7. http�������ӿ��� -8. chunk����£�content_length ��������ݽ���ʱʱ�ܳ��� -9. �Ự�У�ҵ��㲻����Ҫ�ûỰ��Ϣ����ô�Ͳ�����gzip -10.http stat����pend��close��ͳ�Ƶ����� -************************************************************ -20160301 -1.��������URL�����URL -2.����S2C�������Ĵ���ʶ�� -3.���Ӵ����������ܣ���Ҫ�벶��������ʹ�� -��־�� -FATAL -INFO:pending and close -DEBUG:uri and URL -DEBUG:connect -************************************************************ -20160128 -1.֧��deflate��ѹ�� -2.����������ʱ�����ڴ����ޱ�������KB�ڴ��realloc -************************************************************ -20160122 -1. set HTTP_DATA_END when http_clearHttpInfor and before build http_infor -************************************************************ -20151103 -1. http_region2proto_flag ת��Ϊ��Сд������֮����ƥ�� - ��ʹ�ô˺������Բ��ø��� -************************************************************ -20150917 -1.������һ��http_infor��if else����bugӰ���һ�����ݰ��ǵ���������S->C�ķ��� -************************************************************ -20150818 -1.��http_url_decode��bug -************************************************************ -20150609 -1.check mem��http_doWithGzipData -������httpͷ���������ظ�����Ϣ�� -************************************************************ -20150603 -1.����http_state�͵�ǰ�������������HTTPͷ����������ʼ�к�ͷ��: -�������� -1��http_state=DATA_BIGIN,session->buf��ֵ������ҵ��� -2����ǰ������header����������http_state< DATA_BIGIN, session->buf��ֵ������ҵ��� - -a_http->phttp_begin��ָ��http�������ݵĿ�ʼ���ߵ�ǰtcp���ݰ�����ʼλ�� -ҵ��㴦����: -http_state<= DATA_BIGIN && session->buf!=NULL,���д��� -switch(session_info->prot_flag) - { - case HTTP_STATE: - if(a_http->http_state<=HTTP_DATA_BEGIN&&a_http->http_state>=HTTP_START_LINE) - { - if(session_info->buf!=NULL) - { - fwrite(session_info->buf,session_info->buflen,1,g_hs_prog_para.fp); - } - } - } - -HTTPͷ�����ݻ�ȡ˵���� -ͷ�����ݰ�����ʼ�к�ͷ���ԭʼ���� -ͷ�����ݰ���������Ӧ������� - -2.�۵���copy������ -�����۵����ŵ������л�ɾ�����������е�\t\r\n�ո��ַ������������в�ɾ��\t\n�ո� -��ʼ���е��۵����Ų���ɾ������Ϊɾ���ո��Ӱ����ʼ�е��ж� -����������key value��ʱ���ɾ���ո�\t\r\n - -�����п�����\r \r\n \n -����\n������������ - -3. ȷ����httpЭ��֮ǰ������ҵ��� -************************************************************ -20150601 -1. ����pending��close�ĵ�����Ϣ��log_leve=20�� -2. ��bug,pendng!=close��lost,�ͷ�����û�е�ת���� -************************************************************ -20150420 -1.dig��δ��ʼ�� -************************************************************ -20150401 -1.�����۵��У�before��û������ -************************************************************ -20150330 -1.����98-122.pcap���������������Ӧ��࣬��������packet_entity_len=0 -************************************************************ -20150326 -1.�������ͷ��֮�����������ģ�����return -2.��������µĴ�����Ӧ�ð���a_tcp�ķ������ǵ�ǰ���ڲ�����a_http_stream�ķ��� -************************************************************ -20150323 -1.����conteng-length:-1����� -************************************************************ -20150320 -1.�������http_infor�������ͷŽṹ�壬��Ӧ�����ͷ�֮�������ʴ���ڴ˽ṹ���ص�mgs_status -************************************************************ -20150318 -1.��tcp�ж�����ʱ��Ӧ����DATA_BEGINʱ���ܼ���������������ȫ������ - --------------------------------------------------------------------------------------------------------- - -************************************************************ -20140327 -1. ֧��HTTP CONNECT���� -************************************************************ -20141016 -1. ֧�ִ����İ汾�Ͳ�֧�ִ����ĺϲ������ӱ�������ȷ���Ƿ�֧��HTTP���� -2. ����HTTPͳ�ƹ���:filed_stat,�����ļ����ӣ� - /*0 �������Ļ 1��������ļ�*/ - stat_screen_print=0 - stat_file=./log/http/http_stat.log - /*0 means close stat*/ - stat_cycle=0 -************************************************************ -20141017����ͷ�ļ����� -1. HTTP_Message.h->http.h -************************************************************ -20141113 -1. ɾ��KILLME -2. http.h���Ӱ汾�� -3. ֧��˫ջ��http������ papp20141024���� - -************************************************************ -20141114 -1. ���������û�д�ungzip�Ŀ��أ�ҵ���ע�����ungzip����ôҵ��㲻���յ����� - -************************************************************ -20141121 -1. �ϲ㲻��Ҫdata�����Ǵ�ʱ�п�����over_flag״̬��ԽҪ�����ϲ� - -************************************************************ -20141201 -1. xjfd������ȥ��XJFD_PROJRCTY��أ�ά��һ�״��� -2. chraset ��Ϊmemcasemem -************************************************************ -20141202 -1. http_getRegionName�IJ�����prot_flag��Ӧ��ת��Ϊregion_id, makefile����o2 - -************************************************************ -20141203 -1. http_judgeHeaderOver realloc->dictator_realloc - -************************************************************ -20141204 -1. http.h���� V3 �汾 -1) ��ʽ�ĵ�������gzip��ѹ��,�������µĿ� -2) http.hɾ���ṹ�� -3) ����Ĭ��ungzip,Ĭ�ϲ�����TextProc,ʹ�� -4��dictator -5) �������� -6�����ṹ���� -7������ڴ�й© -8) �ú�дһ��Makefile -o2 -9) ����const -10) �����ļ�����ƣ������ֶα��ֶζ�Ҫ��д��All���ɣ����ֶΡ� -11����Сд -12) ע����Ȥ��data, ungzipdata ����ѡ�� - -qq���Ͳ��û�������������������Ҫ��һ���ֶ� - -************************************************************ -20141209 -V3�汾 -1. ɾ��http_infor�ṹ�壬����ҵ������ʹ�õı��� -2. ��Ȥ�ֶ�����������ע�ͣ��ṩALL�ֶ�,��������Ҫhttp.conf�������ֶ� �ֶ����ָı� -3. ijЩif�ж���Ϊassert -4. ����Ĭ�Ͻ�gzipѹ������ͨ�������ļ��ص���ѹ����ģ�� -5. http���Ĭ�ϲ����ӽ�ѹ���Ŀ⣬ͨ��Makefile���ӿ� -6. ��Makefile,����-O2��ѡ�� -7. ȷ�ϲ���httpЭ��֮��ֱ�ӷ��� -8. �ṩ��ҵ���ĺ�����������const������ -9. http����Ĭ�ϴ�Ŀǰ���Բ��࣬���ȶ�ʱ�ṩ���궨��رմ˹��� -10.����ע������ԭʼ���ݣ�CONTENT��ѹ������UNGZIP_CONTENT - -ҵ��������֪�� -�����ļ�main.conf��http.conf�и��� -ҵ�����Ҫ����http.h��������Ҫ��case���� -��Ҫ�������ļ�inf - -���ļ�¼�� -20141210 ����ҵ����ע���ֶΣ�����ע�ͣ���Щ������࣬��Щ��Ӧ��֧࣬��ALLע�����������ļ��е��ֶΡ� ��ѹ���ij�ʼ���� - -�Բ⣺ -�ڴ�й¶ -�ֽڶ��� -dictator_malloc -���� - -************************************************************ -20141209 -V3�汾 -1. ����˵�� -֧�ֲ�֧�ֽ�ѹ�����������ļ����ƣ� - - - -papp����stream_register.h��stream_inc�� - - -cont-length:134 -cont-range:bs 100-233/1000 - - -1. ����ָ��->���� -2. ����״̬ע��������� -3. ��ʼ�У�method res_code uriע��+����ͷ�� - ͷ������������+Ӧ�� -4. ����http����״̬ok -5. content-range��ҵ��ע�ᣬ����Ҫ����,ָ��ΪNULL���Ż�cont-range�Ľ�������ok -6. method+res_code �ṩ����ok -7. over_flag link_state chunk_state״̬ͼ ok -8. �����ж�http_judgeHttpMethod��->memcmp OK -9. ��չ�ֶΣ�����ֵ��������session�б������У�value�����д��� OK - - -20141231 �������Ĵ��� - ע��ijЩ�ֶβŻᴦ��valueֵ������HOST charset���� -20150104 ��cont-range�ֶδ�����content-range��ҵ��ע�ᣬ����Ҫ����,ָ��ΪNULL���Ż�cont-range�Ľ������� - ����http_infor���ṩ����ָ�룬��Ϊ�ṩ�����ķ��� - over_flag�ܲ��ܺϲ���over_flag== ��������������� ����˫������Ӧ����� ���߳����������������data�������ӣ�dir��1��������һ���ǵ����������Ե�����������������Ҳ��ǵ�һ�����ݰ�����˵���ûỰ���������Ա���over_flag��״̬�� - �Ĵ��룬�����������ò�Ӧ��̫� - ����http�ķ������curdir - ����ע��������״̬ע�ᡢ������ʼ��ע�ᡢӦ����ʼ��ע�� - ������������ - -20150105 �������ֲ��� - -20150106 data�������ӣ���������ʶ��������ͷŻỰ����Ϊ - -************************************************************ -20150114 -�ṩ��������ַ��������ĺ����ĺ��� -************************************************************ -20140126 -1. ����url_decode���� -2. http_infor����append_infor������http.h�ģ����ϼ��� -3. ����other�ֶΣ�http.conf������ -4. HTTP.h��������˳������ -5. �Ĵ���ģ�顣 -6. PORT_DROPPKT����ƽ̨ -************************************************************ -20150202 -1. ����ڴ�й¶�� - chunk����*offset+1 - hostй¶ԭ����Ӧ����Ϣ������λstate,Ӧ�ü���HTTP_DATA_END. -2. HTTP_RETURN_DROPPKT ����������ֻ�Ƿ��ظ�ƽ̨��DROPPKT��ԭ��һ��������ټ���������ǰ������ô���ܽ���������ԭ�����������봫������ҵ��㣬��Ҫ�����������DROPME. - - -*************************************************************** -HTTP������¼: -1.�ر��ܵĽ�gzipѹ����http_main.conf��������֧�ֽ���gzip�� -2.HTTP_ALL������ͷ���� -3.HTTP_OTHER�ǷDZ�ͷ��������� -4.��չ�ֶε�buflen��:֮��ģ����������з����� - cur_http_node->parser.append_infor.content = data+start_pos; - cur_http_node->parser.append_infor.contlen - ���е�ͷ������һ���Ĵ������ȿ�����:֮��ģ�Ҳ���Ի�������С� -5.http_state==HTTP_DATA_BEGIN��ʾͷ�������� - a_http->session.buf ��ǰhttp�Ự��ʼ�ĵط�; - a_http->session.buflen ����http�Ự��ʼ�ij��ȣ� -6.�����session.buf��HTTP_DATA_BEGINһ����ֻ��http_state״̬��һ���� -7.������:(��Ҫע��http_state���д˹���(ɾ��)) - ������ǰpkt�е��������ָ�롣�����������룬������һ��pkt����֮����롣 - ��֤�ص�ҵ�������ظ��� - - - - - - - - - - - - - - - diff --git a/src/HTTP_Analyze.c b/src/HTTP_Analyze.c index 5ff5e5c..7d2cbf0 100644 --- a/src/HTTP_Analyze.c +++ b/src/HTTP_Analyze.c @@ -25,7 +25,7 @@ http_prog_runtime_parameter_t g_http_prog_para; int G_HTTP_H_VERSION_3_20150320 = 0; -int G_HTTP_VERSION_4_20181113 = 0; +int G_HTTP_VERSION_4_20190105 = 0; void history() { //2014-12-09 V3.0 new documentAnalyze lib ; http.h add and delete ; @@ -97,7 +97,8 @@ void history() //2017-09-18 V4.0 //batch info when callback, not to do //2017-11-03 V4.0 //proc absolute URI without host //2018-09-07 V4.0 //http_line2region:region name is raw pkt - //2018-11-13 V4.0 //special http pkt, proc span + //2018-11-13 V4.0 //special http pkt, proc span + //2019-01-05 V4.0 //special http packet, get_span_space.pcap } /* @@ -935,7 +936,11 @@ uchar http_analyseHttpConnection(http_stream* a_http_stream,struct streaminfo *a /*http identify : v3 judge is http stream or not firstly*/ if(HTTP_FLASE==a_http_stream->maybe_http_stream) { - http_deleteEmptyRow(&(a_http_stream->packet_offset), (char*)(tcp_detail->pdata), tcp_detail->datalen); + /*20190105:����֮ǰ�Ŀո�ɾ������Ӱ��ʶ���Ѿ���ʼ��������֮����Ҫɾ���ո�������������ʼ�е�����Ԫ��*/ + if(a_http_stream->pbuf==NULL) + { + http_deleteEmptyRow(&(a_http_stream->packet_offset), (char*)(tcp_detail->pdata), tcp_detail->datalen); + } uchar rec = http_judgeHttpProtocol(a_http_stream, a_tcp->curdir, tcp_detail, thread_seq); if(rec==ERROR) { |
