Browse Source

Created a Nuclear Power Plant Profile simulating MODBUS,HTTP,FTP and TELNET

Shreyas Srinivasa 9 years ago
parent
commit
ba5ab7703e

BIN
res/drawable-xxxhdpi/ic_nuclearpp.png


+ 1 - 0
res/values/strings.xml

@@ -246,6 +246,7 @@
 	<string name="profile_linux_hard_desc">This profile will imitate a linux machine which has just SSH activated</string>
     <string name="profile_voip_desc">This profile imitates a VOIP Server by monitoring the SIP service</string>
     <string name="profile_random_desc">This profile monitors services randomly</string>
+    <string name="profile_nuclearPower_desc">This profile simulates the Siemens SIMATIC S7 200 PLC working in a Nuclear Power Plant Environment</string>
     <string name="profile_paranoid_desc">This profile monitors all available services</string>
     <string name="profile_help_swipe">Swipe from the left or right on an item to expose all available actions for an item</string>
     <string name="profile_monitor_ghost">Monitor GHOST</string>

+ 17 - 1
src/de/tudarmstadt/informatik/hostage/persistence/ProfileManager.java

@@ -639,8 +639,24 @@ public class ProfileManager {
 
 		this.addProfile(randomProfile, false);
 
-		Profile paranoidProfile = new Profile(
+
+		Profile nuclearPlant = new Profile(
 				8,
+				"Nuclear Power Plant",
+				MainActivity.getInstance().getString(R.string.profile_nuclearPower_desc),
+				R.drawable.ic_nuclearpp,
+				false
+		);
+
+		nuclearPlant.mActiveProtocols.put("MODBUS",true);
+		nuclearPlant.mActiveProtocols.put("HTTP",true);
+		nuclearPlant.mActiveProtocols.put("FTP",true);
+		nuclearPlant.mActiveProtocols.put("TELNET",true);
+		this.addProfile(nuclearPlant,false);
+
+
+		Profile paranoidProfile = new Profile(
+				9,
 				"Paranoid",
                 MainActivity.getInstance().getString(R.string.profile_paranoid_desc),
 				R.drawable.ic_profile_paranoid,

+ 7 - 4
src/de/tudarmstadt/informatik/hostage/protocol/MODBUS.java

@@ -60,7 +60,7 @@ public class MODBUS implements Protocol {
     //public static final int WRITE_MULTIPLE_COILS = 15; Not sure of these commands
     //public static final int WRITE_MULTIPLE_REGISTERS = 16; Not sure of these commands
 
-    //Packet Constants
+    //Packet Constants, declaring it for now, depends on usage. Static assignment is not a good idea
 
     int FUNCTION_CODE;
     int UNIT_NUMBER;
@@ -69,6 +69,9 @@ public class MODBUS implements Protocol {
 
 
 
+
+
+
     public int sid=1; // Denotes the Unit Number or Slave_ID of the device
 
     public static final int COIL_MAX_DATA_ADDRESS = 128; // Max coil data address
@@ -325,7 +328,7 @@ public class MODBUS implements Protocol {
 
     private String getDeviceInfo() {
 
-        DeviceInfo = "5369656d656e732053494d415449432053372d323030";
+        DeviceInfo = "5369656d656e732053494d415449432053372d323030"; // Hex value for Simatic S7 200
         return DeviceInfo;
     }
 
@@ -334,7 +337,7 @@ public class MODBUS implements Protocol {
 
     private int readRegister(int registerAddress) {
 
-        registerAddress+=30001; //Offset of 30001
+       // registerAddress+=30001; //Offset of 30001 Check the packet in wireshark and decide to put offset
 
         if (register.containsKey(registerAddress)) {
             int val = (Integer) register.get(registerAddress);
@@ -361,7 +364,7 @@ public class MODBUS implements Protocol {
 
     private int writeSingleRegister(int regAddress, int regData){
 
-        regData+=30001;
+        //regData+=30001;
         register.put(regAddress, regData);
         int val = (Integer)register.get(regAddress);
         return val;