crond-jaist / AutoPentest-DRL

AutoPentest-DRL: Automated Penetration Testing Using Deep Reinforcement Learning
BSD 3-Clause "New" or "Revised" License
331 stars 82 forks source link

FileNotFound error #6

Closed QuynhNguyen269 closed 2 years ago

QuynhNguyen269 commented 2 years ago

Hi, I'm trying to run the code but it gives me multiple FileNotFound errors. Please help. Thank you!

The output is:

################################################################################ AutoPentest-DRL: Automated Penetration Testing Using Deep Reinforcement Learning ################################################################################ AutoPentest-DRL: Operation mode: Attack on logical network AutoPentest-DRL: Target topology: MulVAL_P/logical_topology_1.P

AutoPentest-DRL: Compute attack path for logical network... Generate attack graph using MulVAL... sh: 1: ../repos/mulval/utils/graph_gen.sh: not found Process attack graph into attack matrix... Traceback (most recent call last): File "/home/leekutti/NT522/AutoPentest-DRL/DQN/./confirm_path.py", line 9, in MAP = generateMapClass.sendMap File "./learn/generateMap.py", line 108, in sendMap self.x = self.createMatrix() File "./learn/generateMap.py", line 20, in createMatrix self.csvfile = open('../mulval_result/VERTICES.CSV', 'r') FileNotFoundError: [Errno 2] No such file or directory: '../mulval_result/VERTICES.CSV' Traceback (most recent call last): File "/home/leekutti/NT522/AutoPentest-DRL/DQN/learn/./dqn_learn.py", line 32, in env = gym.make('dqnenv-v0') File "/usr/local/lib/python3.9/dist-packages/gym/envs/registration.py", line 235, in make return registry.make(id, kwargs) File "/usr/local/lib/python3.9/dist-packages/gym/envs/registration.py", line 129, in make env = spec.make(kwargs) File "/usr/local/lib/python3.9/dist-packages/gym/envs/registration.py", line 89, in make cls = load(self.entry_point) File "/usr/local/lib/python3.9/dist-packages/gym/envs/registration.py", line 27, in load mod = importlib.import_module(mod_name) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/leekutti/NT522/AutoPentest-DRL/DQN/learn/env/environment.py", line 12, in class dqnEnvironment(gym.Env): File "/home/leekutti/NT522/AutoPentest-DRL/DQN/learn/env/environment.py", line 14, in dqnEnvironment MAP = np.loadtxt('../processdata/newmap.txt') File "/usr/lib/python3/dist-packages/numpy/lib/npyio.py", line 961, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/usr/lib/python3/dist-packages/numpy/lib/_datasource.py", line 195, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/usr/lib/python3/dist-packages/numpy/lib/_datasource.py", line 535, in open raise IOError("%s not found." % path) OSError: ../processdata/newmap.txt not found.

crond-jaist commented 2 years ago

Hi,

From the output you included I can see that the first error is: sh: 1: ../repos/mulval/utils/graph_gen.sh: not found

This means that you forgot to install MulVAL, and the script that comes with it cannot be found. Please check the Prerequisites section in the README.md file for details about MulVAL.

Best wishes, Razvan

QuynhNguyen269 commented 2 years ago

Thank you for your support, but I have one more question. In the paper you wrote that this model has an accuracy of 0.86. I quite don't understand the method of evaluating, the data used for evaluating and whether that data is in this repo or not. Looking forward to your reply. Thank you!

crond-jaist commented 2 years ago

I'm glad to hear that your problem was solved. As for the evaluation, I'll answer in the new issue that you just opened about this topic.