OpenNetworkingFoundation / DELTA

PROJECT DELTA: SDN SECURITY EVALUATION FRAMEWORK
221 stars 76 forks source link

DataOutput- and DataInputStreams equal Null for HostAgentManager leading in NullPointerException #42

Closed benfuhl closed 5 years ago

benfuhl commented 5 years ago

Hi DELTA Team, my name is Ben and I managed to build up a running DELTA all-in-one scenario using the lxc-containers and I am able to start testcases. Unfortunately for many TestCases I get a NullPointerException thrown by the function writeUTF. I've tried to dig deeper into Java code through Eclipse, but I'm not a very experienced Java developer. I have discovered that the error must be that the HostAgentManager does not get passed dos and dis, so these variables remain NULL. The setSocket function is called by the AgentManager after a server socket has been constructed and listenAgent.accept () has been executed. However, agentType = dis.readUTF (); never reads the string "HostAgent" and therefore dis and dos will never be passed to the HostAgentManager. this results in the NullPointerExcetion. image I am getting the NullPointerException for many testcases, but there are a few, that work fine: image Did I do something wrong when installing DELTA, or is the error somewhere else? It would be nice if you could help me!

charles-typ commented 5 years ago

I've also encountered such problems. Have you figured it out? Can you give a list of the successful test you've made?

benfuhl commented 5 years ago

Hi, ok so the problem isn't only on my side... hmm...I didn't test through all testcases with all settings. I started creating a table with testcases in which I documented if a test is running in an error and what error it is, but it is far from complete. Sadly there are only very few testcases that work as expected.... I didn't find a solution to the NullPointerExceptions in DELTA. What I figured out is the need to restart the lxc-containers after DELTA ran in an error. Otherwise the SDN Controller won't start correctly in the next testcase. Here is the table I can provide: DELTA_test_cases_testing.xlsx

jwkim90 commented 5 years ago

Hello guys, We also recognize these problems and currently are working to fix the issues. I think something went wrong when we prepared Blackhat 2018.

I don't know how soon you guys need the correct DELTA release, but it will be fixed soon, don't worry. And thank you very much for all your reports.

Best Regards, Jinwoo Kim

vieangry commented 5 years ago

Hello Ben,I've also encountered such problems. 1、NullPointerExceptions 2、socket error:address already in use 3、“q” commend don't work.(need to restart the lxc-containers ) The reason for all the problem is the code "pc = Runtime.getRuntime().exec("ssh " + sshAddr + " sudo killall java");" don't work as killall is not installed in container then the manager in container can't stop. So the solution is installing killall in container by "apt-get install psmisc". you can try.

benfuhl commented 5 years ago

hi, thank you for this solution. I just looked into it. For me it seems like "psmisc" is already installed ... I doubble-checked it on all containers. Unfotunately the NullPointerException is still popping up... :disappointed:

charles-typ commented 5 years ago

@benfuhl Hi Ben! I had encounter some problems when setting up the DELTA system. In the prerequisites it is mentioned that we have to install the controller first, but after installing the three containers, there are some commands given like : cd /tools/etc/app-agent-setup ./floodlight-1.2-scp. Are these command for installation of the controller or just linking some stuff? And another question is that how did you make to install different version of the same controllers at the same time? The last question is that in the configuration file( i.e. manager_default.cfg) there is a target controller. but actually in the browser(localhost:7070) I typed in another controller, will there be conflict? Which one should I rely on?

Please help we with these questions. Thank you very much.

charles-typ commented 5 years ago

@benfuhl Oh another question is that what does the three containers stands for? container-cp container-dp container-ch?

I really appreciate your help.

benfuhl commented 5 years ago

@charles-typ Hi, I try to give you some answers: Question 1 You will first set up the containers. Then you have to do the "mvn clean install" to get the JARs. Finally you can install the controllers via the *-scp scripts. I think in the installation guide the steps two and three are switched, so that I didn't find the JARs. After the Maven command all files were there, but in slightly different paths than the guide said. I changed the paths in the scripts and then everything worked fine. Question 2 You can just install them parallel, I think. Just use the installation scripts... It works fine. Question 3 For me the .cfg file has no effect when it comes to setting the target Controller. You can choose your target controller in the webUI. Maybe it sets your default target controller for the case you use the DELTA CLI to start attacks. Didn't test that... Question 4 I found following relations: container-cp = Control Plane =Application Agent & SDN Controller container-dp = Data Plane = Host Agent container-ch = Channel Agent Your Host System = Agent Manager

That is all I found out ... Hope that helps you somehow...

charles-typ commented 5 years ago

@benfuhl Thanks a lot!

I used my whole day to try to figure this out and I discovered that they omitted the definition of the environment value $DELTA_APP, so I encountered failure when installing the controllers using the "scp" files.All your answers help me verify my comprehension.Thanks.

However after setting it all up I still can't get results. Sad!

jwkim90 commented 5 years ago

The reported problem of connection between AgentManager and HostAgent has been fixed.

Thank you for all your report.

I'm gonna look for other issues.

charles-typ commented 5 years ago

@benfuhl Hi Ben! Have you tried out the new system after the developer's latest commit? I've encountered some problems and I wonder if you do too.