[工具]eping—为ping增加urlparse
做渗透测试或提交漏洞单时,常常用到ping,来确认内外网IP,或者寻找资产的归属。
然而ping并不支持url parse。我们写个简单的extended ping脚本。
vim /usr/bin/eping
#!/usr/bin/env python
# Extented Ping
import sys
import urlparse
import platform
import os
if __name__ == '__main__':
if len(sys.argv) == 1:
print ' Usage: python %s URL' % sys.argv[0]
sys.exit(0)
target = sys.argv[1].lower()
if not target.startswith('http'):
target = 'http://%s' % target
host = urlparse.urlparse(target, 'http').hostname
param_count = '-c4 ' if platform.system() != 'Windows' else ''
os.system('ping %s%s' % (param_count, host))
chmod +x /usr/bin/eping
root@srvScanner-test-dev001:~# eping http://www.lijiejie.com/requests-exceptions-invalidschema-missing-dependencies-for-socks-support/
PING www.lijiejie.com (47.88.12.133) 56(84) bytes of data.
64 bytes from 47.88.12.133: icmp_seq=1 ttl=52 time=138 ms
64 bytes from 47.88.12.133: icmp_seq=2 ttl=52 time=138 ms
64 bytes from 47.88.12.133: icmp_seq=3 ttl=52 time=138 ms
64 bytes from 47.88.12.133: icmp_seq=4 ttl=52 time=138 ms
--- www.lijiejie.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 138.204/138.387/138.683/0.317 ms
- Windows下使用pyinstaller生成一个exe文件,copy到C:\Windows\System32
pyinstaller –onefile eping.py
Windows 64 bit executable
eping