IP Address Forgery


SUBMITTED BY: ProffesorFaux

DATE: March 28, 2020, 2:31 p.m.

FORMAT: Text only

SIZE: 28.6 kB

HITS: 456

  1. IP Address Forgery
  2. INTERNET HOLES - ELIMINATING IP ADDRESS FORGERY
  3. COPYRIGHT (C), 1996, MANAGEMENT ANALYTICS - ALL RIGHTS RESERVED
  4. _________________________________________________________________
  5. Series Introduction
  6. The Internet is now the world's most popular network and it is full of
  7. potential vulnerabilities. In this series of articles, we explore the
  8. vulnerabilities of the Internet and what you can do to mitigate them.
  9. An Introduction IP Address Forgery
  10. The Internet Protocol (IP) (RFC791) provides for two and only two
  11. functions. It defines a datagram that can be routed through the
  12. Internet, and it provides a means for fragmenting datagrams into
  13. packets and reassembling packets into the original datagrams. To quote
  14. from RFC791:
  15. The internet protocol is specifically limited in scope to provide the
  16. functions necessary to deliver a package of bits (an internet
  17. datagram) from a source to a destination over an interconnected
  18. system of networks. There are no mechanisms to augment end-to-end
  19. data reliability, flow control, sequencing, or other services
  20. commonly found in host-to-host protocols. The internet protocol
  21. can capitalize on the services of its supporting networks to
  22. provide various types and qualities of service.
  23. Here's a description of an IP datagram, also from RFC791:
  24. 0 1 2 3
  25. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  26. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  27. |Version| IHL |Type of Service| Total Length |
  28. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  29. | Identification |Flags| Fragment Offset |
  30. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  31. | Time to Live | Protocol | Header Checksum |
  32. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  33. | Source Address |
  34. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  35. | Destination Address |
  36. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  37. | Options | Padding |
  38. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  39. | data |
  40. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  41. | data |
  42. \ \
  43. \ \
  44. | data |
  45. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  46. | data |
  47. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  48. Description of an IP Datagram
  49. Note that the 4th line of the description calls for the Source Address
  50. of the datagram. In the simplest form of IP address forgery, the
  51. forger only needs to create a packet containing a false Source Address
  52. and insert it into the Internet by writing it into the output device
  53. used to send information to the rest of the Internet. For the
  54. non-expert forger, there is a tool called iptest which is part of the
  55. free and publicly available ipfilter security package that
  56. automatically forges packets for the purpose of testing configurations
  57. or routers and other IP security setups.
  58. The infrastructure of the Internet consists primarily of a set of
  59. gateway computers and packet routers. These systems have multiple
  60. hardware interfaces. They maintain routing tables to let them decide
  61. which output interface to send a packet out on based on the input
  62. interface that it came in on and the destination IP address specified
  63. in the packet. When a forged packet arrives at an infrastructure
  64. element, that element will faithfully route the packet toward the
  65. destination address, exactly as it would a legitimate packet.
  66. How Can IP Address Forgery Be Used
  67. At its root, IP address forgery is a method of deception, and thus it
  68. can be used in much the same way as other forms of deception.
  69. Dunnigan95 More specifically, and using Dunnigan and Nofi's
  70. classification scheme, here are some quick ideas about how IP address
  71. forgery might be used:
  72. * Concealment: IP address forgery is commonly used to conceal the
  73. identity of an attacker, especially when denial of services is the
  74. goal of the attack.
  75. * Camouflage: IP address forgery is used to make one site appear to
  76. be another as a way to convince the victim, for example, that an
  77. attack is from a University, when in fact it is from a competitor.
  78. * False and Planted Information: IP address forgery can be used to
  79. create the impression that a particular site is acting maliciously
  80. in order to create friction or lead a defender to falsely accuse
  81. an innocent third party.
  82. * Reuses: IP address forgery can be used to support another activity
  83. designed to gain the confidence of the defender. For example, a
  84. salesperson for information security products could create IP
  85. address forgeries in order to convince a client of the need for
  86. their services.
  87. * Displays: IP address forgery has been used in order to lead
  88. defenders to believe that many sites are participating in an
  89. attack when in fact only a small number of individuals are
  90. responsible.
  91. * Demonstrations: IP address forgery has been used to demonstrate a
  92. potential for untraceable attacks as a way to convince defenders
  93. not to try to catch attackers.
  94. * Feints: IP address forgery can be used to try to fool an enemy
  95. into believing that an attack is coming from outside or from a
  96. particular direction, when the real attack is very different. This
  97. is a way to misdirect the enemy into spending limited resources in
  98. the wrong way.
  99. * Lies: IP address forgery has been used to create a more convincing
  100. lie that somebody known to the defender is communicating with them
  101. about a particular matter.
  102. * Insight: IP address forgery can be used to gain insight into how
  103. an opponent reacts and as a sort of probe to determine what sorts
  104. of responses are likely to arise.
  105. Another way to view this issue is in terms of the net effect on
  106. information in information systems. Here is another way of viewing
  107. this issue with an example from each category.
  108. * Corruption of Information: IP addresses are often used as the
  109. basis for Internet control decisions. For example, DNS updates are
  110. often designated as coming only from specific other servers. With
  111. IP address forgery, the entire DNS system could be corrupted,
  112. causing services to be rerouted through enemy servers.
  113. * Denial of Services: The Internet is basically a fragile network
  114. that depends on the proper behavior and good will of the
  115. participants for its proper operation. Without wide-ranging
  116. changes to the way the Internet works, denial of services is
  117. almost impossible to prevent. For example, the same DNS attack
  118. could be used to cause widespread denial of services, or perhaps
  119. even to create loops in the packet delivery mechanisms of the
  120. Internet backbone.
  121. * Leakage of Information: Forged IP addresses can be used to cause a
  122. host to take orders for the delivery of information to enemy sites
  123. by forging authorization as if it were from a legitimate
  124. authorizing site.
  125. * Misplaced Liability: Forged IP addresses could be used, as
  126. described above under False and Planted Information, to cause
  127. defenders to assert claims against innocent bystanders and to lay
  128. blame at the wrong feet.
  129. These are only some of the examples of what forged IP addresses can
  130. do. Without a lot of effort, many other examples can be created.
  131. What Can We Do About It?
  132. As individuals, there is little we can do to eliminate all IP address
  133. forgery, but as a community, we can be very effective. Here's how.
  134. Instead of having all infrastructure elements route all packets, each
  135. infrastructure element could, and should, enforce a simple rule. They
  136. should only route packets from sources that could legitimately come
  137. from the interface the packet arrives on.
  138. This may sound complicated, but it really isn't. In fact, the
  139. technology to do this is already in place, and always has been.
  140. Virtually every router and gateway in existence today allows for the
  141. filtering of packets based on their input interface and IP source and
  142. destination address. This is a necessary component of their operation
  143. and is the basis for the way they route all packets.
  144. The only change that has to be made is for these routers and gateways
  145. to enforce the network structure that is legitimately in place. Or in
  146. other words, the routers and gateways should refuse to route
  147. ridiculous packets. Here are some of the simpler examples of known bad
  148. packets:
  149. * The IP address 127.0.0.1 is ONLY used for internal routing of
  150. packets from a host to itself. There is no legitimate IP datagram
  151. that should pass through a router or gateway with this as the
  152. source address. In fact, routing these packets is dangerous
  153. because they may be used to forge packets from the localhost which
  154. often has special privileges. A recent attack that causes denial
  155. of services involves sending a packet to a host's echo port with
  156. 127.0.0.1 as its source address and the echo port as it's source
  157. port. The echo port causes whatever packet it is sent to be
  158. returned to its source. Since the source address is the same port
  159. on the same host, this packet creates an infinite loop which, in
  160. many cases, disables the computer.
  161. * The IP address 0.0.0.0 is not legitimate - full stop. In fact,
  162. there's really no legitimate IP address that should traverse
  163. gateways containing a 0 for one of the address elements.
  164. Unfortunately, many routers use the '.0.' convention in their
  165. filtering tables to indicate any address from 0 to 255 (the whole
  166. range), so blocking these packets may be non-trivial in some
  167. infrastructure elements.
  168. * The IP specification includes provisions for private subnetworks
  169. that are designated for internal use only. There is no legitimate
  170. reason to route packets from these addresses anywhere in the
  171. general Internet infrastructure. (RFC1597) These address ranges
  172. include 10.*.*.*, 172.16-32.*.*, and 192.168.*.* (where *
  173. indicates any value from 0 through 255). No packets should be
  174. routed through the Internet with these addresses as either their
  175. source or their destination.
  176. The next step in eliminating IP address forgery is for the routers and
  177. gateways at each type of infrastructure element to enforce standards
  178. on each interface. Generally, the Internet is broken up into Backbone
  179. providers that provide wide area packet transport services, Private
  180. Networks which are owned and operated by companies, institutions,
  181. government agencies, and other parties for their own purposes, and
  182. Internet Service Providers (ISPs) that provide connections between
  183. the backbone elements and private networks (sometimes including other
  184. ISPs). These roles can be blurred at times, but they are adequate for
  185. our purposes.
  186. * Private Networks: Each private network should;
  187. + 1) prevent all of the known-bad packets from crossing into or
  188. out of the organization,
  189. + 2) prevent packets with internal source addresses from
  190. passing inward,
  191. + 3) prevent packets with external source addresses from
  192. passing outward,
  193. + 4) prevent packets with external destination addresses from
  194. passing inward, and
  195. + 5) prevent packets with internal destination addresses from
  196. passing outward.
  197. * ISPs: Each ISP should;
  198. + 1) prevent all of the known-bad packets from crossing into or
  199. out of their infrastructure,
  200. + 2) prevent any packet inbound from any of their clients with
  201. a source address not from that client's assigned address
  202. range from passing from the client network,
  203. + 3) prevent any packets with a destination address not in
  204. their client's address range from passing to the client
  205. network,
  206. + 4) prevent any packet not from this ISP's legitimate address
  207. range from entering the backbone, and
  208. + 5) prevent any packets originating from the backbone and not
  209. destined for one of their legitimate IP addresses from
  210. entering their network.
  211. Two additional rules will assist the ISP's clients;
  212. + 6) prevent inbound traffic from the client with the client's
  213. address as a destination, and
  214. + 7) prevent outbound traffic to the client with the client's
  215. address claimed to be the source.
  216. * Backbone Networks: Each backbone provider should;
  217. + 1) prevent all of the known-bad packets from crossing into or
  218. out of their infrastructure,
  219. + 2) prevent packets originating from any ISP with source
  220. addresses not in that ISP's range of legitimate source
  221. addresses from entering the backbone,
  222. + 3) prevent any packets not destined for an ISP's address
  223. range from entering that ISP,
  224. + 4) prevent any packets from any other backbone provider that
  225. could not be properly routed through that provider from
  226. entering their backbone, and
  227. + 5) prevent any packets from going to any other backbone
  228. provider unless they could legitimately be routed through
  229. that provider to reach their destination.
  230. For backbones, this requires some effort, however the high volume of
  231. information they carry certainly justifies a little effort for
  232. protection.
  233. Some Examples
  234. As an aide to the less technically inclined, the following examples
  235. provide some real world implementation details.
  236. This set of rules applies to a private network (in this case, the
  237. all.net class C network 204.7.229.*) and are written in the format of
  238. the Morningstar PPP (point to point protocol) Filter file:
  239. # Rule 1 for private networks
  240. # prevent known-bad address ranges from entering (or leaving)
  241. !172.16-32.0.0 # private network segment
  242. !192.168.0.0 # private network segment
  243. !10.0.0.0 # private network segment
  244. !127.0.0.0 # localhost network
  245. # Rule 2 for private networks
  246. # prevent internal source address packets from passing inward
  247. !recv/src/204.7.229.0 # prevent inbound from our network
  248. # Rule 5 for private networks
  249. # prevent internal destination addresses from passing outward
  250. # Note that rule 5 is placed here because the filters are order dependent
  251. !send/dst/204.7.229.0 # prevent our destinations from passing out
  252. # Rule 3 for private networks
  253. # prevent external source address packets from passing outward
  254. send/src/204.7.229.0 # allow legitimate outbound sources
  255. !send/src/0.0.0.0 # prevent illegitimate outbound sources
  256. # Rule 4 for private networks
  257. # prevent external destinations from passing inward
  258. recv/dst/204.7.229.0 # allow legitimate inbound destinations
  259. !recv/dst/0.0.0.0 # prevent illegitimate inbound destinations
  260. The next set of rules applies to an ISP. In this case, we assume that
  261. the ISP has control over three class B networks that it uses to sell
  262. services to its clients. The class B networks used in this example
  263. have IP addresses of 123.7.*.*, 231.6.*.*, and 201.96.*.*. In this
  264. case, we have three different parts of the example:
  265. This is the router connecting the ISP to the backbone, presented in
  266. the format of a Cisco router with interface 0 connected to the
  267. backbone and interface 1 connected to the ISP's internal network. It
  268. implements rules 1, 4, and 5 for the ISP.
  269. # Rule 1 for an ISP
  270. # prevent all of the known-bad address ranges
  271. # this should be done on all in and out connections
  272. # on all interfaces in all access control lists
  273. All interfaces in and out
  274. deny ip 172.16-32.0.0 # private network segment
  275. deny ip 192.168.0.0 # private network segment
  276. deny ip 10.0.0.0 # private network segment
  277. deny ip 127.0.0.0 # localhost network
  278. # Rule 2 for an ISP
  279. # prevent inbound from client not in client's address range
  280. # DONE ELSEWHERE
  281. # Rule 3 for an ISP
  282. # prevent entry of packets not destined clients from passing their way
  283. # DONE ELSEWHERE
  284. # Rule 4 for an ISP
  285. # prevent exit of packets not from our class Bs
  286. # on interface 0 (backbone) out filter
  287. Interface 0 out
  288. permit ip 123.7.0.0
  289. permit ip 231.6.0.0
  290. permit ip 201.96.0.0
  291. deny ip 0.0.0.0
  292. # Rule 5 for an ISP
  293. # prevent entry of packets not destined for our class Bs.
  294. # on interface 0 (backbone) in filter
  295. Interface 0 in
  296. permit ip 123.7.0.0
  297. permit ip 231.6.0.0
  298. permit ip 201.96.0.0
  299. deny ip 0.0.0.0
  300. Next, we implement rules 2 and 3 for each client by creating separate
  301. (in this example ppp) filters on the ISP's gateway computer. Again,
  302. using the Morningstar ppp Filter format and assuming that Class C IP
  303. network 201.96.1.* is assigned to this particular client:
  304. # Rule 1 for ISPs
  305. # prevent known-bad address ranges from entering (or leaving)
  306. !172.16-32.0.0 # private network segment
  307. !192.168.0.0 # private network segment
  308. !10.0.0.0 # private network segment
  309. !127.0.0.0 # localhost network
  310. # Rule 6 for an ISP
  311. # prevent inbound traffic from the client destined for the client
  312. # note that rule 6 is placed here because filters are order dependent
  313. !recv/dest/201.96.1.0 # prevent inbound from client to self
  314. # Rule 7 for an ISP
  315. # prevent outbound traffic to the client claimed to be from the client
  316. # note that rule 7 is placed here because filters are order dependent
  317. !send/src/201.96.1.0 # prevent outbound to client from client
  318. # Rule 2 for an ISP
  319. # prevent inbound from client not in client's address range
  320. recv/src/201.96.1.0 # allow legitimate traffic
  321. !recv/src/0.0.0.0 # prevent all other traffic
  322. # Rule 3 for an ISP
  323. # prevent entry of packets not destined clients from passing their way
  324. send/dest/201.96.1.0 # allow legitimate traffic
  325. !send/dest/0.0.0.0 # prevent all other traffic
  326. Note that redundant protection is provided in several ways. The ISP
  327. protects the clients from backbone forgery both at the backbone router
  328. and at the client's ppp connection, and protects the backbone from IP
  329. forgery emanating from the ISP both by preventing forgery from clients
  330. and by preventing forgery from within the ISP. Similarly, the ISP
  331. provides redundant protection against improperly configured client
  332. hardware and software. The last two filter rules are to assure that
  333. even if the client is not properly configured to prevent forgery of
  334. internal addresses from the outside world or to prevent internal
  335. traffic from being sent out, this traffic is prevented.
  336. This last example is a simplification of a wide area backbone network
  337. in which this particular router (no type specified) is at the junction
  338. between UK connections and non-UK connections. In this case, it is a
  339. reasonable assumption that all internal UK traffic should remain
  340. internal and that external traffic that gets to this node should be
  341. sent out of the UK never to return. This particular backbone node will
  342. be connected to non-UK traffic on interface 0, our previously
  343. described ISP on interface 1, and the rest of the internal UK backbone
  344. on interface 2.
  345. # Rule 1 for a backbone
  346. # prevent all of the known-bad packets from crossing
  347. all-interfaces prevent in/out 172.16-32.0.0 # private network segment
  348. all-interfaces prevent in/out 192.168.0.0 # private network segment
  349. all-interfaces prevent in/out 10.0.0.0 # private network segment
  350. all-interfaces prevent in/out 127.0.0.0 # localhost network
  351. # Rule 2 for a backbone
  352. # prevent packets originating from any ISP with non-ISP source address
  353. interface-1 allow in from 123.7.0.0 # ISP traffic
  354. interface-1 allow in from 231.6.0.0 # ISP traffic
  355. interface-1 allow in from 201.96.0.0 # ISP traffic
  356. interface-1 prevent in from 0.0.0.0 # no other inbound traffic
  357. # Rule 3 for a backbone
  358. # prevent packets not destined for an ISP from going there
  359. interface-1 allow out to 123.7.0.0 # ISP traffic
  360. interface-1 allow out to 231.6.0.0 # ISP traffic
  361. interface-1 allow out to 201.96.0.0 # ISP traffic
  362. interface-1 prevent out to 0.0.0.0 # no other outbound traffic
  363. # Rule 4 for a backbone
  364. # prevent packets from other backbones that shouldn't come this way
  365. interface-0 allow in to UK-1 # UK traffic
  366. interface-0 allow in to UK-2 # UK traffic
  367. ...
  368. interface-0 allow in to UK-n # UK traffic
  369. interface-0 prevent in to 0.0.0.0 # no other inbound traffic
  370. # Rule 5 for a backbone
  371. # prevent packets that should stay in our backbone from going out
  372. interface-0 allow out from UK-1 # UK traffic
  373. interface-0 allow out from UK-2 # UK traffic
  374. ...
  375. interface-0 allow out from UK-n # UK traffic
  376. interface-0 prevent out from 0.0.0.0 # no other outbound traffic
  377. In this example, we have assumed that all UK traffic is on IP
  378. addresses identified as UK-1, ..., UKn.
  379. What-ifs and Objections
  380. WHAT IFS?
  381. * What if a private network ignores the rules? It is to be expected
  382. than many private networks will ignore any such rules, either
  383. through ignorance, intent, or inattention. But even if all private
  384. networks ignored all of the rules, the rules for ISPs would
  385. prevent IP forgery from extending to the overall infrastructure.
  386. * What if an ISP ignores the rules? If an ISP ignores the rules and
  387. allows IP forgery, the backbone can protect the rest of the
  388. Internet, at least to the point where forged packets within the
  389. ISP's domain remain within or are traceable to that domain. That
  390. means that the ISP's clients would be subject to IP forgeries from
  391. other clients of that ISP, but that the rest of the Internet would
  392. be able to trace all packets coming from that ISP to that ISP.
  393. * What if the backbone ignores the rules? If all of the backbone
  394. providers ignore the rules, unless everyone else follows them, we
  395. will continue to have IP forgeries through the ISPs that don't
  396. follow the rules.
  397. * What if combinations ignore the rules? Depending on the specific
  398. combinations, we will have more or fewer IP address forgeries. It
  399. turns out that a complete analysis of this issue is not simple
  400. enough to do in the space provided, but a simple conclusion can be
  401. drawn without a full analysis. As more Internet users and
  402. providers prevent IP address forgery, the job of the forger will
  403. become harder and harder. We don't all have to participate in
  404. order to have proper protection, but if we all fail to
  405. participate, the forgeries will continue.
  406. OTHER OBJECTIONS
  407. * Content (common carrier) objections: Many ISPs and backbone
  408. providers don't want or take responsibility for content in the
  409. Internet. Just like a telephone company, they don't want any role
  410. in examining or dictating the content of the messages - they only
  411. want to be a delivery service. It could be argued that examining
  412. the address information in an IP packet and preventing packets
  413. based on those addresses constitutes limitation of content. Of
  414. course the portion of the content involved here must be examined
  415. in order to route the information, and the routing used in the
  416. Internet already provides exclusion of packets based on IP address
  417. ranges. Furthermore, common carriers (in the U.S.) are allowed to
  418. listen to and filter traffic to the extent that this activity is
  419. done solely to assure the proper operation of the network. Thus
  420. this objection would seem to be moot.
  421. * The cost is too high objection: In fact the cost is negligible. If
  422. the rules set forth herein were applied as a normal part of the
  423. installation and maintenance process, it would come to only a few
  424. minutes of effort during each installation. Even applying them to
  425. systems already in place requires only a few minutes of effort,
  426. again an insubstantial amount of effort well within the discretion
  427. of any systems administrator.
  428. * The we don't want restrictions objections: There are a substantial
  429. number of people that want a total lack of restrictions on
  430. information flowing through the Internet. I generally agree with
  431. the principle of free information flow, except in cases where the
  432. freedom of one person infringes on the freedom of others. This
  433. impingement on other peoples' rights applies to certain types of
  434. information, such as routing information, that must be correct in
  435. order for the Internet to work properly. Since the restrictions
  436. described here only assure that the Internet works properly and
  437. don't restrict the content or flow of information, there is no
  438. restriction of the free flow of information here. Only increased
  439. assurance that those who want to use the media for legitimate
  440. purposes will continue to be able to do so.
  441. Summary
  442. This solution we presented:
  443. * 1) is easy to implement,
  444. * 2) makes good sense from a traffic standpoint,
  445. * 3) allows all legitimate activity without any hinderence,
  446. * 4) works even if all parties don't participate,
  447. * 5) costs almost nothing to implement at each site,
  448. * 6) does not require any changes in existing protocols of traffic
  449. patterns,
  450. * 7) makes good sense for the security of each party that
  451. participates, and
  452. * 8) can be done today.
  453. All that remains is for the people in each of these organizations to
  454. implement these protections. Unlike so many of the problems in the
  455. Internet that are hard to solve and will require years of evolution,
  456. this problem can be solved now. We encourage you to implement these
  457. protections at your earliest convenience and to urge other to do so as
  458. well. Together, we can eliminate IP address forgery.

comments powered by Disqus