![]() |
|
[Python] SMB Connection - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] SMB Connection (/showthread.php?tid=5570408) |
SMB Connection - ccpik - Mar 9, 2017 Hi, I am trying to code a simple application that asks the user for a username,password & IP range. It then takes those inputs and attempts to connect to each host in the IP range over SMB. I have got the program to prompt a user for a username,password & IP range but I am completely stuck with how to get it to try to connect to the machines. I don't mind paying if someone can help me with this? Any advise would be very welcome... * - Dr_Ciphers - Mar 9, 2017 Hey! What you re looking for could be the pysmb library. You may want to check the relevant documentation here https://pythonhosted.org/pysmb/ Also have a look to the following practical example https://gist.github.com/joselitosn/e74dbc2812c6479d3678 If it works for one IP then it's a matter of repeating the same code for a range of IPs with a loop. * - datguy.dev - Mar 9, 2017 I've never messed with SMB in Python so I though I'd try it out. That pysmb library was a big pain in the ass! It was just not going to authenticate even to shares are accessible to everyone on the network. Maybe you'll have better luck, but the documentation or support sucks. As an alternative, you could use the output of the smbclient in Linux. Where you can use $?, which is the exit status of the program. If successful, your user/pass works, it will be 0. If not, it'll be 1. |