Make failing username dynamic

unstable
Dhiru Kholia 2012-10-03 19:17:32 +05:30
parent e33da009ea
commit a0422fe500
1 changed files with 14 additions and 15 deletions

View File

@ -89,22 +89,21 @@ class Metasploit3 < Msf::Auxiliary
:active => true
)
print_status("PostgreSQL LOGIN #{@state[c][:name]} #{@state[c][:username]} / #{@state[c][:password]} / #{@state[c][:database]}")
# send failure message, currently the failing username is always "postgres"
# TODO: make failing username dynamic!
# send failure message
sdata = [
0x45, 0x00, 0x00, 0x00, 0x61, 0x53, 0x46, 0x41,
0x54, 0x41, 0x4c, 0x00, 0x43, 0x32, 0x38, 0x50,
0x30, 0x31, 0x00, 0x4d, 0x70, 0x61, 0x73, 0x73,
0x77, 0x6f, 0x72, 0x64, 0x20, 0x61, 0x75, 0x74,
0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 0x6c,
0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75,
0x73, 0x65, 0x72, 0x20, 0x22, 0x70, 0x6f, 0x73,
0x74, 0x67, 0x72, 0x65, 0x73, 0x22, 0x00, 0x46,
0x61, 0x75, 0x74, 0x68, 0x2e, 0x63, 0x00, 0x4c,
0x33, 0x30, 0x32, 0x00, 0x52, 0x61, 0x75, 0x74,
0x68, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64,
0x00, 0x00].pack("C" * 98)
0x45, 97 - 8 + @state[c][:username].length, 0x53,
0x46, 0x41, 0x54, 0x41, 0x4c, 0x00, 0x43, 0x32,
0x38, 0x50, 0x30, 0x31, 0x00, 0x4d, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x20, 0x61,
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61,
0x69, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72,
0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x22
].pack("CN" + "C" * 56) + @state[c][:username] +
[ 0x22, 0x00, 0x46, 0x61, 0x75, 0x74, 0x68, 0x2e,
0x63, 0x00, 0x4c, 0x33, 0x30, 0x32, 0x00,
0x52, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x66,
0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x00 ].pack("C" * 29)
c.put sdata
c.close
end