Python Penetration Testing Cookbook: Practical recipes on implementing information gathering, network security, intrusion detection, and post-exploitation by Rejah Rehim
Author:Rejah Rehim [Rehim, Rejah]
Language: eng
Format: epub, pdf
Tags: COM053000 - COMPUTERS / Security / General, COM051440 - COMPUTERS / Software Development and Engineering / Tools, COM088010 - COMPUTERS / System Administration / Linux and UNIX Administration
Publisher: Packt Publishing
Published: 2017-11-28T00:00:00+00:00
transport = TCP(dport=53, flags = 'S')
Here we pass the destination port and the flag is set to S for a SYN packet. We can also pass the destination ports as a list for creating multiple packets:
transport = TCP(dport=[(53, 100)], flags = 'S')
Next we can stack these layers with the / operator:
packet = ethernet/network/transport
Now we can check the packets generated by printing them with pprint:
pprint([pkt for pkt in packet])
We can also use ls() to inspect a packet:
for pkt in packet: ls(pkt)
Another option to get the packet details is the show() method in the packet:
for pkt in packet: pkt.show()
Now we can create a single packet with a script. The script will be as follows:
from scapy.all import * from pprint import pprint ethernet = Ether() network = IP(dst = ['rejahrehim.com']) transport = TCP(dport=[(80)], flags = 'S') packet = ethernet/network/transport for pkt in packet: pkt.show()
This will create a TCP/IP packet with the SYN flag set, the destination address https://rejahrehim.com/, and the destination port 80.
Now run the script with the sudo permission:
Download
Python Penetration Testing Cookbook: Practical recipes on implementing information gathering, network security, intrusion detection, and post-exploitation by Rejah Rehim.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7760)
Filmora Efficient Editing by Alexander Zacharias(5726)
The Infinite Retina by Robert Scoble Irena Cronin(5202)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3943)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3932)
Edit Like a Pro with iMovie by Regit(3392)
Linux Administration Best Practices by Scott Alan Miller(2857)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2834)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2520)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2364)
Docker on Windows by Stoneman Elton(2317)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2310)
Creative Projects for Rust Programmers by Carlo Milanesi(2213)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2107)
Hands-On Linux for Architects by Denis Salamanca(2051)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2002)
Computers For Seniors For Dummies by Nancy C. Muir(1995)
The Old New Thing by Raymond Chen(1938)
Linux Kernel Debugging by Kaiwan N Billimoria(1761)
