Is there a flag/option available to display only bad checksum packets using tcpdump - tcpdump

I can see tshark/wireshark has a flag to display only packets with checksum errors (tcp.checksum.status == "Unverified"). I tried checking if there is any similar flag in tcpdump, I couldn't find it. Is there a flag/option available with tcpdump? If so any one knows what it is? Thanks.

As you say, tcpdump only offers the filters specified here. This does not include an option to filter checksum.
However, you can easily filter checksum incorrect packets using grep:
sudo tcpdump -i eth0 -vvv tcp | grep incorrect
Otherwise your best option is to use tshark.

Related

tcpdump: How do I suppress packet information?

When I kill a tcpdump process, I get the following three lines:
NN packets captured
NN packets received by filter
NN packets dropped by kernel
I am piping the output of tcpdump into a txt file and want to keep my terminal clean.
Is there a way to suppress this information?
From this question here, the tcpdump stats and header lines are a part of stderr. So, if you want to suppress this information and store the packet information in a file, you can do:
tcpdump 2> /dev/null > output.txt
Using /dev/null/ will discard the stderr output.

how to capture bitorrent infohash id in network using tcpdump or any other open scource tool?

i am working on a project where we need to collect the bitorrent infohash id running in our small ISP network. using port mirroring we can pass the all wan traffic to a server and run tcpdump tools or any other tool to find the infohash id download by bitorrent client. for example
tcpflow -p -c -i eth1 tcp | grep -oE '(GET) .* HTTP/1.[01].*'
this code is showing result like this
GET /announce?info_hash=N%a1%94%17%2c%11%aa%90%9c%0a%1a0%9d%b2%cfy%08A%03%16&peer_id=-BT7950-%f1%a2%d8%8fO%d7%f9%bc%f1%28%15%26&port=19211&uploaded=55918592&downloaded=0&left=0&corrupt=0&key=21594C0B&numwant=200&compact=1&no_peer_id=1 HTTP/1.1
now we need to capture only infohash and store it to a log or mysql database
can you please tell me which tool can do thing like this
Depending on how rigorous you want to be you'll have to decode the following protocol layers:
TCP, assemble packets of a flow. you're already doing that with tcpflow. tshark - wireshark's CLI - could do that too.
HTTP, extract the value of the GET header. A simple regex would do the job here.
URI, extracting the query string
application/x-www-form-urlencoded, info_hash key value pair extraction and handling of percent-encoding
For the last two steps I would look for tools or libraries in your programming language of choice to handle them.

tcpdump throws PKTAP error

While running tcpdump without providing any interface
tcpdump -nS,
I'm getting tcpdump: cannot use data link type PKTAP error so I tried providing the Interface option in the command
tcpdump -i eth0 or even eth1
then I get the following error
tcpdump: eth1: No such device exists
(BIOCSETIF failed: Device not configured)
I even tried looking up on the Internet but i'm not getting any solution ...
Any help ??
I can't speak to your problem with PKTAP, but I can speak to the "No such device exists" - eth0 is a Linux-ism, and MacOS isn't Linux. You almost certainly want en0, en1, etc. "ifconfig -a" is your friend or, if you have it installed, "tshark -D".
Any reason on why PKTAP issue is occurring
It's probably occurring because you installed your own version of libpcap, which does not know about the DLT_PKTAP link-layer header type, and Apple's tcpdump is somehow using your version rather than their own version (Apple's version does know about it) and, therefore, failing because, when its version of tcpdump is run without a -i argument, it uses an OS mechanism to capture on all devices, and that mechanism supplies packets with DLT_PKTAP headers and the DLT_PKTAP link-layer header type.

Get encryption type for wlan with tcpdump

How can I get the actual encryption type sent in Beacons from tcpdump? I have searched the manpage entry, Google, and website for tcpdump and pcap to no avail. I have the snaplen set to the highest value and the type = IEEE802_11_RADIO and can see a LOT of data from tcpdump -i mon0 -vvv -le 'wlan type mgt subtype beacon' and even without specifying the frame type as mgmt. I am using the latest stable version: 4.3.0 with libpcap 1.1.1
All the string says is "PRIVACY" if encryption is being used.

How to check whether jenkins is fully up and running using webservice ?

I want to know , how to check whether jenkins is fully up and running using webservice ?
i want to use jenkins webservice to check this. Is there any way to do this ?
Thanks.
Probably the easiest way would be to perform a simple HTTP get on the Jenkins server root URL. You get a successful status (200) if Jenkins is fully up. If it is not you'll get 503 - Service Temporarily Unavailable (or possibly other errors depending on specific situation).
From the command line you can use a tool such as wget to perform that request.
Could also use curl:
while [[ $(curl -s -w "%{http_code}" http://server -o /dev/null) != "200" ]]; do
sleep 5
done
In addition to previous answers: If security is enabled, you will get HTTP 403 from the root URL. To get HTTP 200, you can check http://server/login.