Results 1 to 3 of 3

Thread: Kali Share with a windows computer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Kali Share with a windows computer

    I have been reading as much as I can and have tried several different options all to no avail. I am trying to create a shared folder that I can access from both my windows 7 machine and my Kali machine that I have at work. Both of these systems are separate computers and are not in a virtual environment. I recently got as far as to be able to use the smbclient to actually see the shares that are on the widows IP but it is saying the netbios over tcp is not enabled. I went in and enabled it but I am still not having any luck. Is there anyone out there that has been able to do this successfully. *Note* my work environment is not in a AD environment.

  2. #2
    Join Date
    2015-Aug
    Posts
    16
    Some of this may cover familiar ground but here goes...

    Samba is the program that you use to share folders.
    samba will need access to tcp on ports 139 & 445 as well as udp access on 137 & 138. If you aren't using a firewall this part isn't relevant.
    If you would like to, here are the rules I use to get you started.
    (Full Disclosure: There's probably a more elegant way to do this but I'm lazy.)

    # File share to local network only
    samba(){
    #In Rule
    echo "Allowing file sharing to local network only..."
    iptables -A INPUT -s $LANSubnet -p tcp -m multiport --sport 139,445 -j ACCEPT
    iptables -A INPUT -s $LANSubnet -p udp -m multiport --sport 137,138 -j ACCEPT
    iptables -A INPUT -s $LANSubnet -p tcp -m multiport --dport 139,445 -j ACCEPT
    iptables -A INPUT -s $LANSubnet -p udp -m multiport --dport 137,138 -j ACCEPT

    #Out Rule
    echo "Allowing file sharing traffic out on local network..."
    iptables -A OUTPUT -d $LANSubnet -p tcp -m multiport --sport 139,445 -j ACCEPT
    iptables -A OUTPUT -d $LANSubnet -p udp -m multiport --sport 137,138 -j ACCEPT
    iptables -A OUTPUT -d $LANSubnet -p tcp -m multiport --dport 139,445 -j ACCEPT
    iptables -A OUTPUT -d $LANSubnet -p udp -m multiport --dport 137,138 -j ACCEPT
    }
    Notice how my rules are locked to my local network. (via a variable)
    I can't advise you strongly enough about to NOT share your pc, wide open, on the internet.
    (I think that's what you are saying. (?))

    Technically you could open these ports on your firewall and access your pc via your WAN IP but you really shouldn't.

    A better alternative is to connect to your home network via vpn an then access your shares as if they were local.
    Don't try this until after you really get the hang of samba and it's settings.

    Config file should be at /etc/samba/smb.conf
    other resources at https://www.samba.org/

    Good luck.

  3. #3
    Thanks Gumby I am at least partly familiar with smb and its services. I do also know about opening ports and things of that nature. So both of the computers that I am talking about are in my work environment. One of them is on a private network on a 10.180 and the other is on our 167 network. I do not want all of the computers to be able to access my kali system just my windows system that I use at work. There are tools that I find easier to use from inside Linux most of the tools actually, but most of the work environment is windows based. I am not sure if it is relevant or not, but currently it is a Novell network although I think that should not affect to much. I am not going to turn off the firewall as that is a bad practice and have no interest in opening the system up to the internet. I just want to be able to create a smb share between my Kali system and my windows system both of which are at work. I have been able to do this at home within VMware, but have been unsuccessful doing it with 2 physical machines.

    Where might I have to modify that script to get it to access a local machine rather than the whole network?

Similar Threads

  1. Replies: 0
    Last Post: 2013-06-23, 03:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •