Closed shubhamdhingra38 closed 3 years ago
Build time: 2012-12-21 00:00:00 UTC Revision: none
Groovy: 2.4.17 Ant: Apache Ant(TM) version 1.10.7 compiled on October 24 2019 JVM: 1.8.0_292 (Private Build 25.292-b10) OS: Linux 5.8.0-50-generic amd64
Hello,
Did you run the python server?
$ python model/app.py
The java interface is a legacy code that needs to be removed, the main work now is with the web interface, after running the python server you'll be given a link to follow to access the web ui, next step is to run the java server. Then you can click the start button (on web)
Yes, I ran the python server and could see the interface there too.
After that how do I run the java server? With sudo gradle run
I get the application interface, is that the server or there's something else?
yes with sude gradle run
or with ./gradlew execute
/ gradlew execute
, you'll get the java interface, don't use it
Using the python webapp interface, as soon as I click the button I get
[2021-05-12 23:59:27,067] ERROR in app: Exception on /start [POST]
Traceback (most recent call last):
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/flask/app.py", line 2051, in wsgi_app
response = self.full_dispatch_request()
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/flask/app.py", line 1501, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/flask/app.py", line 1499, in full_dispatch_request
rv = self.dispatch_request()
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/flask/app.py", line 1485, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "app.py", line 78, in start
app_get.startTrafficFlow()
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/py4j/java_gateway.py", line 1309, in __call__
return_value = get_return_value(
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/py4j/protocol.py", line 326, in get_return_value
raise Py4JJavaError(
py4j.protocol.Py4JJavaError: An error occurred while calling t.startTrafficFlow.
: java.lang.NullPointerException
at cic.cs.unb.ca.flow.ui.FlowMonitorPane.startTrafficFlow(FlowMonitorPane.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:282)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.lang.Thread.run(Thread.java:748)
192.168.29.173 - - [12/May/2021 23:59:27] "POST /start HTTP/1.1" 500 -
and on the java server
Check command to run the interface script
java.io.FileNotFoundException: ./interface (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileReader.<init>(FileReader.java:72)
at cic.cs.unb.ca.flow.ui.FlowMonitorPane.startTrafficFlow(FlowMonitorPane.java:261)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:282)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.lang.Thread.run(Thread.java:748)
Also, one thing not sure if it matters, I have to run the app.py using
cd model
python3 app.py
if I run it from root directory of project using
python3 model/app.py
I get
[ERROR] './server.py' does not exist
Traceback (most recent call last):
File "model/app.py", line 185, in <module>
socketio, app = create_app()
File "model/app.py", line 47, in create_app
model_server = process('./server.py')
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/pwnlib/tubes/process.py", line 251, in __init__
executable_val, argv_val, env_val = self._validate(cwd, executable, argv, env)
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/pwnlib/tubes/process.py", line 575, in _validate
self.error("%r does not exist" % executable)
File "/home/shubham/MajorProject/venv/lib/python3.8/site-packages/pwnlib/log.py", line 424, in error
raise PwnlibException(message % args)
pwnlib.exception.PwnlibException: './server.py' does not exist
I hard-coded the network interface name which I got running python3 interface.py
in CICFlowmeter repository.
I don't have any error now it seems but I tried a DDOS attack tool, https://github.com/palahsu/DDoS-Ripper and used it on my local ip which I got through hostname -i
but it doesn't show any alerts.
I do see in the java server some type of count, and in the python server a dictionary being printed like
{'Bot': 8, 'DoS attack': 38, 'Brute Force': 0, 'DDoS attacks': 0, '0': 855}
but I don't see the interface saying any alert.
Any idea why or can you suggest some other tool to use?
Refer to this closed issue, we mention the used tools for attacking: https://github.com/bibs2091/Anomaly-detection-system/issues/6
Please report to us the results
Still not working :(
I tried the GoldenEye tool. I am getting 400 status code for any GET request to /socket.io/
Here are some logs
127.0.0.1 - - [13/May/2021 17:25:25] "GET /reset_status HTTP/1.1" 200 -
Data received!
{'Bot': 1, 'DoS attack': 0, 'Brute Force': 0, 'DDoS attacks': 0, '0': 23}
127.0.0.1 - - [13/May/2021 17:25:25] "POST /post-predict HTTP/1.1" 200 -
127.0.0.1 - - [13/May/2021 17:25:25] "GET /reset_status HTTP/1.1" 200 -
Data received!
{'Bot': 4, 'DoS attack': 0, 'Brute Force': 0, 'DDoS attacks': 0, '0': 32}
127.0.0.1 - - [13/May/2021 17:25:25] "POST /post-predict HTTP/1.1" 200 -
127.0.0.1 - - [13/May/2021 17:25:25] "GET /reset_status HTTP/1.1" 200 -
Data received!
{'Bot': 7, 'DoS attack': 0, 'Brute Force': 0, 'DDoS attacks': 0, '0': 39}
127.0.0.1 - - [13/May/2021 17:25:25] "POST /post-predict HTTP/1.1" 200 -
127.0.0.1 - - [13/May/2021 17:25:25] "GET /reset_status HTTP/1.1" 200 -
Data received!
{'Bot': 9, 'DoS attack': 0, 'Brute Force': 0, 'DDoS attacks': 0, '0': 50}
127.0.0.1 - - [13/May/2021 17:25:25] "POST /post-predict HTTP/1.1" 200 -
192.168.29.173 - - [13/May/2021 17:25:28] "GET /socket.io/?EIO=3&transport=polling&t=NbbbEVs HTTP/1.1" 400 -
192.168.29.173 - - [13/May/2021 17:25:34] "GET /socket.io/?EIO=3&transport=polling&t=NbbbFzc HTTP/1.1" 400 -
192.168.29.173 - - [13/May/2021 17:25:40] "GET /socket.io/?EIO=3&transport=polling&t=NbbbHRM HTTP/1.1" 400 -
192.168.29.173 - - [13/May/2021 17:25:46] "GET /socket.io/?EIO=3&transport=polling&t=NbbbIv6 HTTP/1.1" 400 -
192.168.29.173 - - [13/May/2021 17:25:52] "GET /socket.io/?EIO=3&transport=polling&t=NbbbKMs HTTP/1.1" 400 -
192.168.29.173 - - [13/May/2021 17:25:58] "GET /socket.io/?EIO=3&transport=polling&t=NbbbLqc HTTP/1.1" 400 -
Inside CICFlowmeter folder create a file called "interface" no extension is needed and put inside it the interface you want to capture for example eth0.
@shubhamdhingra38 how did you get those dict printed ? I don't get any of those calls ?
@bondbenz I have what you told still not able to solve this issue. I am not even getting any dict printed as shown in this issue, the flask server continously shows 400 for every polled call.
Hi, I followed the instructions in the repository. I am running CICFlowmeter using
sudo gradle run
I see it only goes uptil 75% executing, and when the java application with the button opens and I click "Scan", I get this error. Please help Error: