예제 #1
0
파일: www.py 프로젝트: Herysutrisno/honeyd
def honeyd_init(data):
	mydata = {}
	mydata['re_req'] = re.compile("^([A-Z]*)\s+/(.*)\s+HTTP/1.[01]")
	mydata['write'] = ''
	honeyd.read_selector(honeyd.EVENT_ON)
	honeyd.write_selector(honeyd.EVENT_OFF)
	return mydata
예제 #2
0
파일: www.py 프로젝트: zengziqian/honeyd
def honeyd_init(data):
    mydata = {}
    mydata['re_req'] = re.compile("^([A-Z]*)\s+/(.*)\s+HTTP/1.[01]")
    mydata['write'] = ''
    honeyd.read_selector(honeyd.EVENT_ON)
    honeyd.write_selector(honeyd.EVENT_OFF)
    return mydata
예제 #3
0
파일: www.py 프로젝트: Herysutrisno/honeyd
def honeyd_readdata(mydata, data):
	mydata["write"] += data
	data = mydata['write']
	if data.find('\r\n\r\n') >= 0:
		honeyd.write_selector(honeyd.EVENT_ON)
		res = mydata['re_req'].match(data)
		if not res:
			bad_request(mydata)
		else:
			request(mydata, res.group(1), res.group(2))
	elif (len(data) > 1000):
		honeyd.write_selector(honeyd.EVENT_ON)
		bad_request(mydata)
	else:
		honeyd.read_selector(honeyd.EVENT_ON)
	
	return 0
예제 #4
0
파일: www.py 프로젝트: zengziqian/honeyd
def honeyd_readdata(mydata, data):
    mydata["write"] += data
    data = mydata['write']
    if data.find('\r\n\r\n') >= 0:
        honeyd.write_selector(honeyd.EVENT_ON)
        res = mydata['re_req'].match(data)
        if not res:
            bad_request(mydata)
        else:
            request(mydata, res.group(1), res.group(2))
    elif (len(data) > 1000):
        honeyd.write_selector(honeyd.EVENT_ON)
        bad_request(mydata)
    else:
        honeyd.read_selector(honeyd.EVENT_ON)

    return 0