Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dumps(self, ip, port, username):
- # returns bytes which represent the data
- #print (self.fbit,' ', type(self.fbit).__name__)
- #db_path = realpath('iaxdb.db')
- conn = sqlite3.connect('/usr/local/src/dionaea/modules/python/scripts/iax/iaxdb.db')
- print(conn)
- c = conn.cursor()
- print(c)
- if (self.dst_call_no == 0):
- a = (struct.pack('>2HI2H', self.fbit << 15 | generate_rand_src(), self.rbit << 15 | self.src_call_no, self.timestamp+1, self.o_seq_no << 8 |self.i_seq_no+1, self.frame_type << 8 | 14))
- else:
- a = (struct.pack('>2HI2H', self.fbit << 15 | self.dst_call_no, self.rbit << 15 | self.src_call_no, self.timestamp+1, self.o_seq_no << 8 |self.i_seq_no+1, self.frame_type << 8 | 14))
- a += self.packs(14, 2, 3)
- rand = str(generate_rand9())
- username = str(username, 'utf-8')
- #query = 'update credentials set salt={:s} where username={:s}'.format(rand,username)
- query = 'create table randomname(one char(5), two char(5))'
- result = conn.execute(query)
- print(result)
- conn.commit()
- c.close()
- a += self.packs(15, 9, rand)
- a += self.packs(6, len(str(username, 'utf-8')), str(username, 'utf-8'))
- return a
Add Comment
Please, Sign In to add comment