| 1 | package com.jsql.view.swing.terminal; | |
| 2 | ||
| 3 | import java.io.IOException; | |
| 4 | import java.net.ServerSocket; | |
| 5 | import java.net.Socket; | |
| 6 | ||
| 7 | public class ServerInput { | |
| 8 | ||
| 9 | private ServerSocket serverSocket = null; | |
| 10 | private final int port; | |
| 11 | private ServerInputConnection serverInputConnection; | |
| 12 | private final ExploitReverseShell exploitReverseShell; | |
| 13 | ||
| 14 | public ServerInput(ExploitReverseShell exploitReverseShell, int port) { | |
| 15 | this.port = port; | |
| 16 | this.exploitReverseShell = exploitReverseShell; | |
| 17 | } | |
| 18 | ||
| 19 | public void startServer() throws IOException { | |
| 20 | this.serverSocket = new ServerSocket(this.port); // port less than 1024 if root | |
| 21 |
1
1. startServer : removed call to java/net/ServerSocket::setSoTimeout → NO_COVERAGE |
this.serverSocket.setSoTimeout(10000); |
| 22 | Socket clientSocket = this.serverSocket.accept(); | |
| 23 | this.serverInputConnection = new ServerInputConnection(this.exploitReverseShell, clientSocket, this); | |
| 24 |
1
1. startServer : removed call to com/jsql/view/swing/terminal/ServerInputConnection::run → NO_COVERAGE |
this.serverInputConnection.run(); |
| 25 | } | |
| 26 | ||
| 27 | void close() throws IOException { | |
| 28 |
1
1. close : removed call to java/net/ServerSocket::close → NO_COVERAGE |
this.serverSocket.close(); |
| 29 | } | |
| 30 | ||
| 31 | public ServerInputConnection getServerInputConnection() { | |
| 32 |
1
1. getServerInputConnection : replaced return value with null for com/jsql/view/swing/terminal/ServerInput::getServerInputConnection → NO_COVERAGE |
return this.serverInputConnection; |
| 33 | } | |
| 34 | } | |
Mutations | ||
| 21 |
1.1 |
|
| 24 |
1.1 |
|
| 28 |
1.1 |
|
| 32 |
1.1 |