File: swat_guessable_usernames.nasl

package info (click to toggle)
nessus-plugins 1.0.10-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,924 kB
  • ctags: 408
  • sloc: sh: 7,838; ansic: 3,415; makefile: 233
file content (91 lines) | stat: -rw-r--r-- 2,313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# This script was written by Renaud Deraison <deraison@nessus.com>
#
# See the Nessus Scripts License for details
#

if(description)
{
 script_id(10590);
 script_cve_id("CAN-2000-0938");
 
 
 name["english"] = "SWAT allows the obtention of user names by brute force";
 name["francais"] = "SWAT allows the obtention of user names by brute force";
 script_name(english:name["english"], francais:name["francais"]);
 
 desc["english"] = "
The remote SWAT server replies with different error codes when
it is issued a bad user name or a bad password.

An attacker may use this flaw to obtain the list of
user names of the remote host by a brute force attack.

As SWAT does not log login attempts, an attacker may use
this flaw even more effectively

Solution : get the latest version of samba, or disable swat
Risk factor : Low";


 script_description(english:desc["english"]);
 
 summary["english"] = "Detect SWAT server port";
 script_summary(english:summary["english"]);
 
 script_category(ACT_GATHER_INFO);
 
 script_copyright(english:"This script is Copyright (C) 2000 Renaud Deraison");
 family["english"] = "General";
 script_family(english:family["english"]);

 script_dependencie("find_service.nes");
 script_require_ports("Services/swat", 901);
 exit(0);
}

#
# The script code starts here
#

port = get_kb_item("Services/swat");
if(!port)port = 901;
if (get_port_state(port))
{
 soctcp901 = open_sock_tcp(port);

 if (soctcp901)
 {
  sendata = http_get(item:"/", port:port);
  sendata = sendata - string("\r\n\r\n");
  
  #
  # First attempt - we try to log in as nobodyhome123/a
  #
  
  sendata = sendata + string("\r\nAuthorization: Basic bm9zdWNodXNlcjEyMzQ6bm9wYXNz\r\n\r\n");
  
  send(socket:soctcp901, data:sendata);
  code1 = recv_line(socket:soctcp901, length:8196);
  close(soctcp901);
  
  soctcp901 = open_sock_tcp(port);
  sendata = http_get(item:"/", port:port);
  sendata = sendata - string("\r\n\r\n");
  
  #
  # First attempt - we try to log in as nobodyhome123/a
  #
 
  sendata = sendata + string("\r\nAuthorization: Basic cm9vdDpub3Bhc3MK\r\n\r\n");
  send(socket:soctcp901, data:sendata);
  code2   = recv_line(socket:soctcp901, length:8196);
  close(soctcp901);

  if(("401" >< code1)  &&
     ("401" >< code2))
     {
       if(code1 != code2)security_warning(port);
      }
 }
}