Skip to content

Simple tool based on LearnLib to infer every FTP state model via Active Learning

Notifications You must be signed in to change notification settings

cristiandaniele/ftp-statemodel-learner

Repository files navigation

ftp-statemodel-learner

LearnLib harness to infer every FTP state model via Active Learning.

Setting the configuration file

Before running the learner, you need to edit the config.properties. Here you find a typical setup:

  • ip: 127.0.0.1

    [ip target]

  • port: 2200

    [server port]

  • commands: USER ubuntu,NOOP,PWD,TYPE,PORT,CDUP,CWD,RETR,ABOR,DELE,PASS ubuntu,REST,SIZE,MKD,RMD,STOR,SYST,APPE,RNFR,RNTO,OPTS,AUTH,PBSZ,PROT,SITE [list of commands, separated by a comma] NB:You don't have to add the QUIT command

  • debug: true

    [the default value is false]

  • timing_info: true

    [if enabled, the learner will add the cost -- in terms of seconds -- for every transition]

Running the learner

  • Via jar file:

    1. java -jar ftpLearner.jar
  • via Eclipse:

    1. File -> Open Project from File System
    2. Select the project
    3. Run it

Output

If you enable the debug mode, you can see every request and response:

alt text

The inferred state model is saved in a .dot file:

alt text Light FTP state model

Cleaning the state model

If you want to merge all the clouds into a single edge labelled with "others/{list of response codes}", you can run the script simplify_model.py

python3 simplify_model.py <input_file> <output_file>

to obtain something like this:

alt text Light FTP state model

Case studies

Implementation Inferred Number of states
Light FTP Yes 5
bftpd Yes 8
pure-ftp Yes 5
ProFTPd Yes 7

Todo

About

Simple tool based on LearnLib to infer every FTP state model via Active Learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published