View Issue Details

IDProjectCategoryView StatusLast Update
0003288Kali LinuxKali Package Bugpublic2016-05-13 13:24
Reporterg0tmi1k Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
Summary0003288: Weevely ~ ImportError: No module named sockshandler
Description

Name: Weevely
Version: 3.2.0-0kali3
Kali Version: Linux kali 4.4.0-kali1-amd64 0000001 SMP Debian 4.4.6-1kali1 (2016-03-18) x86_64 GNU/Linux
Type: Installed, VM (VMware)
Issue:

root@kali:~# weevely http://<REMOVED>/test.php password123 whoami
Traceback (most recent call last):
File "./weevely.py", line 98, in <module>
main(arguments)
File "./weevely.py", line 48, in main
modules.load_modules(session)
File "/usr/share/weevely/core/modules.py", line 24, in load_modules
(module_group, module_name), fromlist=["*"]
File "/usr/share/weevely/modules/shell/php.py", line 4, in <module>
from core.channels.channel import Channel
File "/usr/share/weevely/core/channels/channel.py", line 8, in <module>
import sockshandler
ImportError: No module named sockshandler
root@kali:~#

Forum Posting: https://forums.kali.org/showthread.php?27168-Kali-2-0-pysocks-issue-not-backward-compatible-(weevely-broken

Solution: https://pypi.python.org/pypi/PySocks/ - needs to be added to the repo.

Additional Information

You need to put in all arguments for the error to trigger.

root@kali:~# weevely

[+] weevely 3.2.0
[!] Error: too few arguments

[+] Run terminal to the target
weevely <URL> <password> [cmd]

[+] Load session file
weevely session <path> [cmd]

[+] Generate backdoor agent
weevely generate <password> <path>

root@kali:~#
root@kali:~# weevely <REMOVED>/test.php password123 whoami
[!][weevely] Exiting: URL error format 'http(s)://host/agent.php' is expected
root@kali:~#

Activities

sbrun

sbrun

2016-05-13 13:15

manager   ~0005244

What is the version of your installed package python-socks?

With the latest version 1.5.6-1 I don't have the issue (but with previous versions of python-socks 1.5.0* weevely failed)

g0tmi1k

g0tmi1k

2016-05-13 13:23

administrator   ~0005245

Ah yes!
I can confirm this was the case & solution.
Thanks @sbrun

[root:~]# weevely http://localhost/test.php g0tmi1k id
Traceback (most recent call last):
File "./weevely.py", line 98, in <module>
main(arguments)
File "./weevely.py", line 48, in main
modules.load_modules(session)
File "/usr/share/weevely/core/modules.py", line 24, in load_modules
(module_group, module_name), fromlist=["*"]
File "/usr/share/weevely/modules/shell/php.py", line 4, in <module>
from core.channels.channel import Channel
File "/usr/share/weevely/core/channels/channel.py", line 8, in <module>
import sockshandler
ImportError: No module named sockshandler
[root:~]# dpkg -l | grep python-socks
ii python-socks 1.5.0+dfsg-4 all Python 2 SOCKS client module
[root:~]#

[root:~]# apt-get update && apt-get install python-socks
Get:1 http://http.kali.org/kali kali-rolling InRelease [24.6 kB]
Get:2 http://http.kali.org/kali kali-rolling/main Sources [10.3 MB]
Get:3 http://http.kali.org/kali kali-rolling/contrib Sources [63.5 kB]
Get:4 http://http.kali.org/kali kali-rolling/non-free Sources [121 kB]
Get:5 http://http.kali.org/kali kali-rolling/main amd64 Packages [13.8 MB]
Get:6 http://http.kali.org/kali kali-rolling/main i386 Packages [13.7 MB]
Get:7 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb) [28.8 MB]
Get:8 http://http.kali.org/kali kali-rolling/main i386 Contents (deb) [28.8 MB]
Get:9 http://http.kali.org/kali kali-rolling/non-free amd64 Packages [147 kB]
Get:10 http://http.kali.org/kali kali-rolling/non-free i386 Packages [133 kB]
Get:11 http://http.kali.org/kali kali-rolling/non-free amd64 Contents (deb) [808 kB]
Get:12 http://http.kali.org/kali kali-rolling/non-free i386 Contents (deb) [756 kB]
Get:13 http://http.kali.org/kali kali-rolling/contrib amd64 Packages [93.9 kB]
Get:14 http://http.kali.org/kali kali-rolling/contrib i386 Packages [89.7 kB]
Get:15 http://http.kali.org/kali kali-rolling/contrib amd64 Contents (deb) [87.9 kB]
Get:16 http://http.kali.org/kali kali-rolling/contrib i386 Contents (deb) [85.4 kB]
Fetched 97.8 MB in 2min 15s (723 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
python-socks
1 upgraded, 0 newly installed, 0 to remove and 707 not upgraded.
Need to get 16.5 kB of archives.
After this operation, 12.3 kB of additional disk space will be used.
Get:1 http://http.kali.org/kali kali-rolling/main amd64 python-socks all 1.5.6-1 [16.5 kB]
Fetched 16.5 kB in 0s (72.3 kB/s)
Reading changelogs... Done
(Reading database ... 383051 files and directories currently installed.)
Preparing to unpack .../python-socks_1.5.6-1_all.deb ...
Unpacking python-socks (1.5.6-1) over (1.5.0+dfsg-4) ...
Setting up python-socks (1.5.6-1) ...
[root:~]#
[root:~]# weevely http://localhost/test.php g0tmi1k id
[root:~]#

Issue History

Date Modified Username Field Change
2016-05-12 12:29 g0tmi1k New Issue
2016-05-13 13:15 sbrun Note Added: 0005244
2016-05-13 13:15 sbrun Status new => feedback
2016-05-13 13:23 g0tmi1k Note Added: 0005245
2016-05-13 13:23 g0tmi1k Status feedback => new
2016-05-13 13:24 g0tmi1k Status new => resolved
2016-05-13 13:24 g0tmi1k Resolution open => no change required