2014-12-14 9 views
2

timestamp으로 패킷을 위조 할 의향이 있습니다. 내가 패킷에 얻을 것은Scapy로 패킷 타임 스탬프를 조작 할 수 없습니다

from scapy.all import * 
from datetime import datetime 

pkt1 = scapy.all.Ether() 
pkt1.src = "01:01:76:05:8c:0d" 
pkt1.dst = "1b:1b:1b:1b:01:01" 
pkt1.time = 12345678 
str(pkt1) 
print datetime.fromtimestamp(pkt1.time) 

는 현재 시간과하지 "12345678" :

나는 다음과 같은 코드 조각을 작성했습니다.

왜 이것이 작동하지 않는 사람이 있습니까? 패킷을 통해 시간 조정을 수행 할 수있는 다른 방법이 있습니까?

답변

0

리포지토리에서 최신 Scapy 버전으로 코드를 실행하면 작동하는 것 같습니다.

$ python 
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from scapy.all import * 
WARNING: No route found for IPv6 destination :: (no default route?) 
>>> from datetime import datetime 
>>> 
>>> pkt1 = scapy.all.Ether() 
>>> pkt1.src = "01:01:76:05:8c:0d" 
>>> pkt1.dst = "1b:1b:1b:1b:01:01" 
>>> pkt1.time = 12345678 
>>> str(pkt1) 
'\x1b\x1b\x1b\x1b\x01\x01\x01\x01v\x05\x8c\r\x00\x00' 
>>> print datetime.fromtimestamp(pkt1.time) 
1970-05-23 22:21:18 
>>> 

무엇을 얻었습니까?

repository에서 최신 버전 (hg clone http://bb.secdev.org/scapy)을 사용해 보셨습니까?

+1

다시 시도하면 작동합니다. 감사합니다. – pugilon