from bluetooth import * def rfcommCon(addr, port): sock = BluetoothSocket(RFCOMM) try: sock.connect((addr, port)) print '[+] RFCOMM Port ' + str(port) + ' open' sock.close() except Exception, e: print '[-] RFCOMM Port ' + str(port) + ' closed' for port in range(1, 50): rfcommCon('09:94:94:20:61:48', port)