When attempting to launch smbclient via the Backtrack menu in Backtrack Linux version 5 release 3 you will receive an error stating there is no such file or directory. It appears some of the paths have changed between Backtrack Linux releases and the menu item for smbclient was not updated. I personally prefer smbclient from the command line however if you like the smbclient.py python script then fixing it is easy as noted in the details below.
The Backtrack smbclient menu item is located under Backtrack > Information Gathering > Network Analysis > SMB Analysis > smbclient. This will launch a python script that provides built out commands that may be easier for some to remember than the actual switches themselves.
Error Launching smbclient From Backtrack Information Gathering Menu:
Backtrack smbclient Menu Item Error Text: sh: line 0: cd: /pentest/python/impacket-examples/: No such file or directory
To resolve this error you just need to update the backtrack-smbclient.desktop file located in the /usr/share/applications directory. There is one minor change to the path of smbclient.py which is changing the second directory from python to libs as shown in the below example outputs.
Original backtrack-smbclient.desktop Menu File:
- [Desktop Entry]
- Exec=sh -c "cd /pentest/python/impacket-examples/ && python smbclient.py;sudo -s"
Updated backtrack-smbclient.desktop File:
- [Desktop Entry]
- Exec=sh -c "cd /pentest/libs/impacket-examples/ && python smbclient.py;sudo -s"
So once you have updated the backtrack-smbclient.desktop file to include the correct path to smbclient.py you should see the below when launching smbclient from the SMB Analysis sub menu.
Launch smbclient.py From Backtrack Menu:
The interface provides commands to analyze SMB shares on a network as shown in the below smbclient.py help menu.
smbclient.py Help Menu In Backtrack Linux:
I will be expanding on using smbclient in Backtrack in a future article so click on the smbclient tag below to view that as well. Also it should be noted that for me it is easier to use smbclient from the command line without using the smbclient.py python file but you should test both to see which one you like better.