{"id":15632026,"url":"https://github.com/jaymzh/iptstate","last_synced_at":"2025-04-16T05:56:45.256Z","repository":{"id":2241256,"uuid":"44512155","full_name":"jaymzh/iptstate","owner":"jaymzh","description":"IP Tables State","archived":false,"fork":false,"pushed_at":"2024-01-12T07:27:52.000Z","size":481,"stargazers_count":77,"open_issues_count":3,"forks_count":10,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-10T08:08:30.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaymzh.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-19T04:59:19.000Z","updated_at":"2025-04-02T07:13:30.000Z","dependencies_parsed_at":"2024-06-19T23:25:38.232Z","dependency_job_id":"e76610c4-19c2-4da7-a61c-b9dc2e3841ff","html_url":"https://github.com/jaymzh/iptstate","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fiptstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fiptstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fiptstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fiptstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaymzh","download_url":"https://codeload.github.com/jaymzh/iptstate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249205639,"owners_count":21229964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T10:42:24.180Z","updated_at":"2025-04-16T05:56:45.226Z","avatar_url":"https://github.com/jaymzh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IP Tables State (iptstate)\n\n[![Lint](https://github.com/jaymzh/iptstate/workflows/Lint/badge.svg)](https://github.com/jaymzh/iptstate/actions?query=workflow%3ALint)\n[![Build](https://github.com/jaymzh/iptstate/workflows/Build/badge.svg)](https://github.com/jaymzh/iptstate/actions?query=workflow%3ABuild)\n\nPlease see the LICENSE file for license information.\n\n## WHAT IS IP TABLES STATE?\n\nIP Tables State (iptstate) was originally written to implement the \"state top\"\nfeature of IP Filter (see \"The Idea\" below) in IP Tables. \"State top\" displays\nthe states held by your stateful firewall in a top-like manner.\n\nSince IP Tables doesn't have a built in way to easily display this information\neven once, an option was added to just have it display the state table once.\n\nFeatures include:\n\n* Top-like realtime state table information\n* Sorting by any field\n* Reversible sorting\n* Single display of state table\n* Customizable refresh rate\n* Display filtering\n* Color-coding\n* Open Source (specifically I'm using the zlib license)\n* much more...\n\nYou can checkout some [screenshots](SCREENSHOTS.md).\n\n## INSTALATION\n\nIPTState is packaged in most Linux distributions. If your distribution is in\nthe table below, your best bet is so use your distro's package manager to\ninstall it.\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/iptstate.svg?exclude_unsupported=1)](https://repology.org/project/iptstate/versions)\n\nOtherwise, you can build it from source.\n\n### Building: prerequisites\n\nMake sure you have some version of curses installed (for most users this is\nprobably ncurses). Note that if you are using vendor packages you will most\nlikely need the packaged with '-dev' on the end of of it (i.e. ncurses-dev).\n\nStarting with version 2.2.0, you also need libnetfilter_conntrack version 0.0.50\nor later. These libraries also require nf_conntrack_netlink and nfnetlink support\nin your kernel. You will also need pkg-config at build-time.\n\n### Building: the quick version:\n\nFor most people the following should do all you need:\n\n```shell\nmake\nmake install # this must be done as root\n```\n\n### Building: the long version:\n\n#### Configuration\n\nThe program is only one c++ source file, so the compile is very simple. For\nthis reason there is no config file.  The defaults in the Makefile should be\nfine, but if you want to change something you can change where iptstate gets\ninstalled by changing the \"SBIN\" variable in your environment. I can't imagine\na reason but if you have 'install' installed in a weird place change the\nINSTALL variable in your environment. Other than that nothing should need\ntweaking. Obviously advanced users may wish to do other stuff, but we'll leave\nthat as an excersize to the reader.\n\n#### Compiling\n\nThe compiling should be as simple as running 'make.' If this doesn't work, feel\nfree to drop me an email, BUT MAKE SURE you put \"IPTSTATE:\" in the subject. In\nthe email include: Distribution, kernel version, make version, gcc version,\nlibc version, and the error messages.\n\nPackage maintainers may wish to override CXXFLAGS, and can do so like so:\n\n```shell\n# CXXFLAGS=-O3 make\n```\n\nand/or use \"make strip\" which will build iptstate and then strip it.\n\nIf you get errors like:\n\n```shell\niptstate.cc:286: passing `in_addr *' as argument\n1 of `gethostbyaddr(const char *, size_t, int)'\n```\n\nthen you need to upgrade your glibc. This is an important thing to keep\nup-to-date anyway.\n\n#### Installing\n\nIPTState installs in /usr/sbin. This is because it should be a utility for the\nsuperuser. You need root access (or CAP_NET_ADMIN) for iptstate to get the data\nit needs anyway.  Installing should be as simple as 'make install' as root. If\nthis fails, feel free to do:\n\n```shell\n# cp iptstate /usr/sbin/iptstate\n# chmod 755 /usr/sbin/iptstate\n# chown root:bin /usr/sbin/iptstate\n# cp iptstate.8 /usr/share/man/man8/iptstate.8\n# chmod 444 /usr/share/man/man1/iptstate.8\n```\n\nAnd that should do it. If 'make install' fails feel free to drop me an email\nprovided you put \"IPTSTATE:\" in the subject. Please see the BUGS file on how to\nsend proper bug reports.\n\n## USAGE\n\nIPTables State is extremely simple to use. Most of the time what you'll want is\njust the command 'iptstate' as root. This will launch you into the 'statetop'\nmode. In here, your state table is being sorted by Source IP. To change the\nsorting, on the fly, type 'b.' This will rotate through the various sorting\npossibilities. You can quit by typing 'q.' You can also change the sorting with\nthe -b (\"sort BY\") option. The -b option takes d (Destination IP), D\n(Destination Port), S (Source IP), p (protocol), s (state), and t (TTL) as it's\npossible options.  To sort by Source IP, just don't specify -b.\n\nYou can also change the refresh rate of the statetop by -R followed by an\ninteger. The integer represents the refresh rate in seconds.\n\nTo get help, hit 'h' from withint iptstate, or run iptstate with the '--help'\noption.\n\nTo get a quick look at what's going across your firewall, try iptstate -1. This\nis \"single run\" mode. It will just print out your state table at the moment you\nrequested it. This is where -b comes in handy. Again, the default sort is by\nSource IP.\n\nNOTE WELL: This is not meant to be a comprehensive guide. There are many other\nfeatures - check the man page, the -h option, and the interactive help page\nwithin iptstate for more information. But this should give you the basics.\n\n## DESIRED FEATURES\n\nThere is a list of features I plan and don't plan to implement in the WISHLIST\nfile.\n\n## THE IDEA\n\nThe idea of statetop comes from IP Filter by Darren Reed.\n\nThis package's main purpose is to provide a state-top type interface for IP\nTables. I've added in the \"single run\" option since there's no nice way to do\nthat with IP Tables either.\n\n## THE AUTHOR\n\nIPTState was written by me, Phil Dibowitz. My day job is large-scale system\nadministration and automation. Outside of work I maintain several open source\nprojects. You can find out more about me at [PhilDev](http://www.phildev.net/).\n\nPhil Dibowitz\nphil AT ipom DOT com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymzh%2Fiptstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaymzh%2Fiptstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymzh%2Fiptstate/lists"}