#!/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. Android studio出现Error:Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"的解决办法

    最近更新了一下Android Studio(下文简写成AS),然后打开工程发现出现Error:Unable to tunnel through proxy. Proxy returns "H ...

  2. Lucene笔记二

    lucene 的排序 package cn.itcast.lucene; import java.io.IOException; import org.apache.lucene.document.D ...

  3. oracle中varchar2字段存入blob字段及blob转成varchar2

    CREATE OR REPLACE FUNCTION C2B (b IN CLOB default empty_clob()) RETURN BLOB -- typecasts BLOB to CLO ...

  4. YBT 2.4 AC自动机

    其实这个专题NOIP几乎不考 AC自动机,就是能让题自动AC的东西,是不是十分神奇 对的,就是这么神奇 AC自动机是解决多模式串与文本串匹配的问题 是KMP+Trie树的结合,也是一个毒瘤算法 Key ...

  5. win10下ndk编译arm可执行体

    编译参考文章 http://blog.csdn.net/john_1984/article/details/12622215 一.编写soLoader主文件 soLoader.c内容: #includ ...

  6. 跳跃表 https://61mon.com/index.php/archives/222/

    跳跃表(英文名:Skip List),于 1990 年 William Pugh 发明,是一个可以在有序元素中实现快速查询的数据结构,其插入,查找,删除操作的平均效率都为 . 跳跃表的整体性能可以和二 ...

  7. python 多线程实现

    多线程和多进程是什么自行google补脑 对于python 多线程的理解,我花了很长时间,搜索的大部份文章都不够通俗易懂.所以,这里力图用简单的例子,让你对多线程有个初步的认识. 单线程 在好些年前的 ...

  8. 将微服务注册到Eureka Server

    一.微服务程序编写 1.在已写好的微服务程序中添加pom依赖: <dependency> <groupId>org.springframework.cloud</grou ...

  9. 如何用好 github 中的 watch、star、fork

    http://www.jianshu.com/p/6c366b53ea41 https://www.zhihu.com/question/20431718 在每个 github 项目的右上角,都有三个 ...

  10. ios开关按钮

    .al-toggle-button{ appearance: none; -webkit-appearance: none; position: relative; width: 52px; heig ...