CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/proto/acpp/client.rb
Views: 11704
1
# -*- coding: binary -*-
2
3
##
4
# ACPP protocol support
5
##
6
7
module Rex
8
module Proto
9
module ACPP
10
11
class Client
12
13
def initialize(sock, opts = {})
14
@sock = sock
15
@opts = opts
16
end
17
18
def authenticate(password = 'public')
19
login = Message.new
20
login.password = password
21
login.type = 20
22
@sock.put(login.to_s)
23
# TODO: the checksum never validates here
24
Message.decode(@sock.get_once(128), false)
25
end
26
end
27
end
28
end
29
end
30
31