이한솔

주간보고서

No preview for this file type
1 -#from hopCountFiltering import HCFStateManager
2 from HCF import * 1 from HCF import *
3 from struct import * 2 from struct import *
4 import sys 3 import sys
5 import socket 4 import socket
6 5
7 -def PacketMonitoring(): 6 +def DetectingPacket():
8 IP = [] 7 IP = []
9 for i in range(1, 10): 8 for i in range(1, 10):
10 ip = '10.0.'+str(i+1)+'.100' 9 ip = '10.0.'+str(i+1)+'.100'
11 IP.append(ip) 10 IP.append(ip)
12 - packetManager = HCF(IP) 11 + packetHCF = HCF(IP)
13 12
14 - # set up the socket
15 try: 13 try:
16 sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0003)) 14 sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0003))
17 15
...@@ -44,10 +42,10 @@ def PacketMonitoring(): ...@@ -44,10 +42,10 @@ def PacketMonitoring():
44 print("TTL: ", ttl) 42 print("TTL: ", ttl)
45 43
46 try : 44 try :
47 - packetTest = packetManager.IsSpoofed({'ttl':ttl, 'src':source_addr}) 45 + packetTest = packetManagerHCF.IsSpoofed({'ttl':ttl, 'src':source_addr})
48 except Exception as e : 46 except Exception as e :
49 print(e) 47 print(e)
50 continue 48 continue
51 49
52 if __name__ == "__main__": 50 if __name__ == "__main__":
53 - PacketMonitoring() 51 + DetectingPacket()
......