router and infrastructure hacking first we take manhattan, then we take berlin… raven alder, nmrc

35
Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Post on 19-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Router and Infrastructure Hacking

First we take Manhattan, then we take Berlin…

Raven Alder, NMRC

Page 2: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Why bother?

Control over your backbone is control over your data

Man in the middle attacks, rerouting, selective data interruption

Security for infrastructure lagging as a priority, operational awareness/caring not always present

Page 3: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

You already know how

Basic pen-test methodology holds, but particulars vary.

Reconnaissance may now include “who are their known BGP peers”, “what do the route servers say about how their block is propagated”, “do they list human POCs with the registrar”.

Gather data, map network/targets, attack, review, recurse.

What hardware are they using? What version of software? What management or routing protocols?

Page 4: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Good backbone recon

Stack fingerprinting is spottier, not helped by many many many possible code trains.

Feed nmap database when you find something that you know

Try service identification, looking in particular for CDP and SNMP

Check for OOB access modems -- war dialing lives again, and many modems are poorly protected

Page 5: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Major surfaces of attack

Weak passwords (boring but successful) Poorly defended web/admin interfaces Social engineering Authentication server hijack Tactical DoS/infrastructure replacement Protocol sniffing (easier than you’d think) Direct attack/overflow Routing manipulation

Page 6: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Weak Passwords

Defaults still enabled on an amazing number of infrastructure devices, great lists online (http://www.phenoelit.de/dpl/dpl.html)

The more obscure the device, the more likely that the default has not been changed

Admins often do not think to limit access to infrastructure devices, outward-facing or DMZ ones in particular

Cracking and forcing programs increasingly popular -- MD5s can be fed to John the Ripper, cisco_torch or hydra to peg the routers

Page 7: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Web/Admin interfaces

Often still open to world, should not be, vulnerable to standard webapp attacks. (Cookie: LoggedIn == True!)

Look up the admin port if you can identify the device type , investigate defaults, known vulns.

Reuse passwords, write similar crackers

Page 8: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Social Engineering (still works)

“I’m Jane from RIPE, and we wish to verify your IP allocation… we just need to log in and dump a copy of your routing table…”

For attacks requiring physical access, a shiny hat will often get you access to the telco closet. (Extant outages hasten this.)

Etc., etc., standards.

Page 9: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Authentication server hijack

Many auth servers are running on poorly secured boxes, and are vulnerable to either OS exploits or attacks against the service itself.

If you own the authentication server, you can grant yourself access to anything that queries it.

Page 10: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Tactical DoS/replacement

Auth servers often DoSable Insert your own box after you’ve downed it

(requires physical access or an appropriate wireless segment).

This works for other devices, too -- end routers are also good things to become.

Is a failover or backup path easier to compromise? Can you trigger a failure?

When wireless is involved, this becomes far, far easier.

Page 11: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Protocol sniffing

Many routing protocols broadcast to find neighbors.

Many routing operators don’t know/care that edge interfaces should be passive.

Even many “secure” versions of the protocols do things like passing auth data in the clear.

Again, wireless makes this worse.

Page 12: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Direct attack/overflow

Possible though not publicly popular against some routers

Many memory management bugs have the capability to become these, though stack and heap watchdog processes must still be addressed if present on the platform

Extant bugs in incorporated software may be carried right along in, and updating/versioning is not always swift.

Page 13: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Routing manipulation

If you can peer with a router, you can usually manipulate its routing tables

With zebra or similar software suites, making a router-on-a-stick is easy

Since more-specific routes are generally preferred, you can advertise someone else’s space back to them and get priority

Hijacking will be noticed (if not always understood), be aware

You can also add a currently unused subnet routed to you (stealthier), or hijack someone else’s block.

Page 14: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

The trouble with logging

Many infrastructure devices only log locally. This makes erasing evidence of a successful hijack easier.

When such devices do log centrally, often authentication is cleartext or nonexistent. This leaves the messages open to interception and the log server open to DoS.

Surprisingly few people watch the router logs unless there’s a Problem, and even then, often only ACL denies and local error conditions are logged. This works to the attacker’s advantage.

Page 15: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Tools for the backbone pen-tester

eigrp.pl in EIGRP Tools, http://www.hackingciscoexposed.com/?link=tools

Zebra for OSPF (http://www.zebra.org/) Yersinia for HSRP, CDP, and other layer 2 attacks

(http://www.yersinia.net) Phenoelit's IRPAS and VIPPR tools

(http://www.phenoelit.de/fr/tools.html) Cisco torch (http://packetstormsecurity.org/cisco/) CDP-tools for lying (http://freshmeat.net/projects/cdp-

tools/) Hydra for brute force, Nmap & amap for id

Page 16: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

How difficult is this?

Not many people with both the skillset and interest, but the number is on the rise

A ticked off network engineer can wreak some serious damage

More widespread interest after Ciscogate “Hacking Cisco Networks Exposed” book

published last year, many tools referenced there have wider infrastructure capabilities

Page 17: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Defense best practices

Test your infrastructure like you test your servers.

White-box pen-testing, design audit Support with policy and incident response

planning Patch management -- update

IOS/CatOS/JunOS as needed

Page 18: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Policy and contracts

Talk with your ISPs about security and responsiveness

DDoS mitigation well known, but make sure they’ll support you with other security issues

Establish a good relationship *before* things are on fire.

Have a security contact, just in case.

Page 19: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Incident Response

Have network people designated as area-specific contacts in case of a security incident.

Log verbosely enough to do good post-mortem analysis in the event of an attack.

Tie this in to your existing security policy

Page 20: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Proactive backbone audit

Check for leaking information -- a packet sniffer on your edge or untrusted networks will tell you a lot.

Make sure that routing and management traffic is encrypted and authenticated whenever possible.

Minimize unnecessary chatter when not debugging.

Page 21: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Encryption

Use SSH rather than telnet to manage infrastructure devices

SSHv2 beats SSHv1, but SSHv1 is better than plain old telnet

Choose IOS images that support encryption Encrypt logs as they transit the network

whenever possible

Page 22: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Authenticate routing

Use BGP MD5 authentication with BGP peers

Other internal gateway protocols will allow authentication keys to be added -- EIGRP, OSPF, IS-IS

This reduces the risk of an outsider spoofing traffic as one of your routers

Page 23: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Stay wired

Routing and management traffic over wireless is often the worst of all worlds

Take extra security precautions, as just anyone can drive up and start talking to you.

This isn’t just not securing your data, it’s *advertising*.

Page 24: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Protect your auth servers

Pen-testers attacking your authentication servers can hit gold.

Logins for the entire network, or for net admins, are very valuable

Never use cisco/cisco or other vendor defaults.

Choose strong passwords that won’t be brute forced.

Page 25: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Adopt defense in depth

If your auth server is compromised, you want to see it. Firewalls, IDS, verbose logging on your devices, and an active monitoring system will all help.

Management and policy support is crucial. Without this, even the best techies can fail.

Page 26: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Filter wisely

Don’t allow people to announce private net-space or your own blocks to you. It’s probably bad.

Only announce your own netblocks out. Egress filtering will save you embarassment.

Consider bogon filtering.

Page 27: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Filtering, v2

Only allow management workstations to connect to infrastructure devices

Firewall your network sanely -- default deny is your friend

Flag anomalous traffic coming from infrastructure devices; compromised machines may show it (spam over telnet)

Page 28: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Update IOS/CatOS/JunOS

Standardize on as few versions as possible that support your needed features

Update when there’s a new security threat. Work with your vendor to choose the right

version for your network, and test thoroughly in the lab before deploying.

Page 29: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Lock down your devices

Follow the secure router and BGP templates http://www.cymru.com/Documents/secure-

ios-template.html http://www.cymru.com/Documents/secure-

bgp-template.html http://www.cymru.com/gillsr/documents/

junos-bgp-template.pdf

Page 30: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

What do I look for?

Uptime and availability issues Sudden processor/memory spikes Read relevant mailing lists -- NANOG,

your incident response list of choice Vulnerability disclosures or vendor

notifications

Page 31: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Incorporating this

Add a backbone device audit into your periodic network assessments

Plan for patching and incident response just like any other network device

Have your admins stay current via mailing lists and vendor bulletins

Backbone security should be part of defense in depth

Page 32: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

New areas of research

Backbone/management crypto implementation testing

Fuzzing of backbone protocols Exploit code vs. devices Strong mutual authentication

Page 33: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Creating new problems

Identify the areas where you can input data or cause device state change.

Figure out what you want from them. DoS? Authentication bypass? Access?

The majority of new bugs found are not theoretically new attacks, they’re poor implementations of existing tech. Try what you know -- it may work.

Page 34: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Questions, comments, and flung tomatoes

Case studies? War stories? Other?

Page 35: Router and Infrastructure Hacking First we take Manhattan, then we take Berlin… Raven Alder, NMRC

Thanks for listening.

[email protected]@nmrc.org