Code Monkey home page Code Monkey logo

payloadgenerator's Introduction

PayloadGenerator

For easier generating of payload for SSH. Based on the HTTP Injector of Evozi. Credits to them.

Implementation

Add this to your root build.gradle

allprojects { 		
   repositories {
       ... 			
       maven { url 'https://jitpack.io' }
   } 	
}

Add this to your dependencies

dependencies { 	 
    compile 'com.github.status404error:PayloadGenerator:v1.5' 	
}

I suggest to use Switch to show and to enable and disable the usage of custom payload. Also take note that you must define your SharedPreference that you use for custom payload enabling and disabling

Initialize PayloadGenerator

private PayloadGenerator payloadGenerator;

On your OnCreate or OnCreateView (for FragmentActivity)

Switch switch = (Switch) ...
payloadGenerator = new PayloadGenerator(this, prefs);


//add custom proxy
payloadGenerator.setProxyKey("use_custom_proxy","generated_proxy");
  • On the custom proxy, you must add the boolean key used on SharedPreference for enabling custom proxy and then the string key Example: on your PreferenceActivity you used CheckBoxPreference for Custom Proxy, the key for that CheckBoxPreference is your boolean key for enabling custom proxy, same timg for the EditTextPreferece for adding your custom proxy.

You can add this condition on your OnCheckedChangeListener of your Switch

if(ischeck){
   //enable custom payload and show PayloadGenerator
   prefs.edit().putBoolean("use_custom_payload",true).apply();
   //add condition for switches 
   //if use ssh or sni
   if(ssh_radio.isChecked()){
      payloadGenerator.showForSSH("generated_ssh");
   }else{
      payloadGenerator.showForSNI("generated_sni");
   }

}else{
//disable custom payload
prefs.edit().putBoolean("use_custom_payload",false).apply();
}

*If you will not declare key for custom proxy, the Option on the PayloadGenerator for custom proxy will be useless

You can also add OnCancelClickedListener if you want to add condition if the "Cancel" Button of the PayloadGenerator is clicked

SwitchButton switchButton = (SwitchButton) findViewById(R.id.switchButton);
payloadGenerator.setOnCancelClickedListener(new PayloadGenerator.OnCancelClickedListener(){

				@Override
				public void OnCancelClickListener(DialogInterface dialogInterface)
				{
					// you can uncheck the switch here
					// you can also disable the usage of custom payload
					switchButton.setChecked(false);
					editor.putBoolean("use_custom_payload", false).apply();
					// TODO: Implement this method
				}
		 });

Versions:

  • 1.4
  • Removed addPayloadSwitch(Switch) and replaced with OnCancelClickedListener so you can use Switch repositories (eg.: SwitchButton)
  • 1.3
  • Changing some condition
  • 1.2
  • Fixed gradle issues
  • 1.1
  • Fixed some issues
  • 1.0
  • Initial Release

payloadgenerator's People

Contributors

kervzcalub avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.