Problem description
Environment: Linux+ Kali2021.3 + Anaconda3 + PyCharm
Compilation environment: Python3.7
Procedure: 1. Run conda to install svn ==1.0. 1.The reason is that the bag was not found.
'''
(base) ┌──(root💀kali)-[~]
└─# conda install svn==1.0.1 1 ⨯
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
Current channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
'''
**2.**Run the conda install SVN command. The SVN is successfully installed, but cannot be
imported.
**3.**Run python3 download_deps.py --accept --force,and error reported because SVN is not available.
**4.**Then try to use pip list| grep svn, found no.But using conda list svn does exist.So then pip install
svn is used.The svn is installed successfully.Again using the pip list| grep svn,and found it exists.Restart PyCharm and find that the import was successful.
**5.**However, when python3 dow nload_ deps.py --accept --force is run again, svn is still not available.In the same time,there is an another error:urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
'''
(malware_rl3) ┌──(root💀kali)-[~/code_program/malware_rl-master]
└─# python3 download_deps.py --accept --force
[*] Attempting to Download ransomwares/ Samples & Place in Temp Directory
[+] Success - Samples Downloaded Placed into Temp Directory
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - ransomwares/ has been removed
[*] Attempting to Download rogues/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - rogues/ has been removed
[*] Attempting to Download trojans/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - trojans/ has been removed
[*] Attempting to Download jokes/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[*] Attempting downloading Ember Model
Traceback (most recent call last):
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1392, in connect
server_hostname=server_hostname)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/ssl.py", line 412, in wrap_socket
session=session
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/ssl.py", line 850, in _create
self.do_handshake()
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/ssl.py", line 1108, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "download_deps.py", line 262, in
storage_directory=UTIL_PATH,
File "download_deps.py", line 61, in download_specific_github_file
retrive_url(source_file_url, filename)
File "download_deps.py", line 49, in retrive_url
urllib.request.urlretrieve(source_file_url, filename)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>
(malware_rl3) ┌──(root💀kali)-[~/code_program/malware_rl-master]
└─# python3 download_deps.py --accept --force 1 ⨯
[*] Attempting to Download ransomwares/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - ransomwares/ has been removed
[*] Attempting to Download rogues/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[*] Attempting to Download trojans/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - trojans/ has been removed
[*] Attempting to Download jokes/ Samples & Place in Temp Directory
Subversion not found. In order to download the sample malware,
Subversion (svn) needs to be installed. This provides a method of
downloading only the target folder rather than the whole repo.
[*] Attempting to Unzip Samples
[+] Success - Samples Unzipped
[*] Attempting to Rename Files to SHA256 Hash
[+] Success - Samples renamed to their SHA256 hash
[*] Attempting Clean Up
[+] Cleanup Complete - jokes/ has been removed
[*] Attempting downloading Ember Model
[+] Success - Ember Model downloaded
[+] Success - Ember Model Downloaded
[*] Attempting to generate example benign strings output
Traceback (most recent call last):
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 1384, in connect
super().connect()
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/http/client.py", line 928, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "download_deps.py", line 268, in
output_dir=MODULE_PATH,
File "download_deps.py", line 179, in generate_example_benign_strings_output
retrive_url(benign_repo, output_zip)
File "download_deps.py", line 49, in retrive_url
urllib.request.urlretrieve(source_file_url, filename)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/root/anaconda3/envs/malware_rl3/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
**6.**I also tried to download and unzip samples
(Ember, Malconv and SOREL-20M ) by myself,but it sames can’t work.And I can’t understand what ‘s the strings and where it is.
'''
**7.**Try to use other virtual environments--Python3.8,delete and recreate the virtual environments--python3.7 but there are still problems. 1. The Tensorflow version in requirements.txt is not compatible with Keras. (2) urllib3>=1.26.5, there is dependency conflict. And so on and so forth.
Summary:
It can be summarized as (1) SVN problem.I also tried to download and unzip samples
(Ember, Malconv and SOREL-20M ) by myself,but it sames can’t work. (2) Requirement. TXT cannot completely install the package. Packages that don't fit are often compounded with ">=" ,which don't require a specific version of the package. At the same time, there is an incompatibility between Tensorflow2.8.0 and Keras2.4.3.(3)I have used the VPN all the time.I am not sure if it caused some problems.
I would like to ask that do you have any solutions to these problems and your specific environment configuration, such as whether GPU is used? I've been trying for two weeks but I haven't been able to solve it.
Thanks a lot.