Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i make a python version and filter.^_^ #1

Open
hnhhzy opened this issue Sep 3, 2016 · 0 comments
Open

i make a python version and filter.^_^ #1

hnhhzy opened this issue Sep 3, 2016 · 0 comments

Comments

@hnhhzy
Copy link

hnhhzy commented Sep 3, 2016

!/usr/bin/env python

-- coding:UTF-8 --

from socket import *
from time import ctime

HOST = '192.168.90.51'

PORT = 20101

PORT = 20100
BUFSIZE = 1024

ADDR = (HOST,PORT)

udpSerSock = socket(AF_INET, SOCK_DGRAM)
udpSerSock.bind(ADDR)

while True:
data, addr = udpSerSock.recvfrom(BUFSIZE)
udpSerSock.sendto('%s'%(data),addr)
datax = ", Data:"
if str(hex(ord(data[2]))) == "0x0":
if str(hex(ord(data[3]))) == "0x50" or str(hex(ord(data[3]))) == "0xf" or str(hex(ord(data[3]))) == "0x32" or str(hex(ord(data[3]))) == "0x1a" or str(hex(ord(data[3]))) == "0x67" or str(hex(ord(data[3]))) == "0x69" or str(hex(ord(data[3]))) == "0x6b" or str(hex(ord(data[3]))) == "0x32" or str(hex(ord(data[3]))) == "0x37" or str(hex(ord(data[3]))) == "0x81" or str(hex(ord(data[3]))) == "0xc" or str(hex(ord(data[3]))) == "0x50" or str(hex(ord(data[3]))) == "0x32" or str(hex(ord(data[3]))) == "0x85" or str(hex(ord(data[3]))) == "0x81" or str(hex(ord(data[3]))) == "0x5" or str(hex(ord(data[3]))) == "0x7" or str(hex(ord(data[3]))) == "0x38" or str(hex(ord(data[3]))) == "0x4f" or str(hex(ord(data[3]))) == "0x80" or str(hex(ord(data[3]))) == "0x82" or str(hex(ord(data[3]))) == "0x6a" or str(hex(ord(data[3]))) == "0x68" or str(hex(ord(data[3]))) == "0x8b" or str(hex(ord(data[3]))) == "0x3d" or str(hex(ord(data[3]))) == "0x9" or str(hex(ord(data[3]))) == "0x7a" or str(hex(ord(data[3]))) == "0x6c" or str(hex(ord(data[3]))) == "0x6d" or str(hex(ord(data[3]))) == "0x6e" or str(hex(ord(data[3]))) == "0x6f" or str(hex(ord(data[3]))) == "0x79" or str(hex(ord(data[3]))) == "0x70" or str(hex(ord(data[3]))) == "0x71" or str(hex(ord(data[3]))) == "0x72" or str(hex(ord(data[3]))) == "0x73" or str(hex(ord(data[3]))) == "0x74" or str(hex(ord(data[3]))) == "0x75" or str(hex(ord(data[3]))) == "0x76" or str(hex(ord(data[3]))) == "0x77" or str(hex(ord(data[3]))) == "0x78" or str(hex(ord(data[3]))) == "0x7c" or str(hex(ord(data[3]))) == "0x89":
continue
elif str(hex(ord(data[2]))) == "0x1":
if str(hex(ord(data[3]))) == "0x9f" or str(hex(ord(data[3]))) == "0x1":
continue
elif str(hex(ord(data[2]))) == "0x2":
if str(hex(ord(data[3]))) == "0x58" or str(hex(ord(data[3]))) == "0xf0" or str(hex(ord(data[3]))) == "0x28" or str(hex(ord(data[3]))) == "0x38" or str(hex(ord(data[3]))) == "0x48" or str(hex(ord(data[3]))) == "0x8" or str(hex(ord(data[3]))) == "0x9":
continue
elif str(hex(ord(data[2]))) == "0x3":
if str(hex(ord(data[3]))) == "0x8f" or str(hex(ord(data[3]))) == "0x59" or str(hex(ord(data[3]))) == "0xb8" or str(hex(ord(data[3]))) == "0xb9" or str(hex(ord(data[3]))) == "0xc9" or str(hex(ord(data[3]))) == "0x8" or str(hex(ord(data[3]))) == "0xe8":
continue
elif str(hex(ord(data[2]))) == "0x4":
if str(hex(ord(data[3]))) == "0x38":
continue
elif str(hex(ord(data[2]))) == "0x5":
if str(hex(ord(data[3]))) == "0x48":
continue

for i in xrange(4,len(data)):
    datax = datax + str(hex(ord(data[i]))) + " "
print "Type:" + str(hex(ord(data[2]))) + ", Opcode:" + str(hex(ord(data[3]))) + datax

udpSerSock.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant