我在我的数据库中发现了很多奇怪的字符串,有人试图进入我的网站?

时间:2016-06-03 09:14:02

标签: sql sql-server asp.net-mvc security sql-injection

我有一个小型网站(MVC5),其中包含“联系我们”功能,今天早上我发现我有来自同一IP的数百封电子邮件。我从数据库查询结果,所有'em只是一堆奇怪的字符串和一些脚本/ SQL注入。

我已经在我的数据库(SQL Server 2014)上使用参数,并对所有用户输入进行白名单过滤。只是想知道我是否应该担心?

Joey'"
Joey\\'\\"
Joey'"'"'"'"
Joey AND 1=1 -- 
Joey AND 1=2 -- 
Joey" AND 1=1 -- 
Joey" AND 1=2 -- 
Joey'
Joey
Joey\'
Joey
Joey" UNION SELECT 8, table_name, 'vega' FROM information_schema.tables WHERE table_name like'%
1 AND 1=1 -- 
1 AND 1=2 -- 
' AND 1=1 -- 
' AND 1=2 -- 
" AND 1=1 -- 
" AND 1=2 -- 
Joey''
Joey' UNION SELECT 8, table_name, 'vega' FROM information_schema.taables WHERE taable_name like'%
javascript:vvv002664v506297
vbscript:vvv002665v506297
" onMouseOver=vvv002666v506297
" style=vvv002667v506297
' onMouseOver=vvv002668v506297
/../../../../../../../../../../../../etc/passwd
Joey`true`
Joey`false`
Joey`uname`
' style=vvv002669v506297
Joey"`false`"
Joey"`uname`"
Joey'true'
Joey'false'
Joey'uname'
Joey" UNION SELECT 8, table_name, 'vega' FROM information_schema.taables WHERE taable_name like'%
htTp://www.google.com/humans.txt
hthttpttp://www.google.com/humans.txt
hthttp://tp://www.google.com/humans.txt
Joey
Joey-0-0
Joey\'\"
Joey\\'\\"
Joey - 0 - 0
Joey 0 0 - -
http://vega.invalid/;?
//vega.invalid/;?
vega://invalid/;?
src=http://vega.invalid/;?
" src=http://vega.invalid/;?
Joeybogus Vega-Inject:bogus
www.google.com/humans.txt
Joeybogus Vega-Inject:bogus
Joey-0
Joey-0-9
Joey
Joey'"
Joey' UNION SELECT 8, table_name, 'vega' FROM information_schema.tables WHERE table_name like'%
Joey' AND 1=2 -- 
Joey' AND 1=1 -- 
Joey''''""""
Joey\'\"
Joey
Joey
Joey
http://www.google.com/humans.txt
Joey
Joey"`true`"
Joey

3 个答案:

答案 0 :(得分:7)

看起来有人试图使用SQL注入。只要您使用输入验证并转义输入,您就可以在这方面做得好。不过,您可能希望了解其他加强网站的方法。

这是protecting against SQL Injection in ASP.NET的资源。 general website hardening的另一个资源。希望它有所帮助!

答案 1 :(得分:4)

似乎没有什么是你需要过度担心的,人们总是会尝试利用输入表单来查看他们是否能够获得任何数据。您似乎已经完成了所有基本和标准方法,以防止它们到达任何地方。您可以使用几种方法来阻止这种情况发生。

请求限制

这非常简单,您实际上只是限制了单个用户在一段时间内以联系表单提交数据的次数。关于这一点有很多文章,很多答案分散在SO上。最简单的方法是使用HttpRuntime缓存,只需将用户IP地址存储到期时间。然后在每个请求上检查缓存以确保其IP地址不存储在其中。

知识产权禁令

这种方法类似于上面的方法,但有点长期。最简单的方法是跟踪提交多个查询的用户,如果他们在10分钟左右的时间内发送超过30个,请将他们的IP地址添加到一个表中,您可以检查并防止他们再提交查询。

你甚至可以将两者结合使用。

答案 2 :(得分:3)

是的,有人试图破解您的网站。看起来它可能是一个脚本。

我建议使用安全扫描工具查看您的应用程序中是否有任何明显的漏洞。 OWASP拥有list个有用的工具。