Comments (10)
So my code is a workaround. Not going to do a pull request. Here is how i got it to work.
in def get_port_list
i added
def get_port_list(self, nmap_result_file, rhost):
cool = open(nmap_result_file).read()
....
then changed the bs
variable to:
bs = BeautifulSoup(cool, 'lxml')
from machine_learning_security.
@Pluto0310
I may found out the reason. Looking care of the nmap output xml file, we will see that none all of the <port ...></port>
field include <service>
.
Let's see DeepExploit.py #L922, if some port exclude <service>
, the info_list would not append an element. So we would get the tip of "IndexError: list index out of range"
the solve way is add three lines before here as follow:
else:
info_list.append('unknown')
after modify it, it likes:
for obj_child in port.contents:
if obj_child.name == 'service':
temp_info = ''
if 'product' in obj_child.attrs:
temp_info += obj_child.attrs['product'] + ' '
if 'version' in obj_child.attrs:
temp_info += obj_child.attrs['version'] + ' '
if 'extrainfo' in obj_child.attrs:
temp_info += obj_child.attrs['extrainfo']
if temp_info != '':
info_list.append(temp_info)
else:
info_list.append('unknown')
break
else:
info_list.append('unknown')
# Display getting port information.
self.util.print_message(const.OK, 'Getting {}/{} info: {}'.format(str(port.attrs['portid']),
port.attrs['protocol'],
info_list[idx]))
from machine_learning_security.
Ok I somehow managed to get it working, exploits are successful but no report is generated at the end of it
from machine_learning_security.
From what I see, it seems to be prematurely shutting down. Would love to work on a fix with admin. Thank you!
[*] Start time: 2019/05/05 07:07:48
[*] Port scanning: 192.168.234.2 [Elapsed time: 0 s]
[*] Executing keep_alive..
[*] End time : 2019/05/05 07:07:55
[+] Get port list from nmap_result_192.168.234.2.xml.
[!] No open port.
[!] Shutdown Deep Exploit...
from machine_learning_security.
Hi,
I have the same problem. The result from Metasploit is generated correctly, i can see that the nmap_result_<ip_address>.xml file contains some open ports. But somehow DeepExploit can't seem to locate that file (or it's not downloading that xml file correctly and therefore couldn't find it?). I can see that the demo video starts from nmap had already been performed and skipped the nmap stage entirely.
I tried to manually copy the result xml file to the same directory that ran DeepExploit.py to no avail.
Couldn't this be a known issue and require fixing?
Thank you.
from machine_learning_security.
So my code is a workaround. Not going to do a pull request. Here is how i got it to work.
indef get_port_list
i addeddef get_port_list(self, nmap_result_file, rhost): cool = open(nmap_result_file).read() ....
then changed the
bs
variable to:
bs = BeautifulSoup(cool, 'lxml')
and i got this error
Traceback (most recent call last):
File "DeepExploit.py", line 2230, in
com_port_list, proto_list, info_list = env.get_port_list(nmap_result, env.rhost)
File "DeepExploit.py", line 938, in get_port_list
info_list[idx]))
IndexError: list index out of range
How can i fix this problem
thank you
from machine_learning_security.
Hello I have the same issue and I add change in the code like @seanrclayton said but I get the same error! @seanrclayton can you please share your code from that function how it's look like, I really appreciate thank you!
from machine_learning_security.
@TARI0510 that works for me, thanks!
from machine_learning_security.
@TARI0510 that works for me, thanks!
It's great to help you~
from machine_learning_security.
from machine_learning_security.
Related Issues (20)
- DeepExploit issues HOT 1
- pip3 install tensorflow error & auto killed HOT 1
- Could not find a version that satisfies the requirement tensorflow>=1.8.0 HOT 1
- python3 DeepExploit.py -h & SyntaxError: invalid syntax
- Problem with string matching HOT 1
- range of targets and modules
- Retry "auth.login" call. reason: [Errno 60] Operation timed out HOT 1
- Illegal instruction HOT 1
- int is not allowed for map key? HOT 3
- DeepExploit issue HOT 2
- Lots Of Bug HOT 3
- Msf5 exploitation
- Starting a Business
- how to s solve this question? HOT 4
- No ports found in host that has opened ports HOT 1
- Retry "auth.login" call. reason: [Errno 111] Connection refused HOT 3
- Installation Environment
- 'utf-8' codec can't decode byte 0xb5 in position 182: invalid start byte
- Retry "auth.login" call. reason: [Errno 110] Connection timed out HOT 1
- can only concatenate str (not "bytes") to str Failed: console.read type:<class 'TypeError'>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from machine_learning_security.