Repository: wanduow/libprotoident
Branch: master
Commit: 97a8efecd257
Files: 602
Total size: 1.7 MB
Directory structure:
gitextract_usa0_lis/
├── .github/
│ └── workflows/
│ ├── pkg-build.yaml
│ └── rpm-build.yaml
├── .gitignore
├── .gitmodules
├── COPYING
├── COPYING.LESSER
├── ChangeLog
├── Makefile.am
├── README
├── bootstrap.sh
├── configure.ac
├── debian/
│ ├── changelog
│ ├── compat
│ ├── control
│ ├── copyright
│ ├── libprotoident-dev.dirs
│ ├── libprotoident-dev.install
│ ├── libprotoident-tools.dirs
│ ├── libprotoident-tools.install
│ ├── libprotoident.dirs
│ ├── libprotoident.install
│ ├── rules
│ └── source/
│ └── format
├── debpkg-build.sh
├── debpkg-setup.sh
├── lib/
│ ├── Makefile.am
│ ├── libprotoident.cc
│ ├── libprotoident.h
│ ├── proto_common.cc
│ ├── proto_common.h
│ ├── proto_manager.cc
│ ├── proto_manager.h
│ ├── tcp/
│ │ ├── Makefile.am
│ │ ├── lpi_300heroes.cc
│ │ ├── lpi_360safeguard.cc
│ │ ├── lpi_4d.cc
│ │ ├── lpi_acestream.cc
│ │ ├── lpi_afp.cc
│ │ ├── lpi_airdroid.cc
│ │ ├── lpi_airmedia.cc
│ │ ├── lpi_akamai.cc
│ │ ├── lpi_amp.cc
│ │ ├── lpi_antcoin.cc
│ │ ├── lpi_appearin.cc
│ │ ├── lpi_apple_push.cc
│ │ ├── lpi_ares.cc
│ │ ├── lpi_badbaidu.cc
│ │ ├── lpi_baofeng_tcp.cc
│ │ ├── lpi_beam.cc
│ │ ├── lpi_bitcoin.cc
│ │ ├── lpi_bitextend.cc
│ │ ├── lpi_bittorrent.cc
│ │ ├── lpi_blackdesert.cc
│ │ ├── lpi_blizzard.cc
│ │ ├── lpi_btsync.cc
│ │ ├── lpi_bwsyncandshare.cc
│ │ ├── lpi_cacaoweb.cc
│ │ ├── lpi_cgp.cc
│ │ ├── lpi_chatango.cc
│ │ ├── lpi_cisco_vpn.cc
│ │ ├── lpi_clashofclans.cc
│ │ ├── lpi_classin_tcp.cc
│ │ ├── lpi_clubbox.cc
│ │ ├── lpi_cod_waw.cc
│ │ ├── lpi_conquer.cc
│ │ ├── lpi_crashplan.cc
│ │ ├── lpi_crossfire_tcp.cc
│ │ ├── lpi_cryptic.cc
│ │ ├── lpi_cvs.cc
│ │ ├── lpi_dahua_tcp.cc
│ │ ├── lpi_dash.cc
│ │ ├── lpi_dell_backup.cc
│ │ ├── lpi_destiny.cc
│ │ ├── lpi_diablo3.cc
│ │ ├── lpi_dianping_tcp.cc
│ │ ├── lpi_directconnect.cc
│ │ ├── lpi_dnf.cc
│ │ ├── lpi_dns.cc
│ │ ├── lpi_dogecoin.cc
│ │ ├── lpi_douyu.cc
│ │ ├── lpi_douyu_chat.cc
│ │ ├── lpi_duelingnetwork.cc
│ │ ├── lpi_dvrns.cc
│ │ ├── lpi_dxp.cc
│ │ ├── lpi_ea_games.cc
│ │ ├── lpi_emule.cc
│ │ ├── lpi_ethernetip.cc
│ │ ├── lpi_eye.cc
│ │ ├── lpi_facebook_turn.cc
│ │ ├── lpi_fb_message.cc
│ │ ├── lpi_fbcdn_ssl.cc
│ │ ├── lpi_ffxiv.cc
│ │ ├── lpi_filenori.cc
│ │ ├── lpi_flash.cc
│ │ ├── lpi_fliggy.cc
│ │ ├── lpi_fring.cc
│ │ ├── lpi_ftpcontrol.cc
│ │ ├── lpi_ftpdata.cc
│ │ ├── lpi_fuckcoin.cc
│ │ ├── lpi_funshion.cc
│ │ ├── lpi_gamespy.cc
│ │ ├── lpi_gcafe_updater.cc
│ │ ├── lpi_giop.cc
│ │ ├── lpi_git.cc
│ │ ├── lpi_glupteba.cc
│ │ ├── lpi_gnutella.cc
│ │ ├── lpi_goku.cc
│ │ ├── lpi_googlehangouts.cc
│ │ ├── lpi_graalonlineera.cc
│ │ ├── lpi_guildwars2.cc
│ │ ├── lpi_hamachi.cc
│ │ ├── lpi_harveys.cc
│ │ ├── lpi_hearthstone.cc
│ │ ├── lpi_hola.cc
│ │ ├── lpi_hots_tcp.cc
│ │ ├── lpi_http.cc
│ │ ├── lpi_http_badport.cc
│ │ ├── lpi_http_nonstandard.cc
│ │ ├── lpi_http_tunnel.cc
│ │ ├── lpi_https.cc
│ │ ├── lpi_ica.cc
│ │ ├── lpi_icep.cc
│ │ ├── lpi_id.cc
│ │ ├── lpi_idrivesync.cc
│ │ ├── lpi_ihexin.cc
│ │ ├── lpi_imap.cc
│ │ ├── lpi_imaps.cc
│ │ ├── lpi_imesh.cc
│ │ ├── lpi_invalid.cc
│ │ ├── lpi_invalid_bittorrent.cc
│ │ ├── lpi_invalid_http.cc
│ │ ├── lpi_invalid_pop.cc
│ │ ├── lpi_invalid_smtp.cc
│ │ ├── lpi_ipfs.cc
│ │ ├── lpi_ipop.cc
│ │ ├── lpi_ipsharkk.cc
│ │ ├── lpi_irc.cc
│ │ ├── lpi_java.cc
│ │ ├── lpi_jedi.cc
│ │ ├── lpi_jx3online.cc
│ │ ├── lpi_kakao.cc
│ │ ├── lpi_kankan_tcp.cc
│ │ ├── lpi_kaseya.cc
│ │ ├── lpi_kaspersky.cc
│ │ ├── lpi_kik.cc
│ │ ├── lpi_kingofglory_tcp.cc
│ │ ├── lpi_kuaibo.cc
│ │ ├── lpi_ldap.cc
│ │ ├── lpi_lifeforge.cc
│ │ ├── lpi_line.cc
│ │ ├── lpi_litecoin.cc
│ │ ├── lpi_llp2p.cc
│ │ ├── lpi_maplestory_china.cc
│ │ ├── lpi_maxicloud.cc
│ │ ├── lpi_message4u.cc
│ │ ├── lpi_minecraft.cc
│ │ ├── lpi_mitglieder.cc
│ │ ├── lpi_mms.cc
│ │ ├── lpi_mongo.cc
│ │ ├── lpi_mp2p.cc
│ │ ├── lpi_msn.cc
│ │ ├── lpi_msnc.cc
│ │ ├── lpi_msnv.cc
│ │ ├── lpi_munin.cc
│ │ ├── lpi_mysql.cc
│ │ ├── lpi_mystery_8000.cc
│ │ ├── lpi_mystery_9000.cc
│ │ ├── lpi_mystery_conn.cc
│ │ ├── lpi_mystery_iG.cc
│ │ ├── lpi_mystery_pspr.cc
│ │ ├── lpi_mystery_rxxf.cc
│ │ ├── lpi_mystery_symantec.cc
│ │ ├── lpi_mzinga.cc
│ │ ├── lpi_naverp2p.cc
│ │ ├── lpi_ncsoft.cc
│ │ ├── lpi_ndt_tput.cc
│ │ ├── lpi_netbios.cc
│ │ ├── lpi_netcat_cctv.cc
│ │ ├── lpi_netmfp.cc
│ │ ├── lpi_nntp.cc
│ │ ├── lpi_nntps.cc
│ │ ├── lpi_nofirstpkt.cc
│ │ ├── lpi_nomachine.cc
│ │ ├── lpi_nopayload.cc
│ │ ├── lpi_norton_backup.cc
│ │ ├── lpi_notes_rpc.cc
│ │ ├── lpi_nsq.cc
│ │ ├── lpi_omegle.cc
│ │ ├── lpi_openvpn.cc
│ │ ├── lpi_ourworld.cc
│ │ ├── lpi_palringo.cc
│ │ ├── lpi_paltalk.cc
│ │ ├── lpi_pandatv.cc
│ │ ├── lpi_pando.cc
│ │ ├── lpi_pathofexile.cc
│ │ ├── lpi_pdbox.cc
│ │ ├── lpi_pop3.cc
│ │ ├── lpi_pop3s.cc
│ │ ├── lpi_postgresql.cc
│ │ ├── lpi_pptp.cc
│ │ ├── lpi_psn_store.cc
│ │ ├── lpi_qcloud_ilvb.cc
│ │ ├── lpi_qq_tcp.cc
│ │ ├── lpi_qqdownload.cc
│ │ ├── lpi_qqlive_tcp.cc
│ │ ├── lpi_qqspeedmobile_tcp.cc
│ │ ├── lpi_qvod.cc
│ │ ├── lpi_rabbitmq.cc
│ │ ├── lpi_ragnarokonline.cc
│ │ ├── lpi_razor.cc
│ │ ├── lpi_rbls.cc
│ │ ├── lpi_rdp.cc
│ │ ├── lpi_realmofthemadgod.cc
│ │ ├── lpi_realvnc.cc
│ │ ├── lpi_rejection.cc
│ │ ├── lpi_relay.cc
│ │ ├── lpi_remote_manipulator.cc
│ │ ├── lpi_revolver_nblbt.cc
│ │ ├── lpi_rfb.cc
│ │ ├── lpi_rpcscan.cc
│ │ ├── lpi_rrtv.cc
│ │ ├── lpi_rsync.cc
│ │ ├── lpi_rtmp.cc
│ │ ├── lpi_rtsp.cc
│ │ ├── lpi_runescape.cc
│ │ ├── lpi_s7comm.cc
│ │ ├── lpi_saprouter.cc
│ │ ├── lpi_saszombieassault4.cc
│ │ ├── lpi_second_life.cc
│ │ ├── lpi_shoutcast.cc
│ │ ├── lpi_silkroadonline.cc
│ │ ├── lpi_sip.cc
│ │ ├── lpi_skyforge.cc
│ │ ├── lpi_skype_tcp.cc
│ │ ├── lpi_smb.cc
│ │ ├── lpi_smite_tcp.cc
│ │ ├── lpi_smtp.cc
│ │ ├── lpi_smtps.cc
│ │ ├── lpi_socks4.cc
│ │ ├── lpi_socks5.cc
│ │ ├── lpi_spdy.cc
│ │ ├── lpi_speedify.cc
│ │ ├── lpi_speedin.cc
│ │ ├── lpi_speedtest.cc
│ │ ├── lpi_spotify.cc
│ │ ├── lpi_ssh.cc
│ │ ├── lpi_ssjj.cc
│ │ ├── lpi_ssl.cc
│ │ ├── lpi_steam.cc
│ │ ├── lpi_stratum.cc
│ │ ├── lpi_stun.cc
│ │ ├── lpi_supl.cc
│ │ ├── lpi_svn.cc
│ │ ├── lpi_talesrunner.cc
│ │ ├── lpi_tankionline.cc
│ │ ├── lpi_tankix.cc
│ │ ├── lpi_taobao.cc
│ │ ├── lpi_tds.cc
│ │ ├── lpi_teamviewer.cc
│ │ ├── lpi_telecomkey.cc
│ │ ├── lpi_telegram.cc
│ │ ├── lpi_telnet.cc
│ │ ├── lpi_telnet_exploit.cc
│ │ ├── lpi_tencent_games.cc
│ │ ├── lpi_tenfivecoin.cc
│ │ ├── lpi_tensafe.cc
│ │ ├── lpi_tera.cc
│ │ ├── lpi_tetrisonline.cc
│ │ ├── lpi_thedivision.cc
│ │ ├── lpi_tip.cc
│ │ ├── lpi_tor.cc
│ │ ├── lpi_tpkt.cc
│ │ ├── lpi_trackmania.cc
│ │ ├── lpi_transocks.cc
│ │ ├── lpi_trion.cc
│ │ ├── lpi_trojan_win32_generic_sb.cc
│ │ ├── lpi_trojan_zeroaccess.cc
│ │ ├── lpi_twitcasting.cc
│ │ ├── lpi_twitch_irc.cc
│ │ ├── lpi_utherverse.cc
│ │ ├── lpi_vainglory.cc
│ │ ├── lpi_vhdp2p.cc
│ │ ├── lpi_viber.cc
│ │ ├── lpi_vmware.cc
│ │ ├── lpi_vodlocker.cc
│ │ ├── lpi_vpnrobot_tcp.cc
│ │ ├── lpi_vpnunlimited_tcp.cc
│ │ ├── lpi_warcraft3.cc
│ │ ├── lpi_web_junk.cc
│ │ ├── lpi_webex_stun.cc
│ │ ├── lpi_weblogic.cc
│ │ ├── lpi_wechat.cc
│ │ ├── lpi_weibo.cc
│ │ ├── lpi_weiqi.cc
│ │ ├── lpi_whatsapp.cc
│ │ ├── lpi_whois.cc
│ │ ├── lpi_winmx.cc
│ │ ├── lpi_wizard101.cc
│ │ ├── lpi_wns.cc
│ │ ├── lpi_wow.cc
│ │ ├── lpi_wuala.cc
│ │ ├── lpi_xiami.cc
│ │ ├── lpi_xmpp.cc
│ │ ├── lpi_xmpps.cc
│ │ ├── lpi_xunlei.cc
│ │ ├── lpi_xunlei_accel.cc
│ │ ├── lpi_xymon.cc
│ │ ├── lpi_yahoo.cc
│ │ ├── lpi_yahoo_error.cc
│ │ ├── lpi_yahoo_games.cc
│ │ ├── lpi_yahoo_webcam.cc
│ │ ├── lpi_youku.cc
│ │ ├── lpi_yy_tcp.cc
│ │ ├── lpi_zabbix.cc
│ │ ├── lpi_zero.cc
│ │ ├── lpi_zoom_tcp.cc
│ │ ├── lpi_zynga.cc
│ │ └── tcp_protocols.h
│ └── udp/
│ ├── Makefile.am
│ ├── lpi_360cn.cc
│ ├── lpi_360p2p.cc
│ ├── lpi_aachen_udp.cc
│ ├── lpi_acercloud.cc
│ ├── lpi_akamai.cc
│ ├── lpi_akamai_transfer.cc
│ ├── lpi_amanda.cc
│ ├── lpi_apple_facetime_init.cc
│ ├── lpi_ard.cc
│ ├── lpi_ares.cc
│ ├── lpi_ark.cc
│ ├── lpi_arma3_server.cc
│ ├── lpi_arma_server.cc
│ ├── lpi_artcp.cc
│ ├── lpi_assettocorsa.cc
│ ├── lpi_avast_secure_dns.cc
│ ├── lpi_backweb.cc
│ ├── lpi_bacnet.cc
│ ├── lpi_baiduyun_p2p.cc
│ ├── lpi_baofeng_udp.cc
│ ├── lpi_battlefield.cc
│ ├── lpi_bjnp.cc
│ ├── lpi_bmdp.cc
│ ├── lpi_btsync.cc
│ ├── lpi_cacaoweb_udp.cc
│ ├── lpi_canon_mfnp.cc
│ ├── lpi_chargen_exploit.cc
│ ├── lpi_checkpoint_rdp.cc
│ ├── lpi_chivalry.cc
│ ├── lpi_cip_io.cc
│ ├── lpi_cirn.cc
│ ├── lpi_cisco_ipsec.cc
│ ├── lpi_cisco_sslvpn.cc
│ ├── lpi_classin_udp.cc
│ ├── lpi_cloudflare_warp.cc
│ ├── lpi_cod.cc
│ ├── lpi_codmobile.cc
│ ├── lpi_combatarms.cc
│ ├── lpi_combatarms_p2p.cc
│ ├── lpi_contract_wars.cc
│ ├── lpi_crossfire.cc
│ ├── lpi_crossout.cc
│ ├── lpi_csgo.cc
│ ├── lpi_csoriginal.cc
│ ├── lpi_dahua.cc
│ ├── lpi_db2.cc
│ ├── lpi_dcc.cc
│ ├── lpi_demonware.cc
│ ├── lpi_destiny_udp.cc
│ ├── lpi_dhcp.cc
│ ├── lpi_dht_dict.cc
│ ├── lpi_dht_other.cc
│ ├── lpi_diablo2.cc
│ ├── lpi_dianping_udp.cc
│ ├── lpi_dianshijia.cc
│ ├── lpi_directconnect.cc
│ ├── lpi_discord.cc
│ ├── lpi_dns.cc
│ ├── lpi_dota2.cc
│ ├── lpi_doyo.cc
│ ├── lpi_driveshare.cc
│ ├── lpi_dtls.cc
│ ├── lpi_emule.cc
│ ├── lpi_emule_weak.cc
│ ├── lpi_epson.cc
│ ├── lpi_eso.cc
│ ├── lpi_esp_encap.cc
│ ├── lpi_ethernetip.cc
│ ├── lpi_eye.cc
│ ├── lpi_fasp.cc
│ ├── lpi_feitwo.cc
│ ├── lpi_forticlient_sslvpn.cc
│ ├── lpi_fortinet.cc
│ ├── lpi_foscam.cc
│ ├── lpi_freechal.cc
│ ├── lpi_freefire.cc
│ ├── lpi_funshion.cc
│ ├── lpi_gamespy.cc
│ ├── lpi_ganglia.cc
│ ├── lpi_gangsofspace.cc
│ ├── lpi_garena.cc
│ ├── lpi_gearsofwar.cc
│ ├── lpi_gnutella.cc
│ ├── lpi_gnutella2.cc
│ ├── lpi_gnutella_weak.cc
│ ├── lpi_gotomeeting.cc
│ ├── lpi_gprs_tunnel.cc
│ ├── lpi_gsm.cc
│ ├── lpi_h1z1.cc
│ ├── lpi_halflife.cc
│ ├── lpi_haloonline.cc
│ ├── lpi_hamachi.cc
│ ├── lpi_heliborne.cc
│ ├── lpi_heroes_generals.cc
│ ├── lpi_heroesevolved.cc
│ ├── lpi_hollachat.cc
│ ├── lpi_hots.cc
│ ├── lpi_icp.cc
│ ├── lpi_imesh.cc
│ ├── lpi_ipmsg.cc
│ ├── lpi_ipv6.cc
│ ├── lpi_isakmp.cc
│ ├── lpi_jedi.cc
│ ├── lpi_jedi_academy.cc
│ ├── lpi_kademlia.cc
│ ├── lpi_kankan.cc
│ ├── lpi_kaspersky.cc
│ ├── lpi_kazaa.cc
│ ├── lpi_kingofglory_udp.cc
│ ├── lpi_kuguo.cc
│ ├── lpi_l2tp.cc
│ ├── lpi_lansync.cc
│ ├── lpi_ldap_ad.cc
│ ├── lpi_line_udp.cc
│ ├── lpi_linkproof.cc
│ ├── lpi_loadout.cc
│ ├── lpi_lol.cc
│ ├── lpi_mdns.cc
│ ├── lpi_merakicloud.cc
│ ├── lpi_moh.cc
│ ├── lpi_moonhunters.cc
│ ├── lpi_mp2p.cc
│ ├── lpi_msn_cache.cc
│ ├── lpi_msn_video.cc
│ ├── lpi_msoffice_mac.cc
│ ├── lpi_mta.cc
│ ├── lpi_mystery_02_36.cc
│ ├── lpi_mystery_05.cc
│ ├── lpi_mystery_0660.cc
│ ├── lpi_mystery_0d.cc
│ ├── lpi_mystery_45.cc
│ ├── lpi_mystery_61_72.cc
│ ├── lpi_mystery_8000.cc
│ ├── lpi_mystery_99.cc
│ ├── lpi_mystery_bt_udp.cc
│ ├── lpi_mystery_e9.cc
│ ├── lpi_mystery_emule.cc
│ ├── lpi_mystery_qq.cc
│ ├── lpi_n2ping.cc
│ ├── lpi_natpmp.cc
│ ├── lpi_netbios.cc
│ ├── lpi_netcat_cctv_udp.cc
│ ├── lpi_netcore_scan.cc
│ ├── lpi_netflow.cc
│ ├── lpi_newerth.cc
│ ├── lpi_nintendo.cc
│ ├── lpi_noction.cc
│ ├── lpi_noe.cc
│ ├── lpi_nopayload.cc
│ ├── lpi_norton.cc
│ ├── lpi_ntp.cc
│ ├── lpi_ntp_reflect.cc
│ ├── lpi_nvidia_gamestream.cc
│ ├── lpi_nwn.cc
│ ├── lpi_opaserv.cc
│ ├── lpi_openvpn.cc
│ ├── lpi_orbit.cc
│ ├── lpi_overwatch.cc
│ ├── lpi_paladins.cc
│ ├── lpi_pando.cc
│ ├── lpi_panipani.cc
│ ├── lpi_planetside2.cc
│ ├── lpi_portmap_rpc.cc
│ ├── lpi_pplive.cc
│ ├── lpi_ppstream.cc
│ ├── lpi_probable_gnutella.cc
│ ├── lpi_ps4_remoteplay.cc
│ ├── lpi_psn.cc
│ ├── lpi_punkbuster.cc
│ ├── lpi_pyzor.cc
│ ├── lpi_qq.cc
│ ├── lpi_qqlive.cc
│ ├── lpi_qqpcmgr.cc
│ ├── lpi_qqspeedmobile_udp.cc
│ ├── lpi_quake.cc
│ ├── lpi_quic.cc
│ ├── lpi_qvod_udp.cc
│ ├── lpi_radius.cc
│ ├── lpi_raknet.cc
│ ├── lpi_ramseydash.cc
│ ├── lpi_rdp_udp.cc
│ ├── lpi_real.cc
│ ├── lpi_risingstorm.cc
│ ├── lpi_robocraft.cc
│ ├── lpi_rocket_league.cc
│ ├── lpi_rrshare.cc
│ ├── lpi_rtcp.cc
│ ├── lpi_rtmfp.cc
│ ├── lpi_rtp.cc
│ ├── lpi_rulesofsurvival.cc
│ ├── lpi_sanandreas_mp.cc
│ ├── lpi_second_life.cc
│ ├── lpi_serialnumberd.cc
│ ├── lpi_sip.cc
│ ├── lpi_skype.cc
│ ├── lpi_slp.cc
│ ├── lpi_smite.cc
│ ├── lpi_snapvpn.cc
│ ├── lpi_snmp.cc
│ ├── lpi_sopcast.cc
│ ├── lpi_spamfighter.cc
│ ├── lpi_spotify_bcast.cc
│ ├── lpi_sql_worm.cc
│ ├── lpi_ssdp.cc
│ ├── lpi_starcitizen.cc
│ ├── lpi_starcraft.cc
│ ├── lpi_starleaf.cc
│ ├── lpi_steam.cc
│ ├── lpi_steam_inhomebroadcast.cc
│ ├── lpi_steam_localbroadcast.cc
│ ├── lpi_steamfriends.cc
│ ├── lpi_storm_worm.cc
│ ├── lpi_stun.cc
│ ├── lpi_syslog.cc
│ ├── lpi_talesrunner_udp.cc
│ ├── lpi_teamspeak.cc
│ ├── lpi_teamviewer.cc
│ ├── lpi_teredo.cc
│ ├── lpi_tf2.cc
│ ├── lpi_tftp.cc
│ ├── lpi_thecrew.cc
│ ├── lpi_thq.cc
│ ├── lpi_torchlight2.cc
│ ├── lpi_tox.cc
│ ├── lpi_traceroute.cc
│ ├── lpi_tremulous.cc
│ ├── lpi_turbovpn.cc
│ ├── lpi_tvants.cc
│ ├── lpi_ubisoft_games.cc
│ ├── lpi_umeye.cc
│ ├── lpi_unreal.cc
│ ├── lpi_ventrilo.cc
│ ├── lpi_viber.cc
│ ├── lpi_vivox.cc
│ ├── lpi_vpnmaster.cc
│ ├── lpi_vpnrobot_udp.cc
│ ├── lpi_vxworks_exploit.cc
│ ├── lpi_warthunder.cc
│ ├── lpi_webex.cc
│ ├── lpi_wechat_udp.cc
│ ├── lpi_winmessage.cc
│ ├── lpi_wireguard.cc
│ ├── lpi_wolfet.cc
│ ├── lpi_worm_22105.cc
│ ├── lpi_xfire_p2p.cc
│ ├── lpi_xlsp.cc
│ ├── lpi_xunlei.cc
│ ├── lpi_xunlei_jsq.cc
│ ├── lpi_xunyou.cc
│ ├── lpi_youdao_dict.cc
│ ├── lpi_youku.cc
│ ├── lpi_yuanfudao.cc
│ ├── lpi_yy_udp.cc
│ ├── lpi_zalo_call.cc
│ ├── lpi_zeroaccess_udp.cc
│ ├── lpi_zoom.cc
│ └── udp_protocols.h
├── rpm/
│ └── libprotoident.spec
├── rpmpkg-build.sh
├── rpmpkg-setup.sh
├── test/
│ └── lpi_test_results
└── tools/
├── Makefile.am
├── Makefile.tools
├── arff/
│ ├── Makefile.am
│ ├── lpi_arff.1
│ └── lpi_arff.cc
├── find_unknown/
│ ├── Makefile.am
│ ├── lpi_find_unknown.1
│ └── lpi_find_unknown.cc
├── live/
│ ├── Makefile.am
│ ├── collector.cc
│ ├── live_common.cc
│ ├── live_common.h
│ ├── lpi_live.cc
│ ├── lpicp.cc
│ ├── lpicp.h
│ ├── lpicp_export.cc
│ └── lpicp_export.h
├── protoident/
│ ├── Makefile.am
│ ├── lpi_protoident.1
│ └── lpi_protoident.cc
├── tools_common.cc
└── tools_common.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/pkg-build.yaml
================================================
name: Packaging for Debian and Ubuntu
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "debian:stretch"
- "debian:buster"
- "debian:bullseye"
- "ubuntu:xenial"
- "ubuntu:bionic"
- "ubuntu:focal"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install prereq packages
run: ./debpkg-setup.sh
- name: Build packages
run: ./debpkg-build.sh
- name: Store packages
run: |
export DIRNAME=`echo ${{ matrix.target }} | tr ':' '_'`
mkdir -p packages/${DIRNAME}
cp ../*.deb packages/${DIRNAME}/
- name: Publish packages to cloudsmith
uses: wanduow/action-cloudsmith-upload-packages@v1
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libprotoident
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}
================================================
FILE: .github/workflows/rpm-build.yaml
================================================
name: Packaging for Centos and Fedora
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "centos:7"
- "centos:8"
- "fedora:33"
- "fedora:32"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install prereq packages
run: ./rpmpkg-setup.sh ${{ matrix.target }}
- name: Build packages
run: ./rpmpkg-build.sh ${{ matrix.target }}
- name: Store packages
run: |
export DIRNAME=`echo ${{ matrix.target }} | tr ':' '_'`
mkdir -p packages/${DIRNAME}
cp ~/rpmbuild/RPMS/x86_64/*.rpm packages/${DIRNAME}/
- name: Publish packages to cloudsmith
uses: wanduow/action-cloudsmith-upload-packages@v1
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libprotoident
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}
================================================
FILE: .gitignore
================================================
*.la
*.o
*.lo
*Makefile.in
*Makefile
*.deps
*.libs
*.swp
config\.*
configure
autom4te.cache/
depcomp
install-sh
aclocal.m4
libtool
ltmain.sh
missing
stamp-h1
tools/arff/lpi_arff
tools/find_unknown/lpi_find_unknown
tools/protoident/lpi_protoident
================================================
FILE: .gitmodules
================================================
[submodule "libflowmanager"]
path = libflowmanager
url = https://github.com/wanduow/libflowmanager
[submodule "libtrace"]
path = libtrace
url = https://github.com/LibtraceTeam/libtrace
================================================
FILE: COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: COPYING.LESSER
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
================================================
FILE: ChangeLog
================================================
Full ChangeLog details can now be found at:
https://github.com/wanduow/libprotoident/wiki/ChangeLog
================================================
FILE: Makefile.am
================================================
SUBDIRS=lib
if BUILD_LPI_TOOLS
SUBDIRS+=tools
endif
AUTOMAKE_OPTIONS = foreign
================================================
FILE: README
================================================
libprotoident 2.0.15
---------------------------------------------------------------------------
Copyright (c) 2011-2020 The University of Waikato, Hamilton, New Zealand.
All rights reserved.
This code has been developed by the University of Waikato WAND
research group. For further information please see http://www.wand.net.nz/.
---------------------------------------------------------------------------
See the file COPYING and COPYING.LESSER for full licensing details for this
software.
Report and bugs, questions or comments to contact@wand.net.nz
NEW: You can now lodge bugs by filing an issue on the libprotoident github:
https://github.com/wanduow/libprotoident
Authors:
Shane Alcock
With contributions from:
Donald Neal
Aaron Murrihy
Paweł Foremski
Fabian Weisshaar
Jeroen Roovers
Jiri Havranek
Romain Fontugne
Jacob van Walraven
Introduction
============
Libprotoident is a library designed to perform application protocol
identification using a very limited form of deep packet inspection, i.e. using
the first four bytes of application payload sent in each direction. The
library provides a simple API that will enable programmers to develop their own
tools that utilise application protocol information and we have also included
some tools that can be used to perform simple analysis of traffic flows.
Required Libraries
==================
libtrace 4.0.1 or later
* available from https://github.com/LibtraceTeam/libtrace
libflowmanager 3.0.0 or later
* optional, but required to build the tools
* available from https://github.com/LibtraceTeam/libflowmanager
Installation
============
After having installed the required libraries, running the following series
of commands should install libprotoident
./bootstrap.sh (only if you've cloned the source from GitHub)
./configure
make
make install
By default, libprotoident installs to /usr/local - this can be changed by
appending the --prefix= option to ./configure.
The libprotoident tools are built by default - this can be changed by using the
--with-tools=no option with ./configure.
Protocols Supported
===================
A full list of supported protocols can be found at
https://github.com/wanduow/libprotoident/wiki/SupportedProtocols
Libprotoident also currently has rules for several "mystery" protocols. These
are patterns that commonly occur in our trace sets that we cannot tie to an
actual protocol. It would be nice to know what these protocols actually are -
if you have any suggestions please feel free to email us at contact@wand.net.nz.
In addition, a flow can be assigned into a "category" based on the protocol
determined by libprotoident, enabling broader analysis. For example,
BitTorrent, Gnutella and eMule all fall into the P2P category, whereas SMTP,
POP3 and IMAP are part of the Mail category.
Tools
=====
There are three tools included with libprotoident.
* lpi_protoident
Description:
This tool attempts to identify each individual flow within the provided
trace. Identification only occurs when the flow has concluded or
expired, so it is not very effective for real-time applications.
Usage:
lpi_protoident
The input trace must be a valid libtrace URI.
See https://github.com/LibtraceTeam/libtrace/wiki/Supported-Trace-Formats
to learn more about libtrace URIs. Note that a URI may be a live
source, such as a network interface.
Output:
For each flow in the input trace, a single line is printed to stdout
describing the flow. The line contains the following fields separated
by spaces (in order):
* Application protocol (as reported by libprotoident)
* IP address of the first endpoint
* IP address of the second endpoint
* Port used by the first endpoint
* Port used by the second endpoint
* Transport protocol (6 = TCP, 17 = UDP)
* Unix timestamp when the flow began
* Unix timestamp when the flow ended
* Total bytes sent from first endpoint to second endpoint
* Total bytes sent from second endpoint to first endpoint
* First four bytes of payload sent from first endpoint (in hex)
* First four bytes of payload sent from first endpoint (ASCII)
* Size of first payload-bearing packet sent from first endpoint
* First four bytes of payload sent from second endpoint (in hex)
* First four bytes of payload sent from second endpoint (ASCII)
* Size of first payload-bearing packet sent from second endpoint
* lpi_find_unknown
Description:
This tool reports all the flows in a trace which libprotoident
was unable to identify. Identification only occurs when the flow has
concluded or expired, so it is not very effective for real-time
applications.
This is mainly intended as a tool to aid development of new protocol
identifiers.
Usage:
lpi_find_unknown
The input trace must be a valid libtrace URI.
See https://github.com/LibtraceTeam/libtrace/wiki/Supported-Trace-Formats
to learn more about libtrace URIs. Note that a URI may be a live
source, such as a network interface.
Output:
For each unknown flow in the input trace, a single line is printed to
stdout describing the flow. The line contains the following fields
separated by spaces (in order):
* IP address of the first endpoint
* IP address of the second endpoint
* Port used by the first endpoint
* Port used by the second endpoint
* Transport protocol (6 = TCP, 17 = UDP)
* Unix timestamp when the flow began
* Total bytes sent from first endpoint to second endpoint
* Total bytes sent from second endpoint to first endpoint
* First four bytes of payload sent from first endpoint (in hex)
* First four bytes of payload sent from first endpoint (ASCII)
* Size of first payload-bearing packet sent from first endpoint
* First four bytes of payload sent from second endpoint (in hex)
* First four bytes of payload sent from second endpoint (ASCII)
* Size of first payload-bearing packet sent from second endpoint
* lpi_arff
Description:
This tool is similar to lpi_protoident except that it writes its
output in the ARFF format so that it is compatible with the Weka
machine learning software (http://www.cs.waikato.ac.nz/ml/weka/).
This tool was contributed by Paweł Foremski .
Usage:
lpi_arff
The input trace must be a valid libtrace URI.
See https://github.com/LibtraceTeam/libtrace/wiki/Supported-Trace-Formats
to learn more about libtrace URIs. Note that a URI may be a live
source, such as a network interface.
Output:
The output begins with a series of lines describing each feature that
will be used to describe each flow. Following that,
for each flow in the input trace, a single line is printed to stdout
describing the flow. The line contains the following fields separated
by commas (in order):
* Application protocol (as reported by libprotoident)
* ID number for the application protocol
* Total number of packets sent from first endpoint to second endpoint
* Total number of bytes sent from first endpoint to second endpoint
* Total number of packets sent from second endpoint to first endpoint
* Total number of bytes sent from second endpoint to first endpoint
* Minimum payload size sent from first endpoint to second endpoint
* Mean payload size sent from first endpoint to second endpoint
* Maximum payload size sent from first endpoint to second endpoint
* Standard deviation of payload size sent from first endpoint to
second endpoint
* Minimum payload size sent from second endpoint to first endpoint
* Mean payload size sent from second endpoint to first endpoint
* Maximum payload size sent from second endpoint to first endpoint
* Standard deviation of payload size sent from second endpoint to
first endpoint
* Minimum packet interarrival time for packets sent from first
endpoint to second endpoint
* Mean packet interarrival time for packets sent from first
endpoint to second endpoint
* Maximum packet interarrival time for packets sent from first
endpoint to second endpoint
* Standard deviation of packet interarrival time for packets sent from
first endpoint to second endpoint
* Minimum packet interarrival time for packets sent from second
endpoint to first endpoint
* Mean packet interarrival time for packets sent from second
endpoint to first endpoint
* Maximum packet interarrival time for packets sent from second
endpoint to first endpoint
* Standard deviation of packet interarrival time for packets sent from
second endpoint to first endpoint
* Flow duration (in microseconds)
* Flow start time (as a Unix timestamp)
API
===
If you want to develop your own tools based on libprotoident, you'll need to
use the libprotoident API. The API is very simple and the best way to learn it
is to examine how the existing tools work. The source for the tools is
located in the tools/ directory.
The tools use libflowmanager to do the flow tracking, using an instance of a
FlowManager class. You will probably want to incorporate this into your own
tool. Usage of libprotoident itself is through functions beginning with 'lpi_'.
The libprotoident API functions themselves are documented in
lib/libprotoident.h if you need further guidance.
Further documentation of the API can also be found at
https://github.com/LibtraceTeam/libflowmanager
If all else fails, drop me a line at shane@alcock.co.nz
================================================
FILE: bootstrap.sh
================================================
#! /bin/sh
set -x
# Prefer aclocal 1.9 if we can find it
aclocal-1.11 || aclocal-1.9 || aclocal
# Darwin bizarrely uses glibtoolize
libtoolize --force --copy ||
glibtoolize --force --copy
autoheader2.50 || autoheader
# Prefer automake-1.9 if we can find it
automake-1.11 --add-missing --copy --foreign ||
automake-1.10 --add-missing --copy --foreign ||
automake-1.9 --add-missing --copy --foreign ||
automake --add-missing --copy --foreign
autoconf2.50 || autoconf
================================================
FILE: configure.ac
================================================
AC_INIT(libprotoident, 2.0.15, contact@wand.net.nz)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(lib/libprotoident.cc)
AM_CONFIG_HEADER(config.h)
# Make sure we use the relatively silent automake output
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PREFIX_DEFAULT(/usr/local/)
# Function that checks if the C++ compiler actually works - there's a bit of
# oversight in autoconf that will set the C++ compiler to g++ if no compiler
# is found, even if g++ is not present! So we need an extra test to make sure
# that the compiler works :(
AC_DEFUN([rw_PROG_CXX_WORKS],
[AC_REQUIRE([AC_PROG_CXX])dnl
AC_CACHE_CHECK([whether the C++ compiler works],
[rw_cv_prog_cxx_works],
[AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rw_cv_prog_cxx_works=yes],
[rw_cv_prog_cxx_works=no])
AC_LANG_POP([C++])])
])
AC_PROG_CC
AC_PROG_CXX
rw_PROG_CXX_WORKS
AC_PROG_INSTALL
AC_LANG(C++)
AC_PROG_LIBTOOL
build_tools=yes
AC_ARG_WITH(tools,
AS_HELP_STRING(--with-tools, install libprotoident tools),[
if test "$withval" = yes
then
build_tools=yes
else
build_tools=no
fi
])
AC_CHECK_LIB([trace], [trace_get_payload_length],,trace_found=0)
if test "$build_tools" = yes; then
AC_CHECK_LIB([flowmanager], [lfm_version_three],,lfm_found=0)
fi
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_CONFIG_FILES([Makefile lib/Makefile tools/Makefile
tools/find_unknown/Makefile tools/protoident/Makefile
tools/arff/Makefile
lib/udp/Makefile lib/tcp/Makefile])
if test "$trace_found" = 0; then
AC_MSG_ERROR(Required library libtrace 3.0.7 or later not found; use LDFLAGS to specify library location)
fi
if test "$lfm_found" = 0; then
AC_MSG_ERROR(Required library libflowmanager not found; use LDFLAGS to specify library location)
fi
AM_CONDITIONAL([BUILD_LPI_TOOLS], [test "$build_tools" = yes])
AC_SUBST([ADD_LIBS])
AC_SUBST([ADD_LDFLAGS])
AC_SUBST([ADD_INCLS])
AC_SUBST([LTLIBOBJS])
AC_OUTPUT
================================================
FILE: debian/changelog
================================================
libprotoident (2.0.15-2) unstable; urgency=low
* Rebuild package so tool binaries are compatible with latest libtrace.
-- Shane Alcock Mon, 29 Mar 2021 13:40:13 +1300
libprotoident (2.0.15-1) unstable; urgency=low
* New upstream release.
* Added new API methods: lpi_get_category_by_protocol() and
lpi_get_category_by_name().
* Improved rules for 6 protocols, including QUIC and Zoom
* Added 5 new protocols.
-- Shane Alcock Thu, 12 Nov 2019 12:00:00 +1300
libprotoident (2.0.14-1) unstable; urgency=low
* New upstream release.
* Added new API method: lpi_get_protocol_by_name().
* Fixed bug where lpi_print_category() would fail for the message
queuing category.
* Renamed "Roblox" to "Raknet" to better reflect the real underlying
protocol.
* Added new protocol category for educational applications.
* Added 17 new application protocols.
* Improved rules for a further 17 application protocols.
-- Shane Alcock Wed, 20 Nov 2019 14:11:21 +1300
libprotoident (2.0.13) unstable; urgency=low
* New upstream release
* Fixed bug where RST payload was used for classification purposes.
* Fixed errors in 4D, Heroes of the Storm and The Division rules.
* Added new protocol category for message queuing applications.
* Added 43 new application protocols.
* Improved rules for a further 35 application protocols.
-- Shane Alcock Tue, 09 Apr 2019 13:49:25 +1200
================================================
FILE: debian/compat
================================================
9
================================================
FILE: debian/control
================================================
Source: libprotoident
Priority: optional
Maintainer: Shane Alcock
Build-Depends: debhelper (>= 9), dh-autoreconf, libtrace4-dev,
libflowmanager-dev
Standards-Version: 4.1.3
Section: libs
Homepage: http://research.wand.net.nz/software/libprotoident.php
Package: libprotoident-dev
Section: libdevel
Architecture: any
Depends: libprotoident (= ${binary:Version}), ${misc:Depends}
Provides: libprotoident-dev
Description: development headers for the libprotoident library
This package contains development headers and other ancillary files for
the libprotoident library.
.
libprotoident is a library that can perform traffic classification
on each network flow observed via a packet capture process (including
pcap trace files and many common live packet capture approaches).
The classification is performed by examining the packet headers and
first four bytes of application payload only, so can be used in
environments where full payload capture is not possible.
.
libprotoident is developed by the WAND Network Research Group at Waikato
University in New Zealand.
Package: libprotoident
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libprotoident
Description: C++ library for network traffic classification.
libprotoident is a library that can perform traffic classification
on each network flow observed via a packet capture process (including
pcap trace files and many common live packet capture approaches).
The classification is performed by examining the packet headers and
first four bytes of application payload only, so can be used in
environments where full payload capture is not possible.
.
libprotoident is developed by the WAND Network Research Group at Waikato
University in New Zealand.
Package: libprotoident-tools
Section: net
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libprotoident-tools
Description: example utilities that make use of the libprotoident library
libprotoident is a library that can perform network traffic classification
using minimal application payload. These tools are provided as working
demonstrations of libprotoident and can be used to perform simple analytic
tasks (i.e. identify flows belonging to a specific application).
.
libprotoident is developed by the WAND Network Research Group at Waikato
University in New Zealand.
================================================
FILE: debian/copyright
================================================
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Libprotoident
Source: http://research.wand.net.nz/software/libprotoident.php
Files: *
Copyright: 2019 The University of Waikato, Hamilton, New Zealand.
License: LGPL-3
This package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option)
any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in `/usr/share/common-licenses/LGPL-3'.
================================================
FILE: debian/libprotoident-dev.dirs
================================================
usr/lib
usr/include
================================================
FILE: debian/libprotoident-dev.install
================================================
usr/include/libprotoident*.h
usr/lib/libprotoident*.so
usr/lib/libprotoident*.a
================================================
FILE: debian/libprotoident-tools.dirs
================================================
usr/bin
================================================
FILE: debian/libprotoident-tools.install
================================================
usr/bin/*
usr/share/man/man1/*
================================================
FILE: debian/libprotoident.dirs
================================================
usr/lib
================================================
FILE: debian/libprotoident.install
================================================
usr/lib/libprotoident*.so.*
================================================
FILE: debian/rules
================================================
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Enable all hardening features, since traces are untrusted input.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CONFFLAGS =
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
configure:
configure-stamp: configure
dh_testdir
dh_autoreconf
./configure $(CONFFLAGS) \
--prefix=/usr \
--with-tools=yes \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info
touch configure-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
[ ! -f Makefile ] || $(MAKE) clean
[ ! -f Makefile ] || $(MAKE) distclean
rm -rf docs/doxygen
dh_autoreconf_clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
#dh_installchangelogs ChangeLog
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_install --sourcedir=debian/tmp
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb -- -Zgzip
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
================================================
FILE: debian/source/format
================================================
3.0 (quilt)
================================================
FILE: debpkg-build.sh
================================================
#!/bin/bash
set -x -e -o pipefail
export DEBEMAIL='packaging@wand.net.nz'
export DEBFULLNAME='WAND Packaging'
export DEBIAN_FRONTEND=noninteractive
export SOURCENAME=`echo ${GITHUB_REF##*/} | cut -d '-' -f 1`
mk-build-deps -i -r -t 'apt-get -f -y --force-yes'
dpkg-buildpackage -b -us -uc -rfakeroot -j4
================================================
FILE: debpkg-setup.sh
================================================
#!/bin/bash
set -x -e -o pipefail
export DEBEMAIL='packaging@wand.net.nz'
export DEBFULLNAME='WAND Packaging'
export DEBIAN_FRONTEND=noninteractive
export SOURCENAME=`echo ${GITHUB_REF##*/} | cut -d '-' -f 1`
apt-get update
apt-get install -y equivs devscripts dpkg-dev quilt curl apt-transport-https \
apt-utils ssl-cert ca-certificates gnupg lsb-release debhelper git \
pkg-config
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.deb.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.deb.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libtrace/cfg/setup/bash.deb.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libflowmanager/cfg/setup/bash.deb.sh' | bash
DISTRO=$(lsb_release -sc)
case ${DISTRO} in
jessie | xenial | stretch )
curl -1sLf 'https://dl.cloudsmith.io/public/wand/dpdk-wand/cfg/setup/bash.deb.sh' | bash
;;
esac
apt-get update
apt-get upgrade -y
================================================
FILE: lib/Makefile.am
================================================
SUBDIRS=tcp udp
lib_LTLIBRARIES=libprotoident.la
include_HEADERS=libprotoident.h
libprotoident_la_SOURCES=libprotoident.h libprotoident.cc \
proto_common.cc proto_common.h \
proto_manager.cc proto_manager.h
INCLUDES=@ADD_INCLS@
libprotoident_la_LIBADD = @ADD_LIBS@ tcp/libprotoident_tcp.la \
udp/libprotoident_udp.la
libprotoident_la_LDFLAGS = @ADD_LDFLAGS@ -version-info 4:0:2
libprotoident_la_CPPFLAGS = -Werror
================================================
FILE: lib/libprotoident.cc
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#define __STDC_FORMAT_MACROS
#define __STDC_LIMIT_MACROS
#include
#include
#include
#include
#include
#include
#include
#include
#include "libprotoident.h"
#include "proto_manager.h"
bool init_called = false;
LPIModuleMap TCP_protocols;
LPIModuleMap UDP_protocols;
lpi_module_t *lpi_icmp = NULL;
lpi_module_t *lpi_unsupported = NULL;
lpi_module_t *lpi_unknown_tcp = NULL;
lpi_module_t *lpi_unknown_udp = NULL;
static LPINameMap lpi_names;
static LPIProtocolMap lpi_protocols;
static LPICategoryMap lpi_categories;
static LPICategoryProtocolMap lpi_category_protocols;
static int seq_cmp (uint32_t seq_a, uint32_t seq_b) {
if (seq_a == seq_b) return 0;
if (seq_a > seq_b)
return (int)(seq_a - seq_b);
else
/* WRAPPING */
return (int)(UINT32_MAX - ((seq_b - seq_a) - 1));
}
int lpi_init_library() {
if (init_called) {
fprintf(stderr, "WARNING: lpi_init_library has already been called\n");
return 0;
}
if (register_tcp_protocols(&TCP_protocols) == -1)
return -1;
if (register_udp_protocols(&UDP_protocols) == -1)
return -1;
init_other_protocols(&lpi_names, &lpi_protocols, &lpi_category_protocols);
register_names(&TCP_protocols, &lpi_names, &lpi_protocols, &lpi_category_protocols);
register_names(&UDP_protocols, &lpi_names, &lpi_protocols, &lpi_category_protocols);
register_category_names(&lpi_categories);
init_called = true;
if (TCP_protocols.empty() && UDP_protocols.empty()) {
fprintf(stderr, "WARNING: No protocol modules loaded\n");
return -1;
}
return 0;
}
void lpi_free_library() {
free_protocols(&TCP_protocols);
free_protocols(&UDP_protocols);
if (lpi_icmp != NULL) {
delete lpi_icmp;
lpi_icmp = NULL;
}
if (lpi_unsupported != NULL) {
delete lpi_unsupported;
lpi_unsupported = NULL;
}
if (lpi_unknown_tcp != NULL) {
delete lpi_unknown_tcp;
lpi_unknown_tcp = NULL;
}
if (lpi_unknown_udp != NULL) {
delete lpi_unknown_udp;
lpi_unknown_udp = NULL;
}
init_called = false;
}
void lpi_init_data(lpi_data_t *data) {
data->payload[0] = 0;
data->payload[1] = 0;
data->seen_syn[0] = false;
data->seen_syn[1] = false;
data->seqno[0] = 0;
data->seqno[1] = 0;
data->observed[0] = 0;
data->observed[1] = 0;
data->server_port = 0;
data->client_port = 0;
data->trans_proto = 0;
data->payload_len[0] = 0;
data->payload_len[1] = 0;
data->ips[0] = 0;
data->ips[1] = 0;
}
static int update_tcp_flow(lpi_data_t *data, libtrace_tcp_t *tcp, uint8_t dir,
uint32_t rem, uint32_t psize) {
uint32_t seq = 0;
if (rem < sizeof(libtrace_tcp_t))
return 0;
if (tcp->rst)
return 0;
if (data->server_port == 0) {
data->server_port = ntohs(tcp->dest);
data->client_port = ntohs(tcp->source);
}
seq = ntohl(tcp->seq);
if (tcp->syn && data->payload_len[dir] == 0) {
data->seqno[dir] = seq + 1;
data->seen_syn[dir] = true;
}
/* Ok, we've got some payload but we never saw the SYN for this
* direction. What do we do?
*
* Current idea: just assume this is the first payload bearing
* packet. Better than running around with an uninitialised seqno */
if (data->seen_syn[dir] == false && psize > 0) {
data->seqno[dir] = seq;
data->seen_syn[dir] = true;
}
if (seq_cmp(seq, data->seqno[dir]) != 0)
return 0;
//data->seqno[dir] = seq;
return 1;
}
static int update_udp_flow(lpi_data_t *data, libtrace_udp_t *udp,
uint32_t rem) {
if (rem < sizeof(libtrace_udp_t))
return 0;
if (data->server_port == 0) {
data->server_port = ntohs(udp->dest);
data->client_port = ntohs(udp->source);
}
return 1;
}
int lpi_update_data(libtrace_packet_t *packet, lpi_data_t *data, uint8_t dir) {
char *payload = NULL;
uint32_t psize = 0;
uint32_t rem = 0;
uint8_t proto = 0;
void *transport;
uint32_t four_bytes;
libtrace_ip_t *ip = NULL;
//tcp = trace_get_tcp(packet);
psize = trace_get_payload_length(packet);
/* Don't bother if we've observed 32k of data - the first packet must
* surely been within that. This helps us avoid issues with sequence
* number wrapping when doing the reordering check below */
if (data->observed[dir] > 32 * 1024)
return 0;
data->observed[dir] += psize;
/* If we're TCP, we have to wait to check that we haven't been
* reordered */
if (data->trans_proto != 6 && data->payload_len[dir] != 0)
return 0;
transport = trace_get_transport(packet, &proto, &rem);
if (data->trans_proto == 0)
data->trans_proto = proto;
if (transport == NULL || rem == 0)
return 0;
if (proto == 6) {
if (update_tcp_flow(data, (libtrace_tcp_t *)transport, dir, rem, psize) == 0)
return 0;
payload = (char *)trace_get_payload_from_tcp(
(libtrace_tcp_t *)transport, &rem);
}
if (proto == 17) {
if (update_udp_flow(data, (libtrace_udp_t *)transport, rem) == 0)
return 0;
payload = (char *)trace_get_payload_from_udp(
(libtrace_udp_t *)transport, &rem);
}
ip = trace_get_ip(packet);
if (payload == NULL)
return 0;
if (psize <= 0)
return 0;
four_bytes = (*(uint32_t *)payload);
if (psize < 4) {
four_bytes = (ntohl(four_bytes)) >> (8 * (4 - psize));
four_bytes = htonl(four_bytes << (8 * (4 - psize)));
}
data->payload[dir] = four_bytes;
data->payload_len[dir] = psize;
if (ip != NULL && data->ips[0] == 0) {
if (dir == 0) {
data->ips[0] = ip->ip_src.s_addr;
data->ips[1] = ip->ip_dst.s_addr;
} else {
data->ips[1] = ip->ip_src.s_addr;
data->ips[0] = ip->ip_dst.s_addr;
}
}
return 1;
}
static lpi_module_t *test_protocol_list(LPIModuleList *ml, lpi_data_t *data) {
LPIModuleList::iterator l_it;
/* Turns out naively looping through the modules is quicker
* than trying to do intelligent stuff with threads. Most
* callbacks complete very quickly so threading overhead is a
* major problem */
for (l_it = ml->begin(); l_it != ml->end(); l_it ++) {
lpi_module_t *module = *l_it;
/* To save time, I'm going to break on the first successful
* match. A threaded version would wait for all the modules
* to run, storing all successful results in a list of some
* sort and selecting an appropriate result from there.
*/
if (module->lpi_callback(data, module))
return module;
}
return NULL;
}
static lpi_module_t *guess_protocol(LPIModuleMap *modmap, lpi_data_t *data) {
lpi_module_t *proto = NULL;
LPIModuleMap::iterator m_it;
/* Deal with each priority in turn - want to match higher priority
* rules first.
*/
for (m_it = modmap->begin(); m_it != modmap->end(); m_it ++) {
LPIModuleList *ml = m_it->second;
proto = test_protocol_list(ml, data);
if (proto != NULL)
break;
}
return proto;
}
lpi_module_t *lpi_guess_protocol(lpi_data_t *data) {
lpi_module_t *p = NULL;
if (!init_called) {
fprintf(stderr, "lpi_init_library was never called - cannot guess the protocol\n");
return NULL;
}
switch(data->trans_proto) {
case TRACE_IPPROTO_ICMP:
return lpi_icmp;
case TRACE_IPPROTO_TCP:
p = guess_protocol(&TCP_protocols, data);
if (p == NULL)
p = lpi_unknown_tcp;
return p;
case TRACE_IPPROTO_UDP:
p = guess_protocol(&UDP_protocols, data);
if (p == NULL)
p = lpi_unknown_udp;
return p;
default:
return lpi_unsupported;
}
return p;
}
lpi_category_t lpi_categorise(lpi_module_t *module) {
if (module == NULL)
return LPI_CATEGORY_NO_CATEGORY;
return module->category;
}
const char *lpi_print_category(lpi_category_t category) {
switch(category) {
case LPI_CATEGORY_WEB:
return "Web";
case LPI_CATEGORY_MAIL:
return "Mail";
case LPI_CATEGORY_CHAT:
return "Chat";
case LPI_CATEGORY_P2P:
return "P2P";
case LPI_CATEGORY_P2P_STRUCTURE:
return "P2P_Structure";
case LPI_CATEGORY_KEY_EXCHANGE:
return "Key_Exchange";
case LPI_CATEGORY_ECOMMERCE:
return "ECommerce";
case LPI_CATEGORY_GAMING:
return "Gaming";
case LPI_CATEGORY_ENCRYPT:
return "Encryption";
case LPI_CATEGORY_MONITORING:
return "Measurement";
case LPI_CATEGORY_NEWS:
return "News";
case LPI_CATEGORY_MALWARE:
return "Malware";
case LPI_CATEGORY_SECURITY:
return "Security";
case LPI_CATEGORY_ANTISPAM:
return "Antispam";
case LPI_CATEGORY_VOIP:
return "VOIP";
case LPI_CATEGORY_TUNNELLING:
return "Tunnelling";
case LPI_CATEGORY_NAT:
return "NAT_Traversal";
case LPI_CATEGORY_STREAMING:
return "Streaming";
case LPI_CATEGORY_SERVICES:
return "Services";
case LPI_CATEGORY_DATABASES:
return "Databases";
case LPI_CATEGORY_FILES:
return "File_Transfer";
case LPI_CATEGORY_REMOTE:
return "Remote_Access";
case LPI_CATEGORY_TELCO:
return "Telco_Services";
case LPI_CATEGORY_P2PTV:
return "P2PTV";
case LPI_CATEGORY_RCS:
return "Revision_Control";
case LPI_CATEGORY_LOGGING:
return "Logging";
case LPI_CATEGORY_PRINTING:
return "Printing";
case LPI_CATEGORY_TRANSLATION:
return "Translation";
case LPI_CATEGORY_CDN:
return "CDN";
case LPI_CATEGORY_CLOUD:
return "Cloud";
case LPI_CATEGORY_NOTIFICATION:
return "Notification";
case LPI_CATEGORY_SERIALISATION:
return "Serialisation";
case LPI_CATEGORY_BROADCAST:
return "Broadcast";
case LPI_CATEGORY_LOCATION:
return "Location";
case LPI_CATEGORY_CACHING:
return "Caching";
case LPI_CATEGORY_ICS:
return "ICS";
case LPI_CATEGORY_MOBILE_APP:
return "Mobile App";
case LPI_CATEGORY_IPCAMERAS:
return "IP Cameras";
case LPI_CATEGORY_EDUCATIONAL:
return "Educational";
case LPI_CATEGORY_MESSAGE_QUEUE:
return "Message_Queuing";
case LPI_CATEGORY_ICMP:
return "ICMP";
case LPI_CATEGORY_MIXED:
return "Mixed";
case LPI_CATEGORY_NOPAYLOAD:
return "No_Payload";
case LPI_CATEGORY_UNKNOWN:
return "Unknown";
case LPI_CATEGORY_UNSUPPORTED:
return "Unsupported";
case LPI_CATEGORY_NO_CATEGORY:
return "Uncategorised";
case LPI_CATEGORY_LAST:
return "Invalid_Category";
}
return "Invalid_Category";
}
const char *lpi_print(lpi_protocol_t proto) {
LPINameMap::iterator it;
it = lpi_names.find(proto);
if (it == lpi_names.end()) {
return "NULL";
}
return (it->second);
}
lpi_protocol_t lpi_get_protocol_by_name(char *name) {
LPIProtocolMap::iterator it;
it = lpi_protocols.find(name);
if (it == lpi_protocols.end()) {
return LPI_PROTO_UNKNOWN;
}
return (it->second);
}
lpi_category_t lpi_get_category_by_name(char *name) {
LPICategoryMap::iterator it;
it = lpi_categories.find(name);
if (it == lpi_categories.end()) {
return LPI_CATEGORY_UNKNOWN;
}
return (it->second);
}
lpi_category_t lpi_get_category_by_protocol(lpi_protocol_t protocol) {
LPICategoryProtocolMap::iterator it;
it = lpi_category_protocols.find(protocol);
if (it == lpi_category_protocols.end()) {
return LPI_CATEGORY_UNKNOWN;
}
return (it->second);
}
bool lpi_is_protocol_inactive(lpi_protocol_t proto) {
LPINameMap::iterator it;
it = lpi_names.find(proto);
if (it == lpi_names.end()) {
return true;
}
return false;
}
================================================
FILE: lib/libprotoident.h
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#ifndef LIBPROTOIDENT_H_
#define LIBPROTOIDENT_H_
#include
#include
#include
#if __GNUC__ >= 3
#ifndef PRINTF
# define DEPRECATED __attribute__((deprecated))
# define SIMPLE_FUNCTION __attribute__((pure))
# define UNUSED __attribute__((unused))
# define PACKED __attribute__((packed))
# define PRINTF(formatpos,argpos) __attribute__((format(printf,formatpos,argpos)))
#endif
#else
#ifndef PRINTF
# define DEPRECATED
# define SIMPLE_FUNCTION
# define UNUSED
# define PACKED
# define PRINTF(formatpos,argpos)
#endif
#endif
#define DEFAULT_MAXTHREADS 10
#ifdef __cplusplus
extern "C" {
#endif
/* Protocol categories - most l7 protocols fall into a broader category that
* describes what they are used for, e.g. P2P, Web, Mail etc.
*/
typedef enum {
LPI_CATEGORY_WEB, /* HTTP-based protocols */
LPI_CATEGORY_CHAT, /* Instant messaging and chatrooms */
LPI_CATEGORY_MAIL, /* E-mail */
LPI_CATEGORY_P2P, /* Peer-to-peer uploads and downloads */
LPI_CATEGORY_P2P_STRUCTURE, /* Maintenance of P2P networks */
LPI_CATEGORY_KEY_EXCHANGE, /* Protocols used to exchange and
manage cryptographic keys, e.g.
ISAKMP */
LPI_CATEGORY_ECOMMERCE, /* Financial transaction protocols */
LPI_CATEGORY_GAMING, /* Game protocols */
LPI_CATEGORY_ENCRYPT, /* Encrypted traffic that is not
clearly part of another category */
LPI_CATEGORY_MONITORING, /* Network measurement / monitoring */
LPI_CATEGORY_NEWS, /* Newsgroup protocols, e.g. NNTP */
LPI_CATEGORY_MALWARE, /* Viruses, trojans etc. */
LPI_CATEGORY_SECURITY, /* Antivirus and firewall updates */
LPI_CATEGORY_ANTISPAM, /* Anti-spam software update protocols
*/
LPI_CATEGORY_VOIP, /* Voice chat and Internet telephony
protocols */
LPI_CATEGORY_TUNNELLING, /* Tunnelling protocols */
LPI_CATEGORY_NAT, /* NAT traversal protocols */
LPI_CATEGORY_STREAMING, /* Streaming media protocols */
LPI_CATEGORY_SERVICES, /* Basic services, e.g. DNS, NTP */
LPI_CATEGORY_DATABASES, /* Database remote access protocols */
LPI_CATEGORY_FILES, /* Non-P2P file transfer protocols */
LPI_CATEGORY_REMOTE, /* Remote access, e.g. SSH, telnet */
LPI_CATEGORY_TELCO, /* Telco services aside from VOIP, e.g
SMS protocols */
LPI_CATEGORY_P2PTV, /* P2P TV, e.g. PPLive */
LPI_CATEGORY_RCS, /* Revision Control */
LPI_CATEGORY_LOGGING, /* Logging */
LPI_CATEGORY_PRINTING, /* Network printing */
LPI_CATEGORY_TRANSLATION, /* Language translation */
LPI_CATEGORY_CDN, /* CDN protocols, e.g. Akamai */
LPI_CATEGORY_CLOUD, /* Cloud computing/storage protocols */
LPI_CATEGORY_NOTIFICATION, /* Notification / messaging protocols */
LPI_CATEGORY_SERIALISATION, /* Transfer of programming "objects" */
LPI_CATEGORY_BROADCAST, /* Protocols usually broadcast to the
local network */
LPI_CATEGORY_LOCATION, /* Location-related services / GPS */
LPI_CATEGORY_CACHING, /* Proxy cache protocols and similar */
LPI_CATEGORY_MOBILE_APP, /* Mobile apps that don't fit any
other category */
LPI_CATEGORY_ICS, /* Industrial control system protocols */
LPI_CATEGORY_IPCAMERAS, /* IP Surveillance Camera protocols */
LPI_CATEGORY_MESSAGE_QUEUE, /* Message queuing protocols */
LPI_CATEGORY_EDUCATIONAL, /* Educational applications, e.g. virtual
classrooms */
LPI_CATEGORY_ICMP, /* ICMP */
LPI_CATEGORY_MIXED, /* Different protos in each direction */
LPI_CATEGORY_NOPAYLOAD, /* No payload observed */
LPI_CATEGORY_UNSUPPORTED, /* Transport protocol unsupported */
LPI_CATEGORY_UNKNOWN, /* Protocol could not be identified */
LPI_CATEGORY_NO_CATEGORY, /* Protocol has not been placed into a
category yet */
LPI_CATEGORY_LAST /* Must always be last */
} lpi_category_t;
typedef enum {
/* TCP Protocols */
LPI_PROTO_HTTP,
LPI_PROTO_SMTP,
LPI_PROTO_BITTORRENT,
LPI_PROTO_IRC,
LPI_PROTO_NCSOFT, /* NCSoft proprietary protocol */
LPI_PROTO_DC, /* DirectConnect */
LPI_PROTO_EMULE,
LPI_PROTO_GNUTELLA,
LPI_PROTO_SSH,
LPI_PROTO_HTTPS,
LPI_PROTO_RAZOR, /* Razor database updates */
LPI_PROTO_POP3,
LPI_PROTO_SSL, /* SSL that isn't HTTPS */
LPI_PROTO_MSN,
LPI_PROTO_DNS,
LPI_PROTO_IMAP,
LPI_PROTO_RTSP,
LPI_PROTO_ID, /* Identification protocol */
LPI_PROTO_YAHOO,
LPI_PROTO_ICQ,
LPI_PROTO_TELNET,
LPI_PROTO_RDP, /* Windows remote desktop protocol */
LPI_PROTO_TDS, /* MS SQL Server protocol */
LPI_PROTO_RPC_SCAN, /* Port 135 exploit attempt */
LPI_PROTO_SMB, /* Server Message Block protocol e.g. samba */
LPI_PROTO_WARCRAFT3,
LPI_PROTO_ETRUST, /* Updates for the eTrust virus scanner */
LPI_PROTO_FTP_CONTROL, /* FTP control e.g. port 21 or 2121 */
LPI_PROTO_FTP_DATA,
LPI_PROTO_EYE, /* Yahoo Game Server Browser */
LPI_PROTO_ARES, /* Ares peer-to-peer protocol */
LPI_PROTO_NNTP, /* Newsfeeds */
LPI_PROTO_NAPSTER,
LPI_PROTO_BNCS, /* Battle.net Chat Server */
LPI_PROTO_RFB, /* Remote Frame Buffer protocol */
LPI_PROTO_YAHOO_WEBCAM,/* Webcam over Yahoo Messenger */
LPI_PROTO_ICA, /* Citrix ICA */
LPI_PROTO_NETBIOS,
LPI_PROTO_KMS, /* Possibly a vista activation service */
LPI_PROTO_MS_DS,
LPI_PROTO_SIP, /* Session Initiation Protocol*/
LPI_PROTO_MZINGA,
LPI_PROTO_GOKUCHAT,
LPI_PROTO_XUNLEI,
LPI_PROTO_DXP,
LPI_PROTO_HAMACHI,
LPI_PROTO_BLIZZARD,
LPI_PROTO_MSNV, /* MSN Voice */
LPI_PROTO_BITEXT, /* BitTorrent extensions */
LPI_PROTO_MITGLIEDER, /* Mitglieder trojan */
LPI_PROTO_TOR, /* TOR (The Onion Router) */
LPI_PROTO_MYSQL,
LPI_PROTO_HTTP_TUNNEL, /* Tunnelling via HTTP */
LPI_PROTO_RSYNC,
LPI_PROTO_NOTES_RPC, /* Lotus Notes RPC (Domino) */
LPI_PROTO_AZUREUS, /* Azureus Extension */
LPI_PROTO_PANDO, /* Pando P2P protocol */
LPI_PROTO_FLASH, /* Flash Player specific behaviour */
LPI_PROTO_STEAM, /* Steam TCP download, i.e. downloading games */
LPI_PROTO_TRACKMANIA, /* Trackmania control protocol */
LPI_PROTO_CONQUER, /* Conquer Online game */
LPI_PROTO_RTMP, /* Adobe RTMP */
LPI_PROTO_TIP, /* Transaction Internet Protocol */
LPI_PROTO_NONSTANDARD_HTTP, /* HTTP on unconventional port numbers */
LPI_PROTO_HARVEYS, /* Photo transfers for Harveys Real Estate */
LPI_PROTO_SHOUTCAST,
LPI_PROTO_HTTP_BADPORT, /* HTTP over port 443, leading to failure */
LPI_PROTO_POSTGRESQL, /* Postgresql protocol */
LPI_PROTO_WOW, /* World of Warcraft */
LPI_PROTO_M4U, /* Message4U (Aus SMS service) */
LPI_PROTO_RBLS, /* Realtime Block List updates */
LPI_PROTO_OPENVPN,
LPI_PROTO_TELECOMKEY, /* Proto used to talk to telecomkey.com */
LPI_PROTO_IMAPS, /* IMAP over SSL */
LPI_PROTO_MSNC, /* MSN Client Protocol */
LPI_PROTO_YAHOO_ERROR, /* Yahoo method of dealing with HTTP errors */
LPI_PROTO_IMESH, /* iMesh */
LPI_PROTO_PPTP, /* MS Tunnelling protocol */
LPI_PROTO_AFP, /* Apple Filing Protocol */
LPI_PROTO_PDBOX, /* Korean P2P TV protocol */
LPI_PROTO_EA_GAMES, /* EA Games protocol */
LPI_PROTO_ZYNGA, /* Protocol used by Zynga games */
LPI_PROTO_CLUBBOX, /* Another Korean file sharing protocol */
LPI_PROTO_WINMX, /* WinMX */
LPI_PROTO_INVALID_BT, /* Bittorrent in one direction but not other */
LPI_PROTO_WEBLOGIC, /* Weblogic server */
LPI_PROTO_INVALID_HTTP, /* HTTP server sending raw HTML */
LPI_PROTO_COD_WAW, /* Call of Duty: World at War TCP */
LPI_PROTO_MP2P,
LPI_PROTO_SVN,
LPI_PROTO_SOCKS5,
LPI_PROTO_SOCKS4,
LPI_PROTO_INVALID_SMTP,
LPI_PROTO_MMS, /* Microsoft Media Server */
LPI_PROTO_CISCO_VPN, /* Cisco VPN protocol */
LPI_PROTO_WEB_JUNK, /* Clients communicating with web servers
using non-HTTP */
LPI_PROTO_CVS,
LPI_PROTO_LDAP, /* LDAP */
LPI_PROTO_INVALID_POP3, /* POP commands send to an SMTP server */
LPI_PROTO_TEAMVIEWER,
LPI_PROTO_XMPP, /* a.k.a. Jabber */
LPI_PROTO_SECONDLIFE, /* SecondLife over TCP */
LPI_PROTO_KASEYA,
LPI_PROTO_KASPERSKY,
LPI_PROTO_JEDI, /* Citrix Jedi */
LPI_PROTO_CGP, /* Citrix CGP */
LPI_PROTO_YOUKU,
LPI_PROTO_STUN,
LPI_PROTO_XYMON,
LPI_PROTO_MUNIN,
LPI_PROTO_TROJAN_WIN32_GENERIC_SB,
LPI_PROTO_PALTALK,
LPI_PROTO_ZABBIX,
LPI_PROTO_AKAMAI,
LPI_PROTO_GAMESPY,
LPI_PROTO_WUALA,
LPI_PROTO_TROJAN_ZEROACCESS,
LPI_PROTO_DVRNS,
LPI_PROTO_CHATANGO,
LPI_PROTO_OMEGLE,
LPI_PROTO_TELNET_EXPLOIT,
LPI_PROTO_POP3S, /* POP3 over TLS/SSL */
LPI_PROTO_PSN_STORE,
LPI_PROTO_SKYPE_TCP, /* Skype TCP sessions */
LPI_PROTO_APPLE_PUSH, /* Apple push notifications */
LPI_PROTO_XMPPS, /* XMPP over TLS/SSL */
LPI_PROTO_SMTPS, /* Legacy Secure SMTP */
LPI_PROTO_NNTPS, /* NNTP over TLS/SSL */
LPI_PROTO_JAVA, /* Serialised Java Objects */
LPI_PROTO_IPOP, /* IP over P2P */
LPI_PROTO_SPOTIFY,
LPI_PROTO_RUNESCAPE,
LPI_PROTO_WHOIS,
LPI_PROTO_VIBER,
LPI_PROTO_FRING,
LPI_PROTO_PALRINGO,
LPI_PROTO_CRYPTIC, /* Games by Cryptic */
LPI_PROTO_SUPL,
LPI_PROTO_MINECRAFT,
LPI_PROTO_TPKT,
LPI_PROTO_QVOD,
LPI_PROTO_KIK,
LPI_PROTO_WHATSAPP,
LPI_PROTO_WECHAT,
LPI_PROTO_FUNSHION,
LPI_PROTO_BTSYNC,
LPI_PROTO_SPEEDTEST,
LPI_PROTO_GIT,
LPI_PROTO_DUELING_NETWORK,
LPI_PROTO_LINE,
LPI_PROTO_AMP,
LPI_PROTO_SPDY,
LPI_PROTO_YAHOO_GAMES,
LPI_PROTO_DELL_BACKUP,
LPI_PROTO_REVOLVER_NBLBT,
LPI_PROTO_CRASHPLAN,
LPI_PROTO_CLASH_OF_CLANS,
LPI_PROTO_TRION,
LPI_PROTO_MONGO,
LPI_PROTO_LLP2P,
LPI_PROTO_HEARTHSTONE,
LPI_PROTO_DIABLO3,
LPI_PROTO_CACAOWEB,
LPI_PROTO_TAOBAO, /* Custom protocol seen on Taobao CDN */
LPI_PROTO_TERA,
LPI_PROTO_SILKROADONLINE, /* Korean MMO */
LPI_PROTO_GOOGLE_HANGOUTS,
LPI_PROTO_HOLA,
LPI_PROTO_GUILDWARS2,
LPI_PROTO_QQ,
LPI_PROTO_TETRISONLINE,
LPI_PROTO_TWITCH_IRC, /* IRC specific to twitch.tv */
LPI_PROTO_QQLIVE,
LPI_PROTO_TENCENT_GAMES, /* Games operated by Tencent */
LPI_PROTO_VODLOCKER,
LPI_PROTO_TELEGRAM,
LPI_PROTO_XUNLEI_ACCEL,
LPI_PROTO_360SAFEGUARD, /* Chinese anti-virus */
LPI_PROTO_NORTON_BACKUP,
LPI_PROTO_BADBAIDU, /* Weird 1 byte flows from Baidu browser */
LPI_PROTO_KAKAO,
LPI_PROTO_WEIBO,
LPI_PROTO_TENSAFE,
LPI_PROTO_KANKAN,
LPI_PROTO_AIRDROID,
LPI_PROTO_KUAIBO,
LPI_PROTO_DIANPING,
LPI_PROTO_XIAMI,
LPI_PROTO_QQDOWNLOAD,
LPI_PROTO_ZERO_FACEBOOK,
LPI_PROTO_FINALFANTASY_XIV,
LPI_PROTO_FACEBOOK_MESSENGER,
LPI_PROTO_YY,
LPI_PROTO_NETCAT_CCTV,
LPI_PROTO_ZOOM,
LPI_PROTO_S7COMM,
LPI_PROTO_MAXICLOUD,
LPI_PROTO_GLUPTEBA,
LPI_PROTO_WNS,
LPI_PROTO_PANDATV,
LPI_PROTO_FACEBOOK_TURN,
LPI_PROTO_DESTINY,
LPI_PROTO_QCLOUD_ILVB,
LPI_PROTO_BITCOIN,
LPI_PROTO_LIFEFORGE,
LPI_PROTO_ACESTREAM,
LPI_PROTO_MAPLESTORY_CHINA,
LPI_PROTO_NDT_TPUT,
LPI_PROTO_RELAY,
LPI_PROTO_DOUYU,
LPI_PROTO_IDRIVE_SYNC,
LPI_PROTO_TWITCASTING,
LPI_PROTO_THE_DIVISION,
LPI_PROTO_BLACKDESERT,
LPI_PROTO_REALVNC,
LPI_PROTO_DOGECOIN,
LPI_PROTO_FUCKCOIN,
LPI_PROTO_OURWORLD,
LPI_PROTO_GRAAL_ONLINE_ERA,
LPI_PROTO_APPEAR_IN,
LPI_PROTO_VAINGLORY,
LPI_PROTO_WEIQI,
LPI_PROTO_4D,
LPI_PROTO_TANKIX,
LPI_PROTO_IPSHARKK,
LPI_PROTO_NET_MFP,
LPI_PROTO_SPEEDIN,
LPI_PROTO_CROSSFIRE,
LPI_PROTO_DASH,
LPI_PROTO_AIRMEDIA,
LPI_PROTO_GIOP,
LPI_PROTO_VPN_UNLIMITED,
LPI_PROTO_TENFIVECOIN,
LPI_PROTO_BAOFENG,
LPI_PROTO_TALESRUNNER,
LPI_PROTO_ANTCOIN,
LPI_PROTO_FBCDN_SSL,
LPI_PROTO_SAPROUTER,
LPI_PROTO_FLIGGY,
LPI_PROTO_SMITE,
LPI_PROTO_VPNROBOT,
LPI_PROTO_VMWARE,
LPI_PROTO_DOUYU_CHAT,
LPI_PROTO_JX3ONLINE,
LPI_PROTO_LITECOIN,
LPI_PROTO_STRATUM,
LPI_PROTO_WIZARD101,
LPI_PROTO_KINGOFGLORY,
LPI_PROTO_SAS_ZOMBIE_ASSAULT_4,
LPI_PROTO_DNF,
LPI_PROTO_IHEXIN,
LPI_PROTO_NAVER_P2P,
LPI_PROTO_GCAFE_UPDATER,
LPI_PROTO_BWSYNC,
LPI_PROTO_TANKIONLINE,
LPI_PROTO_REALMOFTHEMADGOD,
LPI_PROTO_PATHOFEXILE,
LPI_PROTO_SSJJ,
LPI_PROTO_SPEEDIFY,
LPI_PROTO_NSQ,
LPI_PROTO_SKYFORGE,
LPI_PROTO_HOTS,
LPI_PROTO_NOMACHINE,
LPI_PROTO_QQSPEEDMOBILE,
LPI_PROTO_DAHUA,
LPI_PROTO_UTHERVERSE,
LPI_PROTO_300_HEROES,
LPI_PROTO_FILENORI,
LPI_PROTO_IPFS,
LPI_PROTO_REMOTE_MANIPULATOR,
LPI_PROTO_WEBEX_STUN,
LPI_PROTO_RRTV,
LPI_PROTO_RABBITMQ,
LPI_PROTO_ICEP,
LPI_PROTO_BEAM,
LPI_PROTO_VHDP2P,
LPI_PROTO_CLASSIN,
LPI_PROTO_TRANSOCKS,
LPI_PROTO_RAGNAROK_ONLINE,
LPI_PROTO_ETHERNETIP,
/* UDP Protocols */
LPI_PROTO_UDP,
LPI_PROTO_UDP_SIP,
LPI_PROTO_UDP_BTDHT,
LPI_PROTO_UDP_GNUTELLA,
LPI_PROTO_UDP_DNS,
LPI_PROTO_UDP_DHCP,
LPI_PROTO_UDP_QUAKE,
LPI_PROTO_UDP_STEAM,
LPI_PROTO_UDP_STEAM_FRIENDS,
LPI_PROTO_UDP_STEAM_INHOMEBROADCAST,
LPI_PROTO_UDP_WIN_MESSAGE,
LPI_PROTO_UDP_GAMESPY,
LPI_PROTO_UDP_EMULE,
LPI_PROTO_UDP_EYE,
LPI_PROTO_UDP_RTP,
LPI_PROTO_UDP_ETHERNETIP,
LPI_PROTO_UDP_CIP_IO, /* Common industrial protocol IO */
LPI_PROTO_UDP_MSN_VIDEO,
LPI_PROTO_UDP_COD, /* Call of Duty game protocol */
LPI_PROTO_UDP_NTP,
LPI_PROTO_UDP_MP2P, /* MP2P protocol (Piolet, Manolito etc.) */
LPI_PROTO_UDP_SPAMFIGHTER, /* SpamFighter */
LPI_PROTO_UDP_TRACEROUTE,
LPI_PROTO_UDP_SECONDLIFE,
LPI_PROTO_UDP_HL, /* Halflife, includes derivatives such as
* CounterStrike and Garry's Mod */
LPI_PROTO_UDP_XLSP, /* XLSP - Xbox Live */
LPI_PROTO_UDP_DEMONWARE, /* Company that does game networking */
LPI_PROTO_UDP_IMESH, /* iMesh */
LPI_PROTO_UDP_OPASERV, /* Opaserv worm */
LPI_PROTO_UDP_STUN, /* STUN NAT traversal */
LPI_PROTO_UDP_SQLEXP, /* MS SQL Server worm, called SQLExp */
LPI_PROTO_UDP_MSN_CACHE, /* MSN cache callback protocol */
LPI_PROTO_UDP_DIABLO2, /* Diablo 2 game protocol */
LPI_PROTO_UDP_IPV6, /* IPv6 tunnelled directly over UDP */
LPI_PROTO_UDP_ORBIT, /* Orbit downloader */
LPI_PROTO_UDP_TEREDO,
LPI_PROTO_UDP_KADEMLIA, /* Unknown flavour of kademlia */
LPI_PROTO_UDP_PANDO, /* Pando DHT and Peer Exchange */
LPI_PROTO_UDP_ESP, /* ESP/IPSec encapsulated in UDP */
LPI_PROTO_UDP_PSN, /* Playstation Network */
LPI_PROTO_UDP_REAL, /* RDT - the Real Data Transport protocol */
LPI_PROTO_UDP_GNUTELLA2, /* Gnutella2 */
LPI_PROTO_UDP_PYZOR, /* Python implementation of Razor */
LPI_PROTO_UDP_SKYPE,
LPI_PROTO_UDP_ISAKMP, /* ref: RFC 2408 */
LPI_PROTO_UDP_SNMP,
LPI_PROTO_UDP_BACKWEB, /* BackWeb Polite Protocol */
LPI_PROTO_UDP_STARCRAFT,
LPI_PROTO_UDP_XFIRE_P2P, /* Xfire P2P protocol */
LPI_PROTO_UDP_THQ, /* Protocol used by THQ games */
LPI_PROTO_UDP_NEWERTH, /* Heroes of Newerth */
LPI_PROTO_UDP_LINKPROOF, /* Linkproof device packets */
LPI_PROTO_UDP_WORM_22105, /* Chinese worm that uses port 22105 */
LPI_PROTO_UDP_QQ, /* Tencent QQ */
LPI_PROTO_UDP_SLP, /* Service Location Protocol, RFC 2608 */
LPI_PROTO_UDP_ESO, /* Games using Ensemble Studios Online */
LPI_PROTO_UDP_SSDP,
LPI_PROTO_UDP_NETBIOS, /* Netbios lookup */
LPI_PROTO_UDP_CP_RDP, /* Checkpoint RDP */
LPI_PROTO_UDP_VENTRILO, /* Ventrilo VoiceChat */
LPI_PROTO_UDP_MTA, /* Multitheftauto */
LPI_PROTO_UDP_PPLIVE,
LPI_PROTO_UDP_JEDI_ACADEMY, /* Jedi Academy game */
LPI_PROTO_UDP_MOH, /* Medal of Honor game */
LPI_PROTO_UDP_TREMULOUS, /* Tremulous - free OSS FPS */
LPI_PROTO_UDP_VIVOX, /* Vivox voice chat */
LPI_PROTO_UDP_IPMSG, /* IPMsg messenger */
LPI_PROTO_UDP_TEAMSPEAK,
LPI_PROTO_UDP_DC, /* DirectConnect UDP commands */
LPI_PROTO_UDP_FREECHAL, /* FreeChal P2P */
LPI_PROTO_UDP_XUNLEI,
LPI_PROTO_UDP_KAZAA,
LPI_PROTO_UDP_NORTON, /* Norton Antivirus probe */
LPI_PROTO_UDP_CISCO_VPN, /* Cisco VPN (port 10000) */
LPI_PROTO_UDP_RTCP,
LPI_PROTO_UDP_UNREAL, /* Unreal server query protocol */
LPI_PROTO_UDP_TFTP,
LPI_PROTO_UDP_GARENA, /* A gaming platform */
LPI_PROTO_UDP_PPSTREAM, /* PPStream - Chinese P2PTV */
LPI_PROTO_UDP_FORTINET, /* Fortinet update protocol */
LPI_PROTO_UDP_TVANTS, /* TVants P2PTV - no longer active */
LPI_PROTO_UDP_STORM_WORM,
LPI_PROTO_UDP_BATTLEFIELD, /* Battlefield series of games */
LPI_PROTO_UDP_SOPCAST,
LPI_PROTO_UDP_SERIALNUMBERD,
LPI_PROTO_UDP_LDAP_AD,
LPI_PROTO_UDP_RTMFP,
LPI_PROTO_UDP_L2TP,
LPI_PROTO_UDP_SYSLOG,
LPI_PROTO_UDP_AKAMAI,
LPI_PROTO_UDP_RADIUS,
LPI_PROTO_UDP_HAMACHI,
LPI_PROTO_UDP_BJNP, /* Canon BJNP printing protocol */
LPI_PROTO_UDP_KASPERSKY,
LPI_PROTO_UDP_GSM,
LPI_PROTO_UDP_JEDI, /* Citrix Jedi */
LPI_PROTO_UDP_YOUKU,
LPI_PROTO_UDP_YOUDAO_DICT,
LPI_PROTO_UDP_DRIVESHARE,
LPI_PROTO_UDP_CIRN, /* Carpathia Intelligent Routing Network */
LPI_PROTO_UDP_NEVERWINTER,
LPI_PROTO_UDP_QQLIVE,
LPI_PROTO_UDP_TEAMVIEWER,
LPI_PROTO_UDP_ARES,
LPI_PROTO_UDP_EPSON,
LPI_PROTO_UDP_AKAMAI_TRANSFER,
LPI_PROTO_UDP_DCC,
LPI_PROTO_UDP_AMANDA,
LPI_PROTO_UDP_NETFLOW,
LPI_PROTO_UDP_ZEROACCESS,
LPI_PROTO_UDP_VXWORKS_EXPLOIT,
LPI_PROTO_UDP_APPLE_FACETIME_INIT,
LPI_PROTO_UDP_STEAM_LOCALBROADCAST,
/* ^Protocol used by Steam to discover clients on the local network */
LPI_PROTO_UDP_LANSYNC, /* LANSync, used by DropBox */
LPI_PROTO_UDP_BTSYNC,
LPI_PROTO_UDP_MSOFFICE_MAC, /* MS Office for Mac anti-piracy */
LPI_PROTO_UDP_SPOTIFY_BROADCAST,
LPI_PROTO_UDP_MDNS, /* Multicast DNS */
LPI_PROTO_UDP_FASP,
LPI_PROTO_UDP_RAKNET,
LPI_PROTO_UDP_OPENVPN,
LPI_PROTO_UDP_NOE, /* Alcatel's New Office Environment */
LPI_PROTO_UDP_VIBER,
LPI_PROTO_UDP_DTLS,
LPI_PROTO_UDP_ICP,
LPI_PROTO_UDP_LOL, /* League of Legends */
LPI_PROTO_UDP_SANANDREAS, /* San Andreas Multiplayer */
LPI_PROTO_UDP_MFNP, /* Canon MFNP Printer protocol */
LPI_PROTO_UDP_FUNSHION,
LPI_PROTO_UDP_QUIC,
LPI_PROTO_UDP_AVAST_DNS,
LPI_PROTO_UDP_DB2,
LPI_PROTO_UDP_NATPMP,
LPI_PROTO_UDP_GPRS_TUNNEL,
LPI_PROTO_UDP_WECHAT,
LPI_PROTO_UDP_NOCTION,
LPI_PROTO_UDP_ARMA_SERVER, /* Includes DayZ */
LPI_PROTO_UDP_PLANETSIDE2,
LPI_PROTO_UDP_RWTH_AACHEN, /* RWTH-Aachen University research */
LPI_PROTO_UDP_BMDP, /* Part of Microsoft ADS */
LPI_PROTO_UDP_DOTA2,
LPI_PROTO_UDP_LINE,
LPI_PROTO_UDP_ZOOM,
LPI_PROTO_UDP_HEROES_GENERALS, /* Heroes and Generals */
LPI_PROTO_UDP_WARTHUNDER,
LPI_PROTO_UDP_H1Z1,
LPI_PROTO_UDP_CS_GLOBAL_OFFENSIVE,
LPI_PROTO_UDP_NTP_REFLECT, /* NTP reflection attack */
LPI_PROTO_UDP_PUNKBUSTER,
LPI_PROTO_UDP_ROBOCRAFT,
LPI_PROTO_UDP_CISCO_SSLVPN,
LPI_PROTO_UDP_ACERCLOUD,
LPI_PROTO_UDP_360CN,
LPI_PROTO_UDP_WOLF_ET,
LPI_PROTO_UDP_KUGOU,
LPI_PROTO_UDP_XUNLEI_JSQ,
LPI_PROTO_UDP_KANKAN,
LPI_PROTO_UDP_QQPCMGR,
LPI_PROTO_UDP_DIANPING,
LPI_PROTO_UDP_XUNYOU,
LPI_PROTO_UDP_FORTICLIENT_SSLVPN,
LPI_PROTO_UDP_DISCORD,
LPI_PROTO_UDP_NETCORE,
LPI_PROTO_UDP_ARMA3_SERVER,
LPI_PROTO_UDP_BAIDU_YUN_P2P,
LPI_PROTO_UDP_YY,
LPI_PROTO_UDP_OVERWATCH,
LPI_PROTO_UDP_BACNET,
LPI_PROTO_UDP_ARK_SURVIVAL,
LPI_PROTO_UDP_360P2P,
LPI_PROTO_UDP_PORTMAP_RPC,
LPI_PROTO_UDP_NINTENDO,
LPI_PROTO_UDP_CHIVALRY,
LPI_PROTO_UDP_DOYO,
LPI_PROTO_UDP_NETCAT_CCTV,
LPI_PROTO_UDP_N2PING,
LPI_PROTO_UDP_RAMSEY_DASH,
LPI_PROTO_UDP_UBISOFT_GAMES,
LPI_PROTO_UDP_THE_CREW,
LPI_PROTO_UDP_TURBOVPN,
LPI_PROTO_UDP_GEARSOFWAR,
LPI_PROTO_UDP_RDP,
LPI_PROTO_UDP_HOTS,
LPI_PROTO_UDP_VPNMASTER,
LPI_PROTO_UDP_DIANSHIJIA,
LPI_PROTO_UDP_PS4_REMOTEPLAY,
LPI_PROTO_UDP_STARCITIZEN,
LPI_PROTO_UDP_WEBEX,
LPI_PROTO_UDP_HALO_ONLINE,
LPI_PROTO_UDP_GOTOMEETING,
LPI_PROTO_UDP_CROSSOUT,
LPI_PROTO_UDP_UMEYE,
LPI_PROTO_UDP_RISING_STORM,
LPI_PROTO_UDP_CROSSFIRE,
LPI_PROTO_UDP_MERAKICLOUD,
LPI_PROTO_UDP_SNAPVPN,
LPI_PROTO_UDP_DAHUA,
LPI_PROTO_UDP_STARLEAF,
LPI_PROTO_UDP_FOSCAM,
LPI_PROTO_UDP_DESTINY,
LPI_PROTO_UDP_BAOFENG,
LPI_PROTO_UDP_TORCHLIGHT2,
LPI_PROTO_UDP_SMITE,
LPI_PROTO_UDP_COUNTERSTRIKE_16,
LPI_PROTO_UDP_VPNROBOT,
LPI_PROTO_UDP_TF2,
LPI_PROTO_UDP_GANGSOFSPACE,
LPI_PROTO_UDP_COMBATARMS,
LPI_PROTO_UDP_COMBATARMS_P2P,
LPI_PROTO_UDP_PANIPANI,
LPI_PROTO_UDP_FEITWO,
LPI_PROTO_UDP_MOONHUNTERS,
LPI_PROTO_UDP_HELIBORNE,
LPI_PROTO_UDP_KINGOFGLORY,
LPI_PROTO_UDP_ASSETTO_CORSA,
LPI_PROTO_UDP_CACAOWEB,
LPI_PROTO_UDP_ZALO_CALL,
LPI_PROTO_UDP_PALADINS,
LPI_PROTO_UDP_CHARGEN_EXPLOIT,
LPI_PROTO_UDP_TOX,
LPI_PROTO_UDP_HOLLA,
LPI_PROTO_UDP_RRSHARE,
LPI_PROTO_UDP_QQSPEEDMOBILE,
LPI_PROTO_UDP_LOADOUT,
LPI_PROTO_UDP_GANGLIA,
LPI_PROTO_UDP_TALESRUNNER,
LPI_PROTO_UDP_FREEFIRE,
LPI_PROTO_UDP_HEROES_EVOLVED,
LPI_PROTO_UDP_RULES_OF_SURVIVAL,
LPI_PROTO_UDP_CONTRACT_WARS,
LPI_PROTO_UDP_ARD,
LPI_PROTO_UDP_QVOD,
LPI_PROTO_UDP_YUANFUDAO,
LPI_PROTO_UDP_ROCKET_LEAGUE,
LPI_PROTO_UDP_CLOUDFLARE_WARP,
LPI_PROTO_UDP_WIREGUARD,
LPI_PROTO_UDP_COD_MOBILE,
LPI_PROTO_UDP_NVIDIA_GAMESTREAM,
LPI_PROTO_UDP_CLASSIN,
LPI_PROTO_UDP_ARTCP,
/* Patterns that we can match, but do not know the protocol */
LPI_PROTO_REJECTION, /* All responses are 0x02 */
LPI_PROTO_MYSTERY_9000, /* Occurs on tcp port 9000 */
LPI_PROTO_MYSTERY_PSPR,
LPI_PROTO_MYSTERY_8000,
LPI_PROTO_MYSTERY_IG,
LPI_PROTO_MYSTERY_CONN,
LPI_PROTO_MYSTERY_SYMANTEC,
LPI_PROTO_MYSTERY_RXXF,
LPI_PROTO_UDP_MYSTERY_0D,
LPI_PROTO_UDP_MYSTERY_99,
LPI_PROTO_UDP_MYSTERY_8000,
LPI_PROTO_UDP_MYSTERY_45,
LPI_PROTO_UDP_MYSTERY_0660,
LPI_PROTO_UDP_MYSTERY_E9,
LPI_PROTO_UDP_MYSTERY_QQ,
LPI_PROTO_UDP_MYSTERY_61_72,
LPI_PROTO_UDP_MYSTERY_05,
LPI_PROTO_ICMP,
LPI_PROTO_INVALID, /* No single valid protocol */
LPI_PROTO_NO_PAYLOAD,
LPI_PROTO_NO_FIRSTPKT,
LPI_PROTO_UNSUPPORTED,
LPI_PROTO_UNKNOWN,
LPI_PROTO_LAST /** ALWAYS have this as the last value */
} lpi_protocol_t;
/* This structure stores all the data needed by libprotoident to identify the
* application protocol for a flow. Do not change the contents of this struct
* directly - lpi_update_data() will do that for you - but reading the values
* should be ok. */
typedef struct lpi {
uint32_t payload[2];
bool seen_syn[2];
uint32_t seqno[2];
uint32_t observed[2];
uint16_t server_port;
uint16_t client_port;
uint8_t trans_proto;
uint32_t payload_len[2];
uint32_t ips[2];
} lpi_data_t;
typedef struct lpi_module lpi_module_t;
/* This structure describes an individual LPI module - i.e. a protocol
* supported by libprotoident */
struct lpi_module {
lpi_protocol_t protocol; /* The protocol ID */
lpi_category_t category; /* The category for this protocol */
const char *name; /* The protocol name, as a string */
uint8_t priority; /* The relative priority for matching
this protocol */
/* The callback function for testing whether a given set of LPI
* data matches the ruleset for this protocol */
bool (*lpi_callback) (lpi_data_t *proto_d, lpi_module_t *module);
};
typedef std::list ProtoMatchList;
typedef struct lpi_thread {
int index;
lpi_module_t *module;
lpi_data_t *data;
bool result;
} lpi_thread_t;
typedef std::list ThreadList;
/* Initialises the LPI library, by registering all the protocol modules.
*
* @return 0 if initialisation succeeded, -1 otherwise
*/
int lpi_init_library(void);
/* Shuts down the LPI library, by de-registering all the protocol modules */
void lpi_free_library(void);
/** Initialises an LPI data structure, setting all the members to appropriate
* starting values.
*
* @param data The LPI data structure to be initialised.
*/
void lpi_init_data(lpi_data_t *data);
/** Updates the LPI data structure based on the contents of the packet
* provided.
*
* @note The direction must be provided by the caller, as we cannot rely
* on trace_get_direction().
*
* @param packet The packet to update the LPI data from.
* @param data The LPI data structure to be updated.
* @param dir The direction of the packet - 0 is outgoing, 1 is incoming.
*
* @return 0 if the packet was ignored, 1 if the LPI data was updated.
*/
int lpi_update_data(libtrace_packet_t *packet, lpi_data_t *data, uint8_t dir);
/** Returns a unique string describing the provided protocol.
*
* This is essentially a protocol-to-string conversion function.
*
* @param proto The protocol that a string representation is required for.
*
* @return A pointer to a statically allocated string describing the protocol.
* This is allocated on the stack, so should be used or copied immediately.
*/
const char *lpi_print(lpi_protocol_t proto);
/** Given a protocol, returns the category that it matches.
*
* @param proto The protocol that a category is required for.
*
* @return The category that the protocol belongs to.
*/
lpi_category_t lpi_categorise(lpi_module_t *proto);
/** Returns a unique string describing the provided category.
*
* This is essentially a category-to-string conversion function.
*
* @param category The category that a string representation is required for.
*
* @return A pointer to a statically allocated string describing the category.
* This is allocated on the stack, so should be used or copied immediately.
*/
const char *lpi_print_category(lpi_category_t category);
/** Using the provided data, attempts to determine the L7 protocol being used
* by that flow.
*
* @param data The LPI data to use when determining the protocol.
*
* @return The LPI module for the protocol that matches the profile described
* by the given LPI data. If no protocol matches, the module for either
* LPI_UNKNOWN or LPI_UNKNOWN_UDP will be returned, depending on the transport
* protocol.
*/
lpi_module_t *lpi_guess_protocol(lpi_data_t *data);
/** Given the protocol name, returns the lpi protcol it matches.
*
* @param name The protocol name
*
* @returns The LPI protocol for the supplied name.
* LPI_PROTO_UNKNOWN if the name is not found.
*/
lpi_protocol_t lpi_get_protocol_by_name(char *name);
/* Give the category name, returns the lpi category it matches.
*
* @param name The protocol name
*
* @returns the LPI category for the supplied name on success.
* LPI_CATEGORY_UNKNOWN if the name is not found.
*/
lpi_category_t lpi_get_category_by_name(char *name);
/* Given the lpi protocol, returns the lpi category it matches.
*
* @param protocol The lpi protocol
*
* @returns the lpi category for the supplied lpi protocol.
* LPI_CATEGORY_UNKNOWN if the category is not found.
*/
lpi_category_t lpi_get_category_by_protocol(lpi_protocol_t protocol);
/** Determines whether the protocol matching a given protocol number is no
* longer supported by libprotoident.
*
* @param proto The protocol to check
*
* @return true if the protocol is no longer supported, false otherwise.
*
* Some protocols are no longer supported by libprotoident, either because
* the rules were found to be producing too many false positives or the
* protocol has been merged with another existing protocol (especially in the
* case of mystery protocols). When these cases occur, we don't necessarily
* remove the protocol from the enumerated type list, just disable the module
* and set the name string for the protocol to "NULL".
*
* This function allows the caller to check if a given protocol value has
* been disabled. This is often handy when reporting stats for all the
* protocol values (see lpi_live for an example), as ideally you would want
* to avoid reporting anything for the NULL protocols.
*/
bool lpi_is_protocol_inactive(lpi_protocol_t proto);
#ifdef __cplusplus
}
#endif
#endif
================================================
FILE: lib/proto_common.cc
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#include
#ifdef __APPLE__
#include
#define bswap32 OSSwapInt32
#endif
#ifdef __FreeBSD__
#include
#endif
#ifdef __linux__
#include
#define bswap32 __bswap_32
#endif
#include "libprotoident.h"
#include "proto_common.h"
bool match_str_either(lpi_data_t *data, const char *string) {
if (MATCHSTR(data->payload[0], string))
return true;
if (MATCHSTR(data->payload[1], string))
return true;
return false;
}
bool match_str_both(lpi_data_t *data, const char *string1,
const char *string2) {
if (MATCHSTR(data->payload[0], string1) &&
MATCHSTR(data->payload[1], string2))
return true;
if (MATCHSTR(data->payload[1], string1) &&
MATCHSTR(data->payload[0], string2))
return true;
return false;
}
bool match_chars_either(lpi_data_t *data, char a, char b, char c,
char d) {
if (MATCH(data->payload[0], a, b, c, d))
return true;
if (MATCH(data->payload[1], a, b, c, d))
return true;
return false;
}
bool match_payload_length(uint32_t payload, uint32_t payload_len) {
uint32_t header = 0;
header = ntohl(payload);
/* See if the length in the (presumed) header matches the
* length of the rest of the packet minus the header itself (4 bytes).
*
* Watch out for the case of a 4 byte packet containing just
* 00 00 00 00! */
if (payload_len > 4 && header == payload_len - 4)
return true;
return false;
}
bool match_ip_address_both(lpi_data_t *data) {
uint8_t matches = 0;
if (data->ips[0] == 0 || data->ips[0] == 0)
return false;
if (data->payload_len[0] == 0)
matches += 1;
else if (data->payload[0] == data->ips[0])
matches += 1;
else if (data->payload[0] == data->ips[1])
matches += 1;
if (data->payload_len[1] == 0)
matches += 1;
else if (data->payload[1] == data->ips[0])
matches += 1;
else if (data->payload[1] == data->ips[1])
matches += 1;
if (matches == 2)
return true;
else
return false;
}
/* Multiple protocols use HTTP-style requests */
bool match_http_request(uint32_t payload, uint32_t len) {
/* HTTP requests - some of these are MS-specific extensions */
if (len == 0)
return true;
if (MATCHSTR(payload, "GET ")) return true;
if (len == 1 && MATCH(payload, 'G', 0x00, 0x00, 0x00))
return true;
if (len == 2 && MATCH(payload, 'G', 'E', 0x00, 0x00))
return true;
if (len == 3 && MATCH(payload, 'G', 'E', 'T', 0x00))
return true;
if (MATCHSTR(payload, "POST")) return true;
if (MATCHSTR(payload, "HEAD")) return true;
if (MATCHSTR(payload, "PUT ")) return true;
if (MATCHSTR(payload, "DELE")) return true;
if (MATCHSTR(payload, "auth")) return true;
/* SVN? */
if (MATCHSTR(payload, "REPO")) return true;
/* Webdav */
if (MATCHSTR(payload, "LOCK")) return true;
if (MATCHSTR(payload, "UNLO")) return true;
if (MATCHSTR(payload, "OPTI")) return true;
if (MATCHSTR(payload, "PROP")) return true;
if (MATCHSTR(payload, "MKCO")) return true;
if (MATCHSTR(payload, "POLL")) return true;
if (MATCHSTR(payload, "SEAR")) return true;
/* Ntrip - some differential GPS system using modified HTTP */
if (MATCHSTR(payload, "SOUR")) return true;
return false;
}
/* File headers are not specific to any particular protocol */
bool match_file_header(uint32_t payload) {
/* RIFF is a meta-format for storing AVI and WAV files */
if (MATCHSTR(payload, "RIFF"))
return true;
/* MZ is a .exe file */
if (MATCH(payload, 'M', 'Z', ANY, 0x00))
return true;
/* Ogg files */
if (MATCHSTR(payload, "OggS"))
return true;
/* ZIP files */
if (MATCH(payload, 'P', 'K', 0x03, 0x04))
return true;
/* MPEG files */
if (MATCH(payload, 0x00, 0x00, 0x01, 0xba))
return true;
/* RAR files */
if (MATCHSTR(payload, "Rar!"))
return true;
/* EBML */
if (MATCH(payload, 0x1a, 0x45, 0xdf, 0xa3))
return true;
/* JPG */
if (MATCH(payload, 0xff, 0xd8, ANY, ANY))
return true;
/* GIF */
if (MATCHSTR(payload, "GIF8"))
return true;
/* I'm also going to include PHP scripts in here */
if (MATCH(payload, 0x3c, 0x3f, 0x70, 0x68))
return true;
/* Unix scripts */
if (MATCH(payload, 0x23, 0x21, 0x2f, 0x62))
return true;
/* PDFs */
if (MATCHSTR(payload, "%PDF"))
return true;
/* PNG */
if (MATCH(payload, 0x89, 'P', 'N', 'G'))
return true;
/* HTML */
if (MATCHSTR(payload, "server_port == 80 || data->client_port == 80)
return true;
if (data->server_port == 8080 || data->client_port == 8080)
return true;
if (data->server_port == 8081 || data->client_port == 8081)
return true;
/* If port 443 responds, we want it to be counted as genuine
* HTTP, rather than a bad port scenario */
if (data->server_port == 443 || data->client_port == 443) {
if (data->payload_len[0] > 0 && data->payload_len[1] > 0)
return true;
}
return false;
}
/* 16 03 00 X is an SSLv3 handshake */
static inline bool match_ssl3_handshake(uint32_t payload, uint32_t len) {
if (len == 0)
return true;
if (len == 1 && MATCH(payload, 0x16, 0x00, 0x00, 0x00))
return true;
if (MATCH(payload, 0x16, 0x03, 0x00, ANY))
return true;
return false;
}
/* 16 03 01 X is an TLS handshake */
static inline bool match_tls_handshake(uint32_t payload, uint32_t len) {
if (len == 0)
return true;
if (len == 1 && MATCH(payload, 0x16, 0x00, 0x00, 0x00))
return true;
if (MATCH(payload, 0x16, 0x03, 0x01, ANY))
return true;
if (MATCH(payload, 0x16, 0x03, 0x02, ANY))
return true;
if (MATCH(payload, 0x16, 0x03, 0x03, ANY))
return true;
return false;
}
/* SSLv2 handshake - the ANY byte in the 0x80 payload is actually the length
* of the payload - 2.
*
* XXX This isn't always true - consecutive packets may be merged it seems :(
*/
static inline bool match_ssl2_handshake(uint32_t payload, uint32_t len) {
if (MATCH(payload, 0x80, ANY, 0x01, 0x03))
return true;
if (MATCH(payload, 0x81, ANY, 0x01, 0x03))
return true;
return false;
}
static inline bool match_tls_alert(uint32_t payload, uint32_t len) {
if (MATCH(payload, 0x15, 0x03, 0x01, ANY))
return true;
if (MATCH(payload, 0x15, 0x03, 0x02, ANY))
return true;
if (MATCH(payload, 0x15, 0x03, 0x03, ANY))
return true;
/* Alerts are also possible under SSL 3.0 */
if (MATCH(payload, 0x15, 0x03, 0x00, ANY))
return true;
return false;
}
static inline bool match_tls_change(uint32_t payload, uint32_t len) {
if (MATCH(payload, 0x14, 0x03, 0x01, ANY))
return true;
if (MATCH(payload, 0x14, 0x03, 0x02, ANY))
return true;
if (MATCH(payload, 0x14, 0x03, 0x03, ANY))
return true;
return false;
}
static inline bool match_tls_content(uint32_t payload, uint32_t len) {
if (MATCH(payload, 0x17, 0x03, 0x01, ANY))
return true;
if (MATCH(payload, 0x17, 0x03, 0x02, ANY))
return true;
if (MATCH(payload, 0x17, 0x03, 0x03, ANY))
return true;
return false;
}
bool match_ssl(lpi_data_t *data) {
if (match_ssl3_handshake(data->payload[0], data->payload_len[0]) &&
match_ssl3_handshake(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_handshake(data->payload[1], data->payload_len[1]))
return true;
if (match_ssl3_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_handshake(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
match_ssl3_handshake(data->payload[1], data->payload_len[1]))
return true;
/* Seems we can sometimes skip the full handshake and start on the data
* right away (as indicated by 0x17) - for now, I've only done this for TLS */
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_content(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_handshake(data->payload[1], data->payload_len[1]) &&
match_tls_content(data->payload[0], data->payload_len[0]))
return true;
/* Need to check for TLS alerts (errors) too */
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_alert(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_handshake(data->payload[1], data->payload_len[1]) &&
match_tls_alert(data->payload[0], data->payload_len[0]))
return true;
if (match_ssl3_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_alert(data->payload[1], data->payload_len[1]))
return true;
if (match_ssl3_handshake(data->payload[1], data->payload_len[1]) &&
match_tls_alert(data->payload[0], data->payload_len[0]))
return true;
/* Need to check for cipher changes too */
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
match_tls_change(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_handshake(data->payload[1], data->payload_len[1]) &&
match_tls_change(data->payload[0], data->payload_len[0]))
return true;
/* Some HTTPS servers respond with unencrypted content, presumably
* when somebody invalid attempts a connection */
if (match_tls_handshake(data->payload[0], data->payload_len[0]) &&
MATCHSTR(data->payload[1], "payload_len[0] != 0)
return true;
if (match_tls_handshake(data->payload[1], data->payload_len[1]) &&
MATCHSTR(data->payload[0], "payload_len[1] != 0)
return true;
/* Allow TLS content in both directions -- could be multi-path TCP?
* Or some form of picking up where a previous connection left off?
*/
if (match_tls_content(data->payload[0], data->payload_len[0]) &&
match_tls_content(data->payload[1], data->payload_len[1]))
return true;
if (match_tls_content(data->payload[1], data->payload_len[1]) &&
match_tls_content(data->payload[0], data->payload_len[0]))
return true;
if ((match_tls_handshake(data->payload[0], data->payload_len[0]) ||
match_ssl3_handshake(data->payload[0], data->payload_len[0])) &&
match_ssl2_handshake(data->payload[1], data->payload_len[1]))
return true;
if ((match_tls_handshake(data->payload[1], data->payload_len[1]) ||
match_ssl3_handshake(data->payload[1], data->payload_len[1])) &&
match_ssl2_handshake(data->payload[0], data->payload_len[0]))
return true;
if (data->payload_len[0] == 0 && match_ssl2_handshake(data->payload[1], data->payload_len[1]))
return true;
if (data->payload_len[1] == 0 && match_ssl2_handshake(data->payload[0], data->payload_len[0]))
return true;
return false;
}
static bool dns_req(uint32_t payload) {
/* The flags / rcode on requests are usually all zero.
*
* Exceptions: CD and RD may be set
*
* Remember BYTE ORDER!
*/
payload = htonl(payload);
if ((payload & 0x0000ffff) == 0x00000000)
return true;
/* Check for CD */
if ((payload & 0x0000ffff) == 0x00000010)
return true;
/* Check for RD */
if ((payload & 0x0000ffff) == 0x00000100)
return true;
return false;
}
static bool dns_backscatter(uint32_t payload) {
/* Let's see if we can identify unsolicited DNS responses */
/* Last byte seems to be always 0x00 - third is either 0x84 or 0x85 */
payload = htonl(payload);
if ((payload & 0x0000ffff) == 0x00008500)
return true;
if ((payload & 0x0000ffff) == 0x00008580)
return true;
if ((payload & 0x0000ffff) == 0x00008400)
return true;
if ((payload & 0x0000ffff) == 0x00008480)
return true;
if ((payload & 0x0000ffff) == 0x00008483)
return true;
if ((payload & 0x0000ffff) == 0x00008403)
return true;
if ((payload & 0x0000ffff) == 0x00008000)
return true;
return false;
}
bool match_dns(lpi_data_t *data) {
if (data->payload_len[0] == 0 || data->payload_len[1] == 0) {
/* No response, so we have a bit of a hard time - however,
* most requests have a pretty standard set of flags.
*
* We'll also use the port here to help out */
if (data->server_port != 53 && data->client_port != 53)
return false;
if (data->payload_len[0] > 12 && dns_req(data->payload[0]))
return true;
if (data->payload_len[1] > 12 && dns_req(data->payload[1]))
return true;
if (data->payload_len[0] > 12 &&
dns_backscatter(data->payload[0]))
return true;
if (data->payload_len[1] > 12 &&
dns_backscatter(data->payload[1]))
return true;
return false;
}
if (((htonl(data->payload[0])) & 0xffff7800) !=
((htonl(data->payload[1])) & 0xffff7800))
return false;
if ((htonl(data->payload[0]) & 0x00008000) ==
(htonl(data->payload[1]) & 0x00008000))
return false;
return true;
}
bool match_tds_request(uint32_t payload, uint32_t len) {
uint32_t stated_len = 0;
stated_len = (ntohl(payload) & 0xffff);
if (stated_len != len)
return false;
if (MATCH(payload, 0x12, 0x01, ANY, ANY))
return true;
if (MATCH(payload, 0x10, 0x01, ANY, ANY))
return true;
return false;
}
bool match_8000_payload(uint32_t payload, uint32_t len) {
if (len == 0)
return true;
if (MATCH(payload, 0x3b, 0x00, 0x00, 0x00)) {
return true;
}
if (MATCH(payload, 0x3c, 0x00, 0x00, 0x00)) {
return true;
}
if (MATCH(payload, 0x3d, 0x00, 0x00, 0x00)) {
return true;
}
if (MATCH(payload, 0x3e, 0x00, 0x00, 0x00)) {
return true;
}
return false;
}
bool match_emule(lpi_data_t *data) {
/* Check that payload begins with e3 or c5 in both directions before
* classifying as eMule */
/* (I noticed that most emule(probably) flows began with "e3 xx 00 00"
* or "c5 xx 00 00", perhaps is worth looking into... Although I
* couldn't find anything about emule packets) */
if (data->payload_len[0] < 4 && data->payload_len[1] < 4)
return false;
if (MATCH(data->payload[0], 0xe3, ANY, 0x00, 0x00) &&
MATCH(data->payload[1], 0xe3, ANY, 0x00, 0x00))
return true;
if (MATCH(data->payload[0], 0xe3, ANY, 0x00, 0x00) &&
MATCH(data->payload[1], 0xc5, ANY, 0x00, 0x00))
return true;
/* XXX I haven't seen any obviously legit emule that starts with c5
* in both directions */
/*
if (MATCH(data->payload[0], 0xc5, ANY, ANY, ANY) &&
MATCH(data->payload[1], 0xc5, ANY, ANY, ANY))
return true;
*/
if (MATCH(data->payload[0], 0xc5, ANY, 0x00, 0x00) &&
MATCH(data->payload[1], 0xe3, ANY, 0x00, 0x00))
return true;
if (MATCH(data->payload[0], 0xe3, ANY, 0x00, 0x00) &&
data->payload_len[1] == 0)
return true;
if (MATCH(data->payload[1], 0xe3, ANY, 0x00, 0x00) &&
data->payload_len[0] == 0)
return true;
return false;
}
static inline bool match_kaspersky_ke(uint32_t payload, uint32_t len) {
if (len == 0)
return true;
if (MATCH(payload, 'K', 'E', 0x00, 0x00))
return true;
if (MATCH(payload, 'K', 'E', 0x00, 0x02))
return true;
if (MATCH(payload, 'K', 'E', 0x00, 0x07))
return true;
return false;
}
static inline bool match_kaspersky_ks(uint32_t payload, uint32_t len) {
if (len == 0)
return true;
if (MATCH(payload, 'K', 'S', 0x00, 0x00))
return true;
return false;
}
bool match_kaspersky(lpi_data_t *data) {
/* Traffic is either on TCP port 443 or UDP port 2001.
*
* One of the endpoints is always in either a Kaspersky range or
* an old PSInet range */
if (match_str_both(data, "PI\x00\x00", "PI\x00\x00")) {
if (data->payload_len[0] == 2 && data->payload_len[1] == 2)
return true;
}
if (match_kaspersky_ke(data->payload[0], data->payload_len[0])) {
if (match_kaspersky_ke(data->payload[1], data->payload_len[1]))
return true;
}
if (match_kaspersky_ks(data->payload[0], data->payload_len[0])) {
if (match_kaspersky_ks(data->payload[1], data->payload_len[1]))
return true;
}
return false;
}
bool match_youku_payload(uint32_t pload, uint32_t len) {
if (len == 0)
return true;
if (MATCH(pload, 0x4b, 0x55, 0x00, 0x01))
return true;
if (MATCH(pload, 0x4b, 0x55, 0x00, 0x02))
return true;
if (MATCH(pload, 0x4b, 0x55, 0x00, 0x03))
return true;
if (MATCH(pload, 0x4b, 0x55, 0x00, 0x04))
return true;
return false;
}
bool match_tpkt(uint32_t payload, uint32_t len) {
uint32_t stated_len = 0;
/*
* TPKT header is 03 00 + 2 bytes of length (including the TPKT header)
*/
if (!MATCH(payload, 0x03, 0x00, ANY, ANY))
return false;
stated_len = ntohl(payload) & 0xffff;
if (stated_len != len)
return false;
return true;
}
bool match_qqlive_payload(uint32_t payload, uint32_t len) {
uint32_t swap;
/* This appears to have a 3 byte header. First byte is always 0xfe.
* Second and third bytes are the length (minus the 3 byte header).
*/
if (len == 0)
return true;
swap = htonl(payload);
swap = (swap & 0xffff00) >> 8;
if (ntohs(swap) != len - 3)
return false;
/* Interestingly, the third and fourth byte always match */
swap = htonl(payload);
if ((swap & 0xff) != ((swap & 0xff00) >> 8))
return false;
if (MATCH(payload, 0xfe, ANY, ANY, ANY))
return true;
return false;
}
bool match_yy_payload(uint32_t payload, uint32_t len) {
/* The first four bytes are a length field, but using the
* wrong byte order...
*/
if (!MATCH(payload, ANY, ANY, 0x00, 0x00))
return false;
#if BYTE_ORDER == BIG_ENDIAN
if (bswap32(payload) == len)
return true;
#else
if (payload == len)
return true;
#endif
return false;
}
/* Byte swapping functions for various inttypes */
uint64_t byteswap64(uint64_t num)
{
return (byteswap32((num&0xFFFFFFFF00000000ULL)>>32))
|((uint64_t)byteswap32(num&0x00000000FFFFFFFFULL)<<32);
}
uint32_t byteswap32(uint32_t num)
{
return ((num&0x000000FFU)<<24)
| ((num&0x0000FF00U)<<8)
| ((num&0x00FF0000U)>>8)
| ((num&0xFF000000U)>>24);
}
uint16_t byteswap16(uint16_t num)
{
return ((num<<8)&0xFF00)|((num>>8)&0x00FF);
}
================================================
FILE: lib/proto_common.h
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#ifndef PROTO_COMMON_H_
#define PROTO_COMMON_H_
#include "libprotoident.h"
#ifndef __BYTE_ORDER
#include
#endif
#define ANY -1
#define MASKOCTET(x) \
((x) == ANY ? 0U : 255U)
#if __BYTE_ORDER == __BIG_ENDIAN
#define FORMUP(a,b,c,d) \
(unsigned)((((a)&0xFF)<<24)|(((b)&0xFF)<<16)|(((c)&0xFF)<<8)|((d)&0xFF))
#else
#define FORMUP(a,b,c,d) \
(unsigned)((((d)&0xFF)<<24)|(((c)&0xFF)<<16)|(((b)&0xFF)<<8)|((a)&0xFF))
#endif
#define FORMUPMASK(a,b,c,d) \
FORMUP(MASKOCTET(a),MASKOCTET(b),MASKOCTET(c),MASKOCTET(d))
#define MATCH(x,a,b,c,d) \
((x&FORMUPMASK(a,b,c,d))==(FORMUP(a,b,c,d)&FORMUPMASK(a,b,c,d)))
#define MATCHSTR(x,st) \
(memcmp(&(x),(st),sizeof(x))==0)
/** Byteswaps a 64-bit value.
*
* @param num The value to be byteswapped.
* @return The byteswapped 64-bit number
*
*/
uint64_t byteswap64(uint64_t num);
/** Byteswaps a 32-bit value.
*
* @param num The value to be byteswapped.
* @return The byteswapped 32-bit number
*
*/
uint32_t byteswap32(uint32_t num);
/** Byteswaps a 16-bit value.
*
* @param num The value to be byteswapped.
* @return The byteswapped 16-bit number
*
*/
uint16_t byteswap16(uint16_t num);
#if __BYTE_ORDER == __BIG_ENDIAN
#define bswap_host_to_be64(num) ((uint64_t)(num))
#define bswap_host_to_le64(num) byteswap64(num)
#define bswap_host_to_be32(num) ((uint32_t)(num))
#define bswap_host_to_le32(num) byteswap32(num)
#define bswap_host_to_be16(num) ((uint16_t)(num))
#define bswap_host_to_le16(num) byteswap16(num)
#define bswap_be_to_host64(num) ((uint64_t)(num))
#define bswap_le_to_host64(num) byteswap64(num)
#define bswap_be_to_host32(num) ((uint32_t)(num))
#define bswap_le_to_host32(num) byteswap32(num)
#define bswap_be_to_host16(num) ((uint16_t)(num))
#define bswap_le_to_host16(num) byteswap16(num)
/* We use ntoh*() here, because the compiler may
* attempt to optimise it
*/
#elif __BYTE_ORDER == __LITTLE_ENDIAN
#define bswap_host_to_be64(num) (byteswap64(num))
#define bswap_host_to_le64(num) ((uint64_t)(num))
#define bswap_host_to_be32(num) (htonl(num))
#define bswap_host_to_le32(num) ((uint32_t)(num))
#define bswap_host_to_be16(num) (htons(num))
#define bswap_host_to_le16(num) ((uint16_t)(num))
#define bswap_be_to_host64(num) (byteswap64(num))
#define bswap_le_to_host64(num) ((uint64_t)(num))
#define bswap_be_to_host32(num) (ntohl(num))
#define bswap_le_to_host32(num) ((uint32_t)(num))
#define bswap_be_to_host16(num) (ntohs(num))
#define bswap_le_to_host16(num) ((uint16_t)(num))
#else
#error "Unknown byte order"
#endif
bool match_str_either(lpi_data_t *data, const char *string);
bool match_str_both(lpi_data_t *data, const char *string1,
const char *string2);
bool match_chars_either(lpi_data_t *data, char a, char b, char c,
char d);
bool match_payload_length(uint32_t payload, uint32_t payload_len);
bool match_ip_address_both(lpi_data_t *data);
bool match_file_header(uint32_t payload);
bool match_http_request(uint32_t payload, uint32_t len);
bool valid_http_port(lpi_data_t *data);
bool match_ssl(lpi_data_t *data);
bool match_dns(lpi_data_t *data);
bool match_tds_request(uint32_t payload, uint32_t len);
bool match_8000_payload(uint32_t payload, uint32_t len);
bool match_youku_payload(uint32_t payload, uint32_t len);
bool match_emule(lpi_data_t *data);
bool match_kaspersky(lpi_data_t *data);
bool match_tpkt(uint32_t payload, uint32_t len);
bool match_qqlive_payload(uint32_t payload, uint32_t len);
bool match_yy_payload(uint32_t payload, uint32_t len);
#endif
================================================
FILE: lib/proto_manager.cc
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#include "config.h"
#include
#include
#include "proto_manager.h"
#include "tcp/tcp_protocols.h"
#include "udp/udp_protocols.h"
void register_protocol(lpi_module_t *mod, LPIModuleMap *mod_map) {
LPIModuleMap::iterator it;
LPIModuleList *ml;
it = mod_map->find(mod->priority);
if (it == mod_map->end()) {
(*mod_map)[mod->priority] = new LPIModuleList();
it = mod_map->find(mod->priority);
}
ml = it->second;
ml->push_back(mod);
}
void free_protocols(LPIModuleMap *mod_map) {
LPIModuleMap::iterator it;
LPIModuleList *ml;
for (it = mod_map->begin(); it != mod_map->end(); it ++) {
ml = it->second;
ml->clear();
delete(ml);
}
mod_map->clear();
}
int register_tcp_protocols(LPIModuleMap *mod_map) {
register_300heroes(mod_map);
register_360safeguard(mod_map);
register_4d(mod_map);
register_acestream(mod_map);
register_afp(mod_map);
register_airdroid(mod_map);
register_airmedia(mod_map);
register_akamai_tcp(mod_map);
register_amp(mod_map);
register_antcoin(mod_map);
register_appearin(mod_map);
register_apple_push(mod_map);
register_ares(mod_map);
register_badbaidu(mod_map);
register_baofeng_tcp(mod_map);
register_beam(mod_map);
register_bitcoin(mod_map);
register_bitextend(mod_map);
register_bittorrent(mod_map);
register_blackdesert(mod_map);
register_blizzard(mod_map);
register_btsync(mod_map);
register_bwsyncandshare(mod_map);
register_cacaoweb(mod_map);
register_cgp(mod_map);
register_chatango(mod_map);
register_cisco_vpn(mod_map);
register_clashofclans(mod_map);
register_classin_tcp(mod_map);
register_clubbox(mod_map);
register_cod_waw(mod_map);
register_conquer(mod_map);
register_crashplan(mod_map);
register_crossfire_tcp(mod_map);
register_cryptic(mod_map);
register_cvs(mod_map);
register_dahua_tcp(mod_map);
register_dash(mod_map);
register_dell_backup(mod_map);
register_destiny(mod_map);
register_diablo3(mod_map);
register_dianping_tcp(mod_map);
register_directconnect(mod_map);
register_dnf(mod_map);
register_dns_tcp(mod_map);
register_dogecoin(mod_map);
register_douyu(mod_map);
register_douyu_chat(mod_map);
register_duelingnetwork(mod_map);
register_dvrns(mod_map);
register_dxp(mod_map);
register_ea_games(mod_map);
register_emule(mod_map);
register_ethernetip(mod_map);
register_eye(mod_map);
register_facebook_turn(mod_map);
register_fb_message(mod_map);
register_fbcdn_ssl(mod_map);
register_ffxiv(mod_map);
register_filenori(mod_map);
register_flash(mod_map);
register_fliggy(mod_map);
register_fring(mod_map);
register_ftpcontrol(mod_map);
register_ftpdata(mod_map);
register_fuckcoin(mod_map);
register_funshion_tcp(mod_map);
register_gamespy_tcp(mod_map);
register_gcafe_updater(mod_map);
register_giop(mod_map);
register_git(mod_map);
register_glupteba(mod_map);
register_gnutella(mod_map);
register_goku(mod_map);
register_googlehangouts(mod_map);
register_graalonlineera(mod_map);
register_guildwars2(mod_map);
register_hamachi(mod_map);
register_harveys(mod_map);
register_hearthstone(mod_map);
register_hola(mod_map);
register_hots_tcp(mod_map);
register_http_badport(mod_map);
register_http(mod_map);
register_http_nonstandard(mod_map);
register_https(mod_map);
register_http_tunnel(mod_map);
register_ica(mod_map);
register_icep(mod_map);
register_id(mod_map);
register_idrivesync(mod_map);
register_ihexin(mod_map);
register_imap(mod_map);
register_imaps(mod_map);
register_imesh(mod_map);
register_invalid(mod_map);
register_invalid_bittorrent(mod_map);
register_invalid_http(mod_map);
register_invalid_pop(mod_map);
register_invalid_smtp(mod_map);
register_ipfs(mod_map);
register_ipop(mod_map);
register_ipsharkk(mod_map);
register_irc(mod_map);
register_java(mod_map);
register_jedi(mod_map);
register_jx3online(mod_map);
register_kakao(mod_map);
register_kankan_tcp(mod_map);
register_kaseya(mod_map);
register_kaspersky(mod_map);
register_kik(mod_map);
register_kingofglory_tcp(mod_map);
register_kuaibo(mod_map);
register_ldap(mod_map);
register_lifeforge(mod_map);
register_line(mod_map);
register_litecoin(mod_map);
register_llp2p(mod_map);
register_maplestory_china(mod_map);
register_maxicloud(mod_map);
register_message4u(mod_map);
register_minecraft(mod_map);
//register_mitglieder(mod_map);
register_mms(mod_map);
register_mongo(mod_map);
register_mp2p(mod_map);
register_msn(mod_map);
register_msnc(mod_map);
register_msnv(mod_map);
register_munin(mod_map);
register_mysql(mod_map);
//register_mystery_8000(mod_map);
//register_mystery_9000(mod_map);
//register_mystery_conn(mod_map);
//register_mystery_iG(mod_map);
//register_mystery_pspr(mod_map);
//register_mystery_rxxf(mod_map);
//register_mystery_symantec(mod_map);
register_mzinga(mod_map);
register_naverp2p(mod_map);
register_ncsoft(mod_map);
register_ndt_tput(mod_map);
register_netbios(mod_map);
register_netcat_cctv(mod_map);
register_netmfp(mod_map);
register_nntp(mod_map);
register_nntps(mod_map);
register_nomachine(mod_map);
register_norton_backup(mod_map);
register_notes_rpc(mod_map);
register_tcp_no_payload(mod_map);
register_tcp_no_firstpkt(mod_map);
register_nsq(mod_map);
register_omegle(mod_map);
register_openvpn(mod_map);
register_ourworld(mod_map);
register_palringo(mod_map);
register_paltalk(mod_map);
register_pandatv(mod_map);
register_pando(mod_map);
register_pathofexile(mod_map);
register_pdbox(mod_map);
register_pop3(mod_map);
register_pop3s(mod_map);
register_postgresql(mod_map);
register_pptp(mod_map);
register_psn_store(mod_map);
register_qcloud_ilvb(mod_map);
register_qq_tcp(mod_map);
register_qqdownload(mod_map);
register_qqlive_tcp(mod_map);
register_qqspeedmobile_tcp(mod_map);
register_qvod(mod_map);
register_rabbitmq(mod_map);
register_ragnarokonline(mod_map);
register_razor(mod_map);
register_rbls(mod_map);
register_rdp(mod_map);
register_realmofthemadgod(mod_map);
register_realvnc(mod_map);
register_rejection(mod_map);
register_relay(mod_map);
register_remote_manipulator(mod_map);
register_revolver_nblbt(mod_map);
register_rfb(mod_map);
register_rpcscan(mod_map);
register_rrtv(mod_map);
register_rsync(mod_map);
register_rtmp(mod_map);
register_rtsp(mod_map);
register_runescape(mod_map);
register_s7comm(mod_map);
register_saprouter(mod_map);
register_saszombieassault4(mod_map);
register_second_life(mod_map);
register_shoutcast(mod_map);
register_silkroadonline(mod_map);
register_sip(mod_map);
register_skyforge(mod_map);
register_skype_tcp(mod_map);
register_smb(mod_map);
register_smite_tcp(mod_map);
register_smtp(mod_map);
register_smtps(mod_map);
register_socks4(mod_map);
register_socks5(mod_map);
register_spdy(mod_map);
register_speedify(mod_map);
register_speedin(mod_map);
register_speedtest(mod_map);
register_spotify(mod_map);
register_ssh(mod_map);
register_ssjj(mod_map);
register_ssl(mod_map);
register_steam(mod_map);
register_stratum(mod_map);
register_stun_tcp(mod_map);
register_supl(mod_map);
register_svn(mod_map);
register_talesrunner(mod_map);
register_tankionline(mod_map);
register_tankix(mod_map);
register_taobao(mod_map);
register_tds(mod_map);
register_teamviewer(mod_map);
register_telecomkey(mod_map);
register_telegram(mod_map);
register_telnet(mod_map);
register_telnet_exploit(mod_map);
register_tencent_games(mod_map);
register_tenfivecoin(mod_map);
register_tensafe(mod_map);
register_tera(mod_map);
register_tetrisonline(mod_map);
register_thedivision(mod_map);
register_tip(mod_map);
register_tor(mod_map);
register_tpkt_generic(mod_map);
register_trackmania(mod_map);
register_transocks(mod_map);
register_trion(mod_map);
register_trojan_win32_generic_sb(mod_map);
register_trojan_zeroaccess(mod_map);
register_twitcasting(mod_map);
register_twitch_irc(mod_map);
register_utherverse(mod_map);
register_vainglory(mod_map);
register_vhdp2p(mod_map);
register_viber(mod_map);
register_vmware(mod_map);
register_vodlocker(mod_map);
register_vpnrobot_tcp(mod_map);
register_vpnunlimited_tcp(mod_map);
register_warcraft3(mod_map);
register_web_junk(mod_map);
register_webex_stun(mod_map);
register_weblogic(mod_map);
register_wechat(mod_map);
register_weibo(mod_map);
register_weiqi(mod_map);
register_whatsapp(mod_map);
register_whois(mod_map);
register_winmx(mod_map);
register_wizard101(mod_map);
register_wns(mod_map);
register_wow(mod_map);
register_wuala(mod_map);
register_xiami(mod_map);
register_xmpp(mod_map);
register_xmpps(mod_map);
register_xunlei(mod_map);
register_xunlei_accel(mod_map);
register_xymon(mod_map);
register_yahoo(mod_map);
register_yahoo_error(mod_map);
register_yahoo_games(mod_map);
register_yahoo_webcam(mod_map);
register_youku_tcp(mod_map);
register_yy_tcp(mod_map);
register_zabbix(mod_map);
register_zero_facebook(mod_map);
register_zoom_tcp(mod_map);
register_zynga(mod_map);
return 0;
}
int register_udp_protocols(LPIModuleMap *mod_map) {
register_360cn(mod_map);
register_360p2p(mod_map);
register_aachen_udp(mod_map);
register_acercloud(mod_map);
register_akamai(mod_map);
register_akamai_transfer(mod_map);
register_amanda(mod_map);
register_apple_facetime_init(mod_map);
register_ard(mod_map);
register_ares_udp(mod_map);
register_arksurvival(mod_map);
register_arma_server(mod_map);
register_arma3_server(mod_map);
register_artcp(mod_map);
register_assettocorsa(mod_map);
register_avast_secure_dns(mod_map);
register_bacnet(mod_map);
register_backweb(mod_map);
register_baiduyun_p2p(mod_map);
register_baofeng_udp(mod_map);
register_battlefield(mod_map);
register_bjnp(mod_map);
register_bmdp(mod_map);
register_btsync_udp(mod_map);
register_cacaoweb_udp(mod_map);
register_canon_mfnp(mod_map);
register_callofduty(mod_map);
register_chargen_exploit(mod_map);
register_checkpoint_rdp(mod_map);
register_chivalry(mod_map);
register_ethernetip_udp(mod_map);
register_cip_io(mod_map);
register_cirn(mod_map);
register_cisco_ipsec(mod_map);
register_cisco_sslvpn(mod_map);
register_classin_udp(mod_map);
register_cloudflare_warp(mod_map);
register_codmobile(mod_map);
register_combatarms(mod_map);
register_combatarms_p2p(mod_map);
register_contract_wars(mod_map);
register_crossfire(mod_map);
register_crossout(mod_map);
register_csgo(mod_map);
register_csoriginal(mod_map);
register_dahua(mod_map);
register_db2(mod_map);
register_dcc_udp(mod_map);
register_demonware(mod_map);
register_destiny_udp(mod_map);
register_dhcp(mod_map);
register_dht_dict(mod_map);
register_dht_other(mod_map);
register_diablo2(mod_map);
register_dianping_udp(mod_map);
register_dianshijia(mod_map);
register_directconnect_udp(mod_map);
register_discord(mod_map);
register_dns_udp(mod_map);
register_dota2(mod_map);
register_doyo(mod_map);
register_driveshare(mod_map);
register_dtls(mod_map);
register_emule_udp(mod_map);
//register_emule_weak_udp(mod_map);
register_epson(mod_map);
//register_eso(mod_map);
register_esp_encap(mod_map);
register_eye_udp(mod_map);
register_fasp(mod_map);
register_feitwo(mod_map);
register_forticlient_sslvpn(mod_map);
register_fortinet(mod_map);
register_foscam(mod_map);
register_freechal(mod_map);
register_freefire(mod_map);
register_funshion_udp(mod_map);
register_gamespy(mod_map);
register_ganglia(mod_map);
register_gangsofspace(mod_map);
register_garena(mod_map);
register_gearsofwar(mod_map);
register_gnutella_udp(mod_map);
register_gnutella2_udp(mod_map);
register_gnutella_weak(mod_map);
register_gotomeeting(mod_map);
register_gprs_tunnel(mod_map);
register_gsm(mod_map);
register_h1z1(mod_map);
register_halflife(mod_map);
register_haloonline(mod_map);
register_hamachi_udp(mod_map);
register_heliborne(mod_map);
register_heroesevolved(mod_map);
register_heroes_generals(mod_map);
register_hollachat(mod_map);
register_hots(mod_map);
register_icp(mod_map);
register_imesh_udp(mod_map);
register_ipmsg(mod_map);
//register_ipv6_udp(mod_map);
register_isakmp(mod_map);
register_jedi_academy(mod_map);
register_jedi_udp(mod_map);
register_kademlia(mod_map);
register_kankan(mod_map);
register_kaspersky_udp(mod_map);
register_kazaa(mod_map);
register_kingofglory_udp(mod_map);
register_kugou(mod_map);
register_l2tp(mod_map);
register_lansync_udp(mod_map);
register_ldap_ad(mod_map);
register_line_udp(mod_map);
register_linkproof(mod_map);
register_loadout(mod_map);
register_lol(mod_map);
register_mdns(mod_map);
register_merakicloud(mod_map);
register_moh(mod_map);
register_moonhunters(mod_map);
register_mp2p_udp(mod_map);
register_msn_cache(mod_map);
register_msn_video(mod_map);
register_msoffice_mac(mod_map);
register_mta(mod_map);
//register_mystery_05(mod_map);
//register_mystery_0660(mod_map);
//register_mystery_0d(mod_map);
//register_mystery_45(mod_map);
//register_mystery_61_72(mod_map);
//register_mystery_8000_udp(mod_map);
//register_mystery_99(mod_map);
//register_mystery_e9(mod_map);
//register_mystery_qq(mod_map);
register_n2ping(mod_map);
register_natpmp(mod_map);
register_netbios_udp(mod_map);
register_netcat_cctv_udp(mod_map);
register_netcore_scan(mod_map);
register_netflow(mod_map);
register_newerth(mod_map);
register_nintendo(mod_map);
register_noction(mod_map);
register_noe(mod_map);
register_norton(mod_map);
register_ntp(mod_map);
register_ntp_reflect(mod_map);
register_nwn(mod_map);
register_nvidia_gamestream(mod_map);
register_opaserv(mod_map);
register_openvpn_udp(mod_map);
register_orbit_udp(mod_map);
register_overwatch(mod_map);
register_paladins(mod_map);
register_pando_udp(mod_map);
register_panipani(mod_map);
register_planetside2(mod_map);
register_portmap_rpc(mod_map);
register_pplive(mod_map);
register_ppstream(mod_map);
//register_probable_gnutella(mod_map);
register_ps4_remoteplay(mod_map);
register_psn(mod_map);
register_punkbuster(mod_map);
register_pyzor(mod_map);
register_qq(mod_map);
register_qqlive(mod_map);
register_qqpcmgr(mod_map);
register_qqspeedmobile_udp(mod_map);
register_quake(mod_map);
register_quic(mod_map);
register_qvod_udp(mod_map);
register_radius(mod_map);
register_ramsey_dash(mod_map);
register_rdp_udp(mod_map);
register_real(mod_map);
register_risingstorm(mod_map);
register_raknet(mod_map);
register_robocraft(mod_map);
register_rocket_league(mod_map);
register_rrshare(mod_map);
register_rtcp(mod_map);
register_rtmfp(mod_map);
register_rtp(mod_map);
register_rulesofsurvival(mod_map);
register_sanandreas_mp(mod_map);
register_second_life_udp(mod_map);
register_serialnumberd(mod_map);
register_sip_udp(mod_map);
register_skype(mod_map);
register_slp(mod_map);
register_smite(mod_map);
register_snapvpn(mod_map);
register_snmp(mod_map);
register_sopcast(mod_map);
register_spamfighter(mod_map);
register_spotify_bcast(mod_map);
register_sql_worm(mod_map);
register_ssdp(mod_map);
register_starcitizen(mod_map);
register_starcraft(mod_map);
register_starleaf(mod_map);
register_steamfriends(mod_map);
register_steam_localbroadcast(mod_map);
register_steam_inhomebroadcast(mod_map);
register_steam_udp(mod_map);
register_storm_worm(mod_map);
register_stun(mod_map);
register_syslog(mod_map);
register_talesrunner_udp(mod_map);
register_teamspeak(mod_map);
register_teamviewer_udp(mod_map);
register_teredo(mod_map);
register_tf2(mod_map);
register_tftp(mod_map);
register_thecrew(mod_map);
register_thq(mod_map);
register_torchlight2(mod_map);
register_tox(mod_map);
register_traceroute(mod_map);
register_tremulous(mod_map);
register_turbovpn(mod_map);
register_tvants(mod_map);
register_ubisoft_games(mod_map);
register_udp_no_payload(mod_map);
register_umeye(mod_map);
register_unreal(mod_map);
register_ventrilo(mod_map);
register_viber_udp(mod_map);
register_vivox(mod_map);
register_vpnmaster(mod_map);
register_vpnrobot_udp(mod_map);
register_vxworks_exploit(mod_map);
register_warthunder(mod_map);
register_webex(mod_map);
register_wechat_udp(mod_map);
register_winmessage(mod_map);
register_wireguard(mod_map);
register_wolfet(mod_map);
register_worm_22105(mod_map);
register_xfire_p2p(mod_map);
register_xlsp(mod_map);
register_xunlei_jsq(mod_map);
register_xunlei_udp(mod_map);
register_xunyou(mod_map);
register_youdao_dict(mod_map);
register_youku_udp(mod_map);
register_yuanfudao(mod_map);
register_yy_udp(mod_map);
register_zalo_call(mod_map);
register_zeroaccess_udp(mod_map);
register_zoom(mod_map);
return 0;
}
static void register_list_names(LPIModuleList *ml, LPINameMap *names, LPIProtocolMap *protos,
LPICategoryProtocolMap *category_protocols) {
LPIModuleList::iterator it;
for (it = ml->begin(); it != ml->end(); it ++) {
lpi_module_t *mod = *it;
(*names)[mod->protocol] = mod->name;
(*protos)[std::string(mod->name)] = mod->protocol;
(*category_protocols)[mod->protocol] = mod->category;
}
}
void register_names(LPIModuleMap *mods, LPINameMap *names, LPIProtocolMap *protocols,
LPICategoryProtocolMap *category_protocols) {
LPIModuleMap::iterator it;
for (it = mods->begin(); it != mods->end(); it ++) {
register_list_names(it->second, names, protocols, category_protocols);
}
}
void register_category_names(LPICategoryMap *categories) {
int i;
for (i = 0; i < LPI_CATEGORY_LAST; i++) {
(*categories)[std::string(lpi_print_category((lpi_category_t)i))] = (lpi_category_t)i;
}
}
void init_other_protocols(LPINameMap *name_map, LPIProtocolMap *proto_map,
LPICategoryProtocolMap *category_protocols) {
lpi_icmp = new lpi_module_t;
lpi_icmp->protocol = LPI_PROTO_ICMP;
lpi_icmp->category = LPI_CATEGORY_ICMP;
lpi_icmp->name = "ICMP";
lpi_icmp->priority = 255;
lpi_icmp->lpi_callback = NULL;
(*name_map)[lpi_icmp->protocol] = lpi_icmp->name;
(*proto_map)[std::string(lpi_icmp->name)] = lpi_icmp->protocol;
(*category_protocols)[lpi_icmp->protocol] = lpi_icmp->category;
lpi_unknown_tcp = new lpi_module_t;
lpi_unknown_tcp->protocol = LPI_PROTO_UNKNOWN;
lpi_unknown_tcp->category = LPI_CATEGORY_UNKNOWN;
lpi_unknown_tcp->name = "Unknown_TCP";
lpi_unknown_tcp->priority = 255;
lpi_unknown_tcp->lpi_callback = NULL;
(*name_map)[lpi_unknown_tcp->protocol] = lpi_unknown_tcp->name;
(*proto_map)[std::string(lpi_unknown_tcp->name)] = lpi_unknown_tcp->protocol;
(*category_protocols)[lpi_unknown_tcp->protocol] = lpi_unknown_tcp->category;
lpi_unknown_udp = new lpi_module_t;
lpi_unknown_udp->protocol = LPI_PROTO_UDP;
lpi_unknown_udp->category = LPI_CATEGORY_UNKNOWN;
lpi_unknown_udp->name = "Unknown_UDP";
lpi_unknown_udp->priority = 255;
lpi_unknown_udp->lpi_callback = NULL;
(*name_map)[lpi_unknown_udp->protocol] = lpi_unknown_udp->name;
(*proto_map)[std::string(lpi_unknown_udp->name)] = lpi_unknown_udp->protocol;
(*category_protocols)[lpi_unknown_udp->protocol] = lpi_unknown_udp->category;
lpi_unsupported = new lpi_module_t;
lpi_unsupported->protocol = LPI_PROTO_UNSUPPORTED;
lpi_unsupported->category = LPI_CATEGORY_UNSUPPORTED;
lpi_unsupported->name = "Unsupported";
lpi_unsupported->priority = 255;
lpi_unsupported->lpi_callback = NULL;
(*name_map)[lpi_unsupported->protocol] = lpi_unsupported->name;
(*proto_map)[std::string(lpi_unsupported->name)] = lpi_unsupported->protocol;
(*category_protocols)[lpi_unsupported->protocol] = lpi_unsupported->category;
}
================================================
FILE: lib/proto_manager.h
================================================
/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information please see http://www.wand.net.nz/
*
* libprotoident is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* libprotoident is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*
*/
#ifndef PROTO_MANAGER_H_
#define PROTO_MANAGER_H_
#include
#include
#include