lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.07k stars 283 forks source link

**FIXED-no wifi interface detected (interface to use for acces point not detected) in many linux distributions for version 4.0.3.... but everything works fine in version 3.6.8 ****EDIT; after testing, i found that version 4.0.3 will work on all tested distros if you run it from command line (sudo wihotspot), it doesnt work on some distros if you run it completely from gui (click on system tools -> Wifi hotspot)---version 3.6.8 works 100% if you run it completely from gui (click on system tools -> Wifi hotspot) #155

Closed LINUX-LIVING closed 3 years ago

LINUX-LIVING commented 3 years ago

Describe the bug

no wifi interfaces are detected (interface to use for acces point not detected) in many linux distributions for version 4.0.3.... however everything works fine in version 3.6.8 (this bug does not happen in linux wifi hotspot version 3.6.8)

:: I noticed this happening in my personal workstations, but i just kept using version 3.6.8.... but some teachers at university were complaining about version 4.0.3 so i decided to file a bug report :::::

debian 10.9 mate desktop enviroment ____NOt working with 4.0.3 ____YES works with 3.6.8 debian 10.6 mate desktop enviroment ____NOt working with 4.0.3 ____YES works with 3.6.8

ubuntu 20.4.2 default desktop enviroment _____YES working with 4.0.3 ____YES works with 3.6.8 linux mint 20.1 mate desktop enviroment ____YES working with 4.0.3 ____YES works with 3.6.8

parrot os 4.11 mate desktop enviroment ____NOt working with 4.0.3 ____YES works with 3.6.8 parrot os 4.10 mate desktop enviroment __NOt working with 4.0.3 ____YES works with 3.6.8

kali linux 2021.1 xfce desktop enviroment _NOt working with 4.0.3 __YES works with 3.6.8 kali linux 2021.1 gnome desktop enviroment _NOt working with 4.0.3 ___YES works with 3.6.8

To Reproduce

Steps to reproduce the behavior: install all linux wifi hotspot dependencies and install linux wifi hotspot 4.0.3 from source / building from source.... execute it from gui (click on system tools -> Wifi hotspot) and it doesnt detect / wont show any wifi interfaces / interfaces for acces point ........ but everything works fine on version 3.6.8

::installed packages (as instructed by linux wifi hotspot):: -bash -util-linux (for getopt) -procps or procps-ng -hostapd

then i installed linux wifi hotspot

git clone https://github.com/lakinduakash/linux-wifi-hotspot cd linux-wifi-hotspot

build binaries

make

install

sudo make install

proof

:: everything was tested in physical hardware... then everything was re-tested in virtual machine... both gave same results...

lakinduakash commented 3 years ago

can you get output of iw dev | awk '$1=="Interface"{print $2}' ?

Also, run wihotspot from the command line and put the output when starting the GUI

LINUX-LIVING commented 3 years ago

i will reply sometime within the next 24 hours with the results of iw dev | awk '$1=="Interface"{print $2}' and the output of runing wihotspot from terminal for each distro and for both versions of linux wifi hotspot (4.0.3 and 3.6.8), i have to redeploy each machine and do the tests... on physical hardware, then on virtual machine (I will test debian 10.9 , ubuntu 20.4.2, linux mint 20.01, parrot os 4.11.1, kali linux 2021.1 xfce, kali linux 2021.1 gnome)

LINUX-LIVING commented 3 years ago

REPORT OF FINDINGS FOR LINUX WIFI HOTSPOT 4.0.3 VS 3.6.8

summary: linux wifi hotspot 4.0.3 works 100% on all the tested debian based distros if you execute it as sudo from the command line .... (sudo wihotspot)

.. if you try to run linux wifi hotspot 4.0.3 completely from the gui (click on system tools -> Wifi hotspot) it does not prompt you to execute it as sudo (like in version 3.6.8) so it does not detect available wireless interfaces for acces point... so you need to run it as sudo from the command line for version 4.0.3 (sudo wihotspot).. suggestion; add prompt to run as sudo like in version 3.6.8

***note: running sudo wihotspot from command line is not necessary for ubuntu 20.04.2 or for linux mint 20.1 ....version 4.0.3 works completely from the gui (click on system tools -> Wifi hotspot)

:DETAILED REPORT for debian 10.9 DETAILED REPORT for debian 10.9:

---debian 10.9 mate desktop enviroment--

kernel information of debian 10.9 (uname -a)

$ uname -a $ Linux debian 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

result of iw dev | awk '$1=="Interface"{print $2}' for debian 10.9

$ iw dev | awk '$1=="Interface"{print $2}' bash: iw: command not found

result of sudo iw dev | awk '$1=="Interface"{print $2}' for debian 10.9 (notice how you must run as sudo for it to work)

$ sudo iw dev | awk '$1=="Interface"{print $2}' wlp6s0 wlxd03745a9f66

:::CONCLUSION for iw dev | awk '$1=="Interface"{print $2}' :::

iw dev | awk '$1=="Interface"{print $2}' must be run as sudo (sudo iw dev | awk '$1=="Interface"{print $2}') in order to detect wireless interfaces

result of wihotspot for debian 10.9

$ wihotspot sh: 1: iw: not found NO WIFI INTERFACES DETECTED IN LINUX WIFI HOTSPOT 4.0.3

result of sudo wihotspot for debian 10.9 (notice how you must run as sudo for it to work)

$ sudo wihotspot 100% WORKING,, EVERYTHING WORKS

::CONCLUSION for wihotspot :::

must be run as sudo wihotspot from command line..... does not work from gui ((click on system tools -> Wifi hotspot)) because it does not run it as sudo / prompt to run as sudo...

screenshot evidence for of testing linux wifi hotspot 4.0.3 on debian 10.9

debian1 debian2

screenshot of linux wifi hotspot 4.0.3 not working when executed completely from gui ((click on system tools -> Wifi hotspot) debian403gui

LINUX-LIVING commented 3 years ago

report for ubuntu 20.04.2

kernel information (uname -a)

$ uname -a Linux ubuntu20042-pc 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

reult of iw dev | awk '$1=="Interface"{print $2}'

$ iw dev | awk '$1=="Interface"{print $2}' wlan0 wlxd037454a9f66

result of running wihotspot on command line

$ wihotspot works 100% no need to run as sudo

works 100% on ubuntu 20.04.2 gnome desktop enviroment(default enviroment) if you run it completely from gui (click on system tools -> Wifi hotspot)

screenshot evidence: ubuntu403-full ubuntu403gui

LINUX-LIVING commented 3 years ago

REPORT FOR linux wifi hotspot 4.0.3 on linux mint 20.1 mate desktop enviroment

same/exactly as with ubuntu 20.04.2 ---100% working, no problems

LINUX-LIVING commented 3 years ago

REPORT for linux wifi hotpot 4.0.3 on PARROT SECURITY OS 4.11 and parrot security os 4.10 and parrot os 4.11.1

result for iw dev | awk '$1=="Interface"{print $2}'

$ iw dev | awk '$1=="Interface"{print $2}' wlan0 wlxd037454a9f66

(it works/detects all wireless interfaces without need of sudo, unlike in debian 10.9)

result of running wihotspot from commandline

$ wihotspot

(100% works no need for sudo, unlike in debian 10.9)

result of running sudo wihotspot from commandline

$ sudo wihotspot

(100% works )

result of running linux wifi hotspot 4.0.3 completely from gui (click on system tools -> Wifi hotspot)

NO-DOESNOT  WORK...     0%    :'(

in order for linux wifi hotspot 4.0.3 to work in parrot os you need to run wihotspot from commandline (does not work completely from gui (click on system tools -> Wifi hotspot) )

screenshot evidence of iw dev | awk '$1=="Interface"{print $2}'

parr403iwresult1

screenshot evidence of runing linux wifi hotspot gui 4.0.3 completely from gui (click on system tools -> Wifi hotspot) NO work 0%

parr403gui

screenshot evidence of running wihotspot from command line 100% works :)

parr403cmd

LINUX-LIVING commented 3 years ago

REPORT for testing with of linux wifi hotspot 4.0.3 with kali linux 2021.1 xfce desktop enviroment and of kali linux 2021.1 gnome desktop enviroment

---same as with parrot os--

doesnt work if executed completely from gui (click on system tools -> Wifi hotspot)

but 100% works if executed from command line ; wihotspot from command line

LINUX-LIVING commented 3 years ago

SUMMARY.... all tests were done on physical hardware, then re-tested on virtual machines..... Same results on both

i suggest to somehow make the gui (click on system tools -> Wifi hotspot) execute the command: sudo wifihotspot in order to fix the issue...

also, it is very common to use many wireless interfaces to create acces point
example: internet interface= wireless device1, access point interface=wireless device 2.... so dont forget this detail

lakinduakash commented 3 years ago

Hi, thank you for the great effort to find that information. I will investigate and each and fix this

lakinduakash commented 3 years ago

This not actually an issue in the application. In order to get the list of interfaces iw command should be installed. $PATH variable should include the path where iw is installed. it's able to be executed iw without root permission. In some of these machines, $PATH variable might incorrect. You can check the location of iw by sudo which iw and export the location returned by that to users $PATH variable.

LINUX-LIVING commented 3 years ago

Hello, thank you for taking the time to look into the issue, I think you are right, this is not an issue with the application, but an issue with some of the distros, it works perfectly in ubuntu and mint; i ran sudo which iw on ubuntu and parrot os and got the same output; $ sudo which iw /usr/sbin/iw

i also ran echo $PATH on both machines and /usr/sbin is in both machines $PATH directory /variable .....

i didnt really do any much testing on many different distros this time,, but i found a fix 100% for parrot os and kali linux.....

i copied iw (from /usr/sbin/iw) to /bin (/bin/iw) and set the permisions to be executed from non root user (didnt test if it needed to have permisions to to be executed from non root user to work or not)... now everything works 100% completely from gui (click on system tools -> Wifi hotspot)...

i then ran many tests to see if copying iw(from /usr/sbin/iw) to /bin (/bin/iw) and set the permisions to be executed from non root user would affect anything and everything is working 100% the same, there was no difference.... so to be clear, iw is now in /usr/sbin/iw and in /bin/iw.... everything works 100% on both kali and in parrot...

so maybe i will just make a personal installation script (or just run the following commands) for linux wifi hotspot v4.0.3 to automate all this specifically for kali linux and/or parrot os (have not tested for debian 10.9/10.6);;;;;

$ git clone https://github.com/lakinduakash/linux-wifi-hotspot $ cd linux-wifi-hotspot

build binaries

$ make

install

$ sudo make install

copy iw from /usr/sbin/ to /bin

$ cp /usr/sbin/iw /bin

set permisions to /usr/sbin/iw to be executed without need of root/sudo (havent tested if this is necessary)

$ chmod +777 /bin/iw

lakinduakash commented 3 years ago

I think the easy way is to modify the $PATH variable for the user. Try changing the path variable in /etc/profile and ~/.bahrc or ~/.zshrc depending on the system shell. eg: export PATH=$PATH:/usr/sbin/