2015-01-05 23:06:46 +00:00
|
|
|
# -*- coding: binary -*-
|
|
|
|
|
|
|
|
##
|
|
|
|
# ACPP protocol support
|
|
|
|
##
|
|
|
|
|
|
|
|
module Rex
|
|
|
|
module Proto
|
|
|
|
module ACPP
|
|
|
|
|
|
|
|
class Client
|
|
|
|
|
|
|
|
def initialize(sock, opts = {})
|
|
|
|
@sock = sock
|
|
|
|
@opts = opts
|
|
|
|
end
|
|
|
|
|
|
|
|
def authenticate(password = 'public')
|
|
|
|
login = Message.new
|
|
|
|
login.password = password
|
|
|
|
login.type = 20
|
|
|
|
@sock.put(login.to_s)
|
|
|
|
# TODO: the checksum never validates here
|
2015-01-12 22:01:23 +00:00
|
|
|
Message.decode(@sock.get_once(128), false)
|
2015-01-05 23:06:46 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|