Add script initialization to executable file.
Edu4rdSHL opened this issue · comments
Please, add #!/usr/bin/bash
to the executable file placed in /usr/bin/whatweb, if you try to execute it from python usiing subprocess.call it gives a OSError.
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/shl/Github/webhackshl/modules/fingerwebmod.py", line 39, in whatw call(["whatweb","-v", web]) File "/usr/lib/python3.6/subprocess.py", line 267, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.6/subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: 'whatweb'
It's solved adding the line in the script top and also is a good programming technique.
The executable file is not a shell script in a default WhatWeb installation.
Please tell me what OS you are using and what package manager was used to install WhatWeb.
The first line of the whatweb executable should be:
#!/usr/bin/env ruby
@urbanadventurer it's a specific distribution, i think. I'm using ArchLinux with blackarch repos. You're free to close it.
As @urbanadventurer suggests, WhatWeb already has a shebang line in the executable script.
Here's the relevant build script, which creates a shell script wrapper for WhatWeb. Looks like it was fixed on May 2.
If the patch on May 2 didn't fix the issue, then this will need to be resolved by whoever is managing the BlackArch WhatWeb package.
Closing this issue.
It create a /usr/bin/whatweb file but it doesnt start with #!/usr/bin/env bash or #!/usr/bin/bash, because it python fails.
Reported to BlackArch as per above.
Allegedly this has now been fixed in BlackArch repos.