-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathSQLNode.py
More file actions
57 lines (48 loc) · 1.45 KB
/
SQLNode.py
File metadata and controls
57 lines (48 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /usr/bin/env python
"""
localNode.py
"""
from CANVASNode import CANVASNode
from exploitutils import *
class SQLNode(CANVASNode):
def __init__(self):
CANVASNode.__init__(self)
self.nodetype = "SQLNode"
self.pix = "SQLNode"
self.capabilities = []
self.activate_text()
self.colour="red2"
###### Node Messenging
# A localnode uses standard "socket" objects.
def send(self,sock,message):
"""
sock is any object that supports send(). Here we send a message to another node.
should probably make this reliable
"""
#sock.send(message)
return
def recv(self,sock,length):
"""
Recv data from another node
reliably read off our stream without being O(N). If you just
do a data+=tmp, then you will run into serious problems with large
datasets
"""
#data=""
#datalist=[]
#readlength=0
#while readlength<length:
#tmp=sock.recv(length-readlength)
#if tmp=="":
#self.log("Connection broken?!?")
#break
#readlength+=len(tmp)
#datalist.append(tmp)
#data="".join(datalist)
#return data
def isactive(self, sock, timeout):
"""
Check to see if the node has anything waiting for us
"""
if __name__=="__main__":
node=SQLNode()