一些信息收集的shell脚本

问题描述

一.搜索子域名的shell脚本

1.wget www.megacorpone.com #下载该网站的首页地址

2.grep "href"index.html #过滤超链接关键字

3.grep "href="index.html |grep

"\.megacorpone" | grep -v"www

\.megacorpone\.com | head

#过滤"hrep="字段在index.html文件中

通过这种逻辑的方式减少我们的数据,并在每次操作中按顺序进行较小的缩减

awk -F设置多个字符的分隔符,与cut不同,后者方式简单但只允许使用单字符分隔符

4.grep "href="index.html | grep

"\.megacorpone" | grep -v"www

\.megacorpong\.com" | awk -F "http"//" 'print $2' | cut -d"/" -f 1

5.grep -o'[^/]*\.megacorpone\.com'

index.html | sort -u > list.txt

#grep -o 逐行输出匹配的内容,支持正则表达式

6.for url in $(cat list.txt); do host $url; done

7.for url in $(cat list.txt); do host $url; done |"has address" |cut -d" " -f 4 |sort -u

二.嗅探并抓取网页快照shell脚本

1.Nmao -A -p 80 --open 10.11.1.0/24 -oGnmap-scan_10.11.1.1-254

2.Cat nmap-scan_10.11.1.1-254 | grep 80 | grep -v "Nmap" | awk '{print$2}'

3.for ip in $(cat nmap-scan_10.11.1.1-254 | grep 80 | grep -v "Nmap" | awk '{print$2}');do cutucapt --url=$ip --out=$ip.png;done

4.

#!bin/bash

echo "<html><body><br>" >web.html

is -| *.png | awk -F: '{print ¥1”:\n<br><img

src=\""$1""$2\" width=600><br>"}' >> web.html

echo"<body></html>" >>web.html

三.漏洞利用程序下载脚本

""shell

Searchsoloit 是一个针对ExploitDB的命令行搜索工具,他允许我们随时随地获取Exploit数据库的脱机副本

-w 返回https://www.exp;oit_db.com上的信息

-t 搜索漏洞利用标题

1.searchsploit afd windows -w -t

2.searchsploit afd windows -w -t | grep http | cut -f 2 -d "|"

3.for e in $(searchsploit afd windows -w -t | grep http | cut -f 2 -d "|"); do exp_name= $(echo $e | cut -d "/" -f 5) && wegt -q --no- check-certificate $url -O $exp_name;done

4.

#!bin/bash

for e in $(searchsploit adf windows -w -t |grep http | cut -f 2 -d "|")

do

 exp_name=$(echo $e | cut -d"/" -f 5)

 erl=$(echo $e | sed's/exploit/raw/')

 wegt -q --no-check-certificate $url -O$exp_name

 done

""

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)