When using scapy in python how can I get the same result as the snippit...

90.2K

Verified Solution

Question

Programming

When using scapy in python how can I get the same result as the snippit bellow? (which in run in terminal)>>> sr(IP(dst=\"192.168.8.1\")/TCP(dport=[21,22,23]))Received 6 packets, got 3 answers, remaining 0 packets(, )>>> ans,unans=_>>> ans.summary()IP / TCP 192.168.8.14:20 > 192.168.8.1:21 S ==> Ether / IP / TCP 192.168.8.1:21 > 192.168.8.14:20 RA / PaddingIP / TCP 192.168.8.14:20 > 192.168.8.1:22 S ==> Ether / IP / TCP 192.168.8.1:22 > 192.168.8.14:20 RA / PaddingIP / TCP 192.168.8.14:20 > 192.168.8.1:23 S ==> Ether / IP / TCP 192.168.8.1:23 > 192.168.8.14:20 RA / Padding

I tried doing something like res =sr(IP(dst=\"192.168.8.1\")/TCP(dport=[21,22,23])) and then doingres.summary(), but it doesnt seem to work :(

Answer & Explanation Solved by verified expert
4.0 Ratings (501 Votes)
Scapy is a library made in Python with its own CLI which allows to create modify send and capture network packets It can be used interactively through the command line interface or as a library by importing it    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students