Sushrut Mair
2014-06-10 05:14:29 UTC
Hi,
I am trying to send out an EICAR string via scapy. It gets sent out but it
seems like scapy maybe
modifying the string. Here is my code:
.
.
.
actualdata="X5O!P%@AP
[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
ip=IP(src=ipsrc,dst=ipdst)
tcp=TCP(sport=srcp,dport=dstp,flags="PA",seq=last_packets_seqnum,ack=last_packets_acknum)
raw=Raw(actualdata.encode('utf-8','strict'))
data=ip/tcp/raw
print ls(data) ---> #1
print actualdata ---> #2
ACK=sr1(data)
.
.
.
#1 prints out he packet and the payload string. the string is printed out
as,
"'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'".
Note the extra
'\'. I have tried to escape the \ and tried other recommended stuff but to
no avail.
#2 prints out the correct string as provided in actualdata.
The only difference between both, afaik, are that ls(data) is controlled by
scapy while actualdata is a
python string.
Can anyone help me with the same? The issue is that while the destination
receives the string, it is
unable to detect it as an eicar string.
Rgds,
Sushrut.
I am trying to send out an EICAR string via scapy. It gets sent out but it
seems like scapy maybe
modifying the string. Here is my code:
.
.
.
actualdata="X5O!P%@AP
[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
ip=IP(src=ipsrc,dst=ipdst)
tcp=TCP(sport=srcp,dport=dstp,flags="PA",seq=last_packets_seqnum,ack=last_packets_acknum)
raw=Raw(actualdata.encode('utf-8','strict'))
data=ip/tcp/raw
print ls(data) ---> #1
print actualdata ---> #2
ACK=sr1(data)
.
.
.
#1 prints out he packet and the payload string. the string is printed out
as,
"'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'".
Note the extra
'\'. I have tried to escape the \ and tried other recommended stuff but to
no avail.
#2 prints out the correct string as provided in actualdata.
The only difference between both, afaik, are that ls(data) is controlled by
scapy while actualdata is a
python string.
Can anyone help me with the same? The issue is that while the destination
receives the string, it is
unable to detect it as an eicar string.
Rgds,
Sushrut.