home *** CD-ROM | disk | FTP | other *** search
/ Cuteskunk BBS / cuteskunk.zip / cuteskunk / unsorted-zines / cracker.txt < prev    next >
Text File  |  2003-06-29  |  38KB  |  822 lines

  1.  
  2.  
  3.  
  4.     Techniques Adopted By 'System Crackers' When Attempting To Break Into
  5.     ---------------------------------------------------------------------
  6.                    Corporate or Sensitive Private Networks.
  7.                    ----------------------------------------
  8.  
  9.  
  10.  
  11.            By the consultants of the Network Security Solutions Ltd.
  12.           Front-line Information Security Team (FIST), December 1998.
  13.  
  14.  
  15.  
  16.                     fist@ns2.co.uk    http://www.ns2.co.uk
  17.  
  18.  
  19.  
  20.  
  21. ------------------------------------------------------------------------------
  22.    0    Table Of Contents
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26.    1.   Introduction
  27.    1.1  Just who is vulnerable anyway?
  28.    1.2  Profile of a typical 'system cracker'
  29.  
  30.    2    Networking
  31.    2.1  Networking methodologies adopted by many companies
  32.    2.2  Understanding vulnerabilities in such networked systems
  33.  
  34.    3    The attack itself
  35.    3.1  Techniques used to 'cloak' the attackers location
  36.    3.2  Network probing and information gathering
  37.    3.3  Identifying trusted network components
  38.    3.4  Identifying vulnerable network components
  39.    3.5  Taking advantage of vulnerable network components
  40.    3.6  Upon gain access to vulnerable network components
  41.  
  42.    4    Abusing network access and privileges
  43.    4.1  Downloading sensitive information
  44.    4.2  Cracking other trusted hosts networks
  45.    4.3  Installing backdoors and trojaned files
  46.    4.4  Taking down networks
  47.  
  48.    5    The improvement of total network security
  49.    5.1  Suggested reading
  50.    5.2  Suggested tools and programs
  51.  
  52.  
  53.  
  54. ------------------------------------------------------------------------------
  55.    1.0  Introduction
  56. ------------------------------------------------------------------------------
  57.  
  58.  
  59.  This white paper was written to help give systems administrators and network
  60.  operations staff an insight into the tactics and methodologies adopted by
  61.  typical system crackers when targeting large networks.
  62.  
  63.  This document is not a guide about how to secure your networks, although it
  64.  should help you identify security risks in your networked environment and
  65.  maybe help point out any accidents that are waiting to happen.
  66.  
  67.  We hope you enjoy reading this paper, and hopefully learn a little about
  68.  how crackers operate in the meantime!
  69.  
  70.  
  71.  
  72.  The Network Security Solutions Ltd. FIST staff (fist@ns2.co.uk)
  73.  
  74.  
  75.  
  76. ------------------------------------------------------------------------------
  77.    1.1  Just who is vulnerable anyway?
  78. ------------------------------------------------------------------------------
  79.  
  80.  
  81.  Networked computer environments are used everyday by corporations and various
  82.  organisations. Networks of computers allow users to share vast amounts of
  83.  data very efficiently.
  84.  
  85.  Usually corporate networks are not designed and implemented with security
  86.  in mind, merely functionality and efficiency, although this is good from a
  87.  business standpoint in the short-term, security problems usually arise
  88.  later, which can cost millions to solve in larger environments.
  89.  
  90.  Most corporate and sensitive private networks work on a client-server
  91.  principle, where employees use workstations to connect to servers in order
  92.  to share information. In this paper we will concentrate on server security,
  93.  as most crackers will always target servers first, the server is much like
  94.  a 'hub' where all the information is stored. If a cracker can gain
  95.  unauthorised access to such a server, the rest of his work is easy.
  96.  
  97.  Vulnerable parties to large-scale network probes usually include :
  98.  
  99.    Financial institutions and banks
  100.    Internet service providers
  101.    Pharmaceutical companies
  102.    Government and defense agencies
  103.    Contractors to various goverment agencies
  104.    Multinational corporations
  105.  
  106.  
  107.  Although many of these attacks take place internally (by users who have
  108.  authorised access to parts of the corporate or sensitive networks already),
  109.  we will be concentrating on the techniques used when breaking into such
  110.  networks entirely from the outside.
  111.  
  112.  Financial institutions and banks are probed and attacked in attempts to
  113.  commit fraud. Many banks have been targeted in this way, risking vast
  114.  monetary funds. Banks make it policy not to admit to being victims
  115.  of such external attacks because they will certainly lose customers and
  116.  trust if attacks are publically known.
  117.  
  118.  Internet service providers are a common target by crackers, as ISP servers
  119.  are easily accessible from the internet, and ISP's have access to large
  120.  fibre optic connections which can be used by crackers to move large
  121.  amounts of data across the internet. The larger ISP's also have customer
  122.  databases, which usually contain confidential user information such as
  123.  credit card numbers, names and addresses.
  124.  
  125.  Pharmaceutical companies are victims of mainly industrial espionage attempts,
  126.  where a team of crackers will be paid large amounts in exchange for stolen
  127.  pharmaceutical data, such drug companies often spend millions on research
  128.  and development, and a lot can be lost as a result of such an attack.
  129.  
  130.  Over the last 6 years, Government and defence agencies in the United States
  131.  have been victim to literally millions of attacks originating from the
  132.  internet. Due to the low information security budgets and the weak security
  133.  policies of such agencies, information security has become an uphill battle,
  134.  as government and military servers are constantly being probed and attacked
  135.  by crackers.
  136.  
  137.  Defence contractors, although security conscious, are targets to crackers
  138.  seeking classified or sensitive military data. Such data can then be
  139.  'sold on' by crackers to foreign groups. Although only a handful of these
  140.  cases have been publically known, such activities can occur at an alarming
  141.  rate.
  142.  
  143.  Multinational corporations are prime examples of victims of industrial
  144.  espionage attempts. Multinational corporations have offices based all around
  145.  the world, and large corporate networks are installed in order for employees
  146.  to be able to share information efficiently. NSS staff have performed
  147.  penetration tests for multinational corporations, and our findings in
  148.  most cases have shown that many can be compromised.
  149.  
  150.  Like pharmaceutical companies, multinational corporations operating in
  151.  electronics, software or computer-related industries, spend millions on
  152.  research and development of new technologies. It is very tempting for a
  153.  competitor of such a corporation, to employ a team of 'system crackers' to
  154.  steal data from a target corporation. Such data can then be used to quickly
  155.  and easily improve the competitors knowledge of key technologies, and result
  156.  in financial losses of the target corporation.
  157.  
  158.  Another form of attack adopted by competitors of corporations, is to 'take
  159.  down' a corporate network for a certain amount of time, this results in
  160.  loss of earnings for the target corporation. In most cases it is extremely
  161.  difficult to locate the source of such an attack. Depending on the internal
  162.  network segmentation in place, this kind of attack can be hugely effective
  163.  and result in massive financial losses.
  164.  
  165.  Such 'foul play' is commonplace in today's networked society, and should be
  166.  taken very seriously.
  167.  
  168.  
  169.  
  170. ------------------------------------------------------------------------------
  171.    1.2  Profile of a typical 'system cracker'
  172. ------------------------------------------------------------------------------
  173.  
  174.  
  175.  Studies have shown that typical a 'system cracker' is usually male, aged
  176.  between 16 and 25. Such crackers usually become interested in breaking into
  177.  machines and networks in order to improve their cracking skills, or to use
  178.  network resources for their own purposes. Most crackers are quite
  179.  persistent in their attacks, this is due to the amount of spare time an
  180.  average cracker has.
  181.  
  182.  
  183.  A high percentage of crackers are opportunists, and run scanners to check
  184.  massive numbers of hosts for remote system vulnerabilities. Upon identifying
  185.  hosts or networks that are vulnerable to remote attacks, the cracker will
  186.  usually gain root access to the host, then install a backdoor and patch the
  187.  host from common remote vulnerabilities, this prevents other crackers from
  188.  being able to use the same popular techniques to gain access to the host.
  189.  
  190.  Opportunists operate on primarily two domains, the first being the
  191.  internet, the second being telephone networks.
  192.  
  193.  To scan internet hosts for common remote vulnerabilities, the cracker will
  194.  usually launch a scanning operation from a host that he has access to with
  195.  a fast connection to the internet, usually on a fibre-optic connection.
  196.  
  197.  To scan for machines operating on telephone networks, being terminal servers,
  198.  bulletin board systems, or voice mail systems. The cracker will use a
  199.  wardialling program, this will automatically scan large amounts of telephone
  200.  numbers for 'carriers', thus identifying such systems.
  201.  
  202.  
  203.  A very small percentage of crackers actually define targets and attempt to
  204.  attack them, such crackers are far more skilled, and adopt 'cutting-edge'
  205.  techniques to compromise networks. It is known for these types of crackers
  206.  to attack corporate networks that are firewalled from the internet by
  207.  exploiting non-published vulnerabilities and 'features' in firewalls.
  208.  
  209.  The networks and hosts targeted by these crackers usually have sensitive
  210.  data contained within them, such as research and development notes,
  211.  or other data that will prove useful to the cracker.
  212.  
  213.  Such crackers are also known to have access to exploits and tools used by
  214.  security consultants and large security companies, and then use them to
  215.  scan defined targets for all known remote vulnerabilities. Crackers that
  216.  are attacking specific hosts are also usually very patient, and have been
  217.  known to spend many months gathering data before attempting to gain access
  218.  to a host or network.
  219.  
  220.  
  221.  
  222. ------------------------------------------------------------------------------
  223.    2.1  Networking methodologies adopted by many companies
  224. ------------------------------------------------------------------------------
  225.  
  226.  
  227.  A typical corporation will have an internet presence for the following
  228.  purposes :
  229.  
  230.    The hosting of corporate webservers
  231.    E-mail and other global communications via. the internet
  232.    To give employees internet access
  233.  
  234.  
  235.  Of the corporations NSS has performed network penetration tests from the
  236.  internet for, a networked environment is adopted where the corporate network
  237.  and the internet are seperated by firewalls and application proxies.
  238.  
  239.  In such environments, the corporate webservers and mailservers are usually
  240.  kept on the 'outside' of the corporate network, and then information is
  241.  passed via. trusted channels onto the corporate network.
  242.  
  243.  In the case of trust present between external mailservers and hosts on the
  244.  corporate network, a well-thought filtering policy has to be put into
  245.  effect, as usually the external mailservers should only be able to
  246.  connect to port 25 of a single 'secure' mailserver on the corporate
  247.  network, as this will massively minimise the probability of unauthorised
  248.  access, even if the external mailserver is compromised.
  249.  
  250.  One of the corporate networks NSS has performed penetration test on also had
  251.  a handful of 'dual-homed' hosts, these hosts had network interfaces active
  252.  on both the internet and the corporate network. From a security standpoint,
  253.  such hosts that operate on multiple networks can pose a massive threat to
  254.  network security, as upon compromising a host, it then acts as a simple
  255.  'bridge' between networks.
  256.  
  257.  
  258.  
  259. ------------------------------------------------------------------------------
  260.    2.2  Understanding vulnerabilities in such networked systems
  261. ------------------------------------------------------------------------------
  262.  
  263.  
  264.  On the internet, a corporation may have 5 external webservers, 2 external
  265.  mailservers, and a firewall or filtering system implemented.
  266.  
  267.  Webservers are usually not attacked by crackers wanting to gain access to
  268.  the corporate network, unless the firewall is misconfigured in some way
  269.  that will allow the cracker access to the corporate network upon compromising
  270.  the webserver. Although it is always good practise to secure your webservers
  271.  and run TCP wrappers to allow only trusted parties to connect to the telnet
  272.  and ftp ports.
  273.  
  274.  Mailservers are commonly targeted by crackers wanting to gain access to the
  275.  corporate network, as a mailserver must have access to mailservers on the
  276.  corporate network in order to distribute and exchange mail between the
  277.  internet and the corporate network. Again, depending on the filtering in
  278.  place, this tactic may or may not be effective on the cracker's part.
  279.  
  280.  Filtering routers are also commonly targeted by crackers with agressive-SNMP
  281.  scanners and community string brute-force programs, if such an attack is
  282.  effective, the router can easily be turned into a bridge, thus allowing
  283.  unauthorised access to the corporate network.
  284.  
  285.  
  286.  In this kind of situation the cracker will evaluate exactly which external
  287.  hosts he has access to, and then attempt to identify any kinds of trust
  288.  between the corporate network and the external hosts. Therefore if you
  289.  install TCP wrappers on all your external hosts, which define that only
  290.  trusted parties can connect to the critical ports of your hosts, which
  291.  are usually :
  292.  
  293.    ftp  (21),   ssh  (22),   telnet (23),   smtp   (25),   named (53),
  294.    pop3 (110),  imap (143),  rsh    (514),  rlogin (513),  lpd   (515).
  295.  
  296.  
  297.  SMTP, named and portmapper should be filtered accordingly depending on
  298.  the host's role is on the network.
  299.  
  300.  Such filtering has been proven to massively reduce the risk of an attack
  301.  on the corporate network.
  302.  
  303.  
  304.  In the cases of networks with no clear 'corporate to internet' network
  305.  security policy, multiple-homed hosts and misconfigured routers will exist.
  306.  A lack of internal network segmentation will also usually exist, this
  307.  makes it a lot easier for an cracker based on the internet to gain
  308.  unauthorised access to the corporate network.
  309.  
  310.  Corporate network mapping can easily occur if external DNS servers are
  311.  misconfigured, as NSS has performed penetration tests where we have been
  312.  able to map the corporate network via. such a misconfigured DNS server,
  313.  because of this, it is very important that DNS doesn't exist between
  314.  hosts on the corporate network and external hosts, it is far safer to
  315.  simply use IP addresses to connect to external machines from the corporate
  316.  network and vice-versa.
  317.  
  318.  Insecure hosts with network interfaces active on multiple networks can
  319.  be abused to gain access to the corporate network very easily.
  320.  The insecure host doesn't even have to be compromised. It is very easy
  321.  to abuse a finger daemon on such a host that allows forwarding.. as users,
  322.  hosts and other network information can be collected to identify easily
  323.  exploitable hosts on the corporate network, the operating system of a
  324.  host can even be determined in many cases by issuing a finger request
  325.  for root@host, bin@host and daemon@host. 
  326.  
  327.  
  328.  Some crackers are now starting to adopt techniques regarding the
  329.  'wardialling' of corporate locations, such as buildings and network
  330.  operation centres.
  331.  
  332.  If a cracker was to find and then compromise a corporate terminal server,
  333.  he would usually have a degree of access to the corporate network, thus
  334.  totally bypassing any firewalls or filters that seperate the corporate
  335.  network from the internet. It is therefore very important to identify
  336.  and ensure the security of your terminal servers, logging of connections
  337.  to such servers is also strongly advised.
  338.  
  339.  
  340.  When trying to understand vulnerabilities in networked systems, a key
  341.  point to remember, is trust between hosts on your network. Either
  342.  through the use of TCP wrappers, hosts.equiv files, .rhosts or .shosts
  343.  files, many larger networks are commonly attacked by exploiting the
  344.  trust between hosts.
  345.  
  346.  For example, if an attacker uses a CGI exploit to view your hosts.allow
  347.  file, he may find that you all connections to your ftp and telnet ports
  348.  from *.trusted.com. Of course, the attacker can then gain access to any
  349.  host at trusted.com, and gain access to your hosts easily.
  350.  
  351.  For these reasons, it is always a good idea to ensure that trusted hosts
  352.  are equally secure from remote attack.
  353.  
  354.  
  355.  One other attack that should be mentioned, is the installation of trojans
  356.  and backdoors on corporate hosts (such as Windows 95/98 machines), if the
  357.  employees have internet access through using an application proxy and a
  358.  firewall, then they will sometimes visit 'warez' sites to download pirated
  359.  software.
  360.  
  361.  Such 'warez' sites usually have screesaver software, and other utilities
  362.  on offer, which in some cases contain trojan horse programs, such as the
  363.  Cult of the Dead Cow's 'Back Orifice' trojan. Upon the installation of
  364.  the screensaver, the trojan infests itself within the machine's registry
  365.  and is run every time the machine boots.
  366.  
  367.  In the case of the BO trojan, plugins can be applied to the trojan to
  368.  make the machine perform certain operations automatically, such as connect
  369.  to IRC servers and join channels, and the like. This can prove very
  370.  dangerous, as a trojaned machine on your corporate network could easily
  371.  be controlled by someone on the internet.
  372.  
  373.  The BO trojan is infinitely more effective if the cracker already has
  374.  access to the corporate network, either because he is an employee or has
  375.  unauthorised access to corporate hosts. The BO trojan could be installed
  376.  on every single Windows 95/98 machine in a matter of weeks if the cracker
  377.  uses the correct strategy, after which he will have total remote control
  378.  over the machines in question, including being able to manipulate files,
  379.  reboot machines and even format drives, entirely remotely.
  380.  
  381.  
  382.  
  383. ------------------------------------------------------------------------------
  384.    3.1  Techniques used to 'cloak' the attackers location
  385. ------------------------------------------------------------------------------
  386.  
  387.  
  388.  Typical crackers will usually use the following techniques to hide
  389.  their true IP address :
  390.  
  391.    - Bouncing through previously compromised hosts via. telnet or rsh.
  392.    - Bouncing through windows hosts via. Wingates.
  393.    - Bouncing through hosts using misconfigured proxies.
  394.  
  395.  
  396.  If such a cracker has a pattern of always scanning your hosts from previously
  397.  compromised machines, wingates or proxies, then it is advisable to contact
  398.  the administrator of the machine by telephone, and notify him of the problems
  399.  in hand. Never e-mail an administrator in such a case, because the cracker
  400.  can simply intercept the e-mail beforehand.
  401.  
  402.  
  403.  The more talented crackers who are skilled in breaking into hosts via.
  404.  telephone exchanges, may use the following techniques :
  405.  
  406.   - Bouncing through '800-number' private telephone exchanges before
  407.     connecting to an ISP using a 'cracked', 'phished' or 'carded' account.
  408.  
  409.   - Connecting to a host by telephone, that is in turn connected to the
  410.     internet.
  411.  
  412.  
  413.  
  414.  Crackers adopting the techniques of bouncing through telephone networks
  415.  before connecting to the internet are extremely hard to track down,
  416.  because they could be literally anywhere in the world. If a cracker
  417.  was to use an '800-number' dialup, he could dial into machines globally
  418.  without having to worry about the cost.
  419.  
  420.  
  421.  
  422. ------------------------------------------------------------------------------
  423.    3.2  Network probing and information gathering
  424. ------------------------------------------------------------------------------
  425.  
  426.  
  427.  Before setting out to attack a corporate network from the internet, a typical
  428.  cracker will perform some preliminary probes of your networks external
  429.  hosts present on the internet. A cracker will attempt to gain external and
  430.  internal hostnames by using the following techniques :
  431.  
  432.    - Using nslookup to perform 'ls <domain or network>' requests.
  433.    - View the HTML on your webservers to identify any other hosts.
  434.    - View the documents on your FTP servers.
  435.    - Connect to your mailservers and perform 'expn <user>' requests.
  436.    - Finger users on your external hosts.
  437.  
  438.  
  439.  Crackers usually attempt to gather information about the layout of your
  440.  network itself first as opposed to identifying specific vulnerabilities.
  441.  
  442.  By looking at results from the queries listed above, it is usually easy
  443.  for a cracker to build a list of hosts and start to understand the
  444.  relationships that exist between them.
  445.  
  446.  When performing these preliminary probes, a typical cracker will make
  447.  very small mistakes and sometimes use his own IP to connect to ports of
  448.  your machines to check operating system versions and other small details.
  449.  
  450.  If your hosts are compromised, it is a good idea to check your FTP and
  451.  HTTPD logs for the presence of any strange requests.
  452.  
  453.  
  454.  
  455. ------------------------------------------------------------------------------
  456.    3.3  Identifying trusted network components
  457. ------------------------------------------------------------------------------
  458.  
  459.  
  460.  Crackers look for trusted network components to attack, a trusted network
  461.  component is usually an administrators machine, or a server that is regarded
  462.  as secure.
  463.  
  464.  A cracker will start out by checking the NFS exports of any of your machines
  465.  running nfsd or mountd, the case being that critical directories on some
  466.  of your hosts (such as /usr/bin, /etc and /home for example) may be
  467.  mountable by such a trusted host.
  468.  
  469.  The finger daemon is often abused to identify trusted hosts and users,
  470.  being users who often log into the machine from specific hosts.
  471.  
  472.  The cracker will then check your machines for other forms of trust, if he
  473.  can exploit a machine using a CGI vulnerability, he may gain access to a
  474.  hosts /etc/hosts.allow file, for example.
  475.  
  476.  After analysing the data from the above checks, the cracker will start
  477.  to identify trust between hosts. The next step for the cracker is to
  478.  identify any trusted hosts that are vulnerable to a remote compromise.
  479.  
  480.  
  481.  
  482. ------------------------------------------------------------------------------
  483.    3.4  Identifying vulnerable network components
  484. ------------------------------------------------------------------------------
  485.  
  486.  
  487.  If a cracker can build lists of your external and internal hosts, he
  488.  will use Linux programs such as ADMhack, mscan, nmap and many smaller
  489.  scanners to scan for specific remote vulnerabilities.
  490.  
  491.  Usuaully such scans of your external hosts will be launched from machines
  492.  on fast fibre-optic connections, ADMhack requires to be run as root on a
  493.  Linux machine, so a cracker will probably use a Linux machine that he has
  494.  gained unauthorised access to and properly installed a 'rootkit' on. Such a
  495.  'rootkit' is used to backdoor critical system binaries to allow unauthorised
  496.  and undetectable access to the host.
  497.  
  498.  The systems administrators of the hosts that are used to scan external
  499.  corporate hosts usually have no idea that scans are being launched from
  500.  their machines, as binaries such as 'ps' and 'netstat' are trojaned to
  501.  hide scanning processes.
  502.  
  503.  
  504.  Other programs such as mscan and nmap don't require to be run as root, and
  505.  so can be launched from Linux (or other platforms in the case of nmap)
  506.  hosts to effectively identify remote vulnerabilities, although these scans
  507.  are slower, and cannot usually be hidden very well (as the attacker doesn't
  508.  need root access to the host as with ADMhack).
  509.  
  510.  
  511.  Both ADMhack and mscan perform the following types of checks on
  512.  remote hosts :
  513.  
  514.   - A TCP portscan of a host.
  515.   - A dump of the RPC services running via. portmapper.
  516.   - A listing of exports present via. nfsd.
  517.   - A listing of shares present via. samba or netbios.
  518.   - Multiple finger requests to identify default accounts.
  519.   - CGI vulnerability scanning.
  520.   - Identification of vulnerable versions of server daemons, including
  521.     Sendmail, IMAP, POP3, RPC status and RPC mountd.
  522.  
  523.  
  524.  Programs such as SATAN are rarely used by crackers nowadays, as they are
  525.  slow.. and scan for outdated vulnerabilities.
  526.  
  527.  After running ADMhack or mscan on the external hosts, the cracker will have
  528.  a good idea of vulnerable or secure hosts.
  529.  
  530.  If routers are present that are SNMP capable, the more advanced crackers
  531.  will adopt agressive-SNMP scanning techniques to try and 'brute force'
  532.  the public and private community strings of such devices.
  533.  
  534.  
  535.  
  536. ------------------------------------------------------------------------------
  537.    3.5  Taking advantage of vulnerable network components
  538. ------------------------------------------------------------------------------
  539.  
  540.  
  541.  So the cracker has identified any trusted external hosts, and also identified
  542.  any vulnerabilities in external hosts. If any vulnerable network components
  543.  were identified, then he will attempt to compromise your hosts.
  544.  
  545.  A patient cracker won't compromise your hosts during normal hours, he will
  546.  usually launch an attack between 9pm in the evening and 6am the next morning,
  547.  this will reduce the likelyhood of anyone knowing about the attack, and give
  548.  the cracker ample time to install backdoors and sniffers on your hosts
  549.  without having to worry about the presence of Systems Administrators.
  550.  
  551.  Most crackers have a great deal of spare time over weekends, and attacks
  552.  are usually launched then.
  553.  
  554.  The cracker will compromise an external trusted host that can be used as
  555.  a point from which to launch an attack on the corporate network. Depending
  556.  on the filtering between the corporate network and the external corporate
  557.  hosts, this technique may or may not work.
  558.  
  559.  If the cracker compromises an external mailserver, which in turn has total
  560.  access to a segment of the internal corporate network, then he can start
  561.  work on embedding himself deeply into your network.
  562.  
  563.  To compromise most networked components, crackers will use programs to
  564.  remotely exploit vulnerable versions of server daemons running on external
  565.  hosts, such examples include vulnerable versions of Sendmail, IMAP, POP3
  566.  and RPC services such as statd, mountd and pcnfsd.
  567.  
  568.  Most remote exploits used by crackers are launched from previously
  569.  compromised hosts, as in some cases they need to be compiled on the same
  570.  platform as the host they are to be used to exploit.
  571.  
  572.  Upon executing such a program remotely to exploit a vulnerable server daemon
  573.  running on your external host, the cracker will usually gain root access to
  574.  your host, which in turn can be abused to gain access to other hosts and
  575.  the corporate network.
  576.  
  577.  
  578.  
  579. ------------------------------------------------------------------------------
  580.    3.6  Upon gain access to vulnerable network components
  581. ------------------------------------------------------------------------------
  582.  
  583.  
  584.  After exploiting a server daemon, the cracker will start a 'clean-up'
  585.  operation of doctoring your hosts logs and 'backdooring' service binaries
  586.  so he can access the host undetected later.
  587.  
  588.  First he will start to implement backdoors, so he can later access the
  589.  host. Most backdoors that crackers use are precompiled, and techniques are
  590.  adopted to change the date and the permissions of the binary that has
  591.  been backdoored, in some cases, even the filesize of the new binary is the
  592.  same as the original binary. Attackers conscious of FTP transfer logs
  593.  may use the 'rcp' program to copy backdoored programs to hosts.
  594.  
  595.  It is unlikely that such a cracker breaking into a corporate network
  596.  will start to patch your hosts from vulnerabilities, he will usually
  597.  only install backdoors and trojan critical system binaries such as 'ps'
  598.  and 'netstat' to hide any connections he may make to and from the host.
  599.  
  600.  The following critical binaries are usually backdoored on Solaris 2.x
  601.  machines :
  602.  
  603.    /usr/bin/login
  604.    /usr/sbin/ping
  605.    /usr/sbin/in.telnetd
  606.    /usr/sbin/in.rshd
  607.    /usr/sbin/in.rlogind
  608.  
  609.  
  610.  Some crackers have also been known to place an .rhosts file in the
  611.  /usr/bin directory to allow remote bin access to the host via. rsh
  612.  and csh in interactive mode.
  613.  
  614.  The next thing that most crackers do is to check the host for any
  615.  presence of logging systems that may have logged his connections to
  616.  the host, he will then proceed to edit such connections out of any
  617.  logs found on the host. It is advisable to log to a lineprinter if
  618.  the machine is very likely to be a prime target of an attack, as
  619.  this makes it extremely difficult for the cracker to edit himself
  620.  from the logs.
  621.  
  622.  Upon ensuring that his presence has not been logged in any way, the
  623.  cracker will proceed to invade the corporate network. Most crackers
  624.  won't bother exploiting vulnerabilities in other external hosts if
  625.  they have access to the internal network.
  626.  
  627.  
  628.  
  629. ------------------------------------------------------------------------------
  630.    4.1  Downloading sensitive information
  631. ------------------------------------------------------------------------------
  632.  
  633.  
  634.  If the cracker's goal is to download sensitive information from FTP servers
  635.  or webservers on the internal corporate network, he can do so from the
  636.  external host that is acting as a 'bridge' between the internet and
  637.  corporate network.
  638.  
  639.  However, if the cracker's goal is to download sensitive information held
  640.  within internally networked hosts, he will proceed to attempt to gain
  641.  access to them by abusing the trust with the external host he already
  642.  has access to.
  643.  
  644.  
  645. ------------------------------------------------------------------------------
  646.    4.2  Cracking other trusted hosts and networks
  647. ------------------------------------------------------------------------------
  648.  
  649.  
  650.  Most crackers will simply repeat the steps taken in sections 3.2, 3.3,
  651.  3.4 and 3.5 to probe and gain access to hosts on the internal corporate
  652.  network, depending on what the cracker is attempting to achieve,
  653.  trojans and backdoors may or may not be installed on your internal
  654.  hosts.
  655.  
  656.  If the cracker wishes to achieve total network access to the hosts on
  657.  the internal network, he will install trojans and backdoors and remove
  658.  logs as in section 3.6. Crackers will also install sniffers on your
  659.  hosts, these are explained in section 4.3.
  660.  
  661.  If the cracker merely wishes to download data from key servers,
  662.  he will take different approaches to gaining access to your hosts,
  663.  such as identifying and attacking key hosts that are trusted by the
  664.  target key servers.
  665.  
  666.  
  667.  
  668. ------------------------------------------------------------------------------
  669.    4.3  Installing sniffers
  670. ------------------------------------------------------------------------------
  671.  
  672.  
  673.  An extremely effective way for crackers to quickly obtain large amounts of
  674.  usernames and passwords for internally networked hosts is to use
  675.  'ethernet sniffer' programs. Because such 'sniffer' programs need to
  676.  operate on the same ethernet as the hosts the cracker wants to gain
  677.  access to, it would be ineffective to run a sniffer on the external host
  678.  he is using as a bridge.
  679.  
  680.  To 'sniff' data flowing across the internal network, the cracker must
  681.  perform a remote root compromise of an internal host that is on the same
  682.  ethernet as a number of other internal hosts. The techniques mentioned
  683.  in sections 3.2, 3.3, 3.4, 3.5 and 3.6 are adopted here, as the cracker
  684.  must compromise and backdoor the host successfully to ensure that the
  685.  sniffer program can be installed and used effectively.
  686.  
  687.  Upon compromising, installing a backdoor and installing trojaned 'ps'
  688.  and 'netstat' programs, the cracker must then install the 'ethernet sniffer'
  689.  program on the host. Such sniffer programs are usually installed in the
  690.  /usr/bin or /dev directories under Solaris 2.x, and then modified to seem
  691.  as if they were installed with all the other system binaries.
  692.  
  693.  Most 'ethernet sniffers' run in the background and output to a log on the
  694.  local machine, it is important to remember that the cracker will usually
  695.  backdoor the 'ps' binary, so the process may not be noticeable.
  696.  
  697.  Such 'ethernet sniffers' work by turning a network interface into
  698.  'promiscuous mode', the interface then listens and logs to the sniffer
  699.  logfile, any useful usernames, passwords or other data that can be used
  700.  by the cracker to gain access to other networked hosts.
  701.  
  702.  Because 'ethernet sniffers' are installed on ethernets, literally any
  703.  data travelling across that network can be sniffed, it doesn't have to
  704.  be travelling to or from the host on which the sniffer is installed.
  705.  
  706.  The cracker will usually return a week later and download the logfile
  707.  created by the 'sniffer' program. In the case of a corporate network
  708.  breach such as this, it is likely that the sniffer will be set up very
  709.  well, and hardly detectable unless a good security policy is implemented.
  710.  
  711.  A very good utility used by many security-conscious Administrators is
  712.  Tripwire, which is available from COAST (see section 5.2). Tripwire
  713.  makes an MD5 'fingerprint' of your filesystem, and will detect any
  714.  modifications to your files made by malicious users or crackers.
  715.  
  716.  To detect promiscuous network interfaces (a common sign of a sniffer
  717.  installation), the 'cpm' tool available from CERT is very useful,
  718.  see http://www.cert.org/ftp/tools/cpm/ for more information.
  719.  
  720.  
  721.  
  722. ------------------------------------------------------------------------------
  723.    4.4  Taking down networks
  724. ------------------------------------------------------------------------------
  725.  
  726.  
  727.  If a cracker can compromise key servers running server applications such
  728.  as databases, network operations systems or any other 'mission critical'
  729.  functions, it is easy for him to take down your network for a period of
  730.  time.
  731.  
  732.  A crude, but not unusual technique adopted by crackers attempting to
  733.  disable network functions, would be to delete all the files from the
  734.  key servers by issuing an 'rm -rf / &' command on the server. Depending
  735.  on the backup system implemented, the system could be for anything from
  736.  hours, to months.
  737.  
  738.  
  739.  If a cracker was to gain access to your internal network, he could abuse
  740.  vulnerabilities present in many routers such as in the Cisco, Bay and
  741.  Ascend brands. In some cases the cracker could restart, or shut down
  742.  routers entirely until an administrator was to reboot them.
  743.  This can cause big problems regarding network functionality,
  744.  as if the cracker was to assemble a list of vulnerable routers that
  745.  performed key networking roles (if they were used on the corporate
  746.  backbone for example), then he could easily disable the corporations
  747.  networking ability for some time.
  748.  
  749.  
  750.  For these reasons, it is very important that 'mission critical' routers
  751.  and servers are always patched and secure.
  752.  
  753.  
  754.  
  755. ------------------------------------------------------------------------------
  756.    5.1  Suggested reading
  757. ------------------------------------------------------------------------------
  758.  
  759.  
  760.  There are many good papers available to help you maintain security of your
  761.  external and internal hosts and routers, we recommend you visit the following
  762.  websites and take a look at the following books if you wish to learn more
  763.  about securing large networks and hosts :
  764.  
  765.   http://www.antionline.com/archives/documents/advanced/
  766.   http://www.rootshell.com/beta/documentation.html
  767.   http://seclab.cs.ucdavis.edu/papers.html
  768.   http://rhino9.ml.org/textware/
  769.  
  770.  
  771.   'Practical Unix & Internet Security'
  772.   ------------------------------------
  773.  
  774.   A good introduction into Unix and Internet security if you really haven't
  775.   read much into the subject before.
  776.  
  777.  
  778.     Simson Garfinkel and Gene Spafford
  779.     O'Reilly & Associates, Inc.
  780.     ISBN 1-56592-148-8
  781.  
  782.     US $39.95  CAN $56.95   (UK around 30 pounds)
  783.  
  784.  
  785.  
  786. ------------------------------------------------------------------------------
  787.    5.2  Suggested tools and programs
  788. ------------------------------------------------------------------------------
  789.  
  790.  
  791.  There are many good free security programs available for common platforms
  792.  such as Solaris, IRIX, Linux, AIX, HP-UX and Windows NT, we recommend you
  793.  take a look at the following websites for information on such free security
  794.  tools :
  795.  
  796.    ftp://coast.cs.purdue.edu/pub/tools/unix/
  797.   http://www.alw.nih.gov/Security/prog-full.html
  798.   http://rhino9.ml.org/software/
  799.  
  800.  
  801.  Network Security Solutions Ltd., is also currently developing a plethora
  802.  of security tools for Unix and Windows based platforms, these will be
  803.  available over the next few months, feel free to visit our site at
  804.  http://www.ns2.co.uk , also look out for free 'lite' versions of our
  805.  software!
  806.  
  807.  
  808.  
  809. ------------------------------------------------------------------------------
  810.  
  811.               Copyright (c) Network Security Solutions Ltd. 1998
  812.                All rights reserved, all trademarks acknowledged
  813.  
  814.  
  815.                            http://www.ns2.co.uk
  816.  
  817.  
  818.              This document may be distributed in the public domain
  819.              as long as the above copyright notices remain intact.
  820.  
  821. ------------------------------------------------------------------------------
  822.