Saturday, July 12, 2014

A Nexus 3548 traffic policer howto

In NX OS 6.0  and on a 3548 switch it's a little bit different than cisco-ios and with regards on how to craft a traffic "policer"  for rate-limiting traffic inbound on a interface.

Here's a  few quick methods for rate-limit traffic . It requires applying this under the class-default class or by using a class-map.


1: e.g ( rate limit traffic on a 1gig interfaces eth 1/1 to 1/3  to not exceed 10mbps )


config t
   policy-map type qos 10mbps-RATE_limter
        description rate-limit of 10mbps 
        class class-default
           police cir percent 1 bc 200 ms conform transmit violate drop

  
 
interface Ethernet1/1-3
  description1GIGE access to my server
  switchport access vlan 1001
  spanning-tree port type edge
  spanning-tree bpduguard enable
  speed 1000
  storm-control broadcast level 1.50
  storm-control multicast level 5.00 

  service -policy in  10mbps-RATE_limter
end 

copy running start


Another option could be to match a class-map with the match dscp options



2: e.g ( by defining a class-map and a rate limiter of 50mbps )


class-map type qos match-any  QOS_class

  match dscp 0-7


policy-map type qos SOCPUP01

   description  rate-limit of 50mbps

  class QOS_class

    police cir percent 5 bc 200 ms conform transmit violate drop



 For the bc value you need to determine what burst-commit value  you want the time measurement.

Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- socpuppets ---dot---com

   ^    ^
=( # # )=
     @
     /  \



Friday, July 11, 2014

Example fo SMTP_AUTH protection fortigate IPS style


Here's a few simple IPS rule that could be used for the  containment of a repetitive SMTPAUTH failures abusers. Massive AUTH failures in your mail-systems logs mens one of two things;

  •  you have an hackingevent  taking place
or
  • you a mailclient end-user that's using the wrong credentials
The latter is easy to identify by looking at the username in the failures. If it's valid user and with no random usernames ( the same users fails over and over and over,etc...) than it might be a legit mis-configuration.

But if your logs shows random users failures & from the same src ip_address, this is a clear sign of abusive and suspect behavior. This should warrant a closer inspection & monitor.

If the src_address falls in any countries of known bad reputations, that could be a clue of an atack


e.g ( very likely suspects )

Nigeria
China
Pakistan
Korea
Turkey
Russia
etc...



 

note:  if you have no users in these geo-country based on the source ip_address, this is a sign of attack!


A sample CLI  ips custom rule based on monitoring the server side of the communication and the failure messages

config ips custom
    edit "SMTP_AUTH01"
        set signature "F-SBID( --attack_id 7393;  --revision 1; --name \"SMTP_AUTH_FAILURE01\"; --service SMTP; --protocol tcp; --tcp_flags PA; --pattern \"535 Authentication failed. Restarting authentication process\"; --flow from_server,reversed; --track dst_ip; --rate 10,120; )"
    next
end






You adjust the sensitivity of the rule by the rate options. You can be more or less aggressive based on decision & after monitoring.

The above allows for 10 failures within a 2min period. This would be a sign of a hacker conducting a bruteforce/dictionary/hybrid attack against a SMTP user mailbox(es).


How long you contain the end user,  is solely depending on how bad of the attack.  Keep in mind a few users that mis-configure there mailclient smtp authentications values, could be caught in the detection. I would monitor the activity of the rule and conduct my own testing. Monitoring of the logs and ban-users for a few weeks/months , would be beneficial. I've ban smtp abusers from  1 hour to  7 days depending on my mood.




NOTE: it's crucil to conduct your own testing and to figure out  the AUTH-failure string that's present to the client from the  mail system that you are trying to protect.

In my case, the server kicks out a  failure string of ;

535 Authentication failed. Restarting authentication process

Other servers might kick up the following;

535 5.7.3 Authentication unsuccessful


NOTE:  In most cases it's a 535 or 538 error code.



Here's a few more rules examples based on the src or dst and the number failure seem or the number of AUTH requests generated by the client




Always monitor your logs and review the ban listing via the cli cmd get user ban list




NOTE: It's adviseable to telnet to your mail server at  port 25; Issue a proper EHLO ( aka extended hello )  & request for AUTH

( example of how the dialog steps follows )


telnet  x.x.x.x   25 ( x.x.x.x  = your mailserver ip_address )

EHLO test.com ( the domain could legit or not, just make sure you issue a domain name )


auth login  ( issue  auth follow by the type you see available after the EHLO response )

1: wait for the 334 response;


Issue a username ( valid or not  encode or not you just need to send something )

2: wait for the 2nd 334 response

Issue a password ( not valid encode or not  you just need to send something so the server SMTP AUTH fails )

3: review the  authentication failure string

( example of a typical smtp connection  dialog, we me sendin username/password unencode to cause the failure  )



Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( $ $ )=
     @
     /  \

Tuesday, July 8, 2014

HOWTO disable SMTP-AUTH support "Fortimail"

Here's a quick way for disabling  SMTP-AUTH on a Fortimail .

After the issuance of the initial EHLO/HELO, & if you recall in SMTP protocol,  after the client has established it's "hello", the SMTP server will  provide it's  supported features and functions like TLS & SMTP-AUTH to the external mailclient.

With SMTP-AUTH, you have to be cautious on the impact that SMTP-AUTH will present. Once a Chinese  hacker has found that your SMTP-server supports SMTP-AUTH, they will try a millions tries at hacking a passwords for a email user.


NOTE:  Yes, they don't even try to hide the fact that they are trying.

So you will find hundreds, if not thousands of failed SMTP-AUTH logins in your logs, if you log this activity. This shouldn't be of a big concern if your email users have secured  passwords, but why take that chance if you don't need SMTP-AUTH enabled to begin with.

If you don't need SMTP-AUTH , it's best to just flat out disable it. I will show you howto  for the email-security gateway  Fortimail.

1st we use  mxtoolbox smtp diagnostic. http://mxtoolbox.com/

MXtoolbox will show you what your SMTP-server sends to clients after a simple extended HELLO known as a EHLO. It will give an ideal of how your initial SMTP banner looks to the world.

(before )


As you can see AUTH is provided to the client and  this Fortimail support PLAIN MD5 & CRAM-MD5

Now if we want to disable this, the cli command set smtp-auth disable  under config sys mailserver, should do the trick.


( disabling SMTP -AUTH   authentication )




( post check afterwards using mxtoolbox again  )



I hope this helps you on SMTP-AUTH checking and control


NOTE: you could write a custom IPS rule to block  src ip_address based on AUTH failures or the number of time they access.


(snort rule )
alert tcp $SMTP_SVRS 25 -> $EXTERNAL_NET any (  msg:"SMTPAUTH AUTH LOGON Failed Attempts"; flow:from_server,established; flags:PA; content:"Error: authentication failed"; nocase; threshold:type threshold, track by_dst, count 10, seconds 60; classtype:attempted-user; sid:100013; rev:2; )

(fortigate ips )
F-SBID ( --name SID100013; --protocol tcp; --src_port 25 ; --flow from_server,established; --tcp_flags PA; --content "Error: authentication failed"; --no_case; --revision 2; )
 

 
FWIW:  I typically  just GEO block countries that exhibits  high SMTP AUTH abuse ( korea/china/turkey/africa/etc.... )  and when I have a requirement for supporting SMTP-AUTH  on a mail gateway YMMV


I 've also use  scripts  that parse the  fortimail logs to grab repeat offenders and then add them to a blacklist  firewall policies that's at the top of my firewallpolicy

YMMV

Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( $ $ )=
     @
     /  \

Sunday, July 6, 2014

Understanding fortinet lifecycle; hardware & software

All items within a network,   typically has a life cycle. Just like a human has "cradle"  to  "grave ",  we have a life cycle process.

But ours is not planned out or determine by any process or comes with  advance notices & dates.  But we might do things that could  speed up and terminate our  life-cycle :)


Within fortinet, you have support that can be looked at  in one of two ways ; hardware & software.

With regards to the support contracts. Fortinet is obligated to maintain the systems during the life-time of the Support Cycle. So  if  my little FWF30B should die before it reaches the End of Support, and I have a validate support contract, Fortinet is on the hook for replacing it or doing what's required to make it correct.

One good thing about the fortinet products; They seem to last & holdup quite good imho. My older gear has done great over the course of 6-7+ years now. The only bad thing with the older gear, you don't get the chance to take advantage of new features that's available in the new code releases. 

Fortinet almost always add new features & technologies, but constricts these improvement to the software releases and these usually doesn't include support for any of the older hardware due to  the model hardware-type, ASIC-type, cpu, memory,disk-storage,etc....

Here's a few terms you should get comfortable with & with regards to the life-cycle  process




The last order date,  means exactly that. This is the extreme last date that a fortinet partner will except orders for a particular model. After this date, you will need to order the replacement model. Your fortinet sales team or  security consultant, can guide you to what's best for you and your environment.

Example  here's the  fortigate 30B models. This is a lowend SOHO device that  was designed around the home users who might need a smaller and cheaper Security Appliance. Or the home telecommuter who has more than 1+ devices & his/her home &  that needed security services & connectivity  back to the main HQ, but  didn't want to use the forticlient for vpn access.



The last possible order date ( LoD )  for this model is just around the corner from this blog-post date @  ( 07/09/2014 )

The last possible date for extending your maintenance contract is 4 years later ( 07/09/2018 ) 

And finally,  the end of support (EoS ) is deemed at  ( 07/09/2019 )


Technically and legality,  at the conclusions of the  EoS date the hardware is deem obsolete & fortinet will not honor any maintenance actions  against this product. If you tried to contact TAC with regards to a problem ( software or hardware ) they will politely turn you down.

As security/network consultant, I'm face with the cheaper and low budget organizations that comes to me for support. When I find their device is out of warranty, has no contract & is  EoL. I can only shrug my arms and say " there's nothing I can do for you ".




Also Fortinet will not allow a support contract to be sold or registered outside of the last maintenance date for contract extensions. So even if the Security Appliances is not at EoL,  but after the last possible support contract sales date, there's nothing that can be done from a support stance. 

btw: Juniper, Checkpoint , Cisco, and others, all works in this exact same fashion.


For software we have another issues to contend with. Almost all software has a "GA" release versions ( general availability ) & guess what? They have a life-cycle also.

What this means,  Fortinet will  continue to support and build  minor revisions or builds against the parent code for 36months. This typically boils down to bug fixes, correction for items that didn't work and any major security fixes. Almost always, they never add new features within that software train from my experience.

So 4.0 GA release will have a MR ( Maintenance Release  )  and 36 months later, they will end software support for that maintenance release train. The same for  4.0 MR2 and the same for  5.0 MR1 and so on.

This way they can build faith in the end-user & ensure that they will not abandon the customer by keeping a  continual support with regards to software improvements & fixes.


Now why do you need to know this?

From a IT-dept role, you should ask and review the EoS date to ensure the product your buying is not going to be obsolete at any near future date for both software and hardware.

e.g

It would not make any sense to buy a  30B  model Security appliances

By selecting a Fortigate  30D model  you would have a longer time before EoS; http://www.fortinet.com/products/fortigate/utm-30series.html


Keep in mind the following;

  •  not all partners/resellers are honest 
  •  some will try to sell you want they  have in stock & at that time
  •  a few seller website will not disclose that the product is coming soon to  a LoD or  even discuss the life-cycle concerns with regards to that model of Security Appliance that you thinking of buying



NOTE: I don't want to bad mouth any one single  partners or resellers, but you should always inquiry about the life-cycle of the product before committing to purchasing any gear. I 've seem some  fishy  action going along with a few of these folks  that are " listed   as authorized resellers of brand xyz "

 IMHO, you should always protect your interest and deal with an reputable partner. You should always consultant with a security consultant ( at minimum ) or partner before buying any security appliance.

For the a IT director position, he/she  should budget for  gear change out for new features and for taking advantage of new technologies over the course of  <3-4 years of the life-cycle of the product.

Example, maybe your in a healthcare sector, and you know  DLP  is required for compliance regulations. You aging old  cisco PIX is not reliable any more,  stuck at fast-ethernet speeds,  and lacks any advance UTM features. You might want to leverage buying a single device that can offer DLP and other UTM features.

So by leveraging a single plane of device, you can use a fortigate security-appliance that offers the DLP and at  the same time, make a big  improvement within your security firewall.

With proper  IT-dept  design & budgeting concerns, we should include some type of  refreshing and renewing  of  your hardware at every 4-5 years.  This will  ensure that you are up to date with regards to security threats and compliance.

With fortinet, you can ask for trade-in  considerations  and/or find out if any trade-in or trade-up programs are in place. The partner will quickly explain what they do offer,  and offer any  rebate that they can offer at that time. To learn more about  this program follow this link; http://www.fortinet.com/promo/trade-up.html

The trade-up program is a way for fortinet to enhance their customer loyalty and to give you some type of price break for being a fortinet end-user.  It never hurts to ask.


NOTE:  For a good & reputable partner , please look at maxis360  http://www.maxisnetworks.com


Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( $ $ )=
     @
     /  \


Thursday, July 3, 2014

A followup to the GLC-T issues on cisco ASR1K ( support issues )

I 've received  a new order of  SFP-T and GLC-T transceivers. These all works in a ASR1K router runing  15.x code and
with no  issuance of the unsupported transceiver service commands. The also goes against cisco list of unsupported  transceivers listing.




These transceiver are cisco labeled and where purchased  from  NHR. The same outfit that sold of their  own  GLC-T that did NOT work,  if you recall my earlier posting about this;


And  here's the page for cisco supported transceiver by models


As you can see,  the transceiver is support and all interfaces are up , and we didn't have to use the hidden unsupported transceiver command






YMMV, as always following the mfg'er literature even if the literature and document is  incorrect. The Cisco Vendor sold us ASR1Ks with hardware  that's suppose to be not compliant but in actually it is.

Who's right or wrong ?





We will never know.




Ken Felix
Freelance Network / Security Engineer
kfelix  ----a---t---socpuppets ---d---o---t---com

     ^      ^
=(  @   @ )=
          o
       /     \

Tuesday, July 1, 2014

How to use a huawei unlocked 3g modem from another carrier Fortigate by changing the APN string

In this post we will use a huawei E160X 3g-usb-modem that was previously used with the celluar
carrier vodafone.

For more information on modems, please see the following page
http://www.3g-modem-wiki.com/page/USB+modems





To use this modem, we must ensure it's unlocked. If not, we would need to generate a huawei unlock code by using a  online code generator. But b4 we do that, we will query the modem to see if it's unlock.

 The AT commad AT^CARDLOCK? will tell you if your modem is indeed locked.


1= locked
2= unlocked

( NOTE:  see the orange rectangle  in the below output )





If your modem is lock  stop and generate a unlock code and try to unlock it;

note: google  search for huawei unlock code generator, for a website that genertes unlocks based on the IMEI number for the modem.The IMEI is the equivalent of a fingerprint for the modem

http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity





A simple method for issuing  AT commands, is to attach the modem to a PC & by using  an async terminal program. The execution of a few modem "AT" commands will provide you some good information.

or

Alternative;  use the diag sys modem cmd command via the fortigate command-line.

(e.g issuing the  modem ATI command "ATtention Inquiry " )
The above output gives you the following information. Alternatively you could have gotten the same output and more by using the  query command.



NOTE: I placed some highlights that we will discuss later on in this post.

The APN dataset  is very very important. It identifies what data Acces Point by Name that you are attempting to connect to. In this modem the default strings  count is 1,2,3. So it has 3  APN defined for IP and the "internet.vodafone.net" is the APN name . If this APN is defined incorrectly, you will not get an establish data connectivity much less an ip_address. We will change the 1st APN string in this posting.

In my case,  the APN is "netgetesa" for the carrier orange-getesa. Some devices can identify the APN automatically, but others need assistance by the extra issuance of a AT init string. So we will have to correct this by providing an modem AT command.

We also will need the phone# to dial and in some case a username.

In our case, we will  issue this using the following modem configuration for the  carrier GETESA

  • APN = netgetesa
  • phone = *99#





If all is done correctly, we should  have the status showing the modem has established and has made a successful call.


Here's a few common AT comands with a brief summary. Almost all AT suppored 3/4g-modems, support these commands.

ATH  = hangup
ATE  =  Echo back to the screen anything that we type so we can see it on the sreen
ATZ  = reset
AT+CPIN=   =  insert my pin ( e.g AT+CPIN=0000 will insert the pin of  0 0 0  0 )
AT&V   =  get carrier network status ( great to determine if the carrier is activce, if you have a signal,etc......)
AT+CGDCONT=1,"namehere"   =  define APN string #1
( note change the #1 to #2 or #3 if you want to change the other strings)
ATI  = inquiry the products
A/  = repeat last successful command ( great when you have a long cmd string and don't want to retype it )

NOTE: sample AT commands outputs



Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( $ $ )=
     @
     /  \

More fortinet fortios 5.2 GA upgrades-woes from soc puppets

This is a continuation from my earlier posting; http://socpuppet.blogspot.com/2014/06/fortinet-fortios-52-upgrades-woes.html

I found a few more issues.

1ST

The USB backups for both the  cmdline or even the  WebGUI fails.

(web)



(cli)




It's very ironic that the hidden  fnsysctl commnd shows a mounted filesystem, and I can copy files to the mount point of /usb which is my usb drive.





2ND

The next problem, some firefox 30.0 browsers, can not access the unit from MACSOX via https. I've tested this  under 10.9.3,  which is not as effected & 10.8.4  seems more greatly effected. I only started to notice it, since socpuppets is a major macosx user. It's being reported for both FGT60D, FWF60D and FGT110C models. I haven't upgraded any of the 2U models yet.

3rd

We've  also seen a trend of slow pages load times & with regards to http or https operations. And when I say slow,  this is on a idled fortigate doing pretty much nothing. The pages load time could be 1-5secs delay. Mainly with the pages for  firewall policies and  address/addrgroups.

FWIW;  I held off upgrading any more  appliances until  the next 5.2 patched- build comes out.


Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( +  - )=
     @
     /  \