Scanning Network for Windows Shared Folders

I have noticed that there are quite a few requests for a network scanning application to search for Windows shared folders.

I thought this will be an interesting implementation for pysmb (a pure Python implementation of the SMB1 and SMB2 protocol that supports the Windows file sharing functionality) as well as for developers who are learning to use pysmb for their applications.

You will need Python 2.4 and above, and have installed pyasn1 and pysmb. Next, download the ScanNetworkForSMB.py script. Then, run the script with 1 IP address to scan for a single machine, or a start/end IP address pair to scan a range of IP addresses. If the scanned machine has its Windows sharing port (port 137) active, the script will print out its IP address together with the names associated with this machine.

Sample output

$bash> python ScanNetworkForSMB.py 192.168.1.2 192.168.1.256
Beginning scanning 255 IP addresses...

     192.168.1.2 --> CETUS WORKGROUP
   192.168.1.109 --> I7PC WORKGROUP

Query timeout. No replies from 253 IP addresses

Python Mutant Tester 0.1.0 Released

I have just released Python Mutant Tester (PyMuTester) version 0.1.0 to the public. More details can be found at the Python Mutant Tester project page.

PyMuTester is a testing tool to facilitate mutant testing in Python applications. By making small (and syntactically correct) modifications to the application's source code and re-run the unit tests over these mutated source code, we can uncover missed checks and loopholes in the test cases.

Currently, PyMuTester is in alpha stage. It has only 2 mutators: If-Condition Negator and Loop Skipping.

  • The If-Condition negator works by negating the original result of the test clause in the if-statements. So, instead of executing the main body of the if-statement, the mutated code will execute the else body of if-statement, and vice versa.
  • The Loop Skipping mutator inserts a statement at the beginning of the bodies of the for- and while-loop code blocks. The inserted statement will skip the body of the loop code block on alternate iteration.

Future releases of PyMuTester may include support for more mutation algorithms, such as superclass mutation, arithmetric mutatioon and return value mutation. PyMuTester may also support other framework testing such as Django and Twisted. For instance, we can mutate Twisted application to skip reading a few bytes or to write a few more/less bytes. The test suite should arrest these corrupted I/O.