Jump to content

"OSError: [Errno 2] No such file or directory" when running Wifite v2 (r87)


doctorized

Recommended Posts

I installed Wifite and every time I run it, I see the following. What is wrong?

[+] scanning for wireless devices...
Traceback (most recent call last):
  File "/usr/bin/wifite", line 3462, in <module>
    engine.Start()
  File "/usr/bin/wifite", line 1313, in Start
    self.RUN_CONFIG.THIS_MAC = get_mac_address(iface)  # Store current MAC address
  File "/usr/bin/wifite", line 1864, in get_mac_address
    proc = Popen(['ifconfig', iface], stdout=PIPE, stderr=DN)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

 

Link to comment
Share on other sites

As it sounds; does that file or directory exist?

Do you have Python installed? Is it version 2.7?

If not, install and make sure "/usr/lib/python2.7/subprocess.py" exists.

If you do have it installed, check what the path is. It might not be python2.7, in which case you'll have to amend the script to point to the correct directory.

 

Link to comment
Share on other sites

18 minutes ago, haze1434 said:

As it sounds; does that file or directory exist?

Do you have Python installed? Is it version 2.7?

If not, install and make sure "/usr/lib/python2.7/subprocess.py" exists.

If you do have it installed, check what the path is. It might not be python2.7, in which case you'll have to amend the script to point to the correct directory.

 

Specific lines in both files are mentioned so the files are there. I checked it. I do have python 2.7 but also 3.5. Should I point it to 3.5? What script should I run?

Link to comment
Share on other sites

47 minutes ago, doctorized said:

It is said in my first post.

Line 390 says "errread, errwrite)" and line 1024 says "raise child_exception".

Ah, those are references to other parts of that Python script.

Can you post the lines leading up to 'errread, errwrite', and also see if there is a function called 'child_exception' and post it?

Edited by haze1434
Link to comment
Share on other sites

7 minutes ago, haze1434 said:

Ah, those are references to other parts of that Python script.

Can you post the lines leading up to 'errread, errwrite', and also see if there is a function called 'child_exception' and post it?

For better results, I uploaded the files to dropbox to see them entrirely.

So:

Subprocess.py

wifite

In my first post you can find the lines and phrases that seem to cause the problem.

Link to comment
Share on other sites

Just a thought, try using Kali? Can be installed when using "apt install kali-linux-wireless" which has all the wifi radio tools you'll need, wifite, pixie, etc.

Link to comment
Share on other sites

On 4/8/2017 at 7:33 PM, digip said:

Just a thought, try using Kali? Can be installed when using "apt install kali-linux-wireless" which has all the wifi radio tools you'll need, wifite, pixie, etc.

I use Kali, 2017.1 x86 light. Unfortunately, I can't run this command right now as I am on vacation and I can't download all the data needed. My mobile ISP gives me limited amount of MBs.

Link to comment
Share on other sites

You can apt-get install the individual tool vs the whole wifi tool chain, as wifite itsself should be fairly small install. Also might need reaver and pixie, but those 3 tools together work well. I'm sure dependencies will need to be installed, but that should happen automatically for you when installing them in Kali.

Link to comment
Share on other sites

1 hour ago, digip said:

You can apt-get install the individual tool vs the whole wifi tool chain, as wifite itsself should be fairly small install. Also might need reaver and pixie, but those 3 tools together work well. I'm sure dependencies will need to be installed, but that should happen automatically for you when installing them in Kali.

I have installed Wifite and all the depedencies it mentioned, such as reaver, cowpatty etc. I didn't install pixie. I will give it a try. I think that something else is causing the problem. If I find a free wifi I will install all of them to be sure.

Link to comment
Share on other sites

I ran "apt-get install kali-linux-wireless". It downloaded several packages but some of them couldn't be found, like opensc_0.17.0~rc1-1_i386.deb. In every case "404 not found" error occurred. In the end, "E: aborting install." referred. Are all other downloaded packages installed or I should run any command to install them?

Link to comment
Share on other sites

Not sure. Might need to do apt-get clean and/or fix if anything failed to install properly, but possibly couldn't find it is legit 404. Might have got disconnected when doing so. Question, is this a VM? Are you on intel 32-bit, or AMD 64bit?

 

If i search, these are what google finds, not what is in your pasted text:

http://archive-4.kali.org/kali/pool/main/o/opensc/

http://http.kali.org/pool/main/o/opensc/

Edited by digip
Link to comment
Share on other sites

9 hours ago, digip said:

Not sure. Might need to do apt-get clean and/or fix if anything failed to install properly, but possibly couldn't find it is legit 404. Might have got disconnected when doing so. Question, is this a VM? Are you on intel 32-bit, or AMD 64bit?

 

If i search, these are what google finds, not what is in your pasted text:

http://archive-4.kali.org/kali/pool/main/o/opensc/

http://http.kali.org/pool/main/o/opensc/

It not a VM. It is a clean installation of Kali 2017.1 light x86. My laptop has a Core Duo cpu, it supports x64 instructions, even Kali suggested installing x64 version during installation, but I always prefer x86 versions as it has only 2GB of RAM.

There was no disconnection when downloading packages. All packages where downloaded except some of them like the one I mention above. I did my own checks and I saw that these packages do not exist. I do not know where did Kali find them.

EDIT:

see in the attached file what did I see this morning after running ""apt-get install kali-linux-wireless --fix-missing". Downloaded packages where not installed. They are just waiting to be installed. The point is how.

1. kali.txt

Edited by doctorized
Added txt file
Link to comment
Share on other sites

yeah, looks like something is wrong with the repo names, the files are definitely there, just not the naming convention in your text file. Only thing I can say is apt-get update again(first) upgrade, and if you feel lucky, dist-upgrade, then try reinstalling them. Something seems like it has the wrong URL's somewhere. you can see the files there if you look manually - http://repo.kali.org/kali/pool/main/o/opensc/ just the naming convention is a bit diff than what I see in your txt file. If this is a true bug, then it needs to be posted on bugs.kali.org if there are some bad entries somewhere.

 

Make sure your sources are not on the dev repo, just to be safe:

https://docs.kali.org/general-use/kali-linux-sources-list-repositories

And all kali mirrors should now accept https as well(although not documented there) see: https://www.kali.org/news/kali-linux-repository-https-support/ for setting it up with https

You should only need:

deb https://http.kali.org/kali kali-rolling main contrib non-free

in your sources list.

Edited by digip
Link to comment
Share on other sites

1 hour ago, digip said:

yeah, looks like something is wrong with the repo names, the files are definitely there, just not the naming convention in your text file. Only thing I can say is apt-get update again(first) upgrade, and if you feel lucky, dist-upgrade, then try reinstalling them. Something seems like it has the wrong URL's somewhere. you can see the files there if you look manually - http://repo.kali.org/kali/pool/main/o/opensc/ just the naming convention is a bit diff than what I see in your txt file. If this is a true bug, then it needs to be posted on bugs.kali.org if there are some bad entries somewhere.

 

Make sure your sources are not on the dev repo, just to be safe:

https://docs.kali.org/general-use/kali-linux-sources-list-repositories

And all kali mirrors should now accept https as well(although not documented there) see: https://www.kali.org/news/kali-linux-repository-https-support/ for setting it up with https

You should only need:


deb https://http.kali.org/kali kali-rolling main contrib non-free

in your sources list.

Yes, the only line is sources.list is the one you mention. I ran update, nothing updated. I ran upgrade and many packages were upgraded. I ran apt-get install kali-linux-wireless --fix-missing and now the command ran with no errors. All packages were installed. I rebooted but my main problem still exists. Wifite refers the same problems. Nothing changed. What should I do anyway?

Link to comment
Share on other sites

4 hours ago, doctorized said:

Yes, the only line is sources.list is the one you mention. I ran update, nothing updated. I ran upgrade and many packages were upgraded. I ran apt-get install kali-linux-wireless --fix-missing and now the command ran with no errors. All packages were installed. I rebooted but my main problem still exists. Wifite refers the same problems. Nothing changed. What should I do anyway?

So you mentioned this is a VM. Are you using a USB wifi dongle, and is it plugged in, and connected to the VM before you start wifite?

Try the following, airmon-ng start wlan0, then try wifite. If you have no connected wifi card, may be why it's throwing the error, which looks like it fails when it tries to get the wifi cards locla MAC address.

Link to comment
Share on other sites

18 hours ago, digip said:

So you mentioned this is a VM. Are you using a USB wifi dongle, and is it plugged in, and connected to the VM before you start wifite?

Try the following, airmon-ng start wlan0, then try wifite. If you have no connected wifi card, may be why it's throwing the error, which looks like it fails when it tries to get the wifi cards locla MAC address.

I never told that it is a VM. It is a clean installation. I have a HP 620 laptop with a 320GB hdd. The disk has 5 partitions. One 450MB, the hidden windows 7/8/8.1 partition, one 128GB for windows, another one 128GB for files etc, a swap linux partition and a linux ext4 partition. The last one has Kali linux. I do not have any USB wifi device. I only have the built-in laptop's wifi card which works fine when connecting to wifi networks. Kali is using it just fine so there is no problem with it. I started feeling that I have to deal with an incompatibility issue. I will try Kali 2016.x as soon as I return back from vacation.

Link to comment
Share on other sites

2 hours ago, doctorized said:

I never told that it is a VM. It is a clean installation. I have a HP 620 laptop with a 320GB hdd. The disk has 5 partitions. One 450MB, the hidden windows 7/8/8.1 partition, one 128GB for windows, another one 128GB for files etc, a swap linux partition and a linux ext4 partition. The last one has Kali linux. I do not have any USB wifi device. I only have the built-in laptop's wifi card which works fine when connecting to wifi networks. Kali is using it just fine so there is no problem with it. I started feeling that I have to deal with an incompatibility issue. I will try Kali 2016.x as soon as I return back from vacation.

That is my bad, was thinking of a different thread, been commenting on a few wifi related posts lately. I see I had already asked you and you said not a VM, so that is my confusion.

That said, the internal wifi card might work fine for connecting, which is in managed mode, but does not mean it is capable of injection and monitor mode. You need to determine if this is the case, and versions of Kali shouldn't make a difference in this regard. Newer versions of Kali should have better driver support vs older ones as they add more drivers.

Not all cards can do all modes, some are only connection capable in Linux via managed mode(default). Bring up the card with "airmon-ng start wlan0" and if it can't, that is your first issue to work around, which would need a different wifi card. iwconfig will show the new interface in monitor mode if it worked, then start wifite. If airmon-ng can't start the card, you need to get a compatible USB wifi card like the Atheros and TP-Link USB cards. Also, some other programs can cause issues, before brining up the card, run "airmon-ng check kill", then "airmon-ng check" to make sure nothing is listed.

If you get a TP-LINK TL-WN722N card, make sure it's a revision v1, anything later will not work. If you get a AWUS036NEH you might have a hit or miss with the card, seems there are some variations out there. The Alfa AWUS036NH is one of the more reliable ones(at least by users of the card). Some of these work better on native hardware, and don't work well at all in a VM, but you shouldn't have that issue since you're on a native install.

Link to comment
Share on other sites

1 hour ago, digip said:

That is my bad, was thinking of a different thread, been commenting on a few wifi related posts lately. I see I had already asked you and you said not a VM, so that is my confusion.

That said, the internal wifi card might work fine for connecting, which is in managed mode, but does not mean it is capable of injection and monitor mode. You need to determine if this is the case, and versions of Kali shouldn't make a difference in this regard. Newer versions of Kali should have better driver support vs older ones as they add more drivers.

Not all cards can do all modes, some are only connection capable in Linux via managed mode(default). Bring up the card with "airmon-ng start wlan0" and if it can't, that is your first issue to work around, which would need a different wifi card. iwconfig will show the new interface in monitor mode if it worked, then start wifite. If airmon-ng can't start the card, you need to get a compatible USB wifi card like the Atheros and TP-Link USB cards. Also, some other programs can cause issues, before brining up the card, run "airmon-ng check kill", then "airmon-ng check" to make sure nothing is listed.

If you get a TP-LINK TL-WN722N card, make sure it's a revision v1, anything later will not work. If you get a AWUS036NEH you might have a hit or miss with the card, seems there are some variations out there. The Alfa AWUS036NH is one of the more reliable ones(at least by users of the card). Some of these work better on native hardware, and don't work well at all in a VM, but you shouldn't have that issue since you're on a native install.

I run "airmon-ng start wlan0" and I get this:

Found 2 processes that could cause trouble.
If airodump-ng, aireplay-ng or airtun-ng stops working after
a short period of time, you may want to run 'airmon-ng check kill'

  PID Name
  446 NetworkManager
  482 wpa_supplicant

PHY    Interface    Driver        Chipset

phy0    wlan0        rt2800pci    Ralink corp. RT3090 Wireless 802.11n 1T/1R PCIe

        (mac80211 monitor mode vif enabled for [phy0]wlan0 on [phy0]wlan0mon)
        (mac80211 station mode vif disabled for [phy0]wlan0)

Then, I run "airmon-ng check kill" and I get this:

Killing these processes:

  PID Name
  482 wpa_supplicant
 1019 dhclient

Running "airmon-ng check" gives nothing.

Running "airmon start wlan0" again, gives:
 

PHY    Interface    Driver        Chipset

phy0    wlan0mon    rt2800pci    Ralink corp. RT3090 Wireless 802.11n 1T/1R PCIe

Running wifite after that, same errors appeared. Also, I lost, internet connection as NetworkManager is not running anymore... I had to restart Kali to be able to post.

Now, I noticed something, "usefull" I think. After rebooting, Kali connected with my android phone's wifi (tethering, no cable, just tethering). I ran wifite in command line and now the second line after "[+] scanning for wireless devices..." is "[+] enabling monitor mode on wlan0... done" and after that the same errors as in my first post follow. After that, I lost connection with my phone and I had to use the USB cable enabling tethering via USB to be able to have internet access again. I cannot connect to my phone's wifi anymore (unless I restart Kali again). Also, now running wifite again is not reporting the new second line about monitor mode. I hope this helps...

Edited by doctorized
Link to comment
Share on other sites

Yeah, you can't be online with the same card when set to monitor mode unless it has two radios/antennas/mimo capabilities, so you can do both wlan0 and wlan0mon at the same time, or get an extra card. Alternative, use a wired connection with eth0 when using monitor mode on wlan0mon.

Once you're done with wifite or any other wifi tools(try some others like airodump-ng to test the card and aireplay-ng) you can then put the card back in managed mode with "airmon-ng stop wlan0mon" and then "ifconfig wlan0 up". Once back up, you can try "dhclient wlan0" and see if you can reconnect, or restart the machine if you can't figure out how to get back on your router. Installing wicd will also make connections with wifi easy-peezy though and has a GUI interface to manage and scan for other AP's and can save settings for each AP you have.

Link to comment
Share on other sites

50 minutes ago, digip said:

Yeah, you can't be online with the same card when set to monitor mode unless it has two radios/antennas/mimo capabilities, so you can do both wlan0 and wlan0mon at the same time, or get an extra card. Alternative, use a wired connection with eth0 when using monitor mode on wlan0mon.

Once you're done with wifite or any other wifi tools(try some others like airodump-ng to test the card and aireplay-ng) you can then put the card back in managed mode with "airmon-ng stop wlan0mon" and then "ifconfig wlan0 up". Once back up, you can try "dhclient wlan0" and see if you can reconnect, or restart the machine if you can't figure out how to get back on your router. Installing wicd will also make connections with wifi easy-peezy though and has a GUI interface to manage and scan for other AP's and can save settings for each AP you have.

I see... at least we know that the card supports monitor mode. Now, what should I do with wifite?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...