Lucene search
+L

Microsoft Windows SMB Accessible Shares

🗓️ 29 Feb 2012 00:00:00Reported by Copyright (c) 2012 SecPodType 
openvas
 openvas
🔗 plugins.openvas.org👁 14 Views

The script detects the Windows SMB Accessible Shares and sets the result into KB

Code
###############################################################################
# OpenVAS Vulnerability Test
# $Id: secpod_ms_smb_accessible_shares.nasl 6125 2017-05-15 09:03:42Z teissa $
#
# Microsoft Windows SMB Accessible Shares
#
# Authors:
# Antu Sanadi <[email protected]>
#
# Copyright:
# Copyright (c) 2012 SecPod, http://www.secpod.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# (or any later version), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
###############################################################################

tag_summary = "The script detects the Windows SMB Accessible Shares and sets the
  result into KB.";

if(description)
{
  script_id(902425);
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
 script_version("$Revision: 6125 $");
  script_tag(name:"last_modification", value:"$Date: 2017-05-15 11:03:42 +0200 (Mon, 15 May 2017) $");
  script_tag(name:"creation_date", value:"2012-02-29 12:08:36 +0530 (Wed, 29 Feb 2012)");
  script_tag(name:"cvss_base", value:"0.0");
  script_name("Microsoft Windows SMB Accessible Shares");
  script_category(ACT_GATHER_INFO);
  script_tag(name:"qod_type", value:"remote_banner");
  script_copyright("Copyright (c) 2012 SecPod");
  script_family("Windows");
  script_dependencies("smb_login.nasl");
  script_require_keys("SMB/transport", "SMB/name", "SMB/login", "SMB/password");
  script_require_ports(139, 445);
  script_tag(name : "summary" , value : tag_summary);
  exit(0);
}


include("smb_nt.inc");



name = "";
domain = "";
port = "";
login = "";
pass = "";
soc = "";
r = "";
prot = "";
uid = "";
tid = "";

name = kb_smb_name();
domain = kb_smb_domain();
port = kb_smb_transport();
login  = kb_smb_login();
pass   = kb_smb_password();

## Get the SMB Port
if(!port){
  port = 139;
}

## Check the port status
if(!get_port_state(port)){
 exit(0);
}

## Open the tcp socket
soc = open_sock_tcp(port);
if(!soc){
  exit(0);
}

## Session request
r = smb_session_request(soc:soc, remote:name);
if(!r)
{
  close(soc);
  exit(0);
}

## Get the protocol
prot = smb_neg_prot(soc:soc);
if(!prot)
{
  close(soc);
  exit(0);
}

## Start the session
r = smb_session_setup(soc:soc, login:login, password:pass ,domain:"", prot:prot);
if(!r)
{
  r = smb_session_setup(soc:soc, login:"anonymous", password:pass ,domain:"", prot:prot);
  if(!r)
  {
    close(soc);
    exit(0);
  }
}

## Get the uid
uid = session_extract_uid(reply:r);
if(!uid)
{
  close(soc);
  exit(0);
}

foreach s (make_list("A$", "C$", "D$", "ADMIN$", "WINDOWS$", "ROOT$", "WINNT$", "IPC$", "E$"))
{
  r = smb_tconx(soc:soc, name:name, uid:uid, share:s);
  if(r)
  {
    tid = tconx_extract_tid(reply:r);
    if(tid){
      set_kb_item(name:"SMB/Accessible_Shares", value:s);
      report += s + '\n';
    }
  }
}

if( report )
{
  report = 'The following shares were found\n' + report;
  log_message( port:port, data:report );
}

close(soc);

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

15 May 2017 00:00Current
0.2Low risk
Vulners AI Score0.2
14