#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#by i3ekr import re,optparse,sys,requests,time,os parse = optparse.OptionParser(usage="python %prog -i '127.0.0.1'",version="%prog 1.0")
parse.add_option('-i','--ip',action='store',dest='ip',help='ip parse...')
parse.add_option('-o','--out',action='store',dest='out',help='this parse is out result file exp:-o "/tmp/result.txt""')
parse.set_defaults(v=1.2)
options,args=parse.parse_args() def gethtml(ip,page):
try:
html = requests.get("https://www.bing.com/search?q=ip:"+ip+"&qs=ds&first="+str(page)+"&FORM=PERE4").content
return html
except Exception as e:
return "访问错误"
exit() def chongfu():
with open("./tmp.txt","r") as f:
tmp = f.read()
url = tmp.split("\r\n")
for i in set(url):
with open("ok.txt","a") as f:
f.write(i+'\r\n') def geturl(html):
try:
url = re.findall(r"(?<=<cite>).*?(?=</cite>)", html)
print url
for u in url:
with open("./tmp.txt","a") as f:
f.write(u+"\r\n")
f.close()
except Exception as e:
raise e #根据索引出来的搜索量来判断有多少个页面,返回值是页面数量
def result_page():
try:
num = str(re.findall(r"<span class=\"sb_count\">(.*?)</span><span class=\"ftrB\"",html)[0]).strip(" 条结果")
page = int(num.replace(",",""))
return page/10
except Exception as e:
print "没有与此相关的结果"
exit() if __name__ == "__main__":
print """
=========================
[+] by i3ekr
[+] Blog nul1.cnblogs.com
[+] Time 2018/6/13
=========================
"""
if len(sys.argv) > 2:
url_pangzhan = []
pg = 1
ip = options.ip
f = False
while True:
if f == False:
html = requests.get("https://www.bing.com/search?q=ip:"+ip+"&qs=ds&first=1&FORM=PERE4").content
result_page()
f = True
else:
for i in xrange(0,result_page()):
html = gethtml(ip,pg)
url = geturl(html)
print "第[%s]页"%(i+1)
pg+=11 chongfu()
os.remove('tmp.txt')
exit() else:
print options.usage()
exit()

bing查询旁站脚本的更多相关文章

  1. 子域名爆破&C段查询&调用Bing查询同IP网站

    在线子域名爆破 <?php function domainfuzz($domain) { $ip = gethostbyname($domain); preg_match("/\d+\ ...

  2. 信息收集之——旁站、C段

    旁站的概念 ​旁站指的是同一服务器上的其他网站,很多时候,有些网站可能不是那么容易入侵.那么,可以查看该网站所在的服务器上是否还有其他网站.如果有其他网站的话,可以先拿下其他网站的webshell,然 ...

  3. aizhan查询旁IP网站脚本

    <?php print_r("-------------------------\r\n"); print_r("-------爱站旁站查询------\r\n&q ...

  4. [原创]K8Cscan插件之C段旁站扫描\子域名扫描

    [原创]K8 Cscan 大型内网渗透自定义扫描器 https://www.cnblogs.com/k8gege/p/10519321.html Cscan简介:何为自定义扫描器?其实也是插件化,但C ...

  5. 人人都是 DBA(XII)查询信息收集脚本汇编

    什么?有个 SQL 执行了 8 秒! 哪里出了问题?臣妾不知道啊,得找 DBA 啊. DBA 人呢?离职了!!擦!!! 程序员在无处寻求帮助时,就得想办法自救,努力让自己变成 "伪 DBA& ...

  6. MySql 简单统计查询消耗时间脚本

    MySql 简单统计查询消耗时间脚本 by:授客 QQ:1033553122 drop procedure if exists selectTime; delimiter; create proced ...

  7. IP反查网站,ip反查接口,旁站查询接口大全,通过IP查域名汇总:

    http://cn.bing.com/search?q=ip%3A220.181.111.85     http://dns.aizhan.com/?q=www.baidu.com     http: ...

  8. $Django 多表操作(增删改查,基于双下划线,对象的查询) 在Python脚本中调用Django环境

    在Python脚本中调用Django环境. import osif __name__ == '__main__': os.environ.setdefault("DJANGO_SETTING ...

  9. pikachu-跨站脚本漏洞(XSS)

    一.跨站脚本漏洞概述 1.1 什么是XSS漏洞?     XSS是一种发生在Web前端的漏洞,其危害的对象也主要是前端用户. 1.2 XSS如何攻击? 二.跨站脚本漏洞类型及测试流程 2.1 跨站脚本 ...

随机推荐

  1. c运行时库,c标准库,Windows系统api的关系

    原文地址:http://blog.csdn.net/seastars_sh/article/details/8233324 C运行库和C标准库的关系 C标准库,顾名思义既然是标准,就是由标准组织制定的 ...

  2. SpringBoot2.0(一) mybatis

    使用mybatis springboot使用mybatis主要依赖 mybatis-spring-boot-starter 来实现.其提供了2中解决方案,一种是使用注解:另一种是简化后的传统的xml方 ...

  3. C# 大文件的复制方法

    如何复制读取大文件,也许困惑了很多人很长时间,这个不知道怎么搞,的确让人头疼欲裂,知道了你就才发现原来那么简单,话不多说,直入正题```` static void Main(string[] args ...

  4. 注解失效,@SpringBootApplication 失效,引入包失效

    因为同时修改两个springboot工程,其中把一个工程的版本调整到2.0.2.RELEASE,然后坑爹的事情出现了,所有springboot工程的@SpringBootApplication失效, ...

  5. 个人vim配置

    YouCompletMe支持golang cd .vim/bundle/YouCompleteMe ./install.sh --clang-completer --go-completer clan ...

  6. springMVC+spring+mybatis搭建最近

    一:概述SSM框架在项目开发中经常使用到,相比于SSH框架,它在仅几年的开发中运用的更加广泛. Spring作为一个轻量级的框架,有很多的拓展功能,最主要的我们一般项目使用的就是IOC和AOP. Sp ...

  7. BZOJ1853:[SCOI2010]幸运数字 & BZOJ2393:Cirno的完美算数教室——题解

    https://www.lydsy.com/JudgeOnline/problem.php?id=1853 https://www.lydsy.com/JudgeOnline/problem.php? ...

  8. sourcemap总结

    sourcemap在线上压缩文件调试中很重要,在此总结如下: 1. 开启sourcemap (1). 浏览器要开启source-map支持(2). 压缩文件底部要有source-map的URL,压缩要 ...

  9. bzoj2144: 跳跳棋(二分/倍增)

    思维好题! 可以发现如果中间的点要跳到两边有两种情况,两边的点要跳到中间最多只有一种情况. 我们用一个节点表示一种状态,那么两边跳到中间的状态就是当前点的父亲,中间的点跳到两边的状态就是这个点的两个儿 ...

  10. ContestHunter暑假欢乐赛 SRM 08

    rating再次跳水www A题贴HR题解!HR智商流选手太强啦!CYC也好强%%%发现了len>10大概率是Y B题 dp+bit优化,据LLQ大爷说splay也可以优化,都好强啊.. C题跑 ...