|
@@ -8,7 +8,6 @@ import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
import java.io.ObjectOutputStream;
|
|
-import java.io.Serializable;
|
|
|
|
import java.io.StreamCorruptedException;
|
|
import java.io.StreamCorruptedException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
@@ -89,7 +88,7 @@ public class ProfileManager {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} finally {
|
|
} finally {
|
|
if(holder.mProfiles.size() == 0){
|
|
if(holder.mProfiles.size() == 0){
|
|
- this.fillWithSampleData();
|
|
|
|
|
|
+ this.fillWithDefaultData();
|
|
loadData();
|
|
loadData();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -263,36 +262,104 @@ public class ProfileManager {
|
|
return holder.mProfiles.size();
|
|
return holder.mProfiles.size();
|
|
}
|
|
}
|
|
|
|
|
|
- public void fillWithSampleData(){
|
|
|
|
- this.addProfile(new Profile(
|
|
|
|
|
|
+ public void fillWithDefaultData(){
|
|
|
|
+ Profile windowsVista = new Profile(
|
|
0,
|
|
0,
|
|
"Windows Vista",
|
|
"Windows Vista",
|
|
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.",
|
|
|
|
|
|
+ "This profile will imitate a Windows Vista machine",
|
|
R.drawable.ic_profile_vista,
|
|
R.drawable.ic_profile_vista,
|
|
false
|
|
false
|
|
- ), false);
|
|
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ windowsVista.mActiveProtocols.put("ECHO", true);
|
|
|
|
+ windowsVista.mActiveProtocols.put("TELNET", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(windowsVista, false);
|
|
|
|
|
|
- this.addProfile(new Profile(
|
|
|
|
|
|
+ Profile windowsXP = new Profile(
|
|
1,
|
|
1,
|
|
- "Windows 7",
|
|
|
|
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.",
|
|
|
|
- R.drawable.ic_profile_w7,
|
|
|
|
|
|
+ "Windows XP",
|
|
|
|
+ "This profile will activate Windows XP typical services",
|
|
|
|
+ R.drawable.ic_profile_xp,
|
|
false
|
|
false
|
|
- ), false);
|
|
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ windowsXP.mActiveProtocols.put("ECHO", true);
|
|
|
|
+ windowsXP.mActiveProtocols.put("TELNET", true);
|
|
|
|
+ windowsXP.mActiveProtocols.put("MySQL", true);
|
|
|
|
|
|
- this.addProfile(new Profile(
|
|
|
|
|
|
+ this.addProfile(windowsXP, false);
|
|
|
|
+
|
|
|
|
+ Profile serverHTTP = new Profile(
|
|
2,
|
|
2,
|
|
- "Unix Distro",
|
|
|
|
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.",
|
|
|
|
|
|
+ "Webserver HTTP",
|
|
|
|
+ "This profile will imitate a simple webserver, which just supports the HTTP protocol",
|
|
|
|
+ R.drawable.ic_profile_apache,
|
|
|
|
+ false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ serverHTTP.mActiveProtocols.put("HTTP", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(serverHTTP, false);
|
|
|
|
+
|
|
|
|
+ Profile serverWeb = new Profile(
|
|
|
|
+ 3,
|
|
|
|
+ "Webserver",
|
|
|
|
+ "This profile will imitate a simple webserver, which supports both the HTTP and HTTPS protocol",
|
|
|
|
+ R.drawable.ic_profile_apache,
|
|
|
|
+ false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ serverWeb.mActiveProtocols.put("HTTP", true);
|
|
|
|
+ serverWeb.mActiveProtocols.put("HTTPS", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(serverWeb, false);
|
|
|
|
+
|
|
|
|
+ Profile unixMachine = new Profile(
|
|
|
|
+ 4,
|
|
|
|
+ "Unix",
|
|
|
|
+ "This profile monitors unix typical services",
|
|
R.drawable.ic_profile_unix,
|
|
R.drawable.ic_profile_unix,
|
|
false
|
|
false
|
|
- ), false);
|
|
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ unixMachine.mActiveProtocols.put("SSH", true);
|
|
|
|
+ unixMachine.mActiveProtocols.put("ECHO", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(unixMachine, false);
|
|
|
|
+
|
|
|
|
+ Profile linuxMachine = new Profile(
|
|
|
|
+ 5,
|
|
|
|
+ "Linux",
|
|
|
|
+ "This profile will imitate a linux machine by monitoring linux typical services",
|
|
|
|
+ R.drawable.ic_profile_linux,
|
|
|
|
+ false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ linuxMachine.mActiveProtocols.put("SSH", true);
|
|
|
|
+ linuxMachine.mActiveProtocols.put("TELNET", true);
|
|
|
|
+ linuxMachine.mActiveProtocols.put("ECHO", true);
|
|
|
|
+ linuxMachine.mActiveProtocols.put("SMB", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(linuxMachine, false);
|
|
|
|
+
|
|
|
|
+ Profile voipServer = new Profile(
|
|
|
|
+ 6,
|
|
|
|
+ "VOIP Server",
|
|
|
|
+ "This profile imitates a VOIP Server by monitoring the SIP service",
|
|
|
|
+ R.drawable.ic_profile_asterisks,
|
|
|
|
+ false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ voipServer.mActiveProtocols.put("SIP", true);
|
|
|
|
+
|
|
|
|
+ this.addProfile(voipServer, false);
|
|
|
|
|
|
Profile randomProfile = new Profile(
|
|
Profile randomProfile = new Profile(
|
|
- 3,
|
|
|
|
|
|
+ 7,
|
|
"Random",
|
|
"Random",
|
|
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.",
|
|
|
|
- R.drawable.ic_service_green,
|
|
|
|
|
|
+ "This profile monitors services randomly",
|
|
|
|
+ R.drawable.ic_launcher,
|
|
false
|
|
false
|
|
);
|
|
);
|
|
|
|
|
|
@@ -300,15 +367,24 @@ public class ProfileManager {
|
|
|
|
|
|
this.addProfile(randomProfile, false);
|
|
this.addProfile(randomProfile, false);
|
|
|
|
|
|
- this.addProfile(new Profile(
|
|
|
|
- 4,
|
|
|
|
- "Mix",
|
|
|
|
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.",
|
|
|
|
- R.drawable.ic_service_green,
|
|
|
|
|
|
+ Profile paranoidProfile = new Profile(
|
|
|
|
+ 8,
|
|
|
|
+ "Paranoid",
|
|
|
|
+ "This profile monitors all available services",
|
|
|
|
+ R.drawable.ic_launcher,
|
|
false
|
|
false
|
|
- ), false);
|
|
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ for(String protocol: MainActivity.context.getResources().getStringArray(R.array.protocols)){
|
|
|
|
+ if(protocol.equals("GHOST")) continue;
|
|
|
|
+ paranoidProfile.mActiveProtocols.put(protocol, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.addProfile(paranoidProfile, false);
|
|
|
|
+ holder.mIncrementValue = 8;
|
|
|
|
+
|
|
|
|
+ this.mCurrentActivatedProfile = randomProfile;
|
|
|
|
|
|
- holder.mIncrementValue = 4;
|
|
|
|
persistData();
|
|
persistData();
|
|
}
|
|
}
|
|
}
|
|
}
|