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

   ^    ^
=( +  - )=
     @
     /  \

Monday, June 30, 2014

Fortigate IPS rule for blocking unauthorized clients sources for recursive lookups

Here's a Howto  for blocking  persistent  dns clients that's trying to use your dns server for recursive lookup,  by using the fortigate IPS UTM feature.

Some times you have a mis-configured dns clients. Other times, you  have someone trying todo your  DNS server harm.

Here's a quick means for dropping a client that's trying to use your dns-server in a bad way. Typically these client will received a "DNS response such as the following"

Domain Name System (response)
    [Request In: 9]
    [Time: 0.000181000 seconds]
    Transaction ID: 0xec12
    Flags: 0x8115 (Standard query response, Refused)
        1... .... .... .... = Response: Message is a response
        .000 0... .... .... = Opcode: Standard query (0)
        .... .0.. .... .... = Authoritative: Server is not an authority for domain
        .... ..0. .... .... = Truncated: Message is not truncated
        .... ...1 .... .... = Recursion desired: Do query recursively
        .... .... 0... .... = Recursion available: Server can't do recursive queries
        .... .... .0.. .... = Z: reserved (0)
        .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
        .... .... ...1 .... = Non-authenticated data: Acceptable
        .... .... .... 0101 = Reply code: Refused (5)


So we will write  a rule triggering off this DNS response of "refused" flags 0x8115.

1st here's the rule;


 edit "DNS-refused"
        set signature "F-SBID( --attack_id 1616;  --revision 2; --name \"DNSQueryArefused\";  --protocol udp; --pattern |8115|; --flow from_server,reversed; --rate 30,60; --track dst_ip; --log dns_query;)"
    next


2nd here my  IPS sensor;



3rd,  here's  the  firewall policy and protection profile applied to my DNS server policy;



 The  IPS sensor is enabled in my  protection profile name "DNS-refusal-policy"

     set ips-sensor-status enable
     set ips-sensor "DNS-refusal"



NOTE:  The referenced "DNS-refusal-policy"_fwpolicy   has the dst address names DNS1 and DNS2 are my  firewall address for the name-servers. I could have also included a adress group.


lastly, we can monitor via the GUI or command line for logs messages;



KeyPoints to take away;
  •  the fortigate has the ability to  write custom sigantures.
  •  this ad-hoc method is simple to deploy
  •  in a true DNS flood, this will not do anything to save your bandwdith
  •  Adjust the quarantine time to best suit you needs
  •  always monitor the  logs, graphs and performance impact
  •  use tshark and  display filter to see the dns query/response
  • you can log the query with the --log query  option for later analysis



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

   ^    ^
=( ~ ~ )=
     @
     /  \

Saturday, June 28, 2014

Stopping the whoopsie on linux . oops!

If you see a linux ps named whoopsie have no fear  you can  stop this

ps -ax | grep whoopsie


sudo  ps -ax | grep whoopsie
[sudo] password for kfelix:
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
  942 ?        Ssl    6:21 whoopsie
13741 pts/0    S+     0:00 grep --color=auto whoopsie



1st

edit the file  /etc/default/whoopsie  and change the "true" to "false"


[General]
report_crashes=true


              

2nd

Kill the process

sudo pkill -9  whoopsie


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

   ^    ^
=( -  - )=
     @
     /  \