Demo entry 6754159

ASDADA

   

Submitted by ASDASDS on Jul 09, 2018 at 04:48
Language: Python 3. Code size: 2.5 kB.

if (SRC_MAC(DATA_LOG)!=None) and (DST_MAC(DATA_LOG)!=None):
                        
                        if (SRC_IP(DATA_LOG)!=None) and (DST_IP(DATA_LOG)!=None):
                                if (SRC_PORT(DATA_LOG) !=None) and (DST_PORT(DATA_LOG) !=None):
                                        TIME_RESULT=TIME(DATA_LOG)
                                        SRC_MAC_RESULT=SRC_MAC(DATA_LOG)
                                        DST_MAC_RESULT=DST_MAC(DATA_LOG)
                                        SRC_IP_RESULT=SRC_IP(DATA_LOG)
                                        DST_IP_RESULT=DST_IP(DATA_LOG)
                                        SRC_PORT_RESULT=SRC_PORT(DATA_LOG)
                                        DST_PORT_RESULT=DST_PORT(DATA_LOG)
                                        LENGTH_RESULT=LENGTH(DATA_LOG)
                                        SEVERITY_RESULT=SEVERITY(DATA_LOG)
                                        

                                        
                                        
                                        INDEX=0

                                        DST_IP_DEC=numToDottedQuad(DST_IP_RESULT)
                                        
                                        #IP가 스택에 없으면 (초기값)
                                        if DST_IP_DEC not in IP_STACK:
                                                #IP 조회용
                                                IP_STACK.append(DST_IP_DEC)
                                                #LEN 조회용
                                                
                                                DST_IP_STACK.append([DST_IP_DEC,LENGTH_RESULT])
                                        #IP가 스택에 있으면
                                                
                                        if DST_IP_DEC in IP_STACK:
                                                
                                                
                                                for DST in DST_IP_STACK:
                                                        #print(DST)
                                                        if DST_IP_DEC==DST[0]:
                                                                DST[1]=DST[1]+LENGTH_RESULT
                                                                DST_IP_STACK[INDEX][1]=DST[1]
                                                        else:
                                                                INDEX=INDEX+1

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).