Ver código fonte

Wrote some lines to open Modbus port

shreyas.srinivasa 9 anos atrás
pai
commit
0e7d43801d

+ 3 - 3
assets/payload/redirect-ports.sh

@@ -3,9 +3,9 @@
 # redirects ports below 1024 to a higher range using iptables, so they can be used without elevated rights
 # MySQL SIP (3306 and 5060) are left out because they are >= 1024 anyways
 
-#             ECHO  FTP   HTTP  HTTPS SMB (NETBIOS UDP & TCP) SSH   TELNET
-protocol=(    "tcp" "tcp" "tcp" "tcp" "udp" "udp"  "tcp" "tcp" "tcp" "tcp")
-origin=(       7     21    80    443   137   138    139   22    23    445)
+#             ECHO  FTP   HTTP  HTTPS SMB (NETBIOS UDP & TCP) SSH   TELNET MODBUS
+protocol=(    "tcp" "tcp" "tcp" "tcp" "udp" "udp"  "tcp" "tcp" "tcp" "tcp" "tcp")
+origin=(       7     21    80    443   137   138    139   22    23    445   28639)
 destination=( 28144 28169 28217 28580 28274 28275 28276 28159 28160 28582) # simply offset by 1024 + 27113
 length=${#protocol[@]} # count protocol elements
 

+ 11 - 10
res/values-de/protocols.xml

@@ -15,15 +15,16 @@
     </string-array>
 
     <string-array name="protocols_description">
-        <item>Protokoll zum testen und messen der round-trip time</item>
-        <item>Protokoll zum Datentransfer zwischen Client/Server und Server/Server</item>
-        <item>Protokoll zum Spiegeln von eingehenden Verbindungen. Antwort erfolgt auf dem selben Port wie die eingegangene Verbindung</item>
-        <item>Datenübertragungsprotokoll für Webseiten</item>
-        <item>Genau wie HTTP mit zusätzlicher Sicherung der Verbindung mittels SSL/TLS</item>
-        <item>Weit verbreitetes relationelles Datenbank Management System</item>
-        <item>Dieses Protokoll wird für VoIP(Voice over IP) Dienste genutzt</item>
-        <item>Protokoll um Daten, Drucker und mehr in einem Netzwerk zu teilen</item>
-        <item>Netzwerkprotokoll das Datenzugriff, Datentransfer und Datenmanagement Funktionen über einen vertrauenswürdigen Datenstrom bereitstellt</item>
-        <item>Netzwerkprotokoll das genutzt wird um eine bidirektionale interaktive Kommunikation in einem virtuellen Terminal zu ermöglichen</item>
+        <item>A service for testing and measurement of round-trip times in IP networks</item>
+        <item>A protocol used to transfer files from one host to another host</item>
+        <item>A protocol mirrors an incoming connection back to the attacker on the same port, that it is running on</item>
+        <item>A protocol to exchange or transfer hypertext. It is the foundation of data communication for the World Wide Web</item>
+        <item>The same as HTTP, but using a secure connections based on SSL/TLS</item>
+        <item>The world\'s second most widely used relational database management system</item>
+        <item>ICS SCADA MODBUS</item>
+        <item>A protocol for VoIP (Voice over IP) services</item>
+        <item>A protocol used for providing shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network</item>
+        <item>A network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream</item>
+        <item>A network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection</item>
     </string-array>
 </resources>

+ 14 - 12
res/values/protocols.xml

@@ -2,12 +2,13 @@
 <resources>
 
     <string-array name="protocols">
-		<item>ECHO</item>
+        <item>ECHO</item>
         <item>FTP</item>
         <item>GHOST</item>
         <item>HTTP</item>
         <item>HTTPS</item>
         <item>MySQL</item>
+        <item>MODBUS</item>
         <item>SIP</item>
         <item>SMB</item>
         <item>SSH</item>
@@ -15,15 +16,16 @@
     </string-array>
 
     <string-array name="protocols_description">
-		<item>A service for testing and measurement of round-trip times in IP networks</item>
-		<item>A protocol used to transfer files from one host to another host</item>
-		<item>A protocol mirrors an incoming connection back to the attacker on the same port, that it is running on</item>
-		<item>A protocol to exchange or transfer hypertext. It is the foundation of data communication for the World Wide Web</item>
-		<item>The same as HTTP, but using a secure connections based on SSL/TLS</item>
-		<item>The world\'s second most widely used relational database management system</item>
-		<item>A protocol for VoIP (Voice over IP) services</item>
-		<item>A protocol used for providing shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network</item>
-		<item>A network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream</item>
-		<item>A network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection</item>
-	</string-array>
+        <item>A service for testing and measurement of round-trip times in IP networks</item>
+        <item>A protocol used to transfer files from one host to another host</item>
+        <item>A protocol mirrors an incoming connection back to the attacker on the same port, that it is running on</item>
+        <item>A protocol to exchange or transfer hypertext. It is the foundation of data communication for the World Wide Web</item>
+        <item>The same as HTTP, but using a secure connections based on SSL/TLS</item>
+        <item>The world\'s second most widely used relational database management system</item>
+        <item>ISC SCADA MODBUS</item>
+        <item>A protocol for VoIP (Voice over IP) services</item>
+        <item>A protocol used for providing shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network</item>
+        <item>A network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream</item>
+        <item>A network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection</item>
+    </string-array>
 </resources>

+ 44 - 0
src/de/tudarmstadt/informatik/hostage/protocol/MODBUS.java

@@ -0,0 +1,44 @@
+package de.tudarmstadt.informatik.hostage.protocol;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import de.tudarmstadt.informatik.hostage.wrapper.Packet;
+
+/**
+ * Created by root on 25.05.15.
+ */
+public class MODBUS implements Protocol {
+
+
+    public int getPort() {
+        return 502;
+    }
+
+    public boolean isClosed() {
+        return false;
+    }
+
+    public boolean isSecure() {
+        return false;
+    }
+
+    public List<Packet> processMessage(Packet requestPacket) {
+        List<Packet> responsePackets = new ArrayList<Packet>();
+        responsePackets.add(requestPacket);
+        return responsePackets;
+    }
+
+    @Override
+    public String toString() {
+        return "MODBUS";
+    }
+
+    public TALK_FIRST whoTalksFirst() {
+        return null;
+    }
+
+
+
+
+}