Skip to main content

Posts

Showing posts from 2012

DS commands and FOR loops

Good old fashion "ds" commands, basic but always available and just do the job! While now days we have PowerShell, I still do come across Win 2003 boxes. DS commands in combination with FOR loops are quite powerful. How to query Active Directory for disabled computer accounts and move them to specified OU? for /f "Tokens=*" %s in ('dsquery computer -disabled -limit 0') do (DSMOVE %s -newparent "ou=Disabled_Computers,dc=securesenses,dc=net") How to move computers to a specified OU using list of hostnames? (hostnames must be listed on per line) for /f "Tokens=*" %i in (comps.txt) do dsquery computer -name %i | (dsmove -newparent "OU=DBServers,OU=Servers,dc=securesenses,dc=net") How to create security groups with  descriptions  listed in a text file? for /f "delims=, tokens=1,2" %i in (groups.txt) do dsadd group "CN=%i,OU=Groups,DC=securesenses,DC=net" -desc %j How to disable...

WMIC

WMIC is a command line interface to WMI (Windows Management Instrumentation). WMI is a powerful management interface that we can access from directly from command line.  WMIC can be used to manage remote computers.  If we want to execute WMIC commands on a single computer we prepend command with /node: as shown below: /node:hostname123   - specifies single server  ( wmic /node:hostname123 qfe where hotfixid="KB974571" list full) If we want to execute WMIC commands on multiple computers listed in c:\nodes.txt we prepend command with /node:@ as shown below: /node:@'c:\node.txt' - specifies text file with server names    ( wmic /node:@'c:\node.txt' qfe where hotfixid="KB974571" list full) It's worth keeping in mind that not all WMI classes have corresponding classes (called aliases) in WMIC. It is however possible to access WMI classes directly from WMIC: wmic /namespace:\\root\ NAMSPACE path CLASSNAME ...

Cisco Secure ACS 5.3 and GNS3

In a previous post I showed how I installed ACS in VBox. The reason I wanted it in VBox was so I could add it to GNS3 topology as a host. GNS uses first NIC in of a VM as a “management” NIC and adds a second NIC for linking within the topology.  ACS supports only single NIC (even the hardware appliance that comes with 4 NICs, has 3 of them disabled). “Runtime”  is the process that listens to and processes TACACS and RADIUS requests. It gets “bound” to the IP addresses configured during the initial setup. When ACS is added to GNS and second NIC installed and configured, the "runtime" still listens only on the first NICs IP address. Configuring the second NIC, disabling the first one and restarting ACS application results in "runtime" not starting at all. To get around that, I needed to do the following at the ACS’s console once ACS was added to GNS as a VBox host: 1.          Configure second NIC with the same IP address as the f...

Monitoring Cisco Secure ACS 5 for authentication failures

Monitoring and alerting on failed authentication attempts is a crucial part of a security strategy. Failed authentication events may be a result of someone trying to guess or brute force passwords.   ACS is used for controlling access to network devices such as switches, routers, firewalls as well as authenticating VPN connections and wireless access. Authentication failures from ACS could alert us of an attacker trying to establish remote connection over VPN or trying to penetrate our wireless. We’ll need 3 separate alarms to notify us of: Attempts to access network devices (TACACS+ authentication failures )         Attempts to penetrate wireless or VPN (RADIUS authentication failures)            Attempts to access ACS admin interface (ACS Instance authentication failures) To configure alerting we need to go to: “Monitoring and Reports” -> “Launch Monitoring & Report Viewer”  “Alarms” -> “...

Installing Cisco Secure ACS 5.3 in VirtualBox

ACS 5.3 is supported on a hardware appliance, VMWare ESX and VMWare Server. Even though not supported, it works without modification in VMWare Player. None of the above helps us if we want to test it with switches or routers in GNS3. While version 5.2 could be installed in VirtualBox, v5.3 consistently failed installation with “Unsupported hardware” error message. After trying all possible combinations of virtual hardware in VBox it still refused to install. After some hacking I eventually managed to get working. Installation requires modification of the ISO image provided by Cisco and a bit of cheating in the kickstart file and pre-creation of partitions in the VM. We will need ISO editor (ISOpen or MagicISO), text editor (such as Notepad++) and a Linux live CD of your choice. VBox hardware configuration: OS Type: RedHat RAM: 1024 CPU: PAE/NX enabled, VT-x/AMD-V disabled Floppy: Disabled Storage: Disk 70GB (I used dynamically expanded), Controller SCSI, SCSI Port 0...

Linux auditing using Nessus

Nessus can scan a range of Linux flavours. As of writing these are: CentOS Debian Fedora Gentoo Red Hat Slackware SuSE Ubuntu There are two types of scans Nessus can run against Linux hosts:  Patch audit Compliance audit Patch audit - the plugin families are "[distro name] Local Security Checks". Nessus will audit targets and report on missing security patches based on advisories  released  by respective distributions. Nessus requires credentials in order to preform this type of scan as this are local checks. Tenable recommends that root level  credentials are used, though  I have been able to successfully scan Linux hosts with a "standard" account.  This however depends on distribution and how hardened it is. On Red Hat distros Nessus executes the following commands which work with non-root accounts: $rpm -qa $uname -a Nessus then compares its database with versions of kernel and installed packages. ...

Securing OSPF

There are multiple ways to secure OSPF.  The essential one is authentication. By default there isn't any validation to assure legitimacy of an OSPF topology update. Basically an attacker or a bored employee could install a physical router and become a member of a routing system. Alternately a tool such as LOKI ( http://www.ernw.de/content/e6/e180/index_eng.html ) could be used. LOKI provides a GUI and is very simple to use, I however found it a bit buggy. More on that can be found in my Attacking OSPF - route injection post. Other tools that could be used include:  SCAPY  http://www.secdev.org/projects/scapy/  - very advanced and fairly complicated packet generation tool, to craft OSPF packets it requires OSPF extension TCPREPLAY -  http://tcpreplay.synfin.net/  - a legitimate OSPF adjacency set up and database exchange could be captured, modified and replayed (I had limited success w...

Attacking OSPF - route injection

LOKI and author's Black Hat presentation can be downloa ded here:   http://www.ernw.de/content/e6/e180/index_eng.html   Falsifying routing information can have disastrous consequences to network stability. For example an attacker could reroute traffic through a monitoring station and capture traffic for later analysis. An attacker could also reroute traffic to a black hole or reroute a 10 Gig transit link traffic towards a 1 GB link causing a Denial of Service (DoS) condition.  Both network topology and scenario presented in this post are extremely simplistic but should be sufficient to present potential implications. Our topology: R1's routing table looks as follows: R1#show ip route C    20.0.0.0/8 is directly connected, FastEthernet1/0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.0.0 is directly connected, FastEthernet0/0 O    192.168.5.0/24 [110/2] via 172.16.0.1, 0...