CS绕过登陆
最近博客少了更新,今天抽空写一篇吧。
大多数我们渗透都是针对b/s模型 很少是针对c/s模型。
无聊搞了两个图,别喷。
搞了个案例
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; namespace sqltest { class Program { static void Main(string[] args) { SqlConnection conn = new SqlConnection("server=.;database=test;uid=sa;pwd=123456"); conn.Open(); while (true) { Console.WriteLine("请输入账号"); string uname = Console.ReadLine(); Console.WriteLine("请输入密码"); string upass = Console.ReadLine(); string sql = "select * from users where uname='" + uname + "' and upass='" + upass + "'"; try { SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); if (sdr.HasRows ==true) { Console.WriteLine("登陆成功"); } else { Console.WriteLine("登陆失败"); } Console.ReadKey(); } catch(Exception ex){ Console.WriteLine("异常:"+ex); Console.ReadKey(); } } } } }
这个是正常的登陆如图:
检测有没有安全漏洞我们可以使用单引号或者其他检测字符让其出错就好了。
出错之后,我们可以利用反编译工具 分析源码。
达到目的就好了。
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论