Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Using automata learning to mine models used for fuzzing of statefull systems

License

Notifications You must be signed in to change notification settings

DES-Lab/Learning-Based-Fuzzing

Repository files navigation

Supplemental Materials for "Learning-Based Fuzzing of IoT Message Brokers"

Getting Started

MQTT Broker Configurations

Running the Tool

  • After the MQTT broker setup the tool can be executed.
    Linux/MAC
    ./gradlew build
    ./gradlew learningBasedFuzzing
    Windows
    ./gradlew.bat build
    ./gradlew.bat learningBasedFuzzing

Brief Comments on the Code

In the Main.java following steps are performed.

  • Creation of the Eclipse Mosquitto adapter and MQTT client which will interact with the Eclipse Mosquitto broker

MQTTBrokerAdapterConfig mosquittoBrokerConfig = new MQTTBrokerAdapterConfig(InetAddress.getByName("127.0.0.1"), 1885, 200, true, true, true); MQTTClientWrapper mosquittoClient = new MQTTClientWrapper("c0", "mosquitto", mosquittoBrokerConfig);

  • Definition of the input alphabet for learning and the corresponding mapper that translates abstract inputs to concrete inputs
  • Learning of the Eclipse Mosquitto model
  • Results are saved in the 'learnedModels' folder
  • If you want to skip learning and use model in 'learnedModels' folder, remove (comment out) the last line:
Learner mosquittoLearner = new Learner(new LearningMapper(mosquittoClient));
 List<String> paperExample = Arrays.asList(
                "connect", "disconnect",
                "subscribe","publish", "unsubscribe",
                "invalid");

String experimentName = "MosquittoModel";
mosquittoLearner.learn(3000, experimentName, paperExample); // COMMENT OUT if you want to skip learning and use already existing model
  • Configuration of clients for other brokers
  • Same abstract input alphabet is used for the fuzzing mapper
  • Define number of random walks and its maximum length
FuzzingBasedTesting fuzzingBasedTesting =
                new FuzzingBasedTesting("learnedModels/MosquittoModel.dot", clients, new DemoFuzzingMapper());

fuzzingBasedTesting.setInputAlphabet(paperExample);

fuzzingBasedTesting.randomWalkWithFuzzing(1000, 10);

About

Using automata learning to mine models used for fuzzing of statefull systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages