├── .gitignore ├── .gitmodules ├── gpt3 ├── data │ ├── csv │ │ ├── davinci_pairs.csv │ │ └── results │ │ │ ├── babbage_200_pairs.csv │ │ │ ├── curie_200_pairs.csv │ │ │ └── davinci_200_pairs.csv │ ├── json │ │ └── davinci_pairs.json │ ├── jsonl │ │ └── davinci_pairs_prepared.jsonl │ ├── pcap │ │ ├── authentic │ │ │ ├── custom_dns.pcapng │ │ │ ├── custom_dns_http_icmp.pcapng │ │ │ ├── custom_pings.pcapng │ │ │ └── custom_pings3.pcapng │ │ └── synthetic │ │ │ ├── generated_curie_commands.pcap │ │ │ ├── generated_icmp.pcap │ │ │ └── generated_icmp_commands.pcap │ ├── pickle │ │ ├── davinci_pairs.pkl │ │ └── davinci_pairs2.pkl │ └── text │ │ ├── dns_summaries.txt │ │ ├── ip_files │ │ └── sample.txt │ │ ├── ping_summaries.txt │ │ └── three_summaries.txt ├── notebooks │ ├── davinci_commands_gen.ipynb │ ├── gen_packet_commands.ipynb │ ├── gen_packet_summary.ipynb │ ├── preprocess_finetuning_data.ipynb │ └── visualize_training_loss.ipynb ├── scripts │ ├── packet_generator.py │ ├── sample_input │ │ └── ip_file.toml │ ├── send_dns.py │ ├── send_icmp.py │ └── synthetic_traffic.pcap └── visualizations │ ├── babbage_loss.png │ ├── babbage_sequence_acc.png │ ├── babbage_token_acc.png │ ├── curie_loss.png │ ├── curie_sequence_acc.png │ ├── curie_token_acc.png │ ├── davinci_loss.png │ ├── davinci_sequence_acc.png │ └── davinci_token_acc.png └── pcap-analysis ├── Test_Scapy.ipynb ├── custom_ping_images.gz ├── custom_ping_images2.gz ├── custom_ping_images3.gz ├── icmp ├── packet_decoder.py ├── packet_encoder.py ├── pcap_reader.py ├── scapy_test.ipynb └── scapy_test.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | # PyCharm 156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 158 | # and can be added to the global gitignore or merged into this file. For a more nuclear 159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 | #.idea/ 161 | 162 | pcap-analysis/data/ 163 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pcap-analysis/scapy"] 2 | path = pcap-analysis/scapy 3 | url = https://github.com/secdev/scapy 4 | -------------------------------------------------------------------------------- /gpt3/data/csv/results/curie_200_pairs.csv: -------------------------------------------------------------------------------- 1 | step,elapsed_tokens,elapsed_examples,training_loss,training_sequence_accuracy,training_token_accuracy 2 | 1,481,1,0.28529609541908385,0.0,0.8966666666666666 3 | 2,954,2,0.27094609898299,0.0,0.9057239057239057 4 | 3,1435,3,0.22746211818904208,0.0,0.92 5 | 4,1980,4,0.34556378392256565,0.0,0.8898305084745762 6 | 5,2437,5,0.1736245306820378,0.0,0.9379562043795621 7 | 6,2910,6,0.1232550765830746,0.0,0.9629629629629629 8 | 7,3447,7,0.22733500193234332,0.0,0.9215686274509803 9 | 8,4128,8,0.23321347057505631,0.0,0.9177777777777778 10 | 9,4793,9,0.11998676113770798,0.0,0.9553571428571429 11 | 10,5266,10,0.0654326353447018,0.0,0.9696969696969697 12 | 11,5739,11,0.0501759892557319,0.0,0.9763513513513513 13 | 12,6220,12,0.028202372994341984,0.0,0.9933110367892977 14 | 13,6693,13,0.03225889765655508,0.0,0.9932659932659933 15 | 14,7174,14,0.025828851067178384,0.0,0.9933333333333333 16 | 15,7655,15,0.022373098466904353,0.0,0.9933110367892977 17 | 16,8136,16,0.011000974097259504,0.0,0.9933333333333333 18 | 17,8721,17,0.11451468276458539,0.0,0.9675675675675676 19 | 18,9298,18,0.03629239715197073,0.0,0.984 20 | 19,9779,19,0.027438989262081537,0.0,0.9932885906040269 21 | 20,10308,20,0.04363090312733758,0.0,0.9886363636363636 22 | 21,10853,21,0.04642105155523318,0.0,0.9774011299435028 23 | 22,11478,22,0.10523793622586436,0.0,0.965 24 | 23,11951,23,0.022713053424864953,0.0,0.9932432432432432 25 | 24,12424,24,0.02143860636080858,0.0,0.9898648648648649 26 | 25,12873,25,0.07373166141846717,0.0,0.981549815498155 27 | 26,13354,26,0.02456825810612098,0.0,0.9865771812080537 28 | 27,13835,27,0.020099734890070598,0.0,0.9932885906040269 29 | 28,14316,28,0.01821843539520994,0.0,0.9933110367892977 30 | 29,14797,29,0.0186524954608821,0.0,0.9866666666666667 31 | 30,15278,30,0.01660876399811933,0.0,0.9932885906040269 32 | 31,15759,31,0.01849691409287361,0.0,0.9899665551839465 33 | 32,16240,32,0.0203015463859264,0.0,0.9899665551839465 34 | 33,16969,33,0.10598448636940133,0.0,0.9665970772442589 35 | 34,17450,34,0.012848006802892895,0.0,0.9966442953020134 36 | 35,17931,35,0.01376605574990739,0.0,0.9966442953020134 37 | 36,18420,36,0.09872426906837058,0.0,0.9678456591639871 38 | 37,18869,37,0.020105592797622782,0.0,0.985239852398524 39 | 38,19454,38,0.025593453904129995,0.0,0.9919354838709677 40 | 39,20023,39,0.028841233410873284,0.0,0.9893048128342246 41 | 40,20568,40,0.14649865931565415,0.0,0.9591280653950953 42 | 41,21113,41,0.014924644726234226,0.0,0.9971988795518207 43 | 42,21586,42,0.021477221478542374,0.0,0.98989898989899 44 | 43,22107,43,0.04179337823139591,0.0,0.9879518072289156 45 | 44,22588,44,0.011510868113645292,0.0,0.9966555183946488 46 | 45,23069,45,0.008702520589672537,1.0,1.0 47 | 46,23638,46,0.01284928029916155,0.0,0.9946524064171123 48 | 47,24127,47,0.011486097998955056,0.0,0.9933774834437086 49 | 48,24720,48,0.017934446457239423,0.0,0.9919786096256684 50 | 49,25201,49,0.00811769055522854,0.0,0.9966442953020134 51 | 50,25682,50,0.009903107416310303,0.0,0.9966555183946488 52 | 51,26251,51,0.021176349841981447,0.0,0.9946091644204852 53 | 52,26732,52,0.008948069622416684,0.0,0.9933333333333333 54 | 53,27213,53,0.00784582973933819,0.0,0.9966555183946488 55 | 54,27902,54,0.03586747629780592,0.0,0.9817767653758542 56 | 55,28383,55,0.02676098072100443,0.0,0.9966555183946488 57 | 56,28888,56,0.08653354159123919,0.0,0.9757575757575757 58 | 57,29457,57,0.020555167941164652,0.0,0.989247311827957 59 | 58,30266,58,0.2662484572987174,0.0,0.9320557491289199 60 | 59,30859,59,0.020835491639652405,0.0,0.9866310160427807 61 | 60,31340,60,0.007747922969250109,0.0,0.9966666666666667 62 | 61,32317,61,0.1369087905057371,0.0,0.9574175824175825 63 | 62,32798,62,0.005883355736441329,1.0,1.0 64 | 63,33279,63,0.0056899373755106356,1.0,1.0 65 | 64,33760,64,0.005787776921148018,1.0,1.0 66 | 65,34305,65,0.02985492140709021,0.0,0.9859154929577465 67 | 66,34786,66,0.008069929717989902,0.0,0.9966555183946488 68 | 67,35323,67,0.017300387962057802,0.0,0.994413407821229 69 | 68,35940,68,0.0219993727351404,0.0,0.990632318501171 70 | 69,36453,69,0.06179498542155584,0.0,0.9730538922155688 71 | 70,37006,70,0.02808547111338418,0.0,0.9886363636363636 72 | 71,37487,71,0.005699190104238361,1.0,1.0 73 | 72,37968,72,0.005082800162439575,1.0,1.0 74 | 73,38449,73,0.004887592857676137,1.0,1.0 75 | 74,38930,74,0.00796482086823587,0.0,0.9966555183946488 76 | 75,39411,75,0.004910715997609894,1.0,1.0 77 | 76,39996,76,0.0439867537844055,0.0,0.9838709677419355 78 | 77,40565,77,0.023822873007829974,0.0,0.9919137466307277 79 | 78,41278,78,0.14114458492767235,0.0,0.9508840864440079 80 | 79,41759,79,0.006588365832744188,0.0,0.9966555183946488 81 | 80,42232,80,0.006014536603725426,1.0,1.0 82 | 81,42713,81,0.008036929974853665,0.0,0.9966442953020134 83 | 82,43194,82,0.005678126771208484,1.0,1.0 84 | 83,43675,83,0.008412522580440885,0.0,0.9966555183946488 85 | 84,44156,84,0.00933875541563693,0.0,0.9966442953020134 86 | 85,45085,85,0.061639645672630014,0.0,0.9767441860465116 87 | 86,45566,86,0.004379777938667756,1.0,1.0 88 | 87,46103,87,0.05744006066671973,0.0,0.9858356940509915 89 | 88,46584,88,0.008360672409345637,0.0,0.9966666666666667 90 | 89,47201,89,0.12103079945250872,0.0,0.9628712871287128 91 | 90,47682,90,0.006406251464656313,0.0,0.9966555183946488 92 | 91,48163,91,0.006566843461668689,1.0,1.0 93 | 92,48676,92,0.03474311122624028,0.0,0.9880597014925373 94 | 93,49669,93,0.057181345925864144,0.0,0.9860335195530726 95 | 94,50238,94,0.017222701613041968,0.0,0.9919137466307277 96 | 95,50719,95,0.02694043144544492,0.0,0.9865771812080537 97 | 96,51192,96,0.005164084704971313,1.0,1.0 98 | 97,51857,97,0.03389610230559283,0.0,0.9885321100917431 99 | 98,52442,98,0.03479457987549294,0.0,0.9891891891891892 100 | 99,52923,99,0.005048786336174135,1.0,1.0 101 | 100,53452,100,0.013735882196520168,0.0,0.9943502824858758 102 | 101,53933,101,0.004500730721176183,1.0,1.0 103 | 102,54462,102,0.017508782556457318,0.0,0.9887005649717514 104 | 103,55143,103,0.018405193476807996,0.0,0.9933184855233853 105 | 104,55624,104,0.022064867927124046,0.0,0.9865771812080537 106 | 105,56097,105,0.010815172802233387,0.0,0.9966329966329966 107 | 106,56570,106,0.013627597563350954,0.0,0.9932659932659933 108 | 107,57155,107,0.01843554235621857,0.0,0.9946236559139785 109 | 108,57772,108,0.060731976191336814,0.0,0.9850746268656716 110 | 109,58245,109,0.0037536421172961027,1.0,1.0 111 | 110,58726,110,0.004457076925086881,1.0,1.0 112 | 111,59207,111,0.00439714390985727,1.0,1.0 113 | 112,59688,112,0.007178213427125452,0.0,0.9966555183946488 114 | 113,60169,113,0.00448886972733169,1.0,1.0 115 | 114,60650,114,0.0045581989420416255,1.0,1.0 116 | 115,61195,115,0.03886372526786495,0.0,0.9885386819484241 117 | 116,61652,116,0.027461938361111236,0.0,0.9927007299270073 118 | 117,62133,117,0.016493302160689713,0.0,0.9966442953020134 119 | 118,62614,118,0.009495227889808033,0.0,0.9966442953020134 120 | 119,63095,119,0.008266874625945948,0.0,0.9966442953020134 121 | 120,63624,120,0.02481159674795389,0.0,0.9915254237288136 122 | 121,64209,121,0.030986996377101998,0.0,0.9891304347826086 123 | 122,64690,122,0.005459556748915582,1.0,1.0 124 | 123,65171,123,0.008661331369465092,0.0,0.9966555183946488 125 | 124,65700,124,0.016638542909492016,0.0,0.9969788519637462 126 | 125,66445,125,0.11585197229577618,0.0,0.9632495164410058 127 | 126,67326,126,0.03677656437358908,0.0,0.9875195007800313 128 | 127,67807,127,0.003648614194147715,1.0,1.0 129 | 128,68288,128,0.006670256364440099,0.0,0.9966442953020134 130 | 129,68769,129,0.004328606811288015,1.0,1.0 131 | 130,69250,130,0.005560444570677501,0.0,0.9966442953020134 132 | 131,69899,131,0.06015239308009262,0.0,0.9822222222222222 133 | 132,70380,132,0.006081882524428011,0.0,0.9966442953020134 134 | 133,70973,133,0.009167174857639092,0.0,0.9973333333333333 135 | 134,71446,134,0.004286789394794028,1.0,1.0 136 | 135,72671,135,0.09027296516927481,0.0,0.9759562841530055 137 | 136,73144,136,0.00371796782353082,1.0,1.0 138 | 137,73625,137,0.0038505074856628515,1.0,1.0 139 | 138,74162,138,0.009354492075166027,1.0,1.0 140 | 139,74643,139,0.00437553743544933,1.0,1.0 141 | 140,75124,140,0.003831518625558531,1.0,1.0 142 | 141,75597,141,0.004525038552900933,1.0,1.0 143 | 142,76230,142,0.15001061232926619,0.0,0.9574944071588367 144 | 143,76711,143,0.003376662095091021,1.0,1.0 145 | 144,77192,144,0.004440342067958095,1.0,1.0 146 | 145,77633,145,0.03168689980872461,0.0,0.9924812030075187 147 | 146,78202,146,0.01009956246524243,0.0,0.9973118279569892 148 | 147,78851,147,0.049036290550286014,0.0,0.9843400447427293 149 | 148,79332,148,0.003671127769196647,1.0,1.0 150 | 149,79813,149,0.003513515164291863,1.0,1.0 151 | 150,80294,150,0.0034195470476713528,1.0,1.0 152 | 151,80775,151,0.00384012844179734,1.0,1.0 153 | 152,81256,152,0.0039646585784456415,1.0,1.0 154 | 153,81729,153,0.003354770265298359,1.0,1.0 155 | 154,82202,154,0.004024621378980696,1.0,1.0 156 | 155,82683,155,0.0033672974584788872,1.0,1.0 157 | 156,83156,156,0.003151934620027091,1.0,1.0 158 | 157,83629,157,0.0036675366578263757,1.0,1.0 159 | 158,84110,158,0.009096398147623235,0.0,0.9966555183946488 160 | 159,84591,159,0.0032843225994989497,1.0,1.0 161 | 160,85480,160,0.05697612815365073,0.0,0.9782945736434109 162 | 161,86049,161,0.019090543181870687,0.0,0.9946236559139785 163 | 162,86530,162,0.0033001683336965223,1.0,1.0 164 | 163,87003,163,0.0030590546233654876,1.0,1.0 165 | 164,87484,164,0.0029405079214879395,1.0,1.0 166 | 165,88005,165,0.016524525715033555,0.0,0.994269340974212 167 | 166,88598,166,0.011723279442825581,0.0,0.9973190348525469 168 | 167,89151,167,0.05837260193192428,0.0,0.9853372434017595 169 | 168,89632,168,0.002772359197002225,1.0,1.0 170 | 169,90113,169,0.0031156916939419237,1.0,1.0 171 | 170,90634,170,0.011620034796046657,0.0,0.9969418960244648 172 | 171,91115,171,0.008170759616509593,0.0,0.9966555183946488 173 | 172,91596,172,0.003527476050135526,1.0,1.0 174 | 173,92077,173,0.0037098370922077537,1.0,1.0 175 | 174,92926,174,0.08579812952871467,0.0,0.96964586846543 176 | 175,93407,175,0.030245706728414968,0.0,0.9966555183946488 177 | 176,93968,176,0.07282171156581627,0.0,0.9775910364145658 178 | 177,94449,177,0.0032944885600974345,1.0,1.0 179 | 178,95018,178,0.011620579123786976,0.0,0.9973333333333333 180 | 179,95499,179,0.003825612696563186,1.0,1.0 181 | 180,95980,180,0.003278312158173841,1.0,1.0 182 | 181,96453,181,0.011472566757704902,0.0,0.9966216216216216 183 | 182,96934,182,0.0033913324087461953,1.0,1.0 184 | 183,97415,183,0.0040551975969486285,1.0,1.0 185 | 184,97888,184,0.003711029900670535,1.0,1.0 186 | 185,98457,185,0.008691527592965261,1.0,1.0 187 | 186,99050,186,0.009363523225437846,0.0,0.9973190348525469 188 | 187,99587,187,0.04688455418634839,0.0,0.9827586206896551 189 | 188,100860,188,0.08018662416424506,0.0,0.9714867617107943 190 | 189,101397,189,0.010009760351611253,0.0,0.9971988795518207 191 | 190,101878,190,0.0027922677927588804,1.0,1.0 192 | 191,102359,191,0.0030573518098318386,1.0,1.0 193 | 192,102840,192,0.0029674810925614174,1.0,1.0 194 | 193,103289,193,0.013151443761533162,0.0,0.9926470588235294 195 | 194,103762,194,0.014167938887855875,0.0,0.9966329966329966 196 | 195,104243,195,0.0036321603277064294,1.0,1.0 197 | 196,104700,196,0.00679876833867336,0.0,0.9963503649635036 198 | 197,105269,197,0.007857455695437528,0.0,0.9973045822102425 199 | 198,105742,198,0.015668434903525562,0.0,0.9932659932659933 200 | 199,106247,199,0.02730894311314219,0.0,0.9909638554216867 201 | 200,106720,200,0.0038268082747664185,1.0,1.0 202 | 201,107201,201,0.004299654702491112,1.0,1.0 203 | 202,107738,202,0.009836399450540325,0.0,0.9971988795518207 204 | 203,108331,203,0.007375151194670471,1.0,1.0 205 | 204,108812,204,0.002626315083464175,1.0,1.0 206 | 205,109293,205,0.0024938226380764473,1.0,1.0 207 | 206,109838,206,0.007502616647637726,0.0,0.9971830985915493 208 | 207,110319,207,0.004222014011128141,0.0,0.9966666666666667 209 | 208,110888,208,0.007286728427288936,0.0,0.9973262032085561 210 | 209,112113,209,0.04854822992087407,0.0,0.9814207650273225 211 | 210,112650,210,0.03223694079828677,0.0,0.9885057471264368 212 | 211,113131,211,0.0024243734335987538,1.0,1.0 213 | 212,113612,212,0.0024564945420091477,1.0,1.0 214 | 213,114197,213,0.006794619241404607,1.0,1.0 215 | 214,114678,214,0.002094388270470059,1.0,1.0 216 | 215,115159,215,0.002276051995548998,1.0,1.0 217 | 216,115640,216,0.0024417479857455366,1.0,1.0 218 | 217,116121,217,0.0022043186455088385,1.0,1.0 219 | 218,116602,218,0.0023917474925628083,1.0,1.0 220 | 219,117219,219,0.02158380587518064,0.0,0.9900990099009901 221 | 220,117700,220,0.0023747493948345923,1.0,1.0 222 | 221,118173,221,0.0020916771925458236,1.0,1.0 223 | 222,118654,222,0.002197318558707431,1.0,1.0 224 | 223,119215,223,0.03665309136788861,0.0,0.988795518207283 225 | 224,119696,224,0.0023680352642717396,1.0,1.0 226 | 225,120177,225,0.0023803446494901786,1.0,1.0 227 | 226,120706,226,0.021264933739186104,0.0,0.9939577039274925 228 | 227,121187,227,0.002355970329332213,1.0,1.0 229 | 228,121732,228,0.028707521736002314,0.0,0.9915966386554622 230 | 229,122221,229,0.010547242882033219,0.0,0.9967845659163987 231 | 230,122702,230,0.002487137720456799,1.0,1.0 232 | 231,123183,231,0.003481245648903595,1.0,1.0 233 | 232,123664,232,0.0033619558455973385,1.0,1.0 234 | 233,124233,233,0.00833751945703769,0.0,0.9973118279569892 235 | 234,124714,234,0.002631610881681264,1.0,1.0 236 | 235,125459,235,0.05354257524601314,0.0,0.9787234042553191 237 | 236,125988,236,0.004065812158235146,1.0,1.0 238 | 237,126461,237,0.002029631081177494,1.0,1.0 239 | 238,127030,238,0.014169589855571431,0.0,0.9973190348525469 240 | 239,127503,239,0.0024763611933052536,1.0,1.0 241 | 240,127944,240,0.01850926709786434,0.0,0.9962406015037594 242 | 241,128657,241,0.03444260216330344,0.0,0.9823182711198428 243 | 242,129138,242,0.002156874860004236,1.0,1.0 244 | 243,129627,243,0.002169118237142022,1.0,1.0 245 | 244,130476,244,0.052260173452203115,0.0,0.984822934232715 246 | 245,130989,245,0.039115449334344604,0.0,0.9850299401197605 247 | 246,131470,246,0.002832600584584796,1.0,1.0 248 | 247,131951,247,0.0025662748027659556,1.0,1.0 249 | 248,132432,248,0.0025186087659133955,1.0,1.0 250 | 249,133097,249,0.01056842442614525,1.0,1.0 251 | 250,133682,250,0.023145003145954707,0.0,0.9945945945945946 252 | 251,134155,251,0.002455639677065179,1.0,1.0 253 | 252,134628,252,0.002317714025840617,1.0,1.0 254 | 253,135101,253,0.0023812969991745853,1.0,1.0 255 | 254,135574,254,0.0029163404319359656,1.0,1.0 256 | 255,136207,255,0.09060156537325616,0.0,0.9664429530201343 257 | 256,136688,256,0.0023151540164718216,1.0,1.0 258 | 257,137169,257,0.001956175235579045,1.0,1.0 259 | 258,137642,258,0.002331979971460304,1.0,1.0 260 | 259,138179,259,0.016192017955057834,0.0,0.9943342776203966 261 | 260,138636,260,0.02258904595832077,0.0,0.9890510948905109 262 | 261,139117,261,0.0023210160009895543,1.0,1.0 263 | 262,139654,262,0.00978325529320527,0.0,0.9972067039106145 264 | 263,140535,263,0.030548211752218845,0.0,0.9859594383775351 265 | 264,141128,264,0.005763638186436525,1.0,1.0 266 | 265,141601,265,0.002193230726831402,1.0,1.0 267 | 266,142082,266,0.0020761971192902067,1.0,1.0 268 | 267,142651,267,0.0059908292369223815,0.0,0.9973262032085561 269 | 268,143100,268,0.016787584650069215,0.0,0.992619926199262 270 | 269,143669,269,0.013816706571350137,0.0,0.9946091644204852 271 | 270,144190,270,0.01062139929752224,0.0,0.997134670487106 272 | 271,144671,271,0.002115184338998654,1.0,1.0 273 | 272,145152,272,0.002105954165334601,1.0,1.0 274 | 273,145625,273,0.0023730862165574312,1.0,1.0 275 | 274,146106,274,0.002369408483560814,1.0,1.0 276 | 275,146587,275,0.0027197751137439164,1.0,1.0 277 | 276,147068,276,0.0024602673899728937,1.0,1.0 278 | 277,147549,277,0.0026530218200761717,1.0,1.0 279 | 278,148822,278,0.0531881624265802,0.0,0.9806517311608961 280 | 279,149303,279,0.0021330244257693433,1.0,1.0 281 | 280,149784,280,0.0022984284481489944,1.0,1.0 282 | 281,150265,281,0.003916668152937712,0.0,0.9966666666666667 283 | 282,150834,282,0.0041518377865521925,1.0,1.0 284 | 283,151315,283,0.0019879257888464853,1.0,1.0 285 | 284,151796,284,0.009428930202644075,0.0,0.9966442953020134 286 | 285,152789,285,0.028605176328250836,0.0,0.9930167597765364 287 | 286,153270,286,0.0047729533408445105,0.0,0.9966555183946488 288 | 287,153743,287,0.003133409231346573,1.0,1.0 289 | 288,154216,288,0.0018418322814353135,1.0,1.0 290 | 289,154697,289,0.001829193992212158,1.0,1.0 291 | 290,155250,290,0.02206721989562223,0.0,0.9882697947214076 292 | 291,155979,291,0.04391530086977401,0.0,0.9832985386221295 293 | 292,156452,292,0.013620387227199507,0.0,0.9966329966329966 294 | 293,156933,293,0.0023645808199639416,1.0,1.0 295 | 294,157414,294,0.002148389584586688,1.0,1.0 296 | 295,157895,295,0.002155732871247343,1.0,1.0 297 | 296,158368,296,0.0019343973275512696,1.0,1.0 298 | 297,158897,297,0.005131537449972082,1.0,1.0 299 | 298,159370,298,0.0028398071937653885,1.0,1.0 300 | 299,159851,299,0.0023650228339055323,1.0,1.0 301 | 300,160324,300,0.001906083136274423,1.0,1.0 302 | 301,160877,301,0.021285810963117595,0.0,0.9943181818181818 303 | 302,161446,302,0.005089793421948364,0.0,0.9973045822102425 304 | 303,161927,303,0.0020111198684000264,1.0,1.0 305 | 304,162608,304,0.008433415322968275,0.0,0.9977728285077951 306 | 305,163081,305,0.0017334332493729714,1.0,1.0 307 | 306,163698,306,0.0064300839073298515,1.0,1.0 308 | 307,164179,307,0.0019470056833196922,1.0,1.0 309 | 308,164660,308,0.0017388019975623338,1.0,1.0 310 | 309,165341,309,0.011801403154710859,0.0,0.9977777777777778 311 | 310,165990,310,0.04929494706839841,0.0,0.9777777777777777 312 | 311,166511,311,0.005760976099461395,1.0,1.0 313 | 312,166992,312,0.0019071757409478492,1.0,1.0 314 | 313,167449,313,0.011226103424830085,0.0,0.9963503649635036 315 | 314,167930,314,0.0019245597900014626,1.0,1.0 316 | 315,168411,315,0.0022648903518118347,1.0,1.0 317 | 316,168884,316,0.0021053910956966774,1.0,1.0 318 | 317,169421,317,0.004144466003199895,1.0,1.0 319 | 318,169990,318,0.006171658204401154,1.0,1.0 320 | 319,170519,319,0.014034863418217055,0.0,0.9971751412429378 321 | 320,171000,320,0.0023407801206673517,1.0,1.0 322 | 321,171481,321,0.002463653465491205,1.0,1.0 323 | 322,172010,322,0.007917391035985492,0.0,0.9971590909090909 324 | 323,172483,323,0.0019344091519771464,1.0,1.0 325 | 324,172964,324,0.0031094369147078227,1.0,1.0 326 | 325,173557,325,0.0056064206128211835,1.0,1.0 327 | 326,174038,326,0.0017588833295553942,1.0,1.0 328 | 327,174519,327,0.0021465087136002775,1.0,1.0 329 | 328,174992,328,0.0020787291001522854,1.0,1.0 330 | 329,175473,329,0.0015906656451323245,1.0,1.0 331 | 330,175954,330,0.0019096542785986502,1.0,1.0 332 | 331,176403,331,0.01205470943314115,0.0,0.996309963099631 333 | 332,176884,332,0.0016202725836499496,1.0,1.0 334 | 333,177365,333,0.0017285371348185745,1.0,1.0 335 | 334,177846,334,0.001816831244156182,1.0,1.0 336 | 335,178319,335,0.0016267699350115772,1.0,1.0 337 | 336,178800,336,0.0016076541645527532,1.0,1.0 338 | 337,179257,337,0.008903095115165984,0.0,0.9963503649635036 339 | 338,179738,338,0.0021367084727382762,1.0,1.0 340 | 339,180219,339,0.0018828253892815762,1.0,1.0 341 | 340,181148,340,0.016831356388400595,0.0,0.9927325581395349 342 | 341,181797,341,0.02890540617940258,0.0,0.9932885906040269 343 | 342,182414,342,0.04559061088243165,0.0,0.9875621890547264 344 | 343,182895,343,0.0022951696458082794,1.0,1.0 345 | 344,183480,344,0.0046534979403967495,1.0,1.0 346 | 345,183961,345,0.0024120381252014547,1.0,1.0 347 | 346,184506,346,0.01327388620704354,0.0,0.9971751412429378 348 | 347,185091,347,0.004436067323102651,1.0,1.0 349 | 348,185572,348,0.001949761794877696,1.0,1.0 350 | 349,186053,349,0.001870738706425526,1.0,1.0 351 | 350,186942,350,0.035561967619745616,0.0,0.9875968992248062 352 | 351,187423,351,0.002215036308216141,1.0,1.0 353 | 352,187904,352,0.0024555174240620176,1.0,1.0 354 | 353,188377,353,0.0021466369700130494,1.0,1.0 355 | 354,188858,354,0.002039477929520757,1.0,1.0 356 | 355,189339,355,0.010138956871532021,0.0,0.9966555183946488 357 | 356,189820,356,0.0020006713445584576,1.0,1.0 358 | 357,190301,357,0.0018367331506607438,1.0,1.0 359 | 358,190774,358,0.0026500446347495414,1.0,1.0 360 | 359,191223,359,0.023378924255708384,0.0,0.9889705882352942 361 | 360,191704,360,0.002197193912380631,1.0,1.0 362 | 361,192273,361,0.013645497741983075,0.0,0.9973118279569892 363 | 362,192754,362,0.0019841533155366842,1.0,1.0 364 | 363,193299,363,0.04336680263841271,0.0,0.9809264305177112 365 | 364,193780,364,0.0020098025451191965,1.0,1.0 366 | 365,194325,365,0.010758855046143078,0.0,0.9971751412429378 367 | 366,194798,366,0.001695899674067913,1.0,1.0 368 | 367,195487,367,0.02331596521447228,0.0,0.9931662870159453 369 | 368,195968,368,0.0020401878850845596,1.0,1.0 370 | 369,196441,369,0.0022317926044606875,1.0,1.0 371 | 370,196914,370,0.0019651486542661242,1.0,1.0 372 | 371,197395,371,0.001766915112748317,1.0,1.0 373 | 372,198060,372,0.00894220724045143,0.0,0.9977678571428571 374 | 373,198541,373,0.0019017826618632975,1.0,1.0 375 | 374,199022,374,0.0018931668297314523,1.0,1.0 376 | 375,199503,375,0.0018769592169935562,1.0,1.0 377 | 376,200072,376,0.004793868734132251,1.0,1.0 378 | 377,200665,377,0.006456000466517268,0.0,0.9973190348525469 379 | 378,201146,378,0.0019286203072282244,1.0,1.0 380 | 379,201627,379,0.0018212364976328756,1.0,1.0 381 | 380,202196,380,0.0061701644938917865,0.0,0.9973118279569892 382 | 381,202733,381,0.006312951202984744,1.0,1.0 383 | 382,203214,382,0.0017031658375586444,1.0,1.0 384 | 383,204023,383,0.06737365556670628,0.0,0.975609756097561 385 | 384,204616,384,0.005726035541287089,0.0,0.9973262032085561 386 | 385,205241,385,0.018142278344529545,0.0,0.9925 387 | 386,205826,386,0.018497298373050558,0.0,0.9945945945945946 388 | 387,206411,387,0.012614890787695066,0.0,0.9972826086956522 389 | 388,206892,388,0.0016912601708195501,1.0,1.0 390 | 389,207397,389,0.012303403692870382,0.0,0.9969879518072289 391 | 390,207878,390,0.0016926731940035693,1.0,1.0 392 | 391,208423,391,0.010992902322152,0.0,0.997134670487106 393 | 392,208936,392,0.008294987646828915,0.0,0.9970149253731343 394 | 393,209417,393,0.0018582839151069618,1.0,1.0 395 | 394,209898,394,0.0018873681711007418,1.0,1.0 396 | 395,210379,395,0.0019566320058738602,1.0,1.0 397 | 396,210900,396,0.020640964572925555,0.0,0.9909638554216867 398 | 397,211405,397,0.016438102432241596,0.0,0.9939393939393939 399 | 398,211886,398,0.002134917089923518,1.0,1.0 400 | 399,212463,399,0.007859528625274767,0.0,0.9973333333333333 401 | 400,213440,400,0.017656411235689756,0.0,0.9931318681318682 402 | 401,214249,401,0.01856864955614453,0.0,0.9930313588850174 403 | 402,214754,402,0.010022027987948757,0.0,0.9939393939393939 404 | 403,215435,403,0.008462807512253062,0.0,0.9977777777777778 405 | 404,215972,404,0.004057494717865423,1.0,1.0 406 | 405,216445,405,0.0016376195360139779,1.0,1.0 407 | 406,216926,406,0.0016041254335485936,1.0,1.0 408 | 407,217399,407,0.0018013457614194698,1.0,1.0 409 | 408,217880,408,0.0016650692316295937,1.0,1.0 410 | 409,218353,409,0.0016198643423116774,1.0,1.0 411 | 410,218906,410,0.016440378209184647,0.0,0.9912023460410557 412 | 411,219387,411,0.0018071475543326757,1.0,1.0 413 | 412,219868,412,0.001625185594393018,1.0,1.0 414 | 413,220349,413,0.0017385371488972737,1.0,1.0 415 | 414,220918,414,0.006531370106619986,0.0,0.9973190348525469 416 | 415,221367,415,0.009816727437481146,0.0,0.9963235294117647 417 | 416,221840,416,0.0014981080833208972,1.0,1.0 418 | 417,222313,417,0.0017457801960756392,1.0,1.0 419 | 418,222794,418,0.0017342107177326688,1.0,1.0 420 | 419,223411,419,0.010571165317984278,0.0,0.9953161592505855 421 | 420,223884,420,0.0018385556518134862,1.0,1.0 422 | 421,224365,421,0.001816192933560231,1.0,1.0 423 | 422,224838,422,0.001683849284662667,1.0,1.0 424 | 423,225319,423,0.0015993808618708577,1.0,1.0 425 | 424,225800,424,0.0019098621375388436,1.0,1.0 426 | 425,226281,425,0.001741034182360638,1.0,1.0 427 | 426,226762,426,0.0018379024751724964,1.0,1.0 428 | 427,227347,427,0.00594315730280339,0.0,0.9973118279569892 429 | 428,227828,428,0.0016508598236608888,1.0,1.0 430 | 429,228285,429,0.007746579544776983,0.0,0.9963503649635036 431 | 430,228758,430,0.001676887746214225,1.0,1.0 432 | 431,229239,431,0.0018436769289587919,1.0,1.0 433 | 432,229720,432,0.0016900076771812357,1.0,1.0 434 | 433,230713,433,0.018936666929044162,0.0,0.994413407821229 435 | 434,231202,434,0.015121153567025019,0.0,0.9967845659163987 436 | 435,231771,435,0.003637861123277891,1.0,1.0 437 | 436,232316,436,0.004992696744142152,1.0,1.0 438 | 437,232797,437,0.0016894207934863223,1.0,1.0 439 | 438,233278,438,0.0016610124426302878,1.0,1.0 440 | 439,233759,439,0.0016058088453032055,1.0,1.0 441 | 440,234352,440,0.004155292477343304,1.0,1.0 442 | 441,234833,441,0.0014759018698854247,1.0,1.0 443 | 442,235314,442,0.0017180951465201742,1.0,1.0 444 | 443,236203,443,0.02410576098669561,0.0,0.9922480620155039 445 | 444,236684,444,0.0017222443656121425,1.0,1.0 446 | 445,237205,445,0.006402614163587162,0.0,0.997134670487106 447 | 446,237686,446,0.0015887534938376147,1.0,1.0 448 | 447,238159,447,0.0015955842364870471,1.0,1.0 449 | 448,238640,448,0.0017368903017461192,1.0,1.0 450 | 449,239329,449,0.018915330961272982,0.0,0.9954441913439636 451 | 450,239842,450,0.01973399268314272,0.0,0.9880239520958084 452 | 451,240315,451,0.0014916542655364655,1.0,1.0 453 | 452,240796,452,0.001609667344933186,1.0,1.0 454 | 453,241277,453,0.0016661134719318511,1.0,1.0 455 | 454,241750,454,0.0015092576522062323,1.0,1.0 456 | 455,242223,455,0.0016815855086786643,1.0,1.0 457 | 456,242704,456,0.0015402657968307237,1.0,1.0 458 | 457,243289,457,0.004287274368720497,1.0,1.0 459 | 458,243770,458,0.0016284961872535355,1.0,1.0 460 | 459,244251,459,0.001668407937896782,1.0,1.0 461 | 460,244732,460,0.0015881593327700093,1.0,1.0 462 | 461,245181,461,0.012951068927021131,0.0,0.996309963099631 463 | 462,245662,462,0.0016187753701671283,1.0,1.0 464 | 463,246143,463,0.0017228029019151275,1.0,1.0 465 | 464,246760,464,0.023105040979462234,0.0,0.9900990099009901 466 | 465,247241,465,0.0015675823664097388,1.0,1.0 467 | 466,247770,466,0.004795376488402358,1.0,1.0 468 | 467,248699,467,0.009305242871363213,0.0,0.9956395348837209 469 | 468,249244,468,0.003396009042028288,1.0,1.0 470 | 469,249717,469,0.0015851565650940056,1.0,1.0 471 | 470,250198,470,0.0015259545165065697,1.0,1.0 472 | 471,250783,471,0.007248425529906874,0.0,0.9972972972972973 473 | 472,251264,472,0.0013980256860072395,1.0,1.0 474 | 473,251745,473,0.0015829005664815203,1.0,1.0 475 | 474,252226,474,0.0015047140374735766,1.0,1.0 476 | 475,252707,475,0.0014146690261680071,1.0,1.0 477 | 476,253252,476,0.012329269788152637,0.0,0.9945504087193461 478 | 477,253733,477,0.0015005209864174059,1.0,1.0 479 | 478,254214,478,0.001406046684719532,1.0,1.0 480 | 479,254687,479,0.001292436037914269,1.0,1.0 481 | 480,255168,480,0.0016149652766221571,1.0,1.0 482 | 481,255649,481,0.0015428698448063318,1.0,1.0 483 | 482,256122,482,0.0013616986906500128,1.0,1.0 484 | 483,256603,483,0.001486280566702273,1.0,1.0 485 | 484,257084,484,0.0015207536230810407,1.0,1.0 486 | 485,257565,485,0.0013536576129708836,1.0,1.0 487 | 486,258086,486,0.009653200237899747,0.0,0.9939759036144579 488 | 487,258559,487,0.0014883715855512191,1.0,1.0 489 | 488,259040,488,0.0015392902857946926,1.0,1.0 490 | 489,259633,489,0.005222343272841167,0.0,0.9973190348525469 491 | 490,260114,490,0.0013966430611252905,1.0,1.0 492 | 491,260595,491,0.001543630241243216,1.0,1.0 493 | 492,261076,492,0.0015285200790985593,1.0,1.0 494 | 493,261645,493,0.004227098356686378,1.0,1.0 495 | 494,262126,494,0.0014086303342235637,1.0,1.0 496 | 495,262711,495,0.0038252867434829738,1.0,1.0 497 | 496,263192,496,0.001392045810042486,1.0,1.0 498 | 497,263761,497,0.004378711963560554,1.0,1.0 499 | 498,264242,498,0.001426560741325824,1.0,1.0 500 | 499,264723,499,0.03292709444125389,0.0,0.9966442953020134 501 | 500,265204,500,0.001547300002253997,1.0,1.0 502 | 501,266085,501,0.011241083650372526,0.0,0.9953198127925117 503 | 502,266750,502,0.010525035477162279,0.0,0.9977064220183486 504 | 503,267207,503,0.011746459978679027,0.0,0.9963503649635036 505 | 504,267784,504,0.0026240426072390312,1.0,1.0 506 | 505,268265,505,0.0016427040142555352,1.0,1.0 507 | 506,268746,506,0.0019849414881101418,1.0,1.0 508 | 507,269227,507,0.007799577257367895,0.0,0.9966555183946488 509 | 508,269708,508,0.0013850443767145035,1.0,1.0 510 | 509,270301,509,0.002902494849501755,1.0,1.0 511 | 510,270782,510,0.001586713516981913,1.0,1.0 512 | 511,271255,511,0.0015856285176358799,1.0,1.0 513 | 512,272104,512,0.030028588479004064,0.0,0.9831365935919055 514 | 513,272585,513,0.0021910925585715444,1.0,1.0 515 | 514,273066,514,0.002079963416708872,1.0,1.0 516 | 515,273635,515,0.0028235629490041122,1.0,1.0 517 | 516,274108,516,0.0024451729719941868,1.0,1.0 518 | 517,274677,517,0.0031669058521192595,1.0,1.0 519 | 518,275150,518,0.0014875622290637287,1.0,1.0 520 | 519,275639,519,0.0014725204746964004,1.0,1.0 521 | 520,276120,520,0.0016555906599462428,1.0,1.0 522 | 521,276593,521,0.0016439761619737121,1.0,1.0 523 | 522,277274,522,0.003563526381462309,1.0,1.0 524 | 523,277755,523,0.0015339419612162828,1.0,1.0 525 | 524,278236,524,0.0014809114039706106,1.0,1.0 526 | 525,278805,525,0.0027059052778405485,1.0,1.0 527 | 526,279342,526,0.003001201296530629,1.0,1.0 528 | 527,279847,527,0.018472610813563918,0.0,0.9939759036144579 529 | 528,280328,528,0.0015031008821895784,1.0,1.0 530 | 529,280857,529,0.0026372417965405725,1.0,1.0 531 | 530,281338,530,0.0013527515102187235,1.0,1.0 532 | 531,281819,531,0.0014028765602122184,1.0,1.0 533 | 532,282300,532,0.0013282347576717716,1.0,1.0 534 | 533,282781,533,0.0013550354516768876,1.0,1.0 535 | 534,283254,534,0.0015292161774059711,1.0,1.0 536 | 535,283799,535,0.010640947614325302,0.0,0.997134670487106 537 | 536,285072,536,0.024779558467505312,0.0,0.9908350305498982 538 | 537,285593,537,0.004054153275858529,1.0,1.0 539 | 538,286178,538,0.014074888497001028,0.0,0.9972826086956522 540 | 539,286691,539,0.0040136811759375664,1.0,1.0 541 | 540,287164,540,0.0013605485761646104,1.0,1.0 542 | 541,287645,541,0.0015065476996778415,1.0,1.0 543 | 542,288126,542,0.0014415988987020803,1.0,1.0 544 | 543,288687,543,0.018279914039324236,0.0,0.9971988795518207 545 | 544,289160,544,0.001248731089793483,1.0,1.0 546 | 545,289641,545,0.0014085654981006233,1.0,1.0 547 | 546,290186,546,0.0030679936104657914,1.0,1.0 548 | 547,290667,547,0.0014581441285182537,1.0,1.0 549 | 548,291140,548,0.0012649767828229507,1.0,1.0 550 | 549,291669,549,0.009979120804409566,0.0,0.9971590909090909 551 | 550,292334,550,0.002900770515904111,1.0,1.0 552 | 551,292815,551,0.0014223266902857214,1.0,1.0 553 | 552,293464,552,0.01603842985797204,0.0,0.9955257270693513 554 | 553,294001,553,0.03420951355046036,0.0,0.9827586206896551 555 | 554,294474,554,0.0013702902891188098,1.0,1.0 556 | 555,294947,555,0.0014512754638677785,1.0,1.0 557 | 556,296172,556,0.025850570581705472,0.0,0.9901639344262295 558 | 557,296653,557,0.00137406573081479,1.0,1.0 559 | 558,297366,558,0.017870540924832288,0.0,0.9901768172888016 560 | 559,297847,559,0.0013423289532353486,1.0,1.0 561 | 560,298328,560,0.0014818692158203824,1.0,1.0 562 | 561,298913,561,0.01639324789856117,0.0,0.9945945945945946 563 | 562,299530,562,0.013295137567036036,0.0,0.9950248756218906 564 | 563,300011,563,0.0013853105903212544,1.0,1.0 565 | 564,300492,564,0.001415516276226262,1.0,1.0 566 | 565,301045,565,0.010856279656967298,0.0,0.9971590909090909 567 | 566,301790,566,0.020643454039639304,0.0,0.9922630560928434 568 | 567,302335,567,0.012078136872593164,0.0,0.9971830985915493 569 | 568,302816,568,0.001519785855266487,1.0,1.0 570 | 569,303441,569,0.009300641790848467,0.0,0.9975 571 | 570,303922,570,0.0014343437198772236,1.0,1.0 572 | 571,304451,571,0.006787343565091686,0.0,0.9969788519637462 573 | 572,305084,572,0.048373881487245855,0.0,0.9798657718120806 574 | 573,305813,573,0.016703188012227085,0.0,0.9895615866388309 575 | 574,306294,574,0.0015187827602660042,1.0,1.0 576 | 575,306863,575,0.0032178543874772756,1.0,1.0 577 | 576,307344,576,0.001433384740593039,1.0,1.0 578 | 577,307993,577,0.016227805061399102,0.0,0.9911111111111112 579 | 578,308474,578,0.0015347349582685045,1.0,1.0 580 | 579,308955,579,0.0015717717578825833,1.0,1.0 581 | 580,309932,580,0.008667505701290252,0.0,0.9972527472527473 582 | 581,310469,581,0.002553636146771062,1.0,1.0 583 | 582,310950,582,0.001483989223952947,1.0,1.0 584 | 583,311431,583,0.001481906321261451,1.0,1.0 585 | 584,312000,584,0.002740999098409873,1.0,1.0 586 | 585,312569,585,0.003346237584232351,1.0,1.0 587 | 586,313106,586,0.004304155816631912,1.0,1.0 588 | 587,313643,587,0.004664790518408918,1.0,1.0 589 | 588,314124,588,0.0015266257340527847,1.0,1.0 590 | 589,314605,589,0.0015252153031759363,1.0,1.0 591 | 590,315086,590,0.013459151177607999,0.0,0.9966555183946488 592 | 591,315567,591,0.0014341680659552488,1.0,1.0 593 | 592,316024,592,0.008382935357700206,0.0,0.9963503649635036 594 | 593,316465,593,0.018229698445928394,0.0,0.9962406015037594 595 | 594,316946,594,0.0016938163448005712,1.0,1.0 596 | 595,317395,595,0.007172339510945459,0.0,0.996309963099631 597 | 596,317964,596,0.005303253383424043,0.0,0.9973333333333333 598 | 597,318445,597,0.0014360958101849492,1.0,1.0 599 | 598,319038,598,0.003455618149961891,1.0,1.0 600 | 599,319567,599,0.004012993917649552,1.0,1.0 601 | 600,320160,600,0.003635911125628624,1.0,1.0 602 | 601,320729,601,0.0029458862899142757,1.0,1.0 603 | 602,321210,602,0.0017242849550832846,1.0,1.0 604 | 603,321691,603,0.0018168088244007144,1.0,1.0 605 | 604,322172,604,0.0017936175895974058,1.0,1.0 606 | 605,322701,605,0.0038083276150562176,1.0,1.0 607 | 606,323182,606,0.0018575388422483092,1.0,1.0 608 | 607,323799,607,0.003650489197696746,1.0,1.0 609 | 608,324272,608,0.0014590930756646922,1.0,1.0 610 | 609,324841,609,0.003008852281074994,1.0,1.0 611 | 610,325434,610,0.0032742482497341687,1.0,1.0 612 | 611,326059,611,0.006438452067204927,0.0,0.9975 613 | 612,326540,612,0.0015584267055355288,1.0,1.0 614 | 613,327021,613,0.001621865245101337,1.0,1.0 615 | 614,327494,614,0.0015817325937486641,1.0,1.0 616 | 615,327975,615,0.0014880893321227075,1.0,1.0 617 | 616,328520,616,0.0026003745739111416,1.0,1.0 618 | 617,329089,617,0.0034105468538911327,1.0,1.0 619 | 618,329562,618,0.0015435060404612295,1.0,1.0 620 | 619,330035,619,0.0013635219418878322,1.0,1.0 621 | 620,330516,620,0.0014897042636903247,1.0,1.0 622 | 621,330989,621,0.0013737385608044326,1.0,1.0 623 | 622,331446,622,0.008163182740281416,0.0,0.9963503649635036 624 | 623,331927,623,0.0014101146636398896,1.0,1.0 625 | 624,332408,624,0.0014316814313667723,1.0,1.0 626 | 625,332889,625,0.0015280509943998042,1.0,1.0 627 | 626,333370,626,0.0014938217274739337,1.0,1.0 628 | 627,333851,627,0.001459615208527471,1.0,1.0 629 | 628,334436,628,0.003194916254049703,1.0,1.0 630 | 629,335005,629,0.0026197537894880833,1.0,1.0 631 | 630,335478,630,0.001421962674834918,1.0,1.0 632 | 631,335959,631,0.001490330976960042,1.0,1.0 633 | 632,336440,632,0.001400751971025581,1.0,1.0 634 | 633,336969,633,0.006599693521089576,0.0,0.9969788519637462 635 | 634,337538,634,0.003342090573823528,1.0,1.0 636 | 635,338019,635,0.0014439602511163681,1.0,1.0 637 | 636,338500,636,0.0014589267559117177,1.0,1.0 638 | 637,339037,637,0.0026835179477217096,1.0,1.0 639 | 638,339518,638,0.0014040903624665515,1.0,1.0 640 | 639,339999,639,0.0014307712741444606,1.0,1.0 641 | 640,340488,640,0.004201624299371963,1.0,1.0 642 | 641,340945,641,0.007991775975187973,0.0,0.9963503649635036 643 | 642,341418,642,0.0013876901206250198,1.0,1.0 644 | 643,341963,643,0.008145045293180173,0.0,0.997275204359673 645 | 644,342444,644,0.0014209993991234474,1.0,1.0 646 | 645,342925,645,0.0014388471077641898,1.0,1.0 647 | 646,343406,646,0.0014149153429242676,1.0,1.0 648 | 647,343887,647,0.001439484602106141,1.0,1.0 649 | 648,344368,648,0.0014562666295303188,1.0,1.0 650 | 649,345001,649,0.016502395880439034,0.0,0.9932885906040269 651 | 650,345474,650,0.0014751206079350397,1.0,1.0 652 | 651,346139,651,0.005753134260402259,1.0,1.0 653 | 652,346732,652,0.002843070580333887,1.0,1.0 654 | 653,347261,653,0.0045044029389061865,0.0,0.9971751412429378 655 | 654,348534,654,0.012087396131511068,0.0,0.9969450101832994 656 | 655,349015,655,0.0013363461958140425,1.0,1.0 657 | 656,349592,656,0.002312896299936468,1.0,1.0 658 | 657,350065,657,0.001492861335821911,1.0,1.0 659 | 658,350538,658,0.0013380795536900648,1.0,1.0 660 | 659,351155,659,0.007859946782821894,0.0,0.9975247524752475 661 | 660,351636,660,0.0013652073489285495,1.0,1.0 662 | 661,352173,661,0.0020189691094955014,1.0,1.0 663 | 662,352654,662,0.0013070066791373435,1.0,1.0 664 | 663,353143,663,0.001380359748402595,1.0,1.0 665 | 664,353624,664,0.0014515580904461412,1.0,1.0 666 | 665,354193,665,0.0027713804268363037,1.0,1.0 667 | 666,354674,666,0.0015485715586081228,1.0,1.0 668 | 667,355195,667,0.002833961014525446,1.0,1.0 669 | 668,355676,668,0.001527960656598476,1.0,1.0 670 | 669,356205,669,0.005562007136915256,1.0,1.0 671 | 670,356774,670,0.002758392067284289,1.0,1.0 672 | 671,357255,671,0.0013353982995518118,1.0,1.0 673 | 672,357768,672,0.006102087958750196,0.0,0.9970149253731343 674 | 673,358249,673,0.0013862884173438538,1.0,1.0 675 | 674,359130,674,0.006075392356118994,1.0,1.0 676 | 675,359843,675,0.006538720560127789,1.0,1.0 677 | 676,360324,676,0.0013248868921480435,1.0,1.0 678 | 677,360861,677,0.012560781845717033,0.0,0.9942528735632183 679 | 678,361310,678,0.008463985928033296,0.0,0.996309963099631 680 | 679,361791,679,0.0015044588222304417,1.0,1.0 681 | 680,362272,680,0.001346460749781855,1.0,1.0 682 | 681,362809,681,0.0026229448329334356,1.0,1.0 683 | 682,363394,682,0.006846388145193908,0.0,0.9972826086956522 684 | 683,363875,683,0.0013967516883202603,1.0,1.0 685 | 684,364420,684,0.002507062622161965,1.0,1.0 686 | 685,365037,685,0.008234684033219593,0.0,0.9975124378109452 687 | 686,365518,686,0.001490410740613157,1.0,1.0 688 | 687,365999,687,0.0012652581575525346,1.0,1.0 689 | 688,366480,688,0.0012926526769050245,1.0,1.0 690 | 689,366961,689,0.0013675501642772044,1.0,1.0 691 | 690,367506,690,0.0035963809971695346,1.0,1.0 692 | 691,368355,691,0.009496694331286536,0.0,0.9983136593591906 693 | 692,368828,692,0.0014014692934829157,1.0,1.0 694 | 693,369309,693,0.0013940058793215058,1.0,1.0 695 | 694,369790,694,0.0013550172195676104,1.0,1.0 696 | 695,370375,695,0.006549142368906075,0.0,0.9972972972972973 697 | 696,370856,696,0.0013994064642829688,1.0,1.0 698 | 697,371297,697,0.015593939952622995,0.0,0.9962406015037594 699 | 698,371778,698,0.0014169207056878874,1.0,1.0 700 | 699,372251,699,0.0014700684258538927,1.0,1.0 701 | 700,372700,700,0.008503065643882474,0.0,0.9963235294117647 702 | 701,373173,701,0.001476796844988481,1.0,1.0 703 | 702,373654,702,0.0013722651213821074,1.0,1.0 704 | 703,374175,703,0.005223366597877431,0.0,0.9969879518072289 705 | 704,374656,704,0.001415545940871338,1.0,1.0 706 | 705,375241,705,0.002822946718762475,1.0,1.0 707 | 706,375722,706,0.0014750664003849107,1.0,1.0 708 | 707,376203,707,0.0012512633297860865,1.0,1.0 709 | 708,376676,708,0.0013218202875378206,1.0,1.0 710 | 709,377157,709,0.0013263187337986208,1.0,1.0 711 | 710,377638,710,0.0014161028227847468,1.0,1.0 712 | 711,378447,711,0.010868355817912047,0.0,0.9965156794425087 713 | 712,378976,712,0.0022797869292585345,1.0,1.0 714 | 713,379513,713,0.008665998887940753,0.0,0.9971988795518207 715 | 714,380058,714,0.005168985596366348,0.0,0.9971830985915493 716 | 715,381051,715,0.008539288284840596,0.0,0.9958100558659218 717 | 716,381604,716,0.007289965047713118,0.0,0.9971590909090909 718 | 717,382077,717,0.0013794145643761958,1.0,1.0 719 | 718,382670,718,0.0026764076511873684,1.0,1.0 720 | 719,383351,719,0.003929959579018632,1.0,1.0 721 | 720,383832,720,0.001552285048123847,1.0,1.0 722 | 721,384345,721,0.008846448669216085,0.0,0.9970059880239521 723 | 722,384826,722,0.0013570538829205244,1.0,1.0 724 | 723,385299,723,0.0013902888527211074,1.0,1.0 725 | 724,385852,724,0.008751077078847914,0.0,0.9941348973607038 726 | 725,386333,725,0.0013898156268301542,1.0,1.0 727 | 726,386814,726,0.001400519363310334,1.0,1.0 728 | 727,387287,727,0.001367623267015395,1.0,1.0 729 | 728,387768,728,0.00144181360359141,1.0,1.0 730 | 729,388249,729,0.0013903230619931868,1.0,1.0 731 | 730,388898,730,0.013118966695729505,0.0,0.9933333333333333 732 | 731,389379,731,0.0015296846822415058,1.0,1.0 733 | 732,389852,732,0.0013739321199436327,1.0,1.0 734 | 733,390437,733,0.002719932819720562,1.0,1.0 735 | 734,390918,734,0.0014804177406188815,1.0,1.0 736 | 735,391399,735,0.0013578414647688216,1.0,1.0 737 | 736,391880,736,0.0014600888556735203,1.0,1.0 738 | 737,392361,737,0.0014171230590458732,1.0,1.0 739 | 738,392930,738,0.0027974305426452213,1.0,1.0 740 | 739,393411,739,0.0012680256655396096,1.0,1.0 741 | 740,393996,740,0.00849986099222289,0.0,0.9945945945945946 742 | 741,394477,741,0.0013988510000355675,1.0,1.0 743 | 742,394926,742,0.008067024123752629,0.0,0.996309963099631 744 | 743,395407,743,0.0013632237977060382,1.0,1.0 745 | 744,395888,744,0.0013640495545169753,1.0,1.0 746 | 745,396361,745,0.0013954452302625162,1.0,1.0 747 | 746,396882,746,0.006697045882940734,0.0,0.997134670487106 748 | 747,397355,747,0.001301894176609316,1.0,1.0 749 | 748,397836,748,0.001392963624264637,1.0,1.0 750 | 749,398317,749,0.0012968324860048103,1.0,1.0 751 | 750,398790,750,0.001374259623057905,1.0,1.0 752 | 751,399271,751,0.0013466530924332505,1.0,1.0 753 | 752,399776,752,0.00865509243454856,0.0,0.9939393939393939 754 | 753,400457,753,0.0030165041004924014,1.0,1.0 755 | 754,400938,754,0.001555417008350649,1.0,1.0 756 | 755,401683,755,0.007743079650227687,1.0,1.0 757 | 756,402164,756,0.0013320350531834922,1.0,1.0 758 | 757,402645,757,0.001344398339819325,1.0,1.0 759 | 758,403126,758,0.00141564283219118,1.0,1.0 760 | 759,403599,759,0.0013213791906149927,1.0,1.0 761 | 760,404248,760,0.010839592117864704,0.0,0.9977628635346756 762 | 761,404937,761,0.012644666810084693,0.0,0.9954441913439636 763 | 762,405418,762,0.0014478720271605587,1.0,1.0 764 | 763,405899,763,0.0013294467289880554,1.0,1.0 765 | 764,406372,764,0.0012442507578774272,1.0,1.0 766 | 765,406853,765,0.0014125299938371374,1.0,1.0 767 | 766,407398,766,0.007450259081713415,0.0,0.997134670487106 768 | 767,407879,767,0.002006315645548827,1.0,1.0 769 | 768,408336,768,0.007343081686359972,0.0,0.9963503649635036 770 | 769,408905,769,0.0024000161126891397,1.0,1.0 771 | 770,410130,770,0.011274739531923655,0.0,0.9978142076502732 772 | 771,410691,771,0.00978778583827055,0.0,0.9971988795518207 773 | 772,411172,772,0.0013169164284216226,1.0,1.0 774 | 773,411901,773,0.009609657644329377,0.0,0.9958246346555324 775 | 774,412878,774,0.005270940056700889,0.0,0.9986263736263736 776 | 775,413359,775,0.0014895592126310277,1.0,1.0 777 | 776,413840,776,0.0014462100333727486,1.0,1.0 778 | 777,414729,777,0.012686881478358924,0.0,0.9953488372093023 779 | 778,415210,778,0.0014136427004520769,1.0,1.0 780 | 779,416139,779,0.006311418453058977,0.0,0.998546511627907 781 | 780,416620,780,0.001368020564722111,1.0,1.0 782 | 781,417189,781,0.0025532610061115265,1.0,1.0 783 | 782,417782,782,0.002933677804224343,1.0,1.0 784 | 783,418263,783,0.001324910332913134,1.0,1.0 785 | 784,418800,784,0.0027381292572406643,1.0,1.0 786 | 785,419281,785,0.0014549366594351133,1.0,1.0 787 | 786,419786,786,0.004037295454424184,1.0,1.0 788 | 787,420451,787,0.0027165240622629666,1.0,1.0 789 | 788,421020,788,0.0024253379161185257,1.0,1.0 790 | 789,421493,789,0.0012977336970266874,1.0,1.0 791 | 790,421974,790,0.0012954059834811723,1.0,1.0 792 | 791,422455,791,0.0013939710212277116,1.0,1.0 793 | 792,422936,792,0.0014600191818804514,1.0,1.0 794 | 793,423417,793,0.001402814266111321,1.0,1.0 795 | 794,423890,794,0.0014196780746057506,1.0,1.0 796 | 795,424371,795,0.0013954770151554483,1.0,1.0 797 | 796,424852,796,0.0013698618816491818,1.0,1.0 798 | 797,425333,797,0.0013919221305842735,1.0,1.0 799 | 798,425806,798,0.0013942658161989615,1.0,1.0 800 | 799,426287,799,0.002486344385866893,1.0,1.0 801 | 800,426880,800,0.0028036721947409552,1.0,1.0 802 | 801,427361,801,0.0014010425743169533,1.0,1.0 803 | 802,427842,802,0.001324603791642353,1.0,1.0 804 | -------------------------------------------------------------------------------- /gpt3/data/csv/results/davinci_200_pairs.csv: -------------------------------------------------------------------------------- 1 | step,elapsed_tokens,elapsed_examples,training_loss,training_sequence_accuracy,training_token_accuracy 2 | 1,473,1,0.2518514749697786,0.0,0.9087837837837838 3 | 2,1018,2,0.33786418782947014,0.0,0.8785310734463276 4 | 3,1499,3,0.21377110597974736,0.0,0.9264214046822743 5 | 4,1956,4,0.20054191902978394,0.0,0.9233576642335767 6 | 5,2429,5,0.13685568161284503,0.0,0.9595959595959596 7 | 6,3094,6,0.15412442398685042,0.0,0.953125 8 | 7,3575,7,0.09183758352425893,0.0,0.9798657718120806 9 | 8,4264,8,0.12868672400778022,0.0,0.9544419134396356 10 | 9,4945,9,0.12916219326542008,0.0,0.9644444444444444 11 | 10,5418,10,0.05700767322024662,0.0,0.9797979797979798 12 | 11,5987,11,0.06563768009549287,0.0,0.9757412398921833 13 | 12,6468,12,0.04700134269487459,0.0,0.9832775919732442 14 | 13,6949,13,0.021497956278955697,0.0,0.9932885906040269 15 | 14,7830,14,0.1035243290835334,0.0,0.9672386895475819 16 | 15,8311,15,0.022942667854983636,0.0,0.9899665551839465 17 | 16,8792,16,0.02944350141124145,0.0,0.9866220735785953 18 | 17,9273,17,0.012339106223213,0.0,0.9933110367892977 19 | 18,9866,18,0.030332036539267502,0.0,0.9892761394101877 20 | 19,10347,19,0.009138951825857595,0.0,0.9966442953020134 21 | 20,10916,20,0.029680723070391133,0.0,0.9892761394101877 22 | 21,11397,21,0.029628847714156598,0.0,0.99 23 | 22,11918,22,0.0434296175935651,0.0,0.9877675840978594 24 | 23,12399,23,0.027282212001328215,0.0,0.9865771812080537 25 | 24,12880,24,0.01211462431644625,0.0,0.9899328859060402 26 | 25,13385,25,0.07583683916163723,0.0,0.9789156626506024 27 | 26,13954,26,0.013991755520989966,0.0,0.9973118279569892 28 | 27,14619,27,0.0281374155906194,0.0,0.9862385321100917 29 | 28,15236,28,0.1753365114196434,0.0,0.948019801980198 30 | 29,15709,29,0.019287758230753467,0.0,0.98989898989899 31 | 30,16278,30,0.022109013801634686,0.0,0.9892183288409704 32 | 31,16895,31,0.017064431941421796,0.0,0.9976580796252927 33 | 32,17376,32,0.006557090874698039,1.0,1.0 34 | 33,17905,33,0.016484678482431552,0.0,0.9943181818181818 35 | 34,18386,34,0.007633229197176337,1.0,1.0 36 | 35,18939,35,0.025090172391605697,0.0,0.9886363636363636 37 | 36,19420,36,0.007687347197429946,0.0,0.9966555183946488 38 | 37,19901,37,0.00802310116716476,1.0,1.0 39 | 38,20382,38,0.007005986326014198,1.0,1.0 40 | 39,21271,39,0.09714837434328039,0.0,0.9689922480620154 41 | 40,21808,40,0.016825776066267693,0.0,0.9943342776203966 42 | 41,22281,41,0.00672937395082102,0.0,0.9966329966329966 43 | 42,22762,42,0.023945926324087267,0.0,0.9933110367892977 44 | 43,23331,43,0.01151443078583968,0.0,0.9973262032085561 45 | 44,23812,44,0.006458062915498517,1.0,1.0 46 | 45,24293,45,0.005625909035242339,1.0,1.0 47 | 46,24742,46,0.09866168036770355,0.0,0.981549815498155 48 | 47,25311,47,0.009021501052570822,1.0,1.0 49 | 48,25792,48,0.006389884656273711,1.0,1.0 50 | 49,26273,49,0.007515500396343162,1.0,1.0 51 | 50,26746,50,0.0076130703476262485,1.0,1.0 52 | 51,27227,51,0.0063507357183523756,1.0,1.0 53 | 52,27812,52,0.014926490538489715,0.0,0.9946236559139785 54 | 53,29085,53,0.07518172781207881,0.0,0.9765784114052953 55 | 54,29614,54,0.014953123121133548,0.0,0.9969788519637462 56 | 55,30607,55,0.06323377054695235,0.0,0.9818435754189944 57 | 56,31200,56,0.010608943092013627,1.0,1.0 58 | 57,31681,57,0.004730602921593286,1.0,1.0 59 | 58,32162,58,0.004896397240921726,1.0,1.0 60 | 59,32755,59,0.00953735923255264,0.0,0.9973190348525469 61 | 60,33236,60,0.004287266219454886,1.0,1.0 62 | 61,34085,61,0.08356853463389749,0.0,0.9679595278246206 63 | 62,34566,62,0.004522426750220902,1.0,1.0 64 | 63,35103,63,0.007621428086665672,0.0,0.9971988795518207 65 | 64,35648,64,0.0943525494080571,0.0,0.9727520435967303 66 | 65,36129,65,0.0035742135874647094,1.0,1.0 67 | 66,36602,66,0.004141159958230971,1.0,1.0 68 | 67,37139,67,0.007137840063321496,0.0,0.9971830985915493 69 | 68,37612,68,0.003968710303968438,1.0,1.0 70 | 69,38237,69,0.05462618398854929,0.0,0.9875 71 | 70,38726,70,0.011333595042482693,0.0,0.9967845659163987 72 | 71,39207,71,0.004066793552210403,1.0,1.0 73 | 72,39688,72,0.00511134774069259,1.0,1.0 74 | 73,40257,73,0.020957412404556584,0.0,0.9946666666666667 75 | 74,40802,74,0.025326964728879613,0.0,0.994269340974212 76 | 75,41275,75,0.0036792597673038904,1.0,1.0 77 | 76,41756,76,0.005300600213293485,1.0,1.0 78 | 77,42237,77,0.004768095688514272,1.0,1.0 79 | 78,42718,78,0.005974555733438904,0.0,0.9966666666666667 80 | 79,43463,79,0.09348485242289119,0.0,0.9709864603481625 81 | 80,43944,80,0.004315965552695905,1.0,1.0 82 | 81,44425,81,0.004448099492347364,1.0,1.0 83 | 82,44906,82,0.0044440062715161745,1.0,1.0 84 | 83,45387,83,0.0042625217366357585,1.0,1.0 85 | 84,45868,84,0.004061515796983206,1.0,1.0 86 | 85,46397,85,0.010033868881450478,0.0,0.9971751412429378 87 | 86,47078,86,0.014617269196879439,0.0,0.9933184855233853 88 | 87,47559,87,0.003961398942835081,1.0,1.0 89 | 88,48040,88,0.007711828340510616,0.0,0.9966442953020134 90 | 89,48521,89,0.0038810342773262624,1.0,1.0 91 | 90,49002,90,0.003980087237414439,1.0,1.0 92 | 91,49483,91,0.0033093362932312023,1.0,1.0 93 | 92,49964,92,0.0034960592322427664,1.0,1.0 94 | 93,50445,93,0.003968404774494335,1.0,1.0 95 | 94,50926,94,0.003683919943103159,1.0,1.0 96 | 95,51407,95,0.004074494429981809,1.0,1.0 97 | 96,51888,96,0.003784223138230311,1.0,1.0 98 | 97,52369,97,0.003779082486175536,1.0,1.0 99 | 98,53002,98,0.12951314978699113,0.0,0.9619686800894854 100 | 99,53475,99,0.0033883683682510777,1.0,1.0 101 | 100,53956,100,0.003630297096179098,1.0,1.0 102 | 101,54605,101,0.05913325943227019,0.0,0.9755555555555555 103 | 102,55318,102,0.09346816604167753,0.0,0.9685658153241651 104 | 103,55799,103,0.003945581679107652,1.0,1.0 105 | 104,56272,104,0.0035926916177220526,1.0,1.0 106 | 105,56753,105,0.0042069988022819405,1.0,1.0 107 | 106,57226,106,0.0037294441197466724,1.0,1.0 108 | 107,57667,107,0.036880701922770605,0.0,0.9924812030075187 109 | 108,58236,108,0.016208082842964624,0.0,0.9919354838709677 110 | 109,58805,109,0.009492118632525573,1.0,1.0 111 | 110,59286,110,0.0037654597182786927,1.0,1.0 112 | 111,59799,111,0.02468164556684912,0.0,0.991044776119403 113 | 112,60280,112,0.004625755665875496,1.0,1.0 114 | 113,60857,113,0.008592603369039277,1.0,1.0 115 | 114,61586,114,0.05058310966621346,0.0,0.9812108559498957 116 | 115,62395,115,0.07272300461272266,0.0,0.9738675958188153 117 | 116,62868,116,0.004285150432243901,1.0,1.0 118 | 117,63485,117,0.044256580030664947,0.0,0.9900497512437811 119 | 118,63966,118,0.0036379514629944214,1.0,1.0 120 | 119,64439,119,0.0032456882320615545,1.0,1.0 121 | 120,64920,120,0.003591915754616377,1.0,1.0 122 | 121,65481,121,0.07917969142489772,0.0,0.9719887955182073 123 | 122,65962,122,0.0032057802825982266,1.0,1.0 124 | 123,66467,123,0.010541298320685056,0.0,0.9939393939393939 125 | 124,66940,124,0.003871201258538592,1.0,1.0 126 | 125,67421,125,0.004390933585326595,1.0,1.0 127 | 126,67870,126,0.035329356440155724,0.0,0.9926470588235294 128 | 127,68351,127,0.003036170970889519,1.0,1.0 129 | 128,68824,128,0.0031094080042326742,1.0,1.0 130 | 129,69297,129,0.00299514148837441,1.0,1.0 131 | 130,69826,130,0.031015734712992654,0.0,0.9915254237288136 132 | 131,70363,131,0.008143165512570808,0.0,0.9971988795518207 133 | 132,70948,132,0.038183008071443106,0.0,0.9918918918918919 134 | 133,71429,133,0.0034815590593196433,1.0,1.0 135 | 134,71902,134,0.0032530486051924766,1.0,1.0 136 | 135,72383,135,0.0032058136537952467,1.0,1.0 137 | 136,72864,136,0.004237221961658142,1.0,1.0 138 | 137,73345,137,0.00445565406241218,1.0,1.0 139 | 138,73834,138,0.00427883157557615,1.0,1.0 140 | 139,74283,139,0.013503515854046121,0.0,0.992619926199262 141 | 140,75508,140,0.05808711534411525,0.0,0.9825136612021858 142 | 141,75989,141,0.0043875275300475506,1.0,1.0 143 | 142,76582,142,0.010612202210349019,1.0,1.0 144 | 143,77119,143,0.012981201994019134,0.0,0.9972067039106145 145 | 144,77600,144,0.0055950949942543,1.0,1.0 146 | 145,78081,145,0.004278975388204457,1.0,1.0 147 | 146,78554,146,0.003789174007112135,1.0,1.0 148 | 147,79123,147,0.005912144554029289,1.0,1.0 149 | 148,79644,148,0.023180322313630486,0.0,0.9909638554216867 150 | 149,80125,149,0.003314729199830613,1.0,1.0 151 | 150,80598,150,0.003439968355929423,1.0,1.0 152 | 151,81079,151,0.0037578554396620716,1.0,1.0 153 | 152,81560,152,0.0032854202190198954,1.0,1.0 154 | 153,82041,153,0.0033494443114216936,1.0,1.0 155 | 154,82514,154,0.0032376256143731756,1.0,1.0 156 | 155,82995,155,0.003158874871795182,1.0,1.0 157 | 156,83476,156,0.0029090578641548116,1.0,1.0 158 | 157,83989,157,0.06867014535235962,0.0,0.9790419161676647 159 | 158,84558,158,0.006762631941074869,1.0,1.0 160 | 159,85039,159,0.003029641378185898,1.0,1.0 161 | 160,85624,160,0.007488471424117794,1.0,1.0 162 | 161,86105,161,0.0029767412271541186,1.0,1.0 163 | 162,86690,162,0.03038032798119859,0.0,0.9945945945945946 164 | 163,87211,163,0.02052337707994672,0.0,0.9885386819484241 165 | 164,87692,164,0.0031812503787958875,1.0,1.0 166 | 165,88237,165,0.006900356154839894,1.0,1.0 167 | 166,88718,166,0.0030090186584811225,1.0,1.0 168 | 167,89199,167,0.0027386534068789057,1.0,1.0 169 | 168,89680,168,0.0028907630841595263,1.0,1.0 170 | 169,90161,169,0.002993122167750972,1.0,1.0 171 | 170,90706,170,0.011236690350986267,0.0,0.9943502824858758 172 | 171,91179,171,0.0027280674929395475,1.0,1.0 173 | 172,91708,172,0.004669996749182798,1.0,1.0 174 | 173,92189,173,0.01521340404008953,0.0,0.9966666666666667 175 | 174,92662,174,0.00288996137527877,1.0,1.0 176 | 175,93135,175,0.0025783938060959842,1.0,1.0 177 | 176,93688,176,0.04466870571033108,0.0,0.9882697947214076 178 | 177,94161,177,0.003072520554604267,1.0,1.0 179 | 178,94642,178,0.003450008591192385,1.0,1.0 180 | 179,95571,179,0.03738347959889448,0.0,0.9854651162790697 181 | 180,96164,180,0.007152890176426238,0.0,0.9973333333333333 182 | 181,96637,181,0.0026629595997501743,1.0,1.0 183 | 182,97118,182,0.0032610038664571267,1.0,1.0 184 | 183,97599,183,0.003201481591751243,1.0,1.0 185 | 184,98080,184,0.0027633303580430666,1.0,1.0 186 | 185,98665,185,0.005749372881666931,1.0,1.0 187 | 186,99146,186,0.0029067581698287662,1.0,1.0 188 | 187,99627,187,0.0029405829778560624,1.0,1.0 189 | 188,100212,188,0.008882010716600386,0.0,0.9972826086956522 190 | 189,100693,189,0.0024704902001516245,1.0,1.0 191 | 190,101174,190,0.0029139663698523324,1.0,1.0 192 | 191,101631,191,0.013832808723507752,0.0,0.9927007299270073 193 | 192,102112,192,0.002984839373467101,1.0,1.0 194 | 193,102593,193,0.004106604454223073,1.0,1.0 195 | 194,103074,194,0.0033747264080959084,1.0,1.0 196 | 195,103619,195,0.020651790697539807,0.0,0.9915492957746479 197 | 196,104268,196,0.03915488733580629,0.0,0.9843400447427293 198 | 197,105245,197,0.025479704237619746,0.0,0.9931318681318682 199 | 198,105782,198,0.04691012389338218,0.0,0.9798850574712644 200 | 199,106239,199,0.010550997189928071,0.0,0.9963503649635036 201 | 200,106720,200,0.0024488598844552728,1.0,1.0 202 | 201,107201,201,0.0029150427692385557,1.0,1.0 203 | 202,107682,202,0.002929120060581628,1.0,1.0 204 | 203,108347,203,0.013405186798380214,0.0,0.9977064220183486 205 | 204,108828,204,0.003256059471281591,1.0,1.0 206 | 205,109309,205,0.0030232144249415804,1.0,1.0 207 | 206,109870,206,0.01950877889536758,0.0,0.9971988795518207 208 | 207,110519,207,0.027415541970100918,0.0,0.9866666666666667 209 | 208,111000,208,0.0029849797334935697,1.0,1.0 210 | 209,111481,209,0.002583801532852605,1.0,1.0 211 | 210,111954,210,0.0030932226874312244,1.0,1.0 212 | 211,112507,211,0.02214530297893076,0.0,0.9882697947214076 213 | 212,112988,212,0.0038124217899636386,1.0,1.0 214 | 213,113525,213,0.01006078198068207,0.0,0.9943977591036415 215 | 214,114006,214,0.002335739413823626,1.0,1.0 216 | 215,114487,215,0.002792695716658615,1.0,1.0 217 | 216,114960,216,0.0023456530900263935,1.0,1.0 218 | 217,115441,217,0.0025988293207550653,1.0,1.0 219 | 218,115970,218,0.006329404595330115,0.0,0.9969788519637462 220 | 219,116451,219,0.002549404509543317,1.0,1.0 221 | 220,116932,220,0.0023989236377668813,1.0,1.0 222 | 221,117413,221,0.002759315977969304,1.0,1.0 223 | 222,118062,222,0.015144785214268859,0.0,0.9977628635346756 224 | 223,118535,223,0.0020125802260450897,1.0,1.0 225 | 224,119264,224,0.031530558777010206,0.0,0.9874739039665971 226 | 225,119737,225,0.001940943381509697,1.0,1.0 227 | 226,120194,226,0.012192815772544977,0.0,0.9963503649635036 228 | 227,121187,227,0.024306679827340777,0.0,0.9930167597765364 229 | 228,121636,228,0.008529938491713733,0.0,0.9963235294117647 230 | 229,122117,229,0.003216941449694351,1.0,1.0 231 | 230,122590,230,0.003991086900568008,0.0,0.9966216216216216 232 | 231,123135,231,0.008783464955905781,0.0,0.9971988795518207 233 | 232,123616,232,0.005818216451991632,0.0,0.9966555183946488 234 | 233,124097,233,0.004351259173335599,0.0,0.9966666666666667 235 | 234,124978,234,0.020779039081795927,0.0,0.9921996879875195 236 | 235,125523,235,0.01244216585348938,0.0,0.994269340974212 237 | 236,126092,236,0.004388687649514114,1.0,1.0 238 | 237,126685,237,0.00587446020756287,1.0,1.0 239 | 238,127166,238,0.0024278625591643444,1.0,1.0 240 | 239,127647,239,0.0023127532778791622,1.0,1.0 241 | 240,128216,240,0.006264736383818126,1.0,1.0 242 | 241,128905,241,0.018299797829033387,0.0,0.9908883826879271 243 | 242,129522,242,0.008289006895805251,0.0,0.9976580796252927 244 | 243,130003,243,0.0021489046117943093,1.0,1.0 245 | 244,130636,244,0.07561535614778113,0.0,0.9664429530201343 246 | 245,131221,245,0.01365096468080292,0.0,0.9945945945945946 247 | 246,131806,246,0.004931126810825288,1.0,1.0 248 | 247,132351,247,0.013739523328055657,0.0,0.9943661971830986 249 | 248,132856,248,0.04055020914430707,0.0,0.990909090909091 250 | 249,133329,249,0.0020696517581379483,1.0,1.0 251 | 250,133786,250,0.023739222405030135,0.0,0.9927007299270073 252 | 251,134267,251,0.0025218691735143703,1.0,1.0 253 | 252,135492,252,0.03412337073171,0.0,0.9879781420765027 254 | 253,136085,253,0.014868704951160406,0.0,0.9973333333333333 255 | 254,136566,254,0.009228848846067568,0.0,0.9966555183946488 256 | 255,137047,255,0.0029283202407556145,1.0,1.0 257 | 256,137560,256,0.025333699073405814,0.0,0.9940119760479041 258 | 257,138129,257,0.006161297740029964,1.0,1.0 259 | 258,138610,258,0.0036785011721389674,1.0,1.0 260 | 259,139187,259,0.006588302744060249,0.0,0.9973333333333333 261 | 260,139772,260,0.008029388148536229,0.0,0.9973118279569892 262 | 261,140253,261,0.004564285681522238,0.0,0.9966666666666667 263 | 262,140822,262,0.006880990439495025,0.0,0.9973045822102425 264 | 263,141303,263,0.003109935187720223,1.0,1.0 265 | 264,141840,264,0.014508580584183865,0.0,0.9971671388101983 266 | 265,142321,265,0.0023675416084355154,1.0,1.0 267 | 266,142802,266,0.0025081428609552755,1.0,1.0 268 | 267,143323,267,0.005261667705395599,1.0,1.0 269 | 268,143804,268,0.002401350529014761,1.0,1.0 270 | 269,144549,269,0.027985162366989672,0.0,0.9903288201160542 271 | 270,145030,270,0.0021509962307983215,1.0,1.0 272 | 271,145575,271,0.0076831428922346625,0.0,0.9971751412429378 273 | 272,146048,272,0.00216327352823786,1.0,1.0 274 | 273,146529,273,0.001975703937792515,1.0,1.0 275 | 274,147002,274,0.00195815053139927,1.0,1.0 276 | 275,147811,275,0.04245730707063287,0.0,0.9825783972125436 277 | 276,148292,276,0.0021050401976312324,1.0,1.0 278 | 277,148805,277,0.008208590866455482,0.0,0.9970149253731343 279 | 278,149286,278,0.0020712265487001303,1.0,1.0 280 | 279,149823,279,0.002783523683664934,1.0,1.0 281 | 280,150296,280,0.0018271469644407297,1.0,1.0 282 | 281,150769,281,0.0020818890734290558,1.0,1.0 283 | 282,151250,282,0.0022844112090453783,1.0,1.0 284 | 283,151699,283,0.016429556651616207,0.0,0.992619926199262 285 | 284,152548,284,0.03878574505919051,0.0,0.9831365935919055 286 | 285,153029,285,0.002079613792606483,1.0,1.0 287 | 286,154302,286,0.04756468733941618,0.0,0.9826883910386965 288 | 287,154783,287,0.001917984629517946,1.0,1.0 289 | 288,155288,288,0.005379830862668984,1.0,1.0 290 | 289,155769,289,0.002026707521597122,1.0,1.0 291 | 290,156250,290,0.0020752439627635825,1.0,1.0 292 | 291,156731,291,0.002005717267355686,1.0,1.0 293 | 292,157300,292,0.007952120478244411,0.0,0.9973045822102425 294 | 293,157869,293,0.003766103812128313,1.0,1.0 295 | 294,158350,294,0.02223860503449963,0.0,0.9966555183946488 296 | 295,158887,295,0.0035132116843811264,1.0,1.0 297 | 296,159368,296,0.0018341137737216317,1.0,1.0 298 | 297,159849,297,0.0017890655673318888,1.0,1.0 299 | 298,160338,298,0.001828786091912179,1.0,1.0 300 | 299,160811,299,0.001884776379675521,1.0,1.0 301 | 300,161348,300,0.026370081933159623,0.0,0.9885057471264368 302 | 301,161829,301,0.0021012785616607212,1.0,1.0 303 | 302,162398,302,0.003347557154352088,1.0,1.0 304 | 303,163111,303,0.030540546181056984,0.0,0.9882121807465619 305 | 304,163584,304,0.001887588959851434,1.0,1.0 306 | 305,164057,305,0.0018744148595780487,1.0,1.0 307 | 306,164538,306,0.002088050751570918,1.0,1.0 308 | 307,165163,307,0.008789793371309198,0.0,0.9975 309 | 308,165644,308,0.006080128141047983,0.0,0.9966442953020134 310 | 309,166101,309,0.008578876551741086,0.0,0.9963503649635036 311 | 310,166582,310,0.002192976250113271,1.0,1.0 312 | 311,167119,311,0.004702334499223669,1.0,1.0 313 | 312,167600,312,0.003676261495870639,1.0,1.0 314 | 313,168073,313,0.002891173063590252,1.0,1.0 315 | 314,168666,314,0.005722022294809392,1.0,1.0 316 | 315,169147,315,0.002122104987062884,1.0,1.0 317 | 316,169716,316,0.009841736020258849,0.0,0.9973190348525469 318 | 317,170189,317,0.0020463012857843115,1.0,1.0 319 | 318,170670,318,0.0019419088322635031,1.0,1.0 320 | 319,171335,319,0.005990615212375223,0.0,0.9955357142857143 321 | 320,171928,320,0.003737903871449357,1.0,1.0 322 | 321,172513,321,0.011691824094448553,0.0,0.9972826086956522 323 | 322,172994,322,0.0017149299608296554,1.0,1.0 324 | 323,173475,323,0.0020773295558793913,1.0,1.0 325 | 324,173956,324,0.0018143969271139223,1.0,1.0 326 | 325,174437,325,0.0017594934108315554,1.0,1.0 327 | 326,174918,326,0.001836302653633659,1.0,1.0 328 | 327,175399,327,0.0018888844736984654,1.0,1.0 329 | 328,175880,328,0.0018891493372367992,1.0,1.0 330 | 329,176769,329,0.024327990249807196,0.0,0.993798449612403 331 | 330,177250,330,0.0014784234220991351,1.0,1.0 332 | 331,177731,331,0.001535386514829311,1.0,1.0 333 | 332,178300,332,0.009919219832619716,0.0,0.9973262032085561 334 | 333,178781,333,0.001675411003829363,1.0,1.0 335 | 334,179710,334,0.008827849845781846,1.0,1.0 336 | 335,180183,335,0.0018538537769917257,1.0,1.0 337 | 336,180664,336,0.001642544505289841,1.0,1.0 338 | 337,181137,337,0.0016232939648310068,1.0,1.0 339 | 338,181618,338,0.001594404159362256,1.0,1.0 340 | 339,182203,339,0.00473869770059478,1.0,1.0 341 | 340,182684,340,0.0016738520390287984,1.0,1.0 342 | 341,183213,341,0.008283383508316993,0.0,0.9971590909090909 343 | 342,183694,342,0.0018521323750010927,1.0,1.0 344 | 343,184175,343,0.0015090909201621778,1.0,1.0 345 | 344,184656,344,0.0018381595583144177,1.0,1.0 346 | 345,185105,345,0.02116576947575197,0.0,0.996309963099631 347 | 346,185586,346,0.0015550680443183256,1.0,1.0 348 | 347,186067,347,0.0015637945100157424,1.0,1.0 349 | 348,186748,348,0.018716697635572797,0.0,0.9977777777777778 350 | 349,187229,349,0.0016742000088433892,1.0,1.0 351 | 350,187710,350,0.001731550810061491,1.0,1.0 352 | 351,188191,351,0.0017623302077004412,1.0,1.0 353 | 352,188672,352,0.0017040833280559157,1.0,1.0 354 | 353,189145,353,0.001646725089989591,1.0,1.0 355 | 354,189626,354,0.0016216747679304944,1.0,1.0 356 | 355,190107,355,0.0017307629249843487,1.0,1.0 357 | 356,190588,356,0.0016241265695980764,1.0,1.0 358 | 357,191133,357,0.01178038828240661,0.0,0.9918256130790191 359 | 358,191606,358,0.0016459048065511016,1.0,1.0 360 | 359,192079,359,0.0016136524263081703,1.0,1.0 361 | 360,192560,360,0.0024620930409418214,1.0,1.0 362 | 361,193089,361,0.011374549102285822,0.0,0.9943502824858758 363 | 362,193562,362,0.0017794387086392483,1.0,1.0 364 | 363,194179,363,0.02224354656449729,0.0,0.9925742574257426 365 | 364,194652,364,0.0018209286926852413,1.0,1.0 366 | 365,195133,365,0.0016293384210097563,1.0,1.0 367 | 366,195606,366,0.0015031628428562203,1.0,1.0 368 | 367,196087,367,0.0016908955185521157,1.0,1.0 369 | 368,196568,368,0.0017337133276028192,1.0,1.0 370 | 369,197041,369,0.0015392419202131186,1.0,1.0 371 | 370,197570,370,0.0041854943828133415,0.0,0.9971751412429378 372 | 371,198051,371,0.0017380286491599603,1.0,1.0 373 | 372,198532,372,0.001738961240136088,1.0,1.0 374 | 373,199005,373,0.0016992913078079793,1.0,1.0 375 | 374,199590,374,0.0050177619833901765,0.0,0.9973118279569892 376 | 375,200135,375,0.005201901829776923,1.0,1.0 377 | 376,200616,376,0.0016909520503715339,1.0,1.0 378 | 377,201209,377,0.0037123258773182825,1.0,1.0 379 | 378,201730,378,0.01691443382397755,0.0,0.9909638554216867 380 | 379,202203,379,0.0015049565637862705,1.0,1.0 381 | 380,202684,380,0.001535252121204386,1.0,1.0 382 | 381,203165,381,0.0015155501392018224,1.0,1.0 383 | 382,203654,382,0.01971961827493545,0.0,0.9935691318327974 384 | 383,204135,383,0.0016194682804603591,1.0,1.0 385 | 384,204704,384,0.016706458728030244,0.0,0.9946666666666667 386 | 385,205145,385,0.02150429228385542,0.0,0.9962406015037594 387 | 386,205626,386,0.0016712402182029907,1.0,1.0 388 | 387,206107,387,0.0015860288163263361,1.0,1.0 389 | 388,207084,388,0.007205359005022799,0.0,0.9986263736263736 390 | 389,207765,389,0.010679716770839212,0.0,0.9977728285077951 391 | 390,208246,390,0.0015758064333697562,1.0,1.0 392 | 391,208799,391,0.02501899790215049,0.0,0.9943181818181818 393 | 392,209416,392,0.030598358679855824,0.0,0.9925373134328358 394 | 393,209985,393,0.0035978580998861525,1.0,1.0 395 | 394,210466,394,0.0017700440820748009,1.0,1.0 396 | 395,210947,395,0.0017303872353537076,1.0,1.0 397 | 396,211428,396,0.0017548240285757612,1.0,1.0 398 | 397,211957,397,0.010059184360740601,0.0,0.9943502824858758 399 | 398,212478,398,0.00621109955207844,0.0,0.997134670487106 400 | 399,212959,399,0.0018271815909613387,1.0,1.0 401 | 400,213440,400,0.0018448088105807257,1.0,1.0 402 | 401,214033,401,0.0038648737826004784,1.0,1.0 403 | 402,214514,402,0.0017803305924424017,1.0,1.0 404 | 403,215059,403,0.006339282206753685,0.0,0.9971751412429378 405 | 404,215540,404,0.0016502586529929236,1.0,1.0 406 | 405,216013,405,0.0017231367520319286,1.0,1.0 407 | 406,216534,406,0.004177009067500628,1.0,1.0 408 | 407,217103,407,0.004248371356583236,1.0,1.0 409 | 408,217584,408,0.001718181093310657,1.0,1.0 410 | 409,218033,409,0.010746292627858967,0.0,0.996309963099631 411 | 410,218570,410,0.006620885061844559,0.0,0.9971988795518207 412 | 411,219131,411,0.016295092594738023,0.0,0.9943977591036415 413 | 412,219748,412,0.015004219823503246,0.0,0.9925742574257426 414 | 413,220229,413,0.001938917219969848,1.0,1.0 415 | 414,220710,414,0.0016469608810602558,1.0,1.0 416 | 415,221191,415,0.0015755377056561144,1.0,1.0 417 | 416,221664,416,0.0017229633798547894,1.0,1.0 418 | 417,222137,417,0.0015689463358784842,1.0,1.0 419 | 418,222706,418,0.003356363903988058,1.0,1.0 420 | 419,223179,419,0.0015633763090565965,1.0,1.0 421 | 420,223660,420,0.0017005622356451211,1.0,1.0 422 | 421,224181,421,0.00520944237001401,0.0,0.9969879518072289 423 | 422,224718,422,0.0032472232162400927,1.0,1.0 424 | 423,225311,423,0.003453680844896639,1.0,1.0 425 | 424,226000,424,0.012287853484109825,0.0,0.9954441913439636 426 | 425,226473,425,0.0015734841796938735,1.0,1.0 427 | 426,226954,426,0.0015289900921328344,1.0,1.0 428 | 427,227427,427,0.0016225080505665448,1.0,1.0 429 | 428,228404,428,0.0051006360313138824,1.0,1.0 430 | 429,228949,429,0.0035058896546292266,1.0,1.0 431 | 430,229430,430,0.001478634067455103,1.0,1.0 432 | 431,229903,431,0.001357895497184175,1.0,1.0 433 | 432,230384,432,0.001382860736238381,1.0,1.0 434 | 433,230865,433,0.0014808956643765807,1.0,1.0 435 | 434,231338,434,0.0014912137683979866,1.0,1.0 436 | 435,232083,435,0.02372725993498928,0.0,0.9903288201160542 437 | 436,232612,436,0.004894582446843804,0.0,0.9971751412429378 438 | 437,233093,437,0.0015400831801992462,1.0,1.0 439 | 438,233566,438,0.0013253691334229195,1.0,1.0 440 | 439,234047,439,0.0016442925761092806,1.0,1.0 441 | 440,234576,440,0.0028074635624454935,1.0,1.0 442 | 441,235057,441,0.0015382555630402421,1.0,1.0 443 | 442,235642,442,0.01110213744184319,0.0,0.9972826086956522 444 | 443,236307,443,0.010982330945834373,0.0,0.9954128440366973 445 | 444,236956,444,0.017976671174306267,0.0,0.9910514541387024 446 | 445,237581,445,0.011125895149413366,0.0,0.9975 447 | 446,238166,446,0.005460285349669167,0.0,0.9972972972972973 448 | 447,238639,447,0.0014019321234492205,1.0,1.0 449 | 448,239120,448,0.0014238038533320267,1.0,1.0 450 | 449,239633,449,0.013559914113697823,0.0,0.9940298507462687 451 | 450,240114,450,0.0015721922632614422,1.0,1.0 452 | 451,240683,451,0.0025883583468201575,1.0,1.0 453 | 452,241172,452,0.0014778179372718673,1.0,1.0 454 | 453,241653,453,0.00155520130781127,1.0,1.0 455 | 454,242206,454,0.010888122678795083,0.0,0.9971590909090909 456 | 455,243135,455,0.00616808822548279,0.0,0.998546511627907 457 | 456,243616,456,0.0016560998992686403,1.0,1.0 458 | 457,244073,457,0.010145169351052793,0.0,0.9963503649635036 459 | 458,244962,458,0.022335021135708576,0.0,0.9922480620155039 460 | 459,245443,459,0.0015429893576544428,1.0,1.0 461 | 460,245996,460,0.012607610893541347,0.0,0.9941348973607038 462 | 461,246445,461,0.0083954221701573,0.0,0.9963235294117647 463 | 462,247670,462,0.017267509726964163,0.0,0.994535519125683 464 | 463,248151,463,0.001708944779329748,1.0,1.0 465 | 464,248632,464,0.0020563463395947596,1.0,1.0 466 | 465,249201,465,0.004915014902928301,1.0,1.0 467 | 466,249770,466,0.004226781998054224,1.0,1.0 468 | 467,250251,467,0.002373202738565394,1.0,1.0 469 | 468,250732,468,0.0021819865094706145,1.0,1.0 470 | 469,251213,469,0.0025394914208973526,1.0,1.0 471 | 470,251798,470,0.004247677124353798,1.0,1.0 472 | 471,252279,471,0.0020530241068893065,1.0,1.0 473 | 472,252760,472,0.0021372103396822143,1.0,1.0 474 | 473,253305,473,0.0032688234652699546,1.0,1.0 475 | 474,253786,474,0.0021516610540514946,1.0,1.0 476 | 475,254267,475,0.0035214649397241654,0.0,0.9966555183946488 477 | 476,254852,476,0.00305703444421782,1.0,1.0 478 | 477,255333,477,0.01030835412705292,0.0,0.9966555183946488 479 | 478,255814,478,0.001477113182275363,1.0,1.0 480 | 479,256295,479,0.0016612231926543142,1.0,1.0 481 | 480,256776,480,0.0015052903550358595,1.0,1.0 482 | 481,257457,481,0.004913303047602137,0.0,0.9977777777777778 483 | 482,257938,482,0.0015031965228106709,1.0,1.0 484 | 483,258515,483,0.0022513013639524223,1.0,1.0 485 | 484,258996,484,0.0014910540750836556,1.0,1.0 486 | 485,259541,485,0.00892784431335255,0.0,0.9971830985915493 487 | 486,260126,486,0.011973370167629132,0.0,0.9945945945945946 488 | 487,260607,487,0.0015031064350362507,1.0,1.0 489 | 488,261240,488,0.025929819036390158,0.0,0.9888143176733781 490 | 489,261721,489,0.0014968229629929927,1.0,1.0 491 | 490,262194,490,0.0014263411844803232,1.0,1.0 492 | 491,262675,491,0.0014774976690542418,1.0,1.0 493 | 492,263156,492,0.0014413211317839574,1.0,1.0 494 | 493,263637,493,0.0013736669729904293,1.0,1.0 495 | 494,264110,494,0.001389325052937127,1.0,1.0 496 | 495,264591,495,0.001350687188746891,1.0,1.0 497 | 496,265160,496,0.0026228460876355523,1.0,1.0 498 | 497,265633,497,0.0014969052854329097,1.0,1.0 499 | 498,266114,498,0.001469983948148435,1.0,1.0 500 | 499,266587,499,0.001375651478275531,1.0,1.0 501 | 500,267100,500,0.011836912558371777,0.0,0.9940119760479041 502 | 501,267637,501,0.008047328640034197,0.0,0.9971671388101983 503 | 502,268174,502,0.002190829442549887,1.0,1.0 504 | 503,268655,503,0.0013467948156220733,1.0,1.0 505 | 504,269160,504,0.011105446527200328,0.0,0.9939393939393939 506 | 505,270433,505,0.021178520278610693,0.0,0.9918533604887984 507 | 506,270914,506,0.0014478287500646547,1.0,1.0 508 | 507,271403,507,0.01225187931362374,0.0,0.9967845659163987 509 | 508,271884,508,0.0014828604551554653,1.0,1.0 510 | 509,272453,509,0.002967453952796498,1.0,1.0 511 | 510,272934,510,0.0014419024143006258,1.0,1.0 512 | 511,273415,511,0.0018084729394987062,1.0,1.0 513 | 512,273896,512,0.0014103963549511487,1.0,1.0 514 | 513,274513,513,0.006819999046289155,1.0,1.0 515 | 514,274994,514,0.0014308225886300967,1.0,1.0 516 | 515,275523,515,0.003136438536374158,1.0,1.0 517 | 516,276028,516,0.006641480408109235,0.0,0.9969879518072289 518 | 517,276501,517,0.00138634114068056,1.0,1.0 519 | 518,276982,518,0.0014330455239679664,1.0,1.0 520 | 519,277463,519,0.0014054770584872038,1.0,1.0 521 | 520,278008,520,0.016381673856010193,0.0,0.997134670487106 522 | 521,278489,521,0.0014186884539786472,1.0,1.0 523 | 522,278930,522,0.023239320278190725,0.0,0.9962406015037594 524 | 523,279403,523,0.0013482092670839378,1.0,1.0 525 | 524,279884,524,0.0013870270124268786,1.0,1.0 526 | 525,280549,525,0.0023241210772656606,1.0,1.0 527 | 526,281030,526,0.0014374381534467916,1.0,1.0 528 | 527,281599,527,0.0024111352130600627,1.0,1.0 529 | 528,282592,528,0.010164980393663514,0.0,0.9958100558659218 530 | 529,283073,529,0.001503679663081116,1.0,1.0 531 | 530,283554,530,0.0013187204383312502,1.0,1.0 532 | 531,284035,531,0.0014006506754663602,1.0,1.0 533 | 532,284564,532,0.0027621587006438396,1.0,1.0 534 | 533,285101,533,0.00182037395155969,1.0,1.0 535 | 534,285582,534,0.001465891461583924,1.0,1.0 536 | 535,286063,535,0.0015733591082603702,1.0,1.0 537 | 536,286632,536,0.0022751994122222076,1.0,1.0 538 | 537,287177,537,0.00888647774815402,0.0,0.997275204359673 539 | 538,287650,538,0.0014556018731763192,1.0,1.0 540 | 539,288131,539,0.001624368185536512,1.0,1.0 541 | 540,288660,540,0.009917571533501281,0.0,0.9971590909090909 542 | 541,289141,541,0.0015475827953062285,1.0,1.0 543 | 542,289622,542,0.0016510802140725508,1.0,1.0 544 | 543,290103,543,0.001487999484394682,1.0,1.0 545 | 544,290560,544,0.009936924699512245,0.0,0.9963503649635036 546 | 545,291209,545,0.01830476862400611,0.0,0.9888888888888889 547 | 546,291690,546,0.0015115648389742822,1.0,1.0 548 | 547,292171,547,0.0014037089834664017,1.0,1.0 549 | 548,292652,548,0.001575566312157457,1.0,1.0 550 | 549,293133,549,0.001443435145788427,1.0,1.0 551 | 550,293614,550,0.0015074249186912368,1.0,1.0 552 | 551,294343,551,0.010348058722491667,0.0,0.9958246346555324 553 | 552,294824,552,0.001778793257413859,1.0,1.0 554 | 553,295305,553,0.0015404986834547554,1.0,1.0 555 | 554,295778,554,0.001579190430162047,1.0,1.0 556 | 555,296259,555,0.0020394351476542665,1.0,1.0 557 | 556,296740,556,0.001584285574844361,1.0,1.0 558 | 557,297309,557,0.0063891511737756024,0.0,0.9973333333333333 559 | 558,297790,558,0.0015852051965958645,1.0,1.0 560 | 559,298263,559,0.0014952920764834958,1.0,1.0 561 | 560,298744,560,0.0017751740844272326,1.0,1.0 562 | 561,299225,561,0.001617026239546771,1.0,1.0 563 | 562,299706,562,0.0013481904788745747,1.0,1.0 564 | 563,300299,563,0.0024500291270928274,1.0,1.0 565 | 564,300780,564,0.001547866513247651,1.0,1.0 566 | 565,301253,565,0.0016174278731886046,1.0,1.0 567 | 566,301734,566,0.0014574305103586104,1.0,1.0 568 | 567,302207,567,0.0013770335756152332,1.0,1.0 569 | 568,302728,568,0.006572569255122043,0.0,0.997134670487106 570 | 569,303209,569,0.0012589018234730397,1.0,1.0 571 | 570,303690,570,0.0013801724004751552,1.0,1.0 572 | 571,304539,571,0.021471417581170944,0.0,0.9932546374367622 573 | 572,305132,572,0.0025248016222739473,1.0,1.0 574 | 573,305613,573,0.001716435613885025,1.0,1.0 575 | 574,306086,574,0.001545979743833522,1.0,1.0 576 | 575,306567,575,0.0014055693943904185,1.0,1.0 577 | 576,307048,576,0.0013159329993960587,1.0,1.0 578 | 577,307497,577,0.010698761267462232,0.0,0.996309963099631 579 | 578,307970,578,0.001463186321030488,1.0,1.0 580 | 579,308451,579,0.0012676437834241742,1.0,1.0 581 | 580,308932,580,0.0013045188903545277,1.0,1.0 582 | 581,309413,581,0.00143745499362601,1.0,1.0 583 | 582,309894,582,0.0013777979042181596,1.0,1.0 584 | 583,310375,583,0.001262838040961775,1.0,1.0 585 | 584,310848,584,0.0015087515388086494,1.0,1.0 586 | 585,311657,585,0.01220782836443547,0.0,0.9912891986062717 587 | 586,312250,586,0.0026389556662214314,1.0,1.0 588 | 587,312819,587,0.0019817933173089256,1.0,1.0 589 | 588,313500,588,0.0027401797121455415,1.0,1.0 590 | 589,313957,589,0.007829548410122065,0.0,0.9963503649635036 591 | 590,314670,590,0.009124635481262928,0.0,0.9980353634577603 592 | 591,315255,591,0.0026905072487108184,1.0,1.0 593 | 592,315872,592,0.0025674474169264105,1.0,1.0 594 | 593,316353,593,0.0013993063278975224,1.0,1.0 595 | 594,316834,594,0.001300316917467663,1.0,1.0 596 | 595,317315,595,0.0014289120637530992,1.0,1.0 597 | 596,318196,596,0.009776858547120853,0.0,0.9953198127925117 598 | 597,318669,597,0.0014127843206581043,1.0,1.0 599 | 598,319150,598,0.001594562070384787,1.0,1.0 600 | 599,319687,599,0.010798424559949506,0.0,0.9942528735632183 601 | 600,320160,600,0.001312217489242455,1.0,1.0 602 | 601,321041,601,0.007091662197494276,0.0,0.9984399375975039 603 | 602,321522,602,0.0015914052880409253,1.0,1.0 604 | 603,322091,603,0.001886065351963944,1.0,1.0 605 | 604,322660,604,0.0020192041174448426,1.0,1.0 606 | 605,323141,605,0.001399149154916394,1.0,1.0 607 | 606,323990,606,0.009179202547651158,1.0,1.0 608 | 607,324575,607,0.004887114488313831,0.0,0.9972972972972973 609 | 608,325056,608,0.0014406531212704946,1.0,1.0 610 | 609,325529,609,0.0012375530012043196,1.0,1.0 611 | 610,326010,610,0.0013371177772112056,1.0,1.0 612 | 611,326491,611,0.0012952028583378423,1.0,1.0 613 | 612,326964,612,0.0014645940313107908,1.0,1.0 614 | 613,327445,613,0.0015836407113125235,1.0,1.0 615 | 614,327918,614,0.0013686789956782934,1.0,1.0 616 | 615,328399,615,0.0013028464529903148,1.0,1.0 617 | 616,328880,616,0.0014436290635629373,1.0,1.0 618 | 617,329401,617,0.0023398908007830604,1.0,1.0 619 | 618,329882,618,0.0013441980099213376,1.0,1.0 620 | 619,330363,619,0.0014469068593369859,1.0,1.0 621 | 620,330844,620,0.0015609983243582354,1.0,1.0 622 | 621,331325,621,0.0013454703796876887,1.0,1.0 623 | 622,331854,622,0.0019828439165629885,1.0,1.0 624 | 623,332335,623,0.0012377401363078979,1.0,1.0 625 | 624,332816,624,0.00120314777088826,1.0,1.0 626 | 625,333289,625,0.0012805758781575442,1.0,1.0 627 | 626,333770,626,0.0012871831666358825,1.0,1.0 628 | 627,334251,627,0.0013527026624758748,1.0,1.0 629 | 628,334732,628,0.0014233371845641767,1.0,1.0 630 | 629,335213,629,0.001417749828868309,1.0,1.0 631 | 630,335878,630,0.004022875186422265,1.0,1.0 632 | 631,336359,631,0.0012770738084619186,1.0,1.0 633 | 632,337352,632,0.005309441901382756,0.0,0.9986033519553073 634 | 633,338329,633,0.0045834563142998705,0.0,0.9986263736263736 635 | 634,338858,634,0.003234987786333917,1.0,1.0 636 | 635,339339,635,0.0013118027745107747,1.0,1.0 637 | 636,339812,636,0.0014395024335962627,1.0,1.0 638 | 637,340381,637,0.0021256681644061426,1.0,1.0 639 | 638,340862,638,0.007642948312081188,0.0,0.9966555183946488 640 | 639,341335,639,0.001363254095887829,1.0,1.0 641 | 640,341808,640,0.0013007205079998486,1.0,1.0 642 | 641,342313,641,0.013579401388649848,0.0,0.9939759036144579 643 | 642,342794,642,0.0013128007650209017,1.0,1.0 644 | 643,343323,643,0.002319827208868818,1.0,1.0 645 | 644,343908,644,0.002285879469537445,1.0,1.0 646 | 645,344365,645,0.009712206379609054,0.0,0.9963503649635036 647 | 646,344910,646,0.00408247714073109,0.0,0.9971751412429378 648 | 647,345479,647,0.0017063930557161286,1.0,1.0 649 | 648,346040,648,0.007065692147554617,0.0,0.9971988795518207 650 | 649,346521,649,0.0012973111836232954,1.0,1.0 651 | 650,347002,650,0.0012773892948599896,1.0,1.0 652 | 651,347483,651,0.0013429538273394422,1.0,1.0 653 | 652,347964,652,0.0013711568572243444,1.0,1.0 654 | 653,348445,653,0.0013860784508869853,1.0,1.0 655 | 654,348982,654,0.0026129746811841383,1.0,1.0 656 | 655,349511,655,0.001739636685725081,1.0,1.0 657 | 656,350160,656,0.010067939844549838,0.0,0.9977628635346756 658 | 657,350681,657,0.003512656061119212,0.0,0.9969879518072289 659 | 658,351162,658,0.0013775427254273383,1.0,1.0 660 | 659,351699,659,0.0020821485152905748,1.0,1.0 661 | 660,352268,660,0.001790402270418399,1.0,1.0 662 | 661,352749,661,0.001353237452049487,1.0,1.0 663 | 662,353230,662,0.0014120491615847086,1.0,1.0 664 | 663,353711,663,0.0012681439224223432,1.0,1.0 665 | 664,354192,664,0.0012864120075485178,1.0,1.0 666 | 665,354673,665,0.0013614957652934342,1.0,1.0 667 | 666,355322,666,0.009187098858435622,0.0,0.9933333333333333 668 | 667,356547,667,0.012550934554743097,0.0,0.9967213114754099 669 | 668,357028,668,0.0013208487472404177,1.0,1.0 670 | 669,357509,669,0.001366363942963278,1.0,1.0 671 | 670,358126,670,0.005727310589422285,1.0,1.0 672 | 671,358599,671,0.0013299709825817718,1.0,1.0 673 | 672,359408,672,0.005860578731481869,1.0,1.0 674 | 673,360681,673,0.010682931593155576,0.0,0.9969450101832994 675 | 674,361154,674,0.0013212949686086653,1.0,1.0 676 | 675,361635,675,0.001359700138530938,1.0,1.0 677 | 676,362220,676,0.001992569405320689,1.0,1.0 678 | 677,362709,677,0.0013692822799380544,1.0,1.0 679 | 678,363190,678,0.0012963150555204838,1.0,1.0 680 | 679,363671,679,0.0012380927545971533,1.0,1.0 681 | 680,364152,680,0.0011875423728172929,1.0,1.0 682 | 681,364841,681,0.00984199864221021,0.0,0.9954441913439636 683 | 682,365474,682,0.00832277550141952,0.0,0.9977628635346756 684 | 683,365955,683,0.0014026406105971958,1.0,1.0 685 | 684,366436,684,0.0013408761730068011,1.0,1.0 686 | 685,367021,685,0.002300608549646355,1.0,1.0 687 | 686,367614,686,0.0021223975043585122,1.0,1.0 688 | 687,368063,687,0.010637265596051883,0.0,0.9963235294117647 689 | 688,368544,688,0.0013551321950792874,1.0,1.0 690 | 689,369129,689,0.0025400639606679852,1.0,1.0 691 | 690,369706,690,0.0016192347391428543,1.0,1.0 692 | 691,370331,691,0.005029660319264718,0.0,0.9975 693 | 692,370788,692,0.009990196243359444,0.0,0.9963503649635036 694 | 693,371261,693,0.0013086187325009513,1.0,1.0 695 | 694,371790,694,0.002958912075535811,1.0,1.0 696 | 695,372271,695,0.0012496196162239085,1.0,1.0 697 | 696,372776,696,0.009027598334090883,0.0,0.9939393939393939 698 | 697,373249,697,0.0012963628029136294,1.0,1.0 699 | 698,373730,698,0.0013830097875194127,1.0,1.0 700 | 699,374211,699,0.0012315467259383732,1.0,1.0 701 | 700,374764,700,0.005809896990440793,0.0,0.9970674486803519 702 | 701,375381,701,0.008395403927712465,0.0,0.9975124378109452 703 | 702,375934,702,0.010765479359314873,0.0,0.9971590909090909 704 | 703,376407,703,0.0012514533633213318,1.0,1.0 705 | 704,377152,704,0.007683806011551895,1.0,1.0 706 | 705,377689,705,0.007075834612323121,0.0,0.9971264367816092 707 | 706,378162,706,0.0013323607441177968,1.0,1.0 708 | 707,378643,707,0.001215183505624429,1.0,1.0 709 | 708,379124,708,0.001517486505686776,1.0,1.0 710 | 709,379605,709,0.0011855448385318821,1.0,1.0 711 | 710,380078,710,0.001441594886693985,1.0,1.0 712 | 711,380759,711,0.0027386933356639736,1.0,1.0 713 | 712,381232,712,0.0013641971280306258,1.0,1.0 714 | 713,381713,713,0.0012830267045932154,1.0,1.0 715 | 714,382194,714,0.001264393348225155,1.0,1.0 716 | 715,383123,715,0.005236543021737968,0.0,0.998546511627907 717 | 716,383604,716,0.0013199549195435495,1.0,1.0 718 | 717,384141,717,0.00635116140918944,0.0,0.9971988795518207 719 | 718,384614,718,0.0012479010180479722,1.0,1.0 720 | 719,385183,719,0.001646721668487737,1.0,1.0 721 | 720,385656,720,0.0012757563654628378,1.0,1.0 722 | 721,386225,721,0.0017483672631154613,1.0,1.0 723 | 722,386698,722,0.0014069600010846628,1.0,1.0 724 | 723,387179,723,0.0013463045155488772,1.0,1.0 725 | 724,387652,724,0.0013297517855874012,1.0,1.0 726 | 725,388093,725,0.013251410223058842,0.0,0.9962406015037594 727 | 726,388574,726,0.0013856313948535195,1.0,1.0 728 | 727,389055,727,0.0014023811939730638,1.0,1.0 729 | 728,389528,728,0.0013362318078676567,1.0,1.0 730 | 729,390009,729,0.0012693457713891742,1.0,1.0 731 | 730,390490,730,0.0013132321272040818,1.0,1.0 732 | 731,390971,731,0.0013957373207638863,1.0,1.0 733 | 732,391444,732,0.0013182180046608513,1.0,1.0 734 | 733,391925,733,0.0012151520143836821,1.0,1.0 735 | 734,392518,734,0.002113202327374973,1.0,1.0 736 | 735,392999,735,0.0013260602239450825,1.0,1.0 737 | 736,393472,736,0.0013477008004225736,1.0,1.0 738 | 737,394065,737,0.0025688055738726594,1.0,1.0 739 | 738,394546,738,0.001401978136627163,1.0,1.0 740 | 739,395027,739,0.0013933053783405551,1.0,1.0 741 | 740,395508,740,0.0014120725610097173,1.0,1.0 742 | 741,395989,741,0.0012169978359300162,1.0,1.0 743 | 742,396670,742,0.002656701895440982,1.0,1.0 744 | 743,397239,743,0.0018083724444159879,1.0,1.0 745 | 744,397720,744,0.0014490247829789396,1.0,1.0 746 | 745,398313,745,0.002170843427653438,1.0,1.0 747 | 746,398770,746,0.00604114642892893,0.0,0.9963503649635036 748 | 747,399251,747,0.0012924105710854065,1.0,1.0 749 | 748,399796,748,0.0033892181060145373,0.0,0.9971751412429378 750 | 749,400277,749,0.0012887407673969052,1.0,1.0 751 | 750,400758,750,0.0014251151080105844,1.0,1.0 752 | 751,401239,751,0.0013759816196343806,1.0,1.0 753 | 752,401824,752,0.0025327769503089804,1.0,1.0 754 | 753,402713,753,0.011353293514289535,0.0,0.9953488372093023 755 | 754,403194,754,0.0013820734349949996,1.0,1.0 756 | 755,403675,755,0.0015128510461323936,1.0,1.0 757 | 756,404188,756,0.0049246771058112145,0.0,0.9970149253731343 758 | 757,404669,757,0.0012844166472968741,1.0,1.0 759 | 758,405238,758,0.0016827869542706294,1.0,1.0 760 | 759,405719,759,0.0015210386161800197,1.0,1.0 761 | 760,406384,760,0.0016922408508435699,1.0,1.0 762 | 761,406865,761,0.0012734308277306543,1.0,1.0 763 | 762,407578,762,0.006184134764930046,0.0,0.9980353634577603 764 | 763,408059,763,0.0015124295157649139,1.0,1.0 765 | 764,408596,764,0.0020037432433790666,1.0,1.0 766 | 765,409069,765,0.001281817829712632,1.0,1.0 767 | 766,409614,766,0.002143358245463864,1.0,1.0 768 | 767,410095,767,0.0013668656491043127,1.0,1.0 769 | 768,410576,768,0.0012963624623105634,1.0,1.0 770 | 769,411121,769,0.005151795277215907,0.0,0.9971830985915493 771 | 770,411594,770,0.0013505753256236144,1.0,1.0 772 | 771,412323,771,0.005613565066538803,0.0,0.9979123173277662 773 | 772,412940,772,0.0022300241062042916,1.0,1.0 774 | 773,413421,773,0.001319119130794228,1.0,1.0 775 | 774,413870,774,0.006210189459968566,0.0,0.996309963099631 776 | 775,414415,775,0.006515207990867968,0.0,0.997134670487106 777 | 776,414888,776,0.0014664595881972787,1.0,1.0 778 | 777,415337,777,0.007522102765536668,0.0,0.996309963099631 779 | 778,415906,778,0.001788121187805334,1.0,1.0 780 | 779,416475,779,0.0022979189385395797,1.0,1.0 781 | 780,416956,780,0.0014899414257141372,1.0,1.0 782 | 781,417437,781,0.001303728559993867,1.0,1.0 783 | 782,417918,782,0.001275631116256925,1.0,1.0 784 | 783,418463,783,0.0031393380042902983,1.0,1.0 785 | 784,419056,784,0.0019928462434352324,1.0,1.0 786 | 785,419569,785,0.011763443267053041,0.0,0.9940119760479041 787 | 786,420042,786,0.0013334363437429286,1.0,1.0 788 | 787,420531,787,0.0027403454609028982,1.0,1.0 789 | 788,421012,788,0.001316190264750863,1.0,1.0 790 | 789,421493,789,0.0014221038712711118,1.0,1.0 791 | 790,421974,790,0.001320324803364767,1.0,1.0 792 | 791,422455,791,0.0014958394215991858,1.0,1.0 793 | 792,422992,792,0.001676850409262567,1.0,1.0 794 | 793,423473,793,0.0013509924729198759,1.0,1.0 795 | 794,423954,794,0.001455458315954356,1.0,1.0 796 | 795,424435,795,0.0014018573731236147,1.0,1.0 797 | 796,424916,796,0.0013878042968607503,1.0,1.0 798 | 797,425397,797,0.0013771657654237236,1.0,1.0 799 | 798,425878,798,0.0013798887280693048,1.0,1.0 800 | 799,426399,799,0.0021630297999019332,1.0,1.0 801 | 800,426880,800,0.0013754043454279508,1.0,1.0 802 | 801,427361,801,0.0011854269677113811,1.0,1.0 803 | -------------------------------------------------------------------------------- /gpt3/data/pcap/authentic/custom_dns.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/authentic/custom_dns.pcapng -------------------------------------------------------------------------------- /gpt3/data/pcap/authentic/custom_dns_http_icmp.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/authentic/custom_dns_http_icmp.pcapng -------------------------------------------------------------------------------- /gpt3/data/pcap/authentic/custom_pings.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/authentic/custom_pings.pcapng -------------------------------------------------------------------------------- /gpt3/data/pcap/authentic/custom_pings3.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/authentic/custom_pings3.pcapng -------------------------------------------------------------------------------- /gpt3/data/pcap/synthetic/generated_curie_commands.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/synthetic/generated_curie_commands.pcap -------------------------------------------------------------------------------- /gpt3/data/pcap/synthetic/generated_icmp.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/synthetic/generated_icmp.pcap -------------------------------------------------------------------------------- /gpt3/data/pcap/synthetic/generated_icmp_commands.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pcap/synthetic/generated_icmp_commands.pcap -------------------------------------------------------------------------------- /gpt3/data/pickle/davinci_pairs.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pickle/davinci_pairs.pkl -------------------------------------------------------------------------------- /gpt3/data/pickle/davinci_pairs2.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/data/pickle/davinci_pairs2.pkl -------------------------------------------------------------------------------- /gpt3/data/text/ip_files/sample.txt: -------------------------------------------------------------------------------- 1 | 192.168.1.1 2 | -------------------------------------------------------------------------------- /gpt3/notebooks/davinci_commands_gen.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "d8ab9384-bfd6-4e54-be3a-3bbb87fc4360", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import random\n", 11 | "import re\n", 12 | "import pickle\n", 13 | "\n", 14 | "import openai\n", 15 | "\n", 16 | "from scapy.all import *\n", 17 | "from scapy.utils import RawPcapReader, wrpcap\n", 18 | "import scapy.all as scapy\n", 19 | "\n", 20 | "from scapy.layers.l2 import Ether\n", 21 | "from scapy.layers.inet import IP, TCP, ICMP" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 2, 27 | "id": "13c8bff7-218b-4916-8e91-663ddedddf8e", 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "packets_per_request = 5" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 3, 37 | "id": "46f766e4-a85a-44f8-8d70-d10e4e3794bc", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "with open(\"../data/text/three_summaries.txt\",\"r\") as f:\n", 42 | " packets_summary = f.read().splitlines()" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 4, 48 | "id": "d69ba537-d564-4e77-9ff0-371700f15130", 49 | "metadata": {}, 50 | "outputs": [ 51 | { 52 | "data": { 53 | "text/plain": [ 54 | "9999" 55 | ] 56 | }, 57 | "execution_count": 4, 58 | "metadata": {}, 59 | "output_type": "execute_result" 60 | } 61 | ], 62 | "source": [ 63 | "len(packets_summary)" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": 5, 69 | "id": "78f7dd84-bc5e-430a-b760-bb0cda6bb733", 70 | "metadata": {}, 71 | "outputs": [], 72 | "source": [ 73 | "engines = openai.Engine.list()\n" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": 6, 79 | "id": "eb483584-6722-4aa7-ab4e-8a5b1deaf608", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "responses = pickle.load( open(\"../data/pickle/davinci_pairs2.pkl\", \"rb\" ))\n" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 7, 89 | "id": "33c7c10f-5663-46c7-af40-2a31af33e860", 90 | "metadata": {}, 91 | "outputs": [ 92 | { 93 | "data": { 94 | "text/plain": [ 95 | "200" 96 | ] 97 | }, 98 | "execution_count": 7, 99 | "metadata": {}, 100 | "output_type": "execute_result" 101 | } 102 | ], 103 | "source": [ 104 | "len(responses)" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 8, 110 | "id": "0f9964e5-74ee-4668-8295-91bd4b9120b2", 111 | "metadata": {}, 112 | "outputs": [ 113 | { 114 | "name": "stdout", 115 | "output_type": "stream", 116 | "text": [ 117 | "This is a packet summary:\n", 118 | "192.168.1.194 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=18917\n", 119 | "This is the python code to generate the packet:\n", 120 | "scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x9015, seq=18917)\n", 121 | "\n", 122 | "This is a packet summary:\n", 123 | "192.168.1.190 → 192.168.1.152 DNS 193 Standard query response 0x0971 No such name AAAA a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com SOA ns-1926.awsdns-48.co.uk\n", 124 | "This is the python code to generate the packet:\n", 125 | "IP(src=\"192.168.1.190\", dst=\"192.168.1.152\")/DNS(id=0x0971, qr=1, opcode=0, rcode=3, qdcount=1, ancount=0, nscount=0, arcount=0, qd=DNSQR(qname=\"a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com\", qtype=\"SOA\", qclass=\"IN\"))\n", 126 | "\n", 127 | "These are the packet summaries:\n", 128 | "192.168.1.152 → 192.168.1.190 DNS 109 Standard query 0x8d29 A a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com\n", 129 | "192.168.1.193 → 192.168.1.190 ICMP 76 Echo (ping) request id=0x0001, seq=5456\n", 130 | "192.168.1.190 → 192.168.1.192 ICMP 100 Echo (ping) reply id=0x112d, seq=5469\n", 131 | "192.168.1.190 → 192.168.1.192 ICMP 100 Echo (ping) reply id=0x112d, seq=6133\n", 132 | "192.168.1.190 → 192.168.1.194 ICMP 100 Echo (ping) reply id=0x9015, seq=19453\n", 133 | "\n", 134 | "Generate python code for creating these packets with scapy framework and put them all in a list named pkt_list.\n" 135 | ] 136 | } 137 | ], 138 | "source": [ 139 | "for i in range(1):\n", 140 | " summaries = random.choices(packets_summary,k=packets_per_request)\n", 141 | " query = \"This is a packet summary:\\n\"\n", 142 | " query += \"192.168.1.194 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=18917\\n\"\n", 143 | " query += \"This is the python code to generate the packet:\\n\"\n", 144 | " query += 'scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x9015, seq=18917)\\n\\n'\n", 145 | " query += \"This is a packet summary:\\n\"\n", 146 | " query += \"192.168.1.190 → 192.168.1.152 DNS 193 Standard query response 0x0971 No such name AAAA a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com SOA ns-1926.awsdns-48.co.uk\\n\"\n", 147 | " query += \"This is the python code to generate the packet:\\n\"\n", 148 | " query += 'IP(src=\"192.168.1.190\", dst=\"192.168.1.152\")/DNS(id=0x0971, qr=1, opcode=0, rcode=3, qdcount=1, ancount=0, nscount=0, arcount=0, qd=DNSQR(qname=\"a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com\", qtype=\"SOA\", qclass=\"IN\"))\\n\\n'\n", 149 | "\n", 150 | " query += \"These are the packet summaries:\\n\"\n", 151 | " text_sum = \"\"\n", 152 | " for summary in summaries:\n", 153 | " query += summary + \"\\n\"\n", 154 | " text_sum += summary + \"\\n\"\n", 155 | "\n", 156 | " query += \"\\nGenerate python code for creating these packets with scapy framework and put them all in a list named pkt_list.\"\n", 157 | "\n", 158 | " print(query)\n", 159 | " break\n", 160 | " \n", 161 | " completion = openai.Completion.create(engine=\"text-davinci-003\", prompt=query,max_tokens=2600,temperature=0.1)\n", 162 | " completion[\"prompt_summary\"] = text_sum\n", 163 | " responses.append(completion)\n", 164 | "\n", 165 | " #print(responses[-1].choices[0].text)\n", 166 | " \n", 167 | " exec(responses[-1].choices[0].text)\n", 168 | " pickle.dump(responses, open( \"../data/pickle/davinci_pairs2.pkl\", \"wb\" ) )\n", 169 | " print(len(responses))\n" 170 | ] 171 | }, 172 | { 173 | "cell_type": "code", 174 | "execution_count": 42, 175 | "id": "bd8bb17f-6a7b-4520-90b2-9d3a55737eac", 176 | "metadata": {}, 177 | "outputs": [ 178 | { 179 | "name": "stdout", 180 | "output_type": "stream", 181 | "text": [ 182 | "[>, >, |>>, >, >]\n" 183 | ] 184 | } 185 | ], 186 | "source": [ 187 | "exec(responses[-1].choices[0].text)\n", 188 | "print(pkt_list)" 189 | ] 190 | }, 191 | { 192 | "cell_type": "code", 193 | "execution_count": 85, 194 | "id": "31f2709a-8b38-4d83-8420-1712fb6a6471", 195 | "metadata": {}, 196 | "outputs": [ 197 | { 198 | "name": "stdout", 199 | "output_type": "stream", 200 | "text": [ 201 | "192.168.1.193 → 192.168.1.190 ICMP 76 Echo (ping) request id=0x0001, seq=5129\n", 202 | "192.168.1.192 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x112d, seq=6406\n", 203 | "2405:6e00:10ce:2c00:20c:29ff:feee:e07a → 2600:9000:5301:200::1 DNS 120 Standard query 0x30e9 A shavar.services.mozilla.com OPT\n", 204 | "2001:503:ba3e::2:30 → 2405:6e00:10ce:2c00:20c:29ff:feee:e07a DNS 1161 Standard query response 0x4aa2 NS NS e.root-servers.net NS h.root-servers.net NS l.root-servers.net NS i.root-servers.net NS a.root-servers.net NS d.root-servers.net NS c.root-servers.net NS b.root-servers.net NS j.root-servers.net NS k.root-servers.net NS g.root-servers.net NS m.root-servers.net NS f.root-servers.net RRSIG A 192.203.230.10 AAAA 2001:500:a8::e A 198.97.190.53 AAAA 2001:500:1::53 A 199.7.83.42 AAAA 2001:500:9f::42 A 192.36.148.17 AAAA 2001:7fe::53 A 198.41.0.4 AAAA 2001:503:ba3e::2:30 A 199.7.91.13 AAAA 2001:500:2d::d A 192.33.4.12 AAAA 2001:500:2::c A 199.9.14.201 AAAA 2001:500:200::b A 192.58.128.30 AAAA 2001:503:c27::2:30 A 193.0.14.129 AAAA 2001:7fd::1 A 192.112.36.4 AAAA 2001:500:12::d0d A 202.12.27.33 AAAA 2001:dc3::35 A 192.5.5.241 AAAA 2001:500:2f::f OPT\n", 205 | "192.168.1.190 → 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=5449\n", 206 | "\n", 207 | "\n", 208 | "\n", 209 | "pkt_list = [scapy.IP(src=\"192.168.1.193\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x0001, seq=5129),\n", 210 | " scapy.IP(src=\"192.168.1.192\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x112d, seq=6406),\n", 211 | " scapy.IP(src=\"2405:6e00:10ce:2c00:20c:29ff:feee:e07a\", dst=\"2600:9000:5301:200::1\")/DNS(id=0x30e9, qr=0, opcode=0, rcode=0, qdcount=1, ancount=0, nscount=0, arcount=0, qd=DNSQR(qname=\"shavar.services.mozilla.com\", qtype=\"A\", qclass=\"IN\")),\n", 212 | " scapy.IP(src=\"2001:503:ba3e::2:30\", dst=\"2405:6e00:10ce:2c00:20c:29ff:feee:e07a\")/DNS(id=0x4aa2, qr=1, opcode=0, rcode=0, qdcount=1, ancount=13, nscount=13, arcount=4, qd=DNSQR(qname=\"\", qtype=\"NS\", qclass=\"IN\"), an=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"e.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"h.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"l.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"i.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"a.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"d.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"c.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"b.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"j.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"k.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"g.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"m.root-servers.net\"), ns=DNSRR(rrname=\"\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"f.root-servers.net\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.203.230.10\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:a8::e\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"198.97.190.53\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:1::53\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"199.7.83.42\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:9f::42\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.36.148.17\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:7fe::53\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"198.41.0.4\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:503:ba3e::2:30\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"199.7.91.13\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:2d::d\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.33.4.12\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:2::c\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"199.9.14.201\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:200::b\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.58.128.30\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:503:c27::2:30\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"193.0.14.129\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:7fd::1\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.112.36.4\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:12::d0d\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"202.12.27.33\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:dc3::35\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"A\", rclass=\"IN\", ttl=300, rdata=\"192.5.5.241\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"AAAA\", rclass=\"IN\", ttl=300, rdata=\"2001:500:2f::f\"), ar=DNSRR(rrname=\"shavar.services.mozilla.com\", type=\"OPT\", rclass=\"IN\", ttl=0, rdata=\"\")),\n", 213 | " scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.193\")/scapy.ICMP(type=0, id=0x0001, seq=5449)]\n" 214 | ] 215 | } 216 | ], 217 | "source": [ 218 | "print(responses[-1].prompt_summary)\n", 219 | "print(responses[-1].choices[0].text)" 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": 44, 225 | "id": "21a0bc16-9c1d-43f2-8380-23060cb8b6c9", 226 | "metadata": {}, 227 | "outputs": [], 228 | "source": [ 229 | "pickle.dump(responses, open( \"../data/pickle/davinci_pairs2.pkl\", \"wb\" ) )" 230 | ] 231 | }, 232 | { 233 | "cell_type": "code", 234 | "execution_count": 11, 235 | "id": "9bb88436-91c5-40a7-86fc-d540dbbb71c1", 236 | "metadata": {}, 237 | "outputs": [], 238 | "source": [ 239 | "fixed_text = \"\"\"\n", 240 | "\n", 241 | "pkt_list = [scapy.IP(src=\"192.168.1.152\", dst=\"192.168.1.190\")/scapy.DNS(id=0x8d29, qr=0, opcode=0, rcode=0, qdcount=1, ancount=0, nscount=0, arcount=0, qd=DNSQR(qname=\"a2z3kk2ebqzso7.iot.ap-southeast-2.amazonaws.com\", qtype=\"A\", qclass=\"IN\")),\n", 242 | " scapy.IP(src=\"192.168.1.193\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x0001, seq=5456),\n", 243 | " scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/scapy.ICMP(type=0, id=0x112d, seq=5469),\n", 244 | " scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/scapy.ICMP(type=0, id=0x112d, seq=6133),\n", 245 | " scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.194\")/scapy.ICMP(type=0, id=0x9015, seq=19453)]\n", 246 | "\"\"\"\n", 247 | "\n" 248 | ] 249 | }, 250 | { 251 | "cell_type": "code", 252 | "execution_count": 12, 253 | "id": "0593a80a-1e9e-42bb-86d7-c0c806133bed", 254 | "metadata": {}, 255 | "outputs": [], 256 | "source": [ 257 | "exec(fixed_text)" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 13, 263 | "id": "8aef95a7-f3ef-404f-a8fe-d95477263888", 264 | "metadata": {}, 265 | "outputs": [ 266 | { 267 | "data": { 268 | "text/plain": [ 269 | "[ |>>,\n", 270 | " >,\n", 271 | " >,\n", 272 | " >,\n", 273 | " >]" 274 | ] 275 | }, 276 | "execution_count": 13, 277 | "metadata": {}, 278 | "output_type": "execute_result" 279 | } 280 | ], 281 | "source": [ 282 | "pkt_list" 283 | ] 284 | }, 285 | { 286 | "cell_type": "code", 287 | "execution_count": 82, 288 | "id": "36835b6f-9fa5-4cf8-a8a8-aa5de226066d", 289 | "metadata": {}, 290 | "outputs": [], 291 | "source": [ 292 | "responses[-1].choices[0].text = fixed_text" 293 | ] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "execution_count": 60, 298 | "id": "d994762f-2ebe-453f-8b8e-d2c601db1bba", 299 | "metadata": {}, 300 | "outputs": [ 301 | { 302 | "name": "stdout", 303 | "output_type": "stream", 304 | "text": [ 305 | "192.168.1.190 → 192.168.1.192 DNS 222 Standard query response 0x1565 A daisy.ubuntu.com A 162.213.33.132 A 162.213.33.108 NS ns1.canonical.com NS ns3.canonical.com NS ns2.canonical.com A 91.189.94.173 A 91.189.95.3 A 91.189.91.139\n", 306 | "192.168.1.190 → 192.168.1.192 ICMP 100 Echo (ping) reply id=0x112d, seq=5807\n", 307 | "192.168.1.190 → 192.168.1.192 ICMP 100 Echo (ping) reply id=0x112d, seq=6340\n", 308 | "192.168.1.190 → 192.168.1.192 ICMP 100 Echo (ping) reply id=0x112d, seq=6600\n", 309 | "192.168.1.194 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=19885\n", 310 | "\n", 311 | "\n", 312 | "\n", 313 | "pkt_list = [scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/DNS(id=0x1565, qr=1, opcode=0, rcode=0, qdcount=1, ancount=5, nscount=3, arcount=0, qd=DNSQR(qname=\"daisy.ubuntu.com\", qtype=\"A\", qclass=\"IN\"), an=DNSRR(rrname=\"daisy.ubuntu.com\", type=\"A\", rclass=\"IN\", ttl=172800, rdata=\"162.213.33.132\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"A\", rclass=\"IN\", ttl=172800, rdata=\"162.213.33.108\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"ns1.canonical.com\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"ns3.canonical.com\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"NS\", rclass=\"IN\", ttl=172800, rdata=\"ns2.canonical.com\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"A\", rclass=\"IN\", ttl=172800, rdata=\"91.189.94.173\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"A\", rclass=\"IN\", ttl=172800, rdata=\"91.189.95.3\")/DNSRR(rrname=\"daisy.ubuntu.com\", type=\"A\", rclass=\"IN\", ttl=172800, rdata=\"91.189.91.139\")], scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/scapy.ICMP(type=0, id=0x112d, seq=5807), scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/scapy.ICMP(type=0, id=0x112d, seq=6340), scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.192\")/scapy.ICMP(type=0, id=0x112d, seq=6600), scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x9015, seq=19885)]\n" 314 | ] 315 | } 316 | ], 317 | "source": [ 318 | "print(responses[-1].prompt_summary)\n", 319 | "print(responses[-1].choices[0].text)" 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 103, 325 | "id": "9bb3a5ba-9651-477a-b0e4-b5869e204fe2", 326 | "metadata": {}, 327 | "outputs": [], 328 | "source": [ 329 | "del responses[-1]" 330 | ] 331 | }, 332 | { 333 | "cell_type": "code", 334 | "execution_count": 22, 335 | "id": "9323cfbe-0e28-4fb3-806c-0b162516024b", 336 | "metadata": {}, 337 | "outputs": [], 338 | "source": [ 339 | "\n", 340 | "pkt_list = []\n", 341 | "\n", 342 | "pkt_list.append(scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.193\")/scapy.ICMP(type=76, id=0x0001, seq=4091))\n", 343 | "\n", 344 | "pkt_list.append(scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=100, id=0x9015, seq=18476))\n", 345 | "\n", 346 | "pkt_list.append(scapy.IP(src=\"192.168.1.192\", dst=\"192.168.1.190\")/scapy.ICMP(type=100, id=0x112d, seq=5799))\n", 347 | "\n", 348 | "pkt_list.append(scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=100, id=0x9015, seq=19355))\n", 349 | "\n", 350 | "pkt_list.append(scapy.IP(src=\"192.168.1.193\", dst=\"192.168.1.190\")/scapy.ICMP(type=76, id=0x0001, seq=4322))\n", 351 | "\n", 352 | "pkt_list.append(scapy.IP(src=\"192.168.1.192\", dst=\"192.168.1.190\")/scapy.ICMP(type=100, id=0x112d, seq=5804))\n", 353 | "\n", 354 | "pkt_list.append(scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.194\")/scapy.ICMP(type=100, id=0x9015, seq=19228))\n", 355 | "\n", 356 | "pkt_list.append(scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.194\")/scapy.ICMP(type=100, id=0x9015, seq=19718))\n", 357 | "\n", 358 | "pkt_list.append(scapy.IP(src=\"192.168.1.193\", dst=\"192.168.1.190\")/scapy.ICMP(type=76, id=0x0001, seq=5336))" 359 | ] 360 | }, 361 | { 362 | "cell_type": "code", 363 | "execution_count": 24, 364 | "id": "f33b0c49-5d12-4392-b76b-f66a1c41be20", 365 | "metadata": {}, 366 | "outputs": [], 367 | "source": [ 368 | "with open(\"../data/pcapgenerated_curie_commands.pcap\", \"wb\") as f:\n", 369 | " wrpcap(f, pkt_list)" 370 | ] 371 | }, 372 | { 373 | "cell_type": "code", 374 | "execution_count": 32, 375 | "id": "6cc2d0dd-f878-4dea-9607-dd5991b70735", 376 | "metadata": {}, 377 | "outputs": [ 378 | { 379 | "name": "stdout", 380 | "output_type": "stream", 381 | "text": [ 382 | "{\n", 383 | " \"choices\": [\n", 384 | " {\n", 385 | " \"finish_reason\": \"stop\",\n", 386 | " \"index\": 0,\n", 387 | " \"logprobs\": null,\n", 388 | " \"text\": \"\\n\\npkt_list = [scapy.IP(src=\\\"192.168.1.192\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x112d, seq=5619),\\n scapy.IP(src=\\\"192.168.1.194\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x9015, seq=19673),\\n scapy.IP(src=\\\"192.168.1.194\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x9015, seq=18836),\\n scapy.IP(src=\\\"192.168.1.190\\\", dst=\\\"192.168.1.193\\\")/scapy.ICMP(type=0, id=0x0001, seq=4886),\\n scapy.IP(src=\\\"192.168.1.190\\\", dst=\\\"192.168.1.193\\\")/scapy.ICMP(type=0, id=0x0001, seq=4305)]\"\n", 389 | " }\n", 390 | " ],\n", 391 | " \"created\": 1677576757,\n", 392 | " \"id\": \"cmpl-6oqdZkXJZj4oXycbtlpbzYMv4Jzfz\",\n", 393 | " \"model\": \"text-davinci-003\",\n", 394 | " \"object\": \"text_completion\",\n", 395 | " \"prompt_summary\": \"192.168.1.192 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x112d, seq=5619\\n192.168.1.194 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=19673\\n192.168.1.194 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=18836\\n192.168.1.190 \\u2192 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4886\\n192.168.1.190 \\u2192 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4305\\n\",\n", 396 | " \"usage\": {\n", 397 | " \"completion_tokens\": 254,\n", 398 | " \"prompt_tokens\": 519,\n", 399 | " \"total_tokens\": 773\n", 400 | " }\n", 401 | "}\n" 402 | ] 403 | } 404 | ], 405 | "source": [ 406 | "print(responses[0])" 407 | ] 408 | }, 409 | { 410 | "cell_type": "code", 411 | "execution_count": null, 412 | "id": "91a6d790-25f0-4413-b862-a1035c82a0c7", 413 | "metadata": {}, 414 | "outputs": [], 415 | "source": [] 416 | } 417 | ], 418 | "metadata": { 419 | "kernelspec": { 420 | "display_name": "Python 3 (ipykernel)", 421 | "language": "python", 422 | "name": "python3" 423 | }, 424 | "language_info": { 425 | "codemirror_mode": { 426 | "name": "ipython", 427 | "version": 3 428 | }, 429 | "file_extension": ".py", 430 | "mimetype": "text/x-python", 431 | "name": "python", 432 | "nbconvert_exporter": "python", 433 | "pygments_lexer": "ipython3", 434 | "version": "3.10.6" 435 | } 436 | }, 437 | "nbformat": 4, 438 | "nbformat_minor": 5 439 | } 440 | -------------------------------------------------------------------------------- /gpt3/notebooks/gen_packet_commands.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "d8ab9384-bfd6-4e54-be3a-3bbb87fc4360", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import random\n", 11 | "import re\n", 12 | "\n", 13 | "import openai\n", 14 | "\n", 15 | "from scapy.all import Raw\n", 16 | "from scapy.utils import RawPcapReader, wrpcap\n", 17 | "\n", 18 | "from scapy.layers.l2 import Ether\n", 19 | "from scapy.layers.inet import IP, TCP, ICMP" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 13, 25 | "id": "13c8bff7-218b-4916-8e91-663ddedddf8e", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "request_num = 1\n", 30 | "packets_per_request = 10" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 24, 36 | "id": "46f766e4-a85a-44f8-8d70-d10e4e3794bc", 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "with open(\"dns_summaries.txt\",\"r\") as f:\n", 41 | " packets_summary = f.read().splitlines()" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 25, 47 | "id": "d69ba537-d564-4e77-9ff0-371700f15130", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/plain": [ 53 | "526" 54 | ] 55 | }, 56 | "execution_count": 25, 57 | "metadata": {}, 58 | "output_type": "execute_result" 59 | } 60 | ], 61 | "source": [ 62 | "len(packets_summary)" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 26, 68 | "id": "78f7dd84-bc5e-430a-b760-bb0cda6bb733", 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [ 72 | "engines = openai.Engine.list()" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": 30, 78 | "id": "0f9964e5-74ee-4668-8295-91bd4b9120b2", 79 | "metadata": {}, 80 | "outputs": [ 81 | { 82 | "name": "stdout", 83 | "output_type": "stream", 84 | "text": [ 85 | "These are the packet summaries:\n", 86 | "130.231.240.70 → 130.231.202.234 DNS 207 Standard query response 0xea13 A steamstore-a.akamaihd.net CNAME steamstore-a.akamaihd.net.edgesuite.net CNAME a1737.b.akamai.net A 193.166.4.71 A 193.166.4.70 OPT\n", 87 | "130.231.202.234 → 130.231.240.70 DNS 100 Standard query 0x3c0b A pagead2.googlesyndication.com OPT\n", 88 | "130.231.202.234 → 208.67.222.222 DNS 99 Standard query 0x3ff6 A myip.opendns.com OPT\n", 89 | "130.231.240.70 → 130.231.202.234 DNS 112 Standard query response 0x01e4 A ext2-fra1.steamserver.net A 162.254.197.54 OPT\n", 90 | "130.231.240.70 → 130.231.202.234 DNS 137 Standard query response 0xca23 No such name A usage.fdown.net SOA brad.ns.cloudflare.com\n", 91 | "130.231.240.70 → 130.231.202.234 DNS 149 Standard query response 0xb6b8 No such name A sstats.fdown.net SOA brad.ns.cloudflare.com OPT\n", 92 | "130.231.240.70 → 130.231.202.234 DNS 149 Standard query response 0xc56c No such name A sstats.fdown.net.oulu.fi SOA ousrvr.oulu.fi OPT\n", 93 | "130.231.240.70 → 130.231.202.234 DNS 148 Standard query response 0x450e No such name A stats.fdown.net.oulu.fi SOA ousrvr.oulu.fi OPT\n", 94 | "130.231.202.234 → 130.231.240.70 DNS 95 Standard query 0xa85b A sstats.fdown.net.oulu.fi OPT\n", 95 | "208.67.222.222 → 130.231.202.234 DNS 103 Standard query response 0x1287 A myip.opendns.com A 130.231.202.234 OPT\n", 96 | "\n", 97 | "Generate python code for creating these packets with Scapy framework and put them all in a list named pkt_list. (Specify both src and dst fields when creating packets.)\n" 98 | ] 99 | } 100 | ], 101 | "source": [ 102 | "responses = []\n", 103 | "for i in range(request_num):\n", 104 | " summaries = random.choices(packets_summary,k=packets_per_request)\n", 105 | " query = \"These are the packet summaries:\\n\"\n", 106 | " for summary in summaries:\n", 107 | " query += summary + \"\\n\"\n", 108 | " \n", 109 | " query += \"\\nGenerate python code for creating these packets with Scapy framework and put them all in a list named pkt_list. (Specify both src and dst fields when creating packets.)\"\n", 110 | " \n", 111 | " print(query)\n", 112 | " #break\n", 113 | " \n", 114 | " completion = openai.Completion.create(engine=\"text-davinci-003\", prompt=query,max_tokens=2600)\n", 115 | " completion[\"prompt_summary\"] = summary\n", 116 | " responses.append(completion)\n" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 31, 122 | "id": "d004a45f-5246-4b57-8731-ad5fed659106", 123 | "metadata": { 124 | "tags": [] 125 | }, 126 | "outputs": [ 127 | { 128 | "name": "stdout", 129 | "output_type": "stream", 130 | "text": [ 131 | "\n", 132 | "\n", 133 | "pkt_list = [\n", 134 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xea13, qr=1, qd=scapy.DNSQR(qname=\"steamstore-a.akamaihd.net\"), an=scapy.DNSRR(rrname=\"steamstore-a.akamaihd.net.edgesuite.net\", type=\"CNAME\", rdata=\"a1737.b.akamai.net\"), ar=scapy.DNSRR(rrname=\"a1737.b.akamai.net\", type=\"A\", rdata=\"193.166.4.71\")/scapy.DNSRR(rrname=\"a1737.b.akamai.net\", type=\"A\", rdata=\"193.166.4.70\")/scapy.DNSOPT(options=[scapy.DNSOPTRR()]),\n", 135 | " scapy.IP(src=\"130.231.202.234\", dst=\"130.231.240.70\")/scapy.DNS(id=0x3c0b, qd=scapy.DNSQR(qname=\"pagead2.googlesyndication.com\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0), \n", 136 | " scapy.IP(src=\"130.231.202.234\", dst=\"208.67.222.222\")/scapy.DNS(id=0x3ff6, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0),\n", 137 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0x01e4, qr=1, qd=scapy.DNSQR(qname=\"ext2-fra1.steamserver.net\"), an=scapy.DNSRR(rrname=\"ext2-fra1.steamserver.net\", type=\"A\", rdata=\"162.254.197.54\")/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 138 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xca23, qr=1, qd=scapy.DNSQR(qname=\"usage.fdown.net\"), an=scapy.DNSRR(rrname=\"usage.fdown.net\", type=\"SOA\", rdata=\"brad.ns.cloudflare.com\"), qr=0),\n", 139 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xb6b8, qr=1, qd=scapy.DNSQR(qname=\"sstats.fdown.net\"), an=scapy.DNSRR(rrname=\"sstats.fdown.net\", type=\"SOA\", rdata=\"brad.ns.cloudflare.com\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 140 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xc56c, qr=1, qd=scapy.DNSQR(qname=\"sstats.fdown.net.oulu.fi\"), an=scapy.DNSRR(rrname=\"sstats.fdown.net.oulu.fi\", type=\"SOA\", rdata=\"ousrvr.oulu.fi\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 141 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0x450e, qr=1, qd=scapy.DNSQR(qname=\"stats.fdown.net.oulu.fi\"), an=scapy.DNSRR(rrname=\"stats.fdown.net.oulu.fi\", type=\"SOA\", rdata=\"ousrvr.oulu.fi\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 142 | " scapy.IP(src=\"130.231.202.234\", dst=\"130.231.240.70\")/scapy.DNS(id=0xa85b, qd=scapy.DNSQR(qname=\"sstats.fdown.net.oulu.fi\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0),\n", 143 | " scapy.IP(src=\"208.67.222.222\", dst=\"130.231.202.234\")/scapy.DNS(id=0x1287, qr=1, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), an=scapy.DNSRR(rrname=\"myip.opendns.com\", type=\"A\", rdata=\"130.231.202.234\")/scapy.DNSRR(optdata=scapy.DNSOPT())\n", 144 | "]\n" 145 | ] 146 | } 147 | ], 148 | "source": [ 149 | "print(responses[0].choices[0].text)" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": 7, 155 | "id": "5598da7c-1d8f-448d-8b3c-491ea272292d", 156 | "metadata": { 157 | "tags": [] 158 | }, 159 | "outputs": [ 160 | { 161 | "name": "stdout", 162 | "output_type": "stream", 163 | "text": [ 164 | "\n", 165 | "\n", 166 | "import scapy.all as scapy\n", 167 | "pkt_list = []\n", 168 | " \n", 169 | "# Echo (ping) request 1\n", 170 | "pkt1 = scapy.IP(dst=\"8.8.8.8\")/scapy.ICMP(type=\"echo-request\", id=0x0002, seq=125)\n", 171 | "pkt_list.append(pkt1)\n", 172 | "\n", 173 | "# Echo (ping) request 2\n", 174 | "pkt2 = scapy.IP(dst=\"8.8.8.8\")/scapy.ICMP(type=\"echo-request\", id=0x0002, seq=147)\n", 175 | "pkt_list.append(pkt2)\n", 176 | "\n", 177 | "# Echo (ping) request 3\n", 178 | "pkt3 = scapy.IP(dst=\"8.8.8.8\")/scapy.ICMP(type=\"echo-request\", id=0x0002, seq=186)\n", 179 | "pkt_list.append(pkt3)\n", 180 | "\n", 181 | "#Echo (ping) request 4\n", 182 | "pkt4 = scapy.IP(dst=\"8.8.8.8\")/scapy.ICMP(type=\"echo-request\", id=0x0002, seq=188)\n", 183 | "pkt_list.append(pkt4)\n", 184 | "\n", 185 | "#Echo (ping) reply 1\n", 186 | "pkt5 = scapy.IP(src=\"8.8.8.8\")/scapy.ICMP(type=\"echo-reply\", id=0x0002, seq=199)\n", 187 | "pkt_list.append(pkt5)\n", 188 | "\n", 189 | "#Echo (ping) request 5\n", 190 | "pkt6 = scapy.IP(dst=\"9.9.9.9\")/scapy.ICMP(type=\"echo-request\", id=0x0004, seq=230)\n", 191 | "pkt_list.append(pkt6)\n", 192 | "\n", 193 | "# Echo (ping) reply 2\n", 194 | "pkt7 = scapy.IP(src=\"9.9.9.9\")/scapy.ICMP(type=\"echo-reply\", id=0x0004, seq=1)\n", 195 | "pkt_list.append(pkt7)\n", 196 | "\n", 197 | "# Echo (ping) reply 3\n", 198 | "pkt8 = scapy.IP(src=\"8.8.8.8\")/scapy.ICMP(type=\"echo-reply\", id=0x0002, seq=101)\n", 199 | "pkt_list.append(pkt8)\n" 200 | ] 201 | } 202 | ], 203 | "source": [ 204 | "print(responses[0].choices[0].text)" 205 | ] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "execution_count": 33, 210 | "id": "2662dbbb-e389-45fc-b884-058966356961", 211 | "metadata": {}, 212 | "outputs": [ 213 | { 214 | "name": "stdout", 215 | "output_type": "stream", 216 | "text": [ 217 | "\n", 218 | "\n", 219 | "pkt_list = [\n", 220 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xea13, qr=1, qd=scapy.DNSQR(qname=\"steamstore-a.akamaihd.net\"), an=scapy.DNSRR(rrname=\"steamstore-a.akamaihd.net.edgesuite.net\", type=\"CNAME\", rdata=\"a1737.b.akamai.net\"), ar=scapy.DNSRR(rrname=\"a1737.b.akamai.net\", type=\"A\", rdata=\"193.166.4.71\")/scapy.DNSRR(rrname=\"a1737.b.akamai.net\", type=\"A\", rdata=\"193.166.4.70\")/scapy.DNSOPT(options=[scapy.DNSOPTRR()]),\n", 221 | " scapy.IP(src=\"130.231.202.234\", dst=\"130.231.240.70\")/scapy.DNS(id=0x3c0b, qd=scapy.DNSQR(qname=\"pagead2.googlesyndication.com\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0), \n", 222 | " scapy.IP(src=\"130.231.202.234\", dst=\"208.67.222.222\")/scapy.DNS(id=0x3ff6, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0),\n", 223 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0x01e4, qr=1, qd=scapy.DNSQR(qname=\"ext2-fra1.steamserver.net\"), an=scapy.DNSRR(rrname=\"ext2-fra1.steamserver.net\", type=\"A\", rdata=\"162.254.197.54\")/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 224 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xca23, qr=1, qd=scapy.DNSQR(qname=\"usage.fdown.net\"), an=scapy.DNSRR(rrname=\"usage.fdown.net\", type=\"SOA\", rdata=\"brad.ns.cloudflare.com\"), qr=0),\n", 225 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xb6b8, qr=1, qd=scapy.DNSQR(qname=\"sstats.fdown.net\"), an=scapy.DNSRR(rrname=\"sstats.fdown.net\", type=\"SOA\", rdata=\"brad.ns.cloudflare.com\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 226 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0xc56c, qr=1, qd=scapy.DNSQR(qname=\"sstats.fdown.net.oulu.fi\"), an=scapy.DNSRR(rrname=\"sstats.fdown.net.oulu.fi\", type=\"SOA\", rdata=\"ousrvr.oulu.fi\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 227 | " scapy.IP(src=\"130.231.240.70\", dst=\"130.231.202.234\")/scapy.DNS(id=0x450e, qr=1, qd=scapy.DNSQR(qname=\"stats.fdown.net.oulu.fi\"), an=scapy.DNSRR(rrname=\"stats.fdown.net.oulu.fi\", type=\"SOA\", rdata=\"ousrvr.oulu.fi\"), qr=0)/scapy.DNSRR(optdata=scapy.DNSOPT()),\n", 228 | " scapy.IP(src=\"130.231.202.234\", dst=\"130.231.240.70\")/scapy.DNS(id=0xa85b, qd=scapy.DNSQR(qname=\"sstats.fdown.net.oulu.fi\"), ar=scapy.DNSRR(optdata=scapy.DNSOPT()), qr=0),\n", 229 | " scapy.IP(src=\"208.67.222.222\", dst=\"130.231.202.234\")/scapy.DNS(id=0x1287, qr=1, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), an=scapy.DNSRR(rrname=\"myip.opendns.com\", type=\"A\", rdata=\"130.231.202.234\")/scapy.DNSRR(optdata=scapy.DNSOPT())\n", 230 | "]\n" 231 | ] 232 | } 233 | ], 234 | "source": [ 235 | "print(responses[0].choices[0].text)" 236 | ] 237 | }, 238 | { 239 | "cell_type": "code", 240 | "execution_count": 32, 241 | "id": "bd8bb17f-6a7b-4520-90b2-9d3a55737eac", 242 | "metadata": {}, 243 | "outputs": [ 244 | { 245 | "ename": "SyntaxError", 246 | "evalue": "closing parenthesis ']' does not match opening parenthesis '(' on line 13 (, line 14)", 247 | "output_type": "error", 248 | "traceback": [ 249 | "Traceback \u001b[0;36m(most recent call last)\u001b[0m:\n", 250 | " File \u001b[1;32m~/.local/lib/python3.10/site-packages/IPython/core/interactiveshell.py:3398\u001b[0m in \u001b[1;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\n", 251 | "\u001b[0;36m Input \u001b[0;32mIn [32]\u001b[0;36m in \u001b[0;35m\u001b[0;36m\u001b[0m\n\u001b[0;31m exec(responses[0].choices[0].text)\u001b[0m\n", 252 | "\u001b[0;36m File \u001b[0;32m:14\u001b[0;36m\u001b[0m\n\u001b[0;31m ]\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m closing parenthesis ']' does not match opening parenthesis '(' on line 13\n" 253 | ] 254 | } 255 | ], 256 | "source": [ 257 | "exec(responses[0].choices[0].text)" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 21, 263 | "id": "824e7b61-35c8-4cb0-8d3f-34adbf1d89f2", 264 | "metadata": {}, 265 | "outputs": [ 266 | { 267 | "data": { 268 | "text/plain": [ 269 | "[>,\n", 270 | " >,\n", 271 | " >,\n", 272 | " >,\n", 273 | " >,\n", 274 | " >,\n", 275 | " >,\n", 276 | " >,\n", 277 | " >,\n", 278 | " >]" 279 | ] 280 | }, 281 | "execution_count": 21, 282 | "metadata": {}, 283 | "output_type": "execute_result" 284 | } 285 | ], 286 | "source": [ 287 | "pkt_list" 288 | ] 289 | }, 290 | { 291 | "cell_type": "code", 292 | "execution_count": 22, 293 | "id": "28a07f8f-1ee7-4ea0-9fb1-88c28bdb8c8f", 294 | "metadata": {}, 295 | "outputs": [], 296 | "source": [ 297 | "with open(\"generated_icmp_commands.pcap\", \"wb\") as f:\n", 298 | " wrpcap(f, pkt_list)" 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": 34, 304 | "id": "a8006891-aa4c-4dbd-8296-a71ba49f4ed6", 305 | "metadata": {}, 306 | "outputs": [ 307 | { 308 | "ename": "SyntaxError", 309 | "evalue": "incomplete input (501196326.py, line 1)", 310 | "output_type": "error", 311 | "traceback": [ 312 | "\u001b[0;36m Input \u001b[0;32mIn [34]\u001b[0;36m\u001b[0m\n\u001b[0;31m pkt = scapy.IP(src=\"208.67.222.222\", dst=\"130.231.202.234\")/scapy.DNS(id=0x1287, qr=1, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), an=scapy.DNSRR(rrname=\"myip.opendns.com\", type=\"A\", rdata=\"130.231.202.234\")/scapy.DNSOPT(options=[scapy.DNSOPTRR()])\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m incomplete input\n" 313 | ] 314 | } 315 | ], 316 | "source": [ 317 | "pkt = scapy.IP(src=\"208.67.222.222\", dst=\"130.231.202.234\")/scapy.DNS(id=0x1287, qr=1, qd=scapy.DNSQR(qname=\"myip.opendns.com\"), an=scapy.DNSRR(rrname=\"myip.opendns.com\", type=\"A\", rdata=\"130.231.202.234\")/scapy.DNSOPT(options=[scapy.DNSOPTRR()])" 318 | ] 319 | }, 320 | { 321 | "cell_type": "code", 322 | "execution_count": null, 323 | "id": "21a0bc16-9c1d-43f2-8380-23060cb8b6c9", 324 | "metadata": {}, 325 | "outputs": [], 326 | "source": [] 327 | } 328 | ], 329 | "metadata": { 330 | "kernelspec": { 331 | "display_name": "Python 3 (ipykernel)", 332 | "language": "python", 333 | "name": "python3" 334 | }, 335 | "language_info": { 336 | "codemirror_mode": { 337 | "name": "ipython", 338 | "version": 3 339 | }, 340 | "file_extension": ".py", 341 | "mimetype": "text/x-python", 342 | "name": "python", 343 | "nbconvert_exporter": "python", 344 | "pygments_lexer": "ipython3", 345 | "version": "3.10.6" 346 | } 347 | }, 348 | "nbformat": 4, 349 | "nbformat_minor": 5 350 | } 351 | -------------------------------------------------------------------------------- /gpt3/notebooks/gen_packet_summary.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "d8ab9384-bfd6-4e54-be3a-3bbb87fc4360", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import random\n", 11 | "import re\n", 12 | "\n", 13 | "import openai\n", 14 | "\n", 15 | "from scapy.all import Raw\n", 16 | "from scapy.utils import RawPcapReader, wrpcap\n", 17 | "\n", 18 | "from scapy.layers.l2 import Ether\n", 19 | "from scapy.layers.inet import IP, TCP, ICMP" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 2, 25 | "id": "13c8bff7-218b-4916-8e91-663ddedddf8e", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "sample_gen_num = 100" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 3, 35 | "id": "9a634bf4-047e-4238-970e-ef087ad3bec5", 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "def process_pcap(file_name):\n", 40 | " print('Opening {}...'.format(file_name))\n", 41 | "\n", 42 | " count = 0\n", 43 | " interesting_packet_count = 0\n", 44 | "\n", 45 | " interesting_packets = []\n", 46 | " for (pkt_data, pkt_metadata,) in RawPcapReader(file_name):\n", 47 | " count += 1\n", 48 | "\n", 49 | " ether_pkt = Ether(pkt_data)\n", 50 | " if 'type' not in ether_pkt.fields:\n", 51 | " # LLC frames will have 'len' instead of 'type'.\n", 52 | " # We disregard those\n", 53 | " continue\n", 54 | "\n", 55 | " if ether_pkt.type != 0x0800:\n", 56 | " # disregard non-IPv4 packets\n", 57 | " continue\n", 58 | " ip_pkt = ether_pkt[IP]\n", 59 | " if ip_pkt.proto != 1:\n", 60 | " # Ignore non-TCP packet\n", 61 | " continue\n", 62 | " interesting_packet_count += 1\n", 63 | " interesting_packets.append(ether_pkt)\n", 64 | "\n", 65 | " print('{} contains {} packets ({} interesting)'.\n", 66 | " format(file_name, count, interesting_packet_count))\n", 67 | "\n", 68 | " return interesting_packets\n" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 4, 74 | "id": "804370db-2a5d-40ad-8a66-cb8edf712c06", 75 | "metadata": {}, 76 | "outputs": [ 77 | { 78 | "name": "stdout", 79 | "output_type": "stream", 80 | "text": [ 81 | "Opening ../pcap-analysis/data/encoder/pcap/custom_pings3.pcapng...\n", 82 | "../pcap-analysis/data/encoder/pcap/custom_pings3.pcapng contains 2261 packets (2261 interesting)\n" 83 | ] 84 | } 85 | ], 86 | "source": [ 87 | "packets_scapy = process_pcap(\"../pcap-analysis/data/encoder/pcap/custom_pings3.pcapng\")" 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": 5, 93 | "id": "b71fb8d5-6853-4f25-8aee-3d1ed9834482", 94 | "metadata": {}, 95 | "outputs": [ 96 | { 97 | "data": { 98 | "text/plain": [ 99 | "2261" 100 | ] 101 | }, 102 | "execution_count": 5, 103 | "metadata": {}, 104 | "output_type": "execute_result" 105 | } 106 | ], 107 | "source": [ 108 | "len(packets_scapy)" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": 7, 114 | "id": "46f766e4-a85a-44f8-8d70-d10e4e3794bc", 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "with open(\"ping_summaries.txt\",\"r\") as f:\n", 119 | " packets_summary = f.read().splitlines()" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": 8, 125 | "id": "d69ba537-d564-4e77-9ff0-371700f15130", 126 | "metadata": {}, 127 | "outputs": [ 128 | { 129 | "data": { 130 | "text/plain": [ 131 | "2261" 132 | ] 133 | }, 134 | "execution_count": 8, 135 | "metadata": {}, 136 | "output_type": "execute_result" 137 | } 138 | ], 139 | "source": [ 140 | "len(packets_summary)" 141 | ] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "execution_count": 9, 146 | "id": "bae40450-1cda-4cc2-8193-2a91b96509d2", 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [ 150 | "packets = tuple(zip(packets_summary,packets_scapy))" 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": 10, 156 | "id": "78f7dd84-bc5e-430a-b760-bb0cda6bb733", 157 | "metadata": {}, 158 | "outputs": [], 159 | "source": [ 160 | "engines = openai.Engine.list()" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": 43, 166 | "id": "0f9964e5-74ee-4668-8295-91bd4b9120b2", 167 | "metadata": {}, 168 | "outputs": [ 169 | { 170 | "name": "stdout", 171 | "output_type": "stream", 172 | "text": [ 173 | "This is the packet summary:\n", 174 | "76.76.2.0 → 130.231.202.234 ICMP 98 Echo (ping) reply id=0x0005, seq=123/31488, ttl=48 (request in 1159)\n", 175 | "\n", 176 | "This is the packet details:\n", 177 | "###[ IP ]### \n", 178 | " version = 4\n", 179 | " ihl = 5\n", 180 | " tos = 0x0\n", 181 | " len = 84\n", 182 | " id = 50746\n", 183 | " flags = \n", 184 | " frag = 0\n", 185 | " ttl = 48\n", 186 | " proto = icmp\n", 187 | " chksum = None\n", 188 | " src = 76.76.2.0\n", 189 | " dst = 130.231.202.234\n", 190 | " \\options \\\n", 191 | "###[ ICMP ]### \n", 192 | " type = echo-reply\n", 193 | " code = 0\n", 194 | " chksum = None\n", 195 | " id = 0x5\n", 196 | " seq = 0x7b\n", 197 | " unused = ''\n", 198 | "\n", 199 | "\n", 200 | "This is another packet summary:\n", 201 | "76.76.2.0 → 130.231.202.234 ICMP 98 Echo (ping) reply id=0x0005, seq=189/48384, ttl=48 (request in 1687)\n", 202 | "\n", 203 | "Generate the packet details.\n" 204 | ] 205 | } 206 | ], 207 | "source": [ 208 | "responses = []\n", 209 | "for i in range(sample_gen_num):\n", 210 | " summary,packet = random.choice(packets)\n", 211 | " packet = packet[IP]\n", 212 | " try:\n", 213 | " del packet[Raw]\n", 214 | " except IndexError:\n", 215 | " packet.show()\n", 216 | " del packet.chksum\n", 217 | " del packet[ICMP].chksum\n", 218 | " query = \"This is the packet summary:\\n\"\n", 219 | " query += summary + \"\\n\\n\"\n", 220 | " query += \"This is the packet details:\\n\"\n", 221 | " query += str(packet.show(dump=True))\n", 222 | " \n", 223 | " summary,_ = random.choice(packets)\n", 224 | " query += \"\\n\\nThis is another packet summary:\\n\"\n", 225 | " query += summary + \"\\n\\n\"\n", 226 | " query += \"Generate the packet details.\"\n", 227 | " \n", 228 | " print(query)\n", 229 | " break\n", 230 | " \n", 231 | " completion = openai.Completion.create(engine=\"text-davinci-003\", prompt=query,max_tokens=3500)\n", 232 | " completion[\"prompt_summary\"] = summary\n", 233 | " responses.append(completion)\n" 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": 14, 239 | "id": "d4111b38-e0f0-4367-b969-7b20914346d2", 240 | "metadata": {}, 241 | "outputs": [ 242 | { 243 | "name": "stdout", 244 | "output_type": "stream", 245 | "text": [ 246 | "100\n" 247 | ] 248 | } 249 | ], 250 | "source": [ 251 | "print(len(responses))" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": 15, 257 | "id": "d004a45f-5246-4b57-8731-ad5fed659106", 258 | "metadata": {}, 259 | "outputs": [ 260 | { 261 | "name": "stdout", 262 | "output_type": "stream", 263 | "text": [ 264 | "8.8.8.8 → 130.231.202.234 ICMP 98 Echo (ping) reply id=0x0002, seq=258/513, ttl=109 (request in 1881)\n", 265 | " \n", 266 | "\n", 267 | "###[ IP ]### \n", 268 | " version = 4\n", 269 | " ihl = 5\n", 270 | " tos = 0x0\n", 271 | " len = 84\n", 272 | " id = 25911\n", 273 | " flags = \n", 274 | " frag = 0\n", 275 | " ttl = 109\n", 276 | " proto = icmp\n", 277 | " chksum = None\n", 278 | " src = 8.8.8.8\n", 279 | " dst = 130.231.202.234\n", 280 | " \\options \\\n", 281 | "###[ ICMP ]### \n", 282 | " type = echo-reply\n", 283 | " code = 0\n", 284 | " chksum = None\n", 285 | " id = 0x2\n", 286 | " seq = 0x102\n", 287 | " unused = ''\n" 288 | ] 289 | } 290 | ], 291 | "source": [ 292 | "print(responses[0].prompt_summary)\n", 293 | "print(responses[0].choices[0].text)" 294 | ] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "execution_count": 39, 299 | "id": "ef4e60fb-b65d-48ef-950c-9478ac7f896e", 300 | "metadata": {}, 301 | "outputs": [], 302 | "source": [ 303 | "def str_to_packet(s):\n", 304 | " packet = IP()\n", 305 | " s2i_proto = {v:k for k,v in packet.get_field(\"proto\").i2s.items()}\n", 306 | " _,ip_text,payload_text = re.split(\"\\#{3}\\[\\s*\\w*\\s*\\]\\#{3}\",s)\n", 307 | " for line in ip_text.splitlines():\n", 308 | " if line == \" \" or line == \" \\\\options \\\\\":\n", 309 | " continue\n", 310 | "\n", 311 | " try: \n", 312 | " key,value = line.split(\"=\")\n", 313 | " except ValueError:\n", 314 | " print(line)\n", 315 | " continue\n", 316 | " if key.strip() == \"proto\":\n", 317 | " packet[IP].proto = s2i_proto[value.strip()]\n", 318 | " continue\n", 319 | " try:\n", 320 | " packet[IP].fields[key.strip()] = int(value.strip(),0)\n", 321 | " except:\n", 322 | " \n", 323 | " packet[IP].fields[key.strip()] = value.strip()\n", 324 | " # Handle ICMP Payload \n", 325 | " if packet[IP].proto == 1:\n", 326 | " packet = packet / ICMP()\n", 327 | " type_conversion = {\"echo-reply\" : 0, \"echo-request\":8}\n", 328 | " for line in payload_text.splitlines():\n", 329 | " if line == \" \" or line == \" \\\\options \\\\\":\n", 330 | " continue\n", 331 | " \n", 332 | " try: \n", 333 | " key,value = line.split(\"=\")\n", 334 | " except ValueError:\n", 335 | " print(line)\n", 336 | " continue\n", 337 | " \n", 338 | " try:\n", 339 | " packet[ICMP].fields[key.strip()] = int(value.strip(),0)\n", 340 | " except:\n", 341 | " packet[ICMP].fields[key.strip()] = value.strip()\n", 342 | "\n", 343 | " if packet.unused == \"''\":\n", 344 | " packet.unused = b''\n", 345 | " packet.type = type_conversion[packet.type]\n", 346 | " return packet" 347 | ] 348 | }, 349 | { 350 | "cell_type": "code", 351 | "execution_count": 40, 352 | "id": "697b299a-8a3e-4c73-9717-f76a352c12e3", 353 | "metadata": {}, 354 | "outputs": [ 355 | { 356 | "name": "stdout", 357 | "output_type": "stream", 358 | "text": [ 359 | "\n", 360 | "\n", 361 | "\n", 362 | "\n", 363 | " \n", 364 | "\n", 365 | "\n", 366 | "\n", 367 | "\n", 368 | "\n", 369 | "\n", 370 | "\n", 371 | "\n", 372 | "\n", 373 | "###[ IP ]### \n", 374 | " version = 4\n", 375 | " ihl = 5\n", 376 | " tos = 0x0\n", 377 | " len = 84\n", 378 | " id = 25911\n", 379 | " flags = \n", 380 | " frag = 0\n", 381 | " ttl = 109\n", 382 | " proto = icmp\n", 383 | " chksum = 0x8a90\n", 384 | " src = 8.8.8.8\n", 385 | " dst = 130.231.202.234\n", 386 | " \\options \\\n", 387 | "###[ ICMP ]### \n", 388 | " type = echo-reply\n", 389 | " code = 0\n", 390 | " chksum = 0xfefb\n", 391 | " id = 0x2\n", 392 | " seq = 0x102\n", 393 | " unused = ''\n", 394 | "\n" 395 | ] 396 | } 397 | ], 398 | "source": [ 399 | "gen_pkts = [str_to_packet(response.choices[0].text) for response in responses]\n", 400 | "\n", 401 | "def delete_wrong_fields(pkt):\n", 402 | "\n", 403 | " del pkt[IP].flags\n", 404 | " del pkt[IP].chksum\n", 405 | " del pkt[ICMP].chksum\n", 406 | " \n", 407 | " return pkt\n", 408 | " \n", 409 | "gen_pkts = list(map(delete_wrong_fields,gen_pkts))\n", 410 | "gen_pkts[0].show2()\n", 411 | "\n", 412 | "with open(\"generated_icmp.pcap\", \"wb\") as f:\n", 413 | " wrpcap(f, gen_pkts)\n" 414 | ] 415 | }, 416 | { 417 | "cell_type": "code", 418 | "execution_count": 41, 419 | "id": "dcecce3f-980b-4e50-825d-a62a4738fc6d", 420 | "metadata": {}, 421 | "outputs": [ 422 | { 423 | "data": { 424 | "text/plain": [ 425 | "100" 426 | ] 427 | }, 428 | "execution_count": 41, 429 | "metadata": {}, 430 | "output_type": "execute_result" 431 | } 432 | ], 433 | "source": [ 434 | "len(gen_pkts)" 435 | ] 436 | }, 437 | { 438 | "cell_type": "code", 439 | "execution_count": 24, 440 | "id": "fa6f6710-ee69-4d7e-b14b-af58a3c7493c", 441 | "metadata": {}, 442 | "outputs": [ 443 | { 444 | "name": "stdout", 445 | "output_type": "stream", 446 | "text": [ 447 | "\n", 448 | "\n", 449 | "###[ IP ]###\n", 450 | " version = 4\n", 451 | " ihl = 5\n", 452 | " tos = 0x0\n", 453 | " len = 84\n", 454 | " id = 22238\n", 455 | " flags = DF\n", 456 | " frag = 0\n", 457 | " ttl = 64\n", 458 | " proto = icmp\n", 459 | " chksum = None\n", 460 | " src = 130.231.202.234\n", 461 | " dst = 8.8.8.8\n", 462 | " \\options \\\n", 463 | "###[ ICMP ]###\n", 464 | " type = echo-request\n", 465 | " code = 0\n", 466 | " chksum = None\n", 467 | " id = 0x2\n", 468 | " seq = 0xb2\n", 469 | " unused = ''\n" 470 | ] 471 | } 472 | ], 473 | "source": [ 474 | "print(responses[0].choices[0].text)" 475 | ] 476 | }, 477 | { 478 | "cell_type": "code", 479 | "execution_count": 173, 480 | "id": "2db5779f-0828-4cb1-ba8f-e39df0f53a97", 481 | "metadata": {}, 482 | "outputs": [], 483 | "source": [ 484 | "summary,packet = random.choice(packets)" 485 | ] 486 | }, 487 | { 488 | "cell_type": "code", 489 | "execution_count": 42, 490 | "id": "9df0548d-97a5-486f-88e1-1660c32b6dbf", 491 | "metadata": {}, 492 | "outputs": [ 493 | { 494 | "data": { 495 | "text/plain": [ 496 | "'76.76.2.0 → 130.231.202.234 ICMP 98 Echo (ping) reply id=0x0005, seq=37/9472, ttl=48 (request in 471)'" 497 | ] 498 | }, 499 | "execution_count": 42, 500 | "metadata": {}, 501 | "output_type": "execute_result" 502 | } 503 | ], 504 | "source": [ 505 | "summary" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "execution_count": 160, 511 | "id": "bc47beb7-4b2d-4511-ab50-ac9fe09a1424", 512 | "metadata": {}, 513 | "outputs": [ 514 | { 515 | "name": "stdout", 516 | "output_type": "stream", 517 | "text": [ 518 | "###[ Ethernet ]### \n", 519 | " dst = 84:a9:38:6a:7f:0d\n", 520 | " src = 70:db:98:81:93:40\n", 521 | " type = IPv4\n", 522 | "###[ IP ]### \n", 523 | " version = 4\n", 524 | " ihl = 5\n", 525 | " tos = 0x0\n", 526 | " len = 84\n", 527 | " id = 53490\n", 528 | " flags = \n", 529 | " frag = 0\n", 530 | " ttl = 53\n", 531 | " proto = icmp\n", 532 | " chksum = 0x54d3\n", 533 | " src = 9.9.9.9\n", 534 | " dst = 130.231.202.234\n", 535 | " \\options \\\n", 536 | "###[ ICMP ]### \n", 537 | " type = echo-reply\n", 538 | " code = 0\n", 539 | " chksum = 0x3c6\n", 540 | " id = 0x4\n", 541 | " seq = 0x101\n", 542 | " unused = ''\n", 543 | "###[ Raw ]### \n", 544 | " load = '\\\\xd5I\\\\x87c\\x00\\x00\\x00\\x00Ӵ\\x0c\\x00\\x00\\x00\\x00\\x00\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./01234567'\n", 545 | "\n" 546 | ] 547 | } 548 | ], 549 | "source": [ 550 | "packet.show()" 551 | ] 552 | }, 553 | { 554 | "cell_type": "code", 555 | "execution_count": 156, 556 | "id": "2aeba976-e474-476b-97b7-38f8ad51ae55", 557 | "metadata": {}, 558 | "outputs": [ 559 | { 560 | "data": { 561 | "text/plain": [ 562 | "True" 563 | ] 564 | }, 565 | "execution_count": 156, 566 | "metadata": {}, 567 | "output_type": "execute_result" 568 | } 569 | ], 570 | "source": [ 571 | "type(gen_pkts[0][ICMP].unused) == type(packet[ICMP].unused)" 572 | ] 573 | }, 574 | { 575 | "cell_type": "code", 576 | "execution_count": 167, 577 | "id": "3a285803-0fd9-40c3-a5a4-0eb4d45897e3", 578 | "metadata": {}, 579 | "outputs": [ 580 | { 581 | "data": { 582 | "text/plain": [ 583 | "" 584 | ] 585 | }, 586 | "execution_count": 167, 587 | "metadata": {}, 588 | "output_type": "execute_result" 589 | } 590 | ], 591 | "source": [ 592 | "gen_pkts[2][IP].flags" 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": 168, 598 | "id": "0e97102d-ae24-4c9d-bb55-96e796fee8a2", 599 | "metadata": {}, 600 | "outputs": [ 601 | { 602 | "data": { 603 | "text/plain": [ 604 | "" 605 | ] 606 | }, 607 | "execution_count": 168, 608 | "metadata": {}, 609 | "output_type": "execute_result" 610 | } 611 | ], 612 | "source": [ 613 | "packet[IP].flags" 614 | ] 615 | }, 616 | { 617 | "cell_type": "code", 618 | "execution_count": 112, 619 | "id": "fb5c4ec5-795f-45aa-bb63-40e2ae485f3f", 620 | "metadata": {}, 621 | "outputs": [ 622 | { 623 | "name": "stdout", 624 | "output_type": "stream", 625 | "text": [ 626 | "###[ IP ]### \n", 627 | " version = 4\n", 628 | " ihl = 5\n", 629 | " tos = 0x0\n", 630 | " len = 84\n", 631 | " id = 49001\n", 632 | " flags = DF\n", 633 | " frag = 0\n", 634 | " ttl = 64\n", 635 | " proto = icmp\n", 636 | " chksum = None\n", 637 | " src = 130.231.202.234\n", 638 | " dst = 8.8.8.8\n", 639 | " \\options \\\n", 640 | "###[ ICMP ]### \n", 641 | " type = echo-request\n", 642 | " code = 0\n", 643 | " chksum = None\n", 644 | " id = 0x2\n", 645 | " seq = 0xb8\n", 646 | " unused = ''\n", 647 | "\n" 648 | ] 649 | } 650 | ], 651 | "source": [ 652 | "gen_pkts[0].show()" 653 | ] 654 | }, 655 | { 656 | "cell_type": "code", 657 | "execution_count": 186, 658 | "id": "710b6ead-4c76-44f9-9a8c-c09f6cb5fad2", 659 | "metadata": {}, 660 | "outputs": [ 661 | { 662 | "name": "stdout", 663 | "output_type": "stream", 664 | "text": [ 665 | "###[ IP ]### \n", 666 | " version = 4\n", 667 | " ihl = 5\n", 668 | " tos = 0x0\n", 669 | " len = 84\n", 670 | " id = 14963\n", 671 | " flags = \n", 672 | " frag = 0\n", 673 | " ttl = 49\n", 674 | " proto = icmp\n", 675 | " chksum = 0xfb5e\n", 676 | " src = 4.2.2.4\n", 677 | " dst = 130.231.202.234\n", 678 | " \\options \\\n", 679 | "###[ ICMP ]### \n", 680 | " type = echo-reply\n", 681 | " code = 0\n", 682 | " chksum = 0xf79f\n", 683 | " id = 0x3\n", 684 | " seq = 0x62\n", 685 | " unused = ''\n", 686 | "###[ Raw ]### \n", 687 | " load = '\"I\\\\x87c\\x00\\x00\\x00\\x00\\\\x96{\\t\\x00\\x00\\x00\\x00\\x00\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./01234567'\n", 688 | "\n", 689 | "###[ IP ]### \n", 690 | " version = 4\n", 691 | " ihl = 5\n", 692 | " tos = 0x0\n", 693 | " len = 84\n", 694 | " id = 14963\n", 695 | " flags = DF\n", 696 | " frag = 0\n", 697 | " ttl = 49\n", 698 | " proto = icmp\n", 699 | " chksum = None\n", 700 | " src = 4.2.2.4\n", 701 | " dst = 130.231.202.234\n", 702 | " \\options \\\n", 703 | "###[ ICMP ]### \n", 704 | " type = echo-reply\n", 705 | " code = 0\n", 706 | " chksum = None\n", 707 | " id = 0x3\n", 708 | " seq = 0x62\n", 709 | " unused = ''\n", 710 | "\n" 711 | ] 712 | } 713 | ], 714 | "source": [ 715 | "summary,packet2 = random.choice(packets)\n", 716 | "packet2[IP].show()\n", 717 | "packet2[IP].flags = \"DF\"\n", 718 | "del packet2[Raw]\n", 719 | "del packet2[IP].chksum\n", 720 | "del packet2[ICMP].chksum\n", 721 | "packet2[IP].show()\n" 722 | ] 723 | }, 724 | { 725 | "cell_type": "code", 726 | "execution_count": 184, 727 | "id": "9be5ef9e-128c-4365-afbf-42309a3b569a", 728 | "metadata": {}, 729 | "outputs": [ 730 | { 731 | "data": { 732 | "text/plain": [ 733 | "" 734 | ] 735 | }, 736 | "execution_count": 184, 737 | "metadata": {}, 738 | "output_type": "execute_result" 739 | } 740 | ], 741 | "source": [ 742 | "packet2[IP].flags" 743 | ] 744 | }, 745 | { 746 | "cell_type": "code", 747 | "execution_count": 187, 748 | "id": "4f168f43-9f3d-4a65-bf09-75095bf503d4", 749 | "metadata": {}, 750 | "outputs": [], 751 | "source": [ 752 | "with open(\"generated_icmp.pcap\", \"wb\") as f:\n", 753 | " wrpcap(f, packet2)\n" 754 | ] 755 | }, 756 | { 757 | "cell_type": "code", 758 | "execution_count": null, 759 | "id": "2239c851-66eb-4d61-904d-7a70fadb3fb3", 760 | "metadata": {}, 761 | "outputs": [], 762 | "source": [] 763 | } 764 | ], 765 | "metadata": { 766 | "kernelspec": { 767 | "display_name": "Python 3 (ipykernel)", 768 | "language": "python", 769 | "name": "python3" 770 | }, 771 | "language_info": { 772 | "codemirror_mode": { 773 | "name": "ipython", 774 | "version": 3 775 | }, 776 | "file_extension": ".py", 777 | "mimetype": "text/x-python", 778 | "name": "python", 779 | "nbconvert_exporter": "python", 780 | "pygments_lexer": "ipython3", 781 | "version": "3.10.6" 782 | } 783 | }, 784 | "nbformat": 4, 785 | "nbformat_minor": 5 786 | } 787 | -------------------------------------------------------------------------------- /gpt3/notebooks/preprocess_finetuning_data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "0ba31d09-0b4a-4297-8b85-485d82901993", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import pickle\n", 11 | "import json\n", 12 | "import csv" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 2, 18 | "id": "682a2c0c-a65e-4a9c-91e6-3c84e3022c15", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "responses = pickle.load( open(\"../data/pickle/davinci_pairs2.pkl\", \"rb\" ))\n" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 3, 28 | "id": "125078c9-c104-4e00-a4b8-4feccb0eecbb", 29 | "metadata": {}, 30 | "outputs": [ 31 | { 32 | "data": { 33 | "text/plain": [ 34 | " JSON: {\n", 35 | " \"choices\": [\n", 36 | " {\n", 37 | " \"finish_reason\": \"stop\",\n", 38 | " \"index\": 0,\n", 39 | " \"logprobs\": null,\n", 40 | " \"text\": \"\\n\\npkt_list = [scapy.IP(src=\\\"192.168.1.192\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x112d, seq=5619),\\n scapy.IP(src=\\\"192.168.1.194\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x9015, seq=19673),\\n scapy.IP(src=\\\"192.168.1.194\\\", dst=\\\"192.168.1.190\\\")/scapy.ICMP(type=8, id=0x9015, seq=18836),\\n scapy.IP(src=\\\"192.168.1.190\\\", dst=\\\"192.168.1.193\\\")/scapy.ICMP(type=0, id=0x0001, seq=4886),\\n scapy.IP(src=\\\"192.168.1.190\\\", dst=\\\"192.168.1.193\\\")/scapy.ICMP(type=0, id=0x0001, seq=4305)]\"\n", 41 | " }\n", 42 | " ],\n", 43 | " \"created\": 1677576757,\n", 44 | " \"id\": \"cmpl-6oqdZkXJZj4oXycbtlpbzYMv4Jzfz\",\n", 45 | " \"model\": \"text-davinci-003\",\n", 46 | " \"object\": \"text_completion\",\n", 47 | " \"prompt_summary\": \"192.168.1.192 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x112d, seq=5619\\n192.168.1.194 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=19673\\n192.168.1.194 \\u2192 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=18836\\n192.168.1.190 \\u2192 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4886\\n192.168.1.190 \\u2192 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4305\\n\",\n", 48 | " \"usage\": {\n", 49 | " \"completion_tokens\": 254,\n", 50 | " \"prompt_tokens\": 519,\n", 51 | " \"total_tokens\": 773\n", 52 | " }\n", 53 | "}" 54 | ] 55 | }, 56 | "execution_count": 3, 57 | "metadata": {}, 58 | "output_type": "execute_result" 59 | } 60 | ], 61 | "source": [ 62 | "responses[0]" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 4, 68 | "id": "51c754dd-fb1c-45b3-a185-eea6b24756ca", 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [ 72 | "data = []\n", 73 | "\n", 74 | "for item in responses:\n", 75 | " data.append({\"prompt\":item[\"prompt_summary\"],\"completion\":item[\"choices\"][0][\"text\"]})\n", 76 | " data[-1][\"prompt\"] += \"\\n###\\n\\n\"\n", 77 | " #data[-1][\"completion\"] = \"\\n\" + data[-1][\"completion\"]\n", 78 | " data[-1][\"completion\"] += \"\\n\\n###\"" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 5, 84 | "id": "8aea2234-9721-480d-b793-173fe28ddf7e", 85 | "metadata": {}, 86 | "outputs": [ 87 | { 88 | "data": { 89 | "text/plain": [ 90 | "{'prompt': '192.168.1.192 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x112d, seq=5619\\n192.168.1.194 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=19673\\n192.168.1.194 → 192.168.1.190 ICMP 100 Echo (ping) request id=0x9015, seq=18836\\n192.168.1.190 → 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4886\\n192.168.1.190 → 192.168.1.193 ICMP 76 Echo (ping) reply id=0x0001, seq=4305\\n\\n###\\n\\n',\n", 91 | " 'completion': '\\n\\npkt_list = [scapy.IP(src=\"192.168.1.192\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x112d, seq=5619),\\n scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x9015, seq=19673),\\n scapy.IP(src=\"192.168.1.194\", dst=\"192.168.1.190\")/scapy.ICMP(type=8, id=0x9015, seq=18836),\\n scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.193\")/scapy.ICMP(type=0, id=0x0001, seq=4886),\\n scapy.IP(src=\"192.168.1.190\", dst=\"192.168.1.193\")/scapy.ICMP(type=0, id=0x0001, seq=4305)]\\n\\n###'}" 92 | ] 93 | }, 94 | "execution_count": 5, 95 | "metadata": {}, 96 | "output_type": "execute_result" 97 | } 98 | ], 99 | "source": [ 100 | "data[0]" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 11, 106 | "id": "01c5b92e-5e2b-4e88-a793-bcb296abb8a3", 107 | "metadata": {}, 108 | "outputs": [], 109 | "source": [ 110 | "with open('../data/json/davinci_pairs.json', 'w') as fp:\n", 111 | " json.dump(data, fp)" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": 6, 117 | "id": "92ef6ec9-b98b-4f73-a103-d45dd21533e2", 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "with open('../data/csv/davinci_pairs.csv', 'w') as csvfile:\n", 122 | " writer = csv.DictWriter(csvfile, fieldnames=[\"prompt\",\"completion\"])\n", 123 | " writer.writeheader()\n", 124 | " for row in data:\n", 125 | " writer.writerow(row)" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "execution_count": null, 131 | "id": "72b878cd-660a-4655-9e7d-793854568cf2", 132 | "metadata": {}, 133 | "outputs": [], 134 | "source": [] 135 | } 136 | ], 137 | "metadata": { 138 | "kernelspec": { 139 | "display_name": "Python 3 (ipykernel)", 140 | "language": "python", 141 | "name": "python3" 142 | }, 143 | "language_info": { 144 | "codemirror_mode": { 145 | "name": "ipython", 146 | "version": 3 147 | }, 148 | "file_extension": ".py", 149 | "mimetype": "text/x-python", 150 | "name": "python", 151 | "nbconvert_exporter": "python", 152 | "pygments_lexer": "ipython3", 153 | "version": "3.10.6" 154 | } 155 | }, 156 | "nbformat": 4, 157 | "nbformat_minor": 5 158 | } 159 | -------------------------------------------------------------------------------- /gpt3/scripts/packet_generator.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import argparse 4 | import os 5 | import sys 6 | import ipaddress 7 | import random 8 | import math 9 | 10 | import toml 11 | import openai 12 | 13 | from scapy.all import * 14 | from scapy.layers.inet import IP, TCP, ICMP 15 | from scapy.utils import wrpcap 16 | import scapy.all as scapy 17 | 18 | packets_per_request = 5 19 | 20 | 21 | def load_toml(ip_file): 22 | network_ips = [] 23 | victim_ip = "" 24 | attacker_ip = "" 25 | with open(ip_file, "r") as f: 26 | data = toml.load(f) 27 | for ip_desc in data['network']['ip']: 28 | network_ips.extend(ipaddress.ip_network(ip_desc.strip()).hosts()) 29 | victim_ip = ipaddress.ip_network(data['victim']['ip'].strip()).hosts() 30 | attacker_ip = ipaddress.ip_network( 31 | data['attacker']['ip'].strip()).hosts() 32 | 33 | return network_ips, victim_ip, attacker_ip 34 | 35 | 36 | def generate_normal_summaries(ip_list, n, protocols): 37 | summaries = [] 38 | ctr = 0 39 | while ctr < math.ceil(n/5)*5: 40 | proto = random.choice(protocols) 41 | if proto == "icmp": 42 | ip1, ip2 = random.choices(ip_list, k=2) 43 | random_id, random_seq = random.randint( 44 | 0, 65535), random.randint(0, 65535) 45 | random_length = random.choice([76, 100]) 46 | summaries.append( 47 | "{} → {} ICMP {} (ping) request id={:#06x}, seq={}".format( 48 | ip1, ip2, random_length, random_id, random_seq)) 49 | summaries.append( 50 | "{} → {} ICMP {} (ping) reply id={:#06x}, seq={}".format( 51 | ip2, ip1, random_length, random_id, random_seq)) 52 | ctr += 2 53 | elif proto == "dns": 54 | ip1, ip2 = random.choices(ip_list, k=2) 55 | random_id = random.randint( 56 | 0, 65535) 57 | random_length = random.choice([76, 100]) 58 | summaries.append( 59 | "{} → {} DNS {} STANDARD query {:#06x} A www.google.com OPT".format( 60 | ip1, ip2, random_length, random_id)) 61 | summaries.append( 62 | "{} → {} DNS {} STANDARD query response {:#06x} A www.google.com A 8.8.8.8 OPT".format( 63 | ip1, ip2, random_length, random_id)) 64 | ctr += 2 65 | return summaries 66 | 67 | 68 | def generate_ping_flood_summaries(ip_list, n, victim_ip, attacker_ip): 69 | summaries = [] 70 | ctr = 0 71 | while ctr < math.ceil(n/5)*5: 72 | malicious = random.choices([True, False], weights=[0.7, 0.3], k=1) 73 | if malicious[0]: 74 | random_id, random_seq = random.randint( 75 | 0, 65535), random.randint(0, 65535) 76 | random_length = random.choice([76, 100]) 77 | summaries.append( 78 | "{} → {} ICMP {} (ping) request id={:#06x}, seq={}".format( 79 | attacker_ip, victim_ip, random_length, random_id, random_seq)) 80 | ctr += 1 81 | else: 82 | ip1, ip2 = random.choices(ip_list, k=2) 83 | random_id, random_seq = random.randint( 84 | 0, 65535), random.randint(0, 65535) 85 | random_length = random.choice([76, 100]) 86 | summaries.append( 87 | "{} → {} ICMP {} (ping) request id={:#06x}, seq={}".format( 88 | ip1, ip2, random_length, random_id, random_seq)) 89 | summaries.append( 90 | "{} → {} ICMP {} (ping) reply id={:#06x}, seq={}".format( 91 | ip2, ip1, random_length, random_id, random_seq)) 92 | ctr += 2 93 | return summaries 94 | 95 | 96 | def generate_packets(summaries): 97 | ctr = 0 98 | packets = [] 99 | prompt = "" 100 | for summary in summaries: 101 | prompt += summary + "\n" 102 | ctr += 1 103 | if ctr == 5: 104 | ctr = 0 105 | prompt += "\n\n###\n\n" 106 | completion = openai.Completion.create( 107 | engine="babbage:ft-ubicomp-2023-02-28-16-59-27", prompt=prompt, 108 | max_tokens=1600, stop="###") 109 | code_to_exec = completion.choices[0].text 110 | code_to_exec += "\n\npackets.extend(pkt_list)\n" 111 | try: 112 | exec(code_to_exec) 113 | except: 114 | print(code_to_exec) 115 | #pass 116 | prompt = "" 117 | return packets 118 | 119 | 120 | def write_pcap(packets, output_path): 121 | with open(output_path, "wb") as f: 122 | wrpcap(f, packets) 123 | 124 | 125 | if __name__ == '__main__': 126 | parser = argparse.ArgumentParser( 127 | prog='PacketGenerator', description="Generate network packets") 128 | parser.add_argument( 129 | '--ip_file', metavar='', 130 | help='config file to read IPs for the generated packets (TOML format)', 131 | required=True) 132 | parser.add_argument( 133 | '--output_file', metavar='', 134 | help='path of output .pcap file (defaults to synthetic_traffic.pcap)', 135 | default="./synthetic_traffic.pcap") 136 | parser.add_argument( 137 | '-n', '--number-of-packets', metavar='', 138 | help='number of packets to generate', default=10, type=int) 139 | parser.add_argument( 140 | '-p', "--protocols", metavar='', action="store", 141 | default=["icmp"], 142 | help='list of protocols to generate (must be from [icmp,dns,http])', 143 | nargs="*", choices=["icmp", "dns", "http"]) 144 | parser.add_argument( 145 | "--scenario", metavar='', action="store", default=["normal"], 146 | help='specific scenario to generate network flow for (must be from [normal, ping_of_death, ping_smurf,\n ping_flood, dns_flood, dns_spoof])', 147 | nargs=1, choices=["normal", "ping_of_death", "ping_smurf", "ping_flood", 148 | "dns_flood", "dns_spoof"]) 149 | parser.add_argument( 150 | '--replay_packets', metavar='', 151 | action="store_const", const=True, default=False, 152 | help='whether to replay packets on the network after generating them', 153 | required=False) 154 | args = parser.parse_args() 155 | 156 | network_ips, victim_ip, attacker_ip = load_toml(args.ip_file) 157 | 158 | if args.scenario[0] == "normal": 159 | summaries = generate_normal_summaries( 160 | network_ips, n=args.number_of_packets, protocols=args.protocols) 161 | elif args.scenario[0] == "ping_flood": 162 | summaries = generate_ping_flood_summaries( 163 | network_ips, args.number_of_packets, victim_ip[0], attacker_ip[0]) 164 | print("Generated {} summaries. Using OpenAI API to generate packets...".format( 165 | len(summaries))) 166 | for summary in summaries: 167 | print(summary) 168 | 169 | packets = generate_packets(summaries) 170 | 171 | print( 172 | "Generated {} packets. Writing them to {} ...".format( 173 | len(packets), 174 | args.output_file)) 175 | 176 | write_pcap(packets, args.output_file) 177 | print("Done!") 178 | -------------------------------------------------------------------------------- /gpt3/scripts/sample_input/ip_file.toml: -------------------------------------------------------------------------------- 1 | [network] 2 | ip = [ 3 | "192.168.1.0/24", 4 | "10.0.0.0/16", 5 | "172.16.0.0/16", 6 | "134.253.82.91" 7 | ] 8 | 9 | [victim] 10 | ip = "192.168.1.12" 11 | 12 | [attacker] 13 | ip = "192.168.1.15" 14 | -------------------------------------------------------------------------------- /gpt3/scripts/send_dns.py: -------------------------------------------------------------------------------- 1 | import scapy.all as scapy 2 | 3 | 4 | def process_pcap(file_name): 5 | print('Opening {}...'.format(file_name)) 6 | 7 | count = 0 8 | interesting_packet_count = 0 9 | 10 | interesting_packets = [] 11 | for (pkt_data, pkt_metadata,) in scapy.RawPcapReader(file_name): 12 | count += 1 13 | 14 | #ether_pkt = scapy.IP(pkt_data) 15 | ether_pkt = scapy.Ether(pkt_data) 16 | #ip_pkt = ether_pkt[scapy.IP] 17 | """ 18 | if 'type' not in ether_pkt.fields: 19 | # LLC frames will have 'len' instead of 'type'. 20 | # We disregard those 21 | continue 22 | if ether_pkt.type != 0x0800: 23 | # disregard non-IPv4 packets 24 | continue 25 | if ip_pkt.proto != 1: 26 | # Ignore non-TCP packet 27 | continue 28 | """ 29 | interesting_packet_count += 1 30 | interesting_packets.append(ether_pkt) 31 | 32 | print('{} contains {} packets ({} interesting)'. 33 | format(file_name, count, interesting_packet_count)) 34 | 35 | return interesting_packets 36 | 37 | 38 | #packets = process_pcap("generated_dns.pcap") 39 | packets = process_pcap("custom_dns.pcapng") 40 | 41 | processed_packets = [] 42 | for pkt in packets: 43 | #pkt[scapy.IP].src = "130.231.202.234" 44 | #pkt[scapy.IP].dst = "130.231.240.70" 45 | #pkt[scapy.ICMP].type = 8 46 | pkt = pkt[scapy.IP] 47 | 48 | del pkt[scapy.IP].len 49 | del pkt[scapy.IP].chksum 50 | del pkt[scapy.UDP].len 51 | del pkt[scapy.UDP].chksum 52 | #del pkt[scapy.ICMP].chksum 53 | #print(pkt[scapy.DNS].opcode) 54 | #print(type(pkt[scapy.DNS].opcode)) 55 | pkt.show2() 56 | 57 | processed_packets.append(pkt) 58 | 59 | ans, unans = scapy.sr(processed_packets, timeout=5) 60 | print(ans) 61 | print(unans) 62 | 63 | quit() 64 | test_icmp = scapy.IP(src="130.231.202.234", dst="8.8.8.8") / scapy.ICMP() 65 | test_icmp.show2() 66 | ans, unans = scapy.sr(test_icmp, timeout=3) 67 | -------------------------------------------------------------------------------- /gpt3/scripts/send_icmp.py: -------------------------------------------------------------------------------- 1 | import scapy.all as scapy 2 | 3 | 4 | def process_pcap(file_name): 5 | print('Opening {}...'.format(file_name)) 6 | 7 | count = 0 8 | interesting_packet_count = 0 9 | 10 | interesting_packets = [] 11 | for (pkt_data, pkt_metadata,) in scapy.RawPcapReader(file_name): 12 | count += 1 13 | 14 | ether_pkt = scapy.IP(pkt_data) 15 | #ether_pkt = scapy.Ether(pkt_data) 16 | #ip_pkt = ether_pkt[scapy.IP] 17 | """ 18 | if 'type' not in ether_pkt.fields: 19 | # LLC frames will have 'len' instead of 'type'. 20 | # We disregard those 21 | continue 22 | if ether_pkt.type != 0x0800: 23 | # disregard non-IPv4 packets 24 | continue 25 | if ip_pkt.proto != 1: 26 | # Ignore non-TCP packet 27 | continue 28 | """ 29 | interesting_packet_count += 1 30 | interesting_packets.append(ether_pkt) 31 | 32 | print('{} contains {} packets ({} interesting)'. 33 | format(file_name, count, interesting_packet_count)) 34 | 35 | return interesting_packets 36 | 37 | 38 | packets = process_pcap("data/pcap/synthetic/generated_curie_commands.pcap") 39 | #packets = process_pcap("custom_pings.pcapng") 40 | 41 | processed_packets = [] 42 | for pkt in packets: 43 | pkt[scapy.IP].src = "130.231.202.234" 44 | pkt[scapy.IP].dst = "8.8.8.8" 45 | pkt[scapy.ICMP].type = 8 46 | #pkt[scapy.ICMP].id = 0 47 | #pkt[scapy.ICMP].seq = 0 48 | #pkt[scapy.IP].id = 1 49 | 50 | pkt = pkt[scapy.IP] 51 | #del pkt[scapy.IP].len 52 | del pkt[scapy.IP].chksum 53 | del pkt[scapy.ICMP].chksum 54 | 55 | pkt.show2() 56 | 57 | processed_packets.append(pkt) 58 | 59 | ans, unans = scapy.sr(processed_packets, timeout=5) 60 | print(ans) 61 | print(unans) 62 | -------------------------------------------------------------------------------- /gpt3/scripts/synthetic_traffic.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/scripts/synthetic_traffic.pcap -------------------------------------------------------------------------------- /gpt3/visualizations/babbage_loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/babbage_loss.png -------------------------------------------------------------------------------- /gpt3/visualizations/babbage_sequence_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/babbage_sequence_acc.png -------------------------------------------------------------------------------- /gpt3/visualizations/babbage_token_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/babbage_token_acc.png -------------------------------------------------------------------------------- /gpt3/visualizations/curie_loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/curie_loss.png -------------------------------------------------------------------------------- /gpt3/visualizations/curie_sequence_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/curie_sequence_acc.png -------------------------------------------------------------------------------- /gpt3/visualizations/curie_token_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/curie_token_acc.png -------------------------------------------------------------------------------- /gpt3/visualizations/davinci_loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/davinci_loss.png -------------------------------------------------------------------------------- /gpt3/visualizations/davinci_sequence_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/davinci_sequence_acc.png -------------------------------------------------------------------------------- /gpt3/visualizations/davinci_token_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/gpt3/visualizations/davinci_token_acc.png -------------------------------------------------------------------------------- /pcap-analysis/Test_Scapy.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "20548fd2-41ac-45b3-9e0e-dd78510a7e21", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "from scapy.utils import RawPcapReader\n", 11 | "from scapy.layers.l2 import Ether\n", 12 | "from scapy.layers.inet import IP, TCP\n" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 2, 18 | "id": "baf35fae-4021-4152-bd37-775b4cedb704", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "def process_pcap(file_name):\n", 23 | " print('Opening {}...'.format(file_name))\n", 24 | "\n", 25 | " count = 0\n", 26 | " interesting_packet_count = 0\n", 27 | "\n", 28 | " interesting_packets = []\n", 29 | " for (pkt_data, pkt_metadata,) in RawPcapReader(file_name):\n", 30 | " count += 1\n", 31 | "\n", 32 | " ether_pkt = Ether(pkt_data)\n", 33 | " if 'type' not in ether_pkt.fields:\n", 34 | " # LLC frames will have 'len' instead of 'type'.\n", 35 | " # We disregard those\n", 36 | " continue\n", 37 | "\n", 38 | " if ether_pkt.type != 0x0800:\n", 39 | " # disregard non-IPv4 packets\n", 40 | " continue\n", 41 | " ip_pkt = ether_pkt[IP]\n", 42 | "\n", 43 | " interesting_packet_count += 1\n", 44 | " interesting_packets.append(ether_pkt)\n", 45 | "\n", 46 | " print('{} contains {} packets ({} interesting)'.\n", 47 | " format(file_name, count, interesting_packet_count))\n", 48 | "\n", 49 | " return interesting_packets\n" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": 3, 55 | "id": "d3ba8bd7-f889-464c-8c09-729a447eb703", 56 | "metadata": {}, 57 | "outputs": [ 58 | { 59 | "name": "stdout", 60 | "output_type": "stream", 61 | "text": [ 62 | "Opening ./data/encoder/pcap/custom_pings3.pcapng...\n", 63 | "./data/encoder/pcap/custom_pings3.pcapng contains 2261 packets (2261 interesting)\n" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "packets = process_pcap(\"./data/encoder/pcap/custom_pings3.pcapng\")" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 5, 74 | "id": "39add6f4-6afa-4ad8-9a18-ad218fff7816", 75 | "metadata": {}, 76 | "outputs": [ 77 | { 78 | "name": "stdout", 79 | "output_type": "stream", 80 | "text": [ 81 | "###[ Ethernet ]### \n", 82 | " dst = 70:db:98:81:93:40\n", 83 | " src = 84:a9:38:6a:7f:0d\n", 84 | " type = IPv4\n", 85 | "###[ IP ]### \n", 86 | " version = 4\n", 87 | " ihl = 5\n", 88 | " tos = 0x0\n", 89 | " len = 84\n", 90 | " id = 38219\n", 91 | " flags = DF\n", 92 | " frag = 0\n", 93 | " ttl = 64\n", 94 | " proto = icmp\n", 95 | " chksum = 0x477c\n", 96 | " src = 130.231.202.234\n", 97 | " dst = 8.8.8.8\n", 98 | " \\options \\\n", 99 | "###[ ICMP ]### \n", 100 | " type = echo-request\n", 101 | " code = 0\n", 102 | " chksum = 0xb93\n", 103 | " id = 0x2\n", 104 | " seq = 0x1\n", 105 | " unused = ''\n", 106 | "###[ Raw ]### \n", 107 | " load = '\\\\xb5H\\\\x87c\\x00\\x00\\x00\\x00\\\\xee\\\\xea\\x02\\x00\\x00\\x00\\x00\\x00\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./01234567'\n", 108 | "\n" 109 | ] 110 | } 111 | ], 112 | "source": [ 113 | "packets[0].show()" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "id": "4de9b1ac-caea-434e-9ac0-d5ce062774b1", 120 | "metadata": {}, 121 | "outputs": [], 122 | "source": [] 123 | } 124 | ], 125 | "metadata": { 126 | "kernelspec": { 127 | "display_name": "Python 3 (ipykernel)", 128 | "language": "python", 129 | "name": "python3" 130 | }, 131 | "language_info": { 132 | "codemirror_mode": { 133 | "name": "ipython", 134 | "version": 3 135 | }, 136 | "file_extension": ".py", 137 | "mimetype": "text/x-python", 138 | "name": "python", 139 | "nbconvert_exporter": "python", 140 | "pygments_lexer": "ipython3", 141 | "version": "3.10.6" 142 | } 143 | }, 144 | "nbformat": 4, 145 | "nbformat_minor": 5 146 | } 147 | -------------------------------------------------------------------------------- /pcap-analysis/custom_ping_images.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/pcap-analysis/custom_ping_images.gz -------------------------------------------------------------------------------- /pcap-analysis/custom_ping_images2.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/pcap-analysis/custom_ping_images2.gz -------------------------------------------------------------------------------- /pcap-analysis/custom_ping_images3.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/pcap-analysis/custom_ping_images3.gz -------------------------------------------------------------------------------- /pcap-analysis/icmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-0ne/NetworkPacketGenerator/7a582e5641ea3b9681168332f81dc8bbb766c1d3/pcap-analysis/icmp -------------------------------------------------------------------------------- /pcap-analysis/packet_decoder.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import sys 4 | import binascii 5 | 6 | from scapy.utils import import_hexcap, wrpcap 7 | from scapy.layers.inet import ICMP, IP 8 | from scapy.sendrecv import sr 9 | 10 | import numpy as np 11 | from PIL import Image 12 | 13 | 14 | def process_npy(file_name, rgb=False, save_images=False, path=""): 15 | print('Opening {}...'.format(file_name)) 16 | 17 | images = np.load(file_name) 18 | 19 | gray_images = [] 20 | if rgb == True: 21 | for i, img in enumerate(images): 22 | img = np.moveaxis(img, 0, -1) 23 | img *= 255 24 | img = img.astype(np.uint8) 25 | gray_img = Image.fromarray(img.astype("uint8")).convert("L") 26 | if save_images: 27 | gray_img.save(os.path.join(path, str(i)+".png")) 28 | gray_images.append(np.array(gray_img.getdata())) 29 | else: 30 | for i, img in enumerate(images): 31 | img = img.reshape(img.shape[1:]) 32 | img = img/2 + 0.5 33 | img *= 255 34 | gray_img = Image.fromarray(img.astype("uint8"), mode="L") 35 | if save_images: 36 | gray_img.save(os.path.join(path, str(i)+".png")) 37 | gray_images.append(np.array(gray_img.getdata())) 38 | 39 | return gray_images 40 | 41 | 42 | def img2packet(images, packet_size=84): 43 | packets = [] 44 | for img in images: 45 | s = bytes(list(img[:packet_size])) 46 | packet = IP(s) 47 | packets.append(packet) 48 | return packets 49 | 50 | 51 | def img2packet2(images, packet_size=84, d=2): 52 | packets = [] 53 | for img in images: 54 | img = img.reshape(32, 32) 55 | packet_bytes = [] 56 | i, j = 0, 0 57 | for byte_index in range(packet_size): 58 | first_aggregate = img[i:i+d, j:j+d].mean() 59 | first_aggregate = int(first_aggregate/16) * 16 60 | 61 | second_aggregate = img[i:i+d, j+d:j+2*d].mean() 62 | second_aggregate = int(second_aggregate/16) 63 | 64 | packet_bytes.append(first_aggregate+second_aggregate) 65 | 66 | j += d*2 67 | if j >= 32: 68 | j = 0 69 | i += d 70 | 71 | s = bytes(packet_bytes) 72 | packet = IP(s) 73 | packets.append(packet) 74 | return packets 75 | 76 | 77 | def post_process_packets(packets): 78 | processed_packets = [] 79 | for packet in packets: 80 | packet.version = 4 81 | packet.ihl = 5 82 | packet.len = 84 83 | packet.frag = 0 84 | packet.proto = "icmp" 85 | #del packet[ICMP].chksum 86 | processed_packets.append(packet) 87 | 88 | return processed_packets 89 | 90 | 91 | if __name__ == '__main__': 92 | parser = argparse.ArgumentParser(description='Packet decoder') 93 | parser.add_argument('--numpy', metavar='', 94 | help='numpy file to parse', required=True) 95 | parser.add_argument( 96 | '--rgb', metavar='', action="store_const", const=True, 97 | default=False, help='flag for when data is in rgb', required=False) 98 | parser.add_argument( 99 | '--post_process', metavar='', action="store_const", 100 | const=True, default=False, 101 | help='whether to post process the packet (set some fields manually)', 102 | required=False) 103 | parser.add_argument( 104 | '--test_packets', metavar='', action="store_const", 105 | const=True, default=False, 106 | help='whether to send some sample packets throught Scapy to test', 107 | required=False) 108 | parser.add_argument( 109 | '--alternative_encoding', metavar='', 110 | action="store_const", const=True, default=False, 111 | help='whether to use the PAC-GAN alternative encoding technique', 112 | required=False) 113 | parser.add_argument( 114 | '--save_images', metavar='', 115 | action="store_const", const=True, default=False, 116 | help='whether to save images to file', 117 | required=False) 118 | args = parser.parse_args() 119 | 120 | file_name = args.numpy 121 | if not os.path.isfile(file_name): 122 | print('"{}" does not exist'.format(file_name), file=sys.stderr) 123 | sys.exit(-1) 124 | 125 | img_out_path = os.path.join( 126 | "data", "decoder", "image", file_name.split(".")[0].split("/")[-1]) 127 | packet_imgs = process_npy( 128 | file_name, args.rgb, args.save_images, img_out_path) 129 | 130 | if args.alternative_encoding: 131 | packets = img2packet2(packet_imgs) 132 | 133 | else: 134 | packets = img2packet(packet_imgs) 135 | 136 | print("\nSample packet (without post processing):\n") 137 | packets[0].show() 138 | if args.post_process: 139 | packets = post_process_packets(packets) 140 | print("\nSample packet (after post processing):\n") 141 | packets[0].show() 142 | 143 | pcap_out_path = os.path.join("data", "decoder", "pcap", file_name.split(".")[ 144 | 0].split("/")[-1]+".pcap") 145 | print('Writing pcap output to {}...'.format(pcap_out_path)) 146 | with open(pcap_out_path, "wb") as f: 147 | wrpcap(f, packets) 148 | 149 | if args.test_packets: 150 | test_packets = packets[:100] 151 | for packet in test_packets: 152 | packet.show() 153 | packet.src = "130.231.202.234" 154 | packet.dst = "8.8.8.8" 155 | del packet.chksum 156 | ans, unans = sr(test_packets, timeout=3, verbose=3) 157 | print("\nAnswered:\n") 158 | ans.summary() 159 | print("\nUnanswered:\n") 160 | unans.summary() 161 | sys.exit(0) 162 | -------------------------------------------------------------------------------- /pcap-analysis/packet_encoder.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import sys 4 | 5 | from scapy.utils import RawPcapReader, chexdump 6 | from scapy.layers.l2 import Ether 7 | from scapy.layers.inet import IP, TCP 8 | from scapy.sendrecv import sr 9 | 10 | import numpy as np 11 | from PIL import Image 12 | 13 | from packet_decoder import img2packet 14 | 15 | 16 | def process_pcap(file_name): 17 | print('Opening {}...'.format(file_name)) 18 | 19 | packet_imgs = [] 20 | for (pkt_data, pkt_metadata,) in RawPcapReader(file_name): 21 | 22 | ether_pkt = Ether(pkt_data) 23 | ip_pkt = ether_pkt[IP] 24 | 25 | s = chexdump(ip_pkt, dump=True).split(",") 26 | s = [t.strip() for t in s] 27 | s = [int(t, 16) for t in s] 28 | img_size = (32, 32) 29 | img = np.pad( 30 | s, (0, img_size[0] * img_size[1] - len(s)), 31 | "constant", constant_values=(0)).reshape(img_size) 32 | 33 | packet_imgs.append(img) 34 | return packet_imgs 35 | 36 | 37 | def process_pcap2(file_name, d=2): 38 | print('Opening {}...'.format(file_name)) 39 | 40 | packet_imgs = [] 41 | for (pkt_data, pkt_metadata,) in RawPcapReader(file_name): 42 | 43 | ether_pkt = Ether(pkt_data) 44 | ip_pkt = ether_pkt[IP] 45 | 46 | s = chexdump(ip_pkt, dump=True).split(",") 47 | s = [t.strip() for t in s] 48 | img_size = (32, 32) 49 | img = np.zeros(img_size) 50 | i, j = 0, 0 51 | for packet_byte in s: 52 | for half_byte in packet_byte[2:]: 53 | val = int(half_byte, 16) * 16 + 8 54 | img[i:i+d, j:j+d] = val 55 | j += 2 56 | if j >= img_size[1]: 57 | j = 0 58 | i += 2 59 | packet_imgs.append(img) 60 | return packet_imgs 61 | 62 | 63 | if __name__ == '__main__': 64 | parser = argparse.ArgumentParser(description='PCAP reader') 65 | parser.add_argument('--pcap', metavar='', 66 | help='pcap file to parse', required=True) 67 | parser.add_argument( 68 | '--alternative_encoding', metavar='', 69 | action="store_const", const=True, default=False, 70 | help='whether to use the PAC-GAN alternative encoding technique', 71 | required=False) 72 | args = parser.parse_args() 73 | 74 | file_name = args.pcap 75 | if not os.path.isfile(file_name): 76 | print('"{}" does not exist'.format(file_name), file=sys.stderr) 77 | sys.exit(-1) 78 | 79 | if args.alternative_encoding: 80 | packet_imgs = process_pcap2(file_name) 81 | 82 | else: 83 | packet_imgs = process_pcap(file_name) 84 | 85 | img_out_path = os.path.join( 86 | "data", "encoder", "image", file_name.split(".")[0].split("/")[-1]) 87 | 88 | print('Saving images to {}...'.format(img_out_path)) 89 | for i, img in enumerate(packet_imgs): 90 | im = Image.fromarray(img.astype("uint8")) 91 | im.save(os.path.join(img_out_path, str(i)+".png")) 92 | images_np = np.array(packet_imgs) 93 | np_out_path = os.path.join("data", "encoder", "npy", file_name.split(".")[ 94 | 0].split("/")[-1]+".npy") 95 | 96 | #im.save(os.path.join(img_out_path, str(i)+".png")) 97 | 98 | print('Writing numpy output to {}...'.format(np_out_path)) 99 | with open(np_out_path, "wb") as f: 100 | np.save(f, images_np) 101 | sys.exit(0) 102 | -------------------------------------------------------------------------------- /pcap-analysis/pcap_reader.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import sys 4 | 5 | from scapy.utils import RawPcapReader 6 | from scapy.layers.l2 import Ether 7 | from scapy.layers.inet import IP, TCP 8 | from scapy.sendrecv import sr 9 | 10 | 11 | def process_pcap(file_name): 12 | print('Opening {}...'.format(file_name)) 13 | 14 | count = 0 15 | interesting_packet_count = 0 16 | 17 | interesting_packets = [] 18 | for (pkt_data, pkt_metadata,) in RawPcapReader(file_name): 19 | count += 1 20 | 21 | ether_pkt = Ether(pkt_data) 22 | if 'type' not in ether_pkt.fields: 23 | # LLC frames will have 'len' instead of 'type'. 24 | # We disregard those 25 | continue 26 | 27 | if ether_pkt.type != 0x0800: 28 | # disregard non-IPv4 packets 29 | continue 30 | ip_pkt = ether_pkt[IP] 31 | if ip_pkt.proto != 1: 32 | # Ignore non-TCP packet 33 | continue 34 | interesting_packet_count += 1 35 | interesting_packets.append(ether_pkt) 36 | 37 | print('{} contains {} packets ({} interesting)'. 38 | format(file_name, count, interesting_packet_count)) 39 | 40 | return interesting_packets 41 | 42 | 43 | if __name__ == '__main__': 44 | parser = argparse.ArgumentParser(description='PCAP reader') 45 | parser.add_argument('--pcap', metavar='', 46 | help='pcap file to parse', required=True) 47 | args = parser.parse_args() 48 | 49 | file_name = args.pcap 50 | if not os.path.isfile(file_name): 51 | print('"{}" does not exist'.format(file_name), file=sys.stderr) 52 | sys.exit(-1) 53 | 54 | packets = process_pcap(file_name) 55 | test_packet = packets[4] 56 | test_packet = test_packet[IP] 57 | del test_packet.chksum 58 | test_packet.src = "130.231.202.234" 59 | test_packet.dst = "8.8.8.8" 60 | test_packet.show() 61 | ans, unans = sr(test_packet, timeout=3) 62 | print(ans) 63 | print(unans) 64 | sys.exit(0) 65 | -------------------------------------------------------------------------------- /pcap-analysis/scapy_test.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 10, 6 | "id": "fe5816ec-f2c7-4671-bf93-edd03df3bd35", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "from scapy.all import *\n", 11 | "import numpy as np" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 11, 17 | "id": "fd70ace9-9598-4b50-bca9-f7c7bf12094e", 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "for (pkt_data, pkt_metadata,) in RawPcapNgReader(\"data/encoder/pcap/custom_pings.pcapng\"):\n", 22 | " ether_pkt = Ether(pkt_data)\n", 23 | " ip_pkt = ether_pkt[IP]\n", 24 | " s = chexdump(ip_pkt, dump=True).split(\",\")\n", 25 | " s = [t.strip() for t in s]\n", 26 | " s = [int(t, 16) for t in s]\n", 27 | " img_size = (32, 32)\n", 28 | " img = np.pad(\n", 29 | " s, (0, img_size[0] * img_size[1] - len(s)),\n", 30 | " \"constant\", constant_values=(0)).reshape(img_size)\n", 31 | " break" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 20, 37 | "id": "9225d4ac-8f27-4d6d-8eef-97880b66c7bc", 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "data": { 42 | "text/plain": [ 43 | "list" 44 | ] 45 | }, 46 | "execution_count": 20, 47 | "metadata": {}, 48 | "output_type": "execute_result" 49 | } 50 | ], 51 | "source": [ 52 | "type(list(img.flatten()[:84]))" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 21, 58 | "id": "3c88a865-feb2-4f61-bd29-9de3d24587a8", 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "data": { 63 | "text/plain": [ 64 | "b'E\\x00\\x00T\\x95K@\\x00@\\x01G|\\x82\\xe7\\xca\\xea\\x08\\x08\\x08\\x08\\x08\\x00\\x0b\\x93\\x00\\x02\\x00\\x01\\xb5H\\x87c\\x00\\x00\\x00\\x00\\xee\\xea\\x02\\x00\\x00\\x00\\x00\\x00\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./01234567'" 65 | ] 66 | }, 67 | "execution_count": 21, 68 | "metadata": {}, 69 | "output_type": "execute_result" 70 | } 71 | ], 72 | "source": [ 73 | "bytes(list(img.flatten()[:84]))" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": 8, 79 | "id": "0b63e874-2800-425d-a5a0-b0db8f40e44e", 80 | "metadata": {}, 81 | "outputs": [ 82 | { 83 | "name": "stdout", 84 | "output_type": "stream", 85 | "text": [ 86 | "###[ IP ]### \n", 87 | " version = 4\n", 88 | " ihl = 5\n", 89 | " tos = 0x0\n", 90 | " len = 84\n", 91 | " id = 38219\n", 92 | " flags = DF\n", 93 | " frag = 0\n", 94 | " ttl = 64\n", 95 | " proto = icmp\n", 96 | " chksum = 0x477c\n", 97 | " src = 130.231.202.234\n", 98 | " dst = 8.8.8.8\n", 99 | " \\options \\\n", 100 | "###[ ICMP ]### \n", 101 | " type = echo-request\n", 102 | " code = 0\n", 103 | " chksum = 0xb93\n", 104 | " id = 0x2\n", 105 | " seq = 0x1\n", 106 | " unused = ''\n", 107 | "###[ Raw ]### \n", 108 | " load = '\\\\xb5H\\\\x87c\\x00\\x00\\x00\\x00\\\\xee\\\\xea\\x02\\x00\\x00\\x00\\x00\\x00\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./01234567'\n", 109 | "\n" 110 | ] 111 | } 112 | ], 113 | "source": [ 114 | "IP(bytes(s)).show()" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "e03b99ed-a537-43ca-9fff-1e22c1632a2d", 121 | "metadata": {}, 122 | "outputs": [], 123 | "source": [] 124 | } 125 | ], 126 | "metadata": { 127 | "kernelspec": { 128 | "display_name": "Python 3 (ipykernel)", 129 | "language": "python", 130 | "name": "python3" 131 | }, 132 | "language_info": { 133 | "codemirror_mode": { 134 | "name": "ipython", 135 | "version": 3 136 | }, 137 | "file_extension": ".py", 138 | "mimetype": "text/x-python", 139 | "name": "python", 140 | "nbconvert_exporter": "python", 141 | "pygments_lexer": "ipython3", 142 | "version": "3.10.6" 143 | } 144 | }, 145 | "nbformat": 4, 146 | "nbformat_minor": 5 147 | } 148 | -------------------------------------------------------------------------------- /pcap-analysis/scapy_test.py: -------------------------------------------------------------------------------- 1 | import scapy.all as scapy 2 | 3 | packet = scapy.IP(dst="8.8.8.8/32") / scapy.ICMP() 4 | packet.show() 5 | ans, unans = scapy.sr(packet, timeout=3) 6 | 7 | print(ans[0]) 8 | print(type(ans[0])) 9 | --------------------------------------------------------------------------------