使用JavaScript扫描端口
<html>
<title>端口扫描</title>
<head></head>
<form>
<label for="target">target</label><br/>
<input type="text" name="target" value="127.0.0.1"/><br/>
<label for="port">port</label><br/>
<input type="text" name="port" value="80"/><br/>
<p>you can use sequence as well 80,81,8080</p>
<label for="timeout">timeout</label><br/>
<input type="text" name="timeout" value="1000"/><br/>
<label for="result">result</label><br/>
<textarea id="result" name="result" rows="7" cols="50"></textarea><br/>
<input class="button" type="button" value="scan" onClick="javascript:scan(this.form)"/>
</form>
<script>
var AttackAPI = {
version: 0.1,
author: "Petko Petkov (architect)",
homepage: "http://www.gnucitizen.org"
};
AttackAPI.PortScanner = {};
AttackAPI.PortScanner.scanPort = function (callback, target, port, timeout) {
var timeout = (timeout == null)?100:timeout;
var img = new Image();
img.onerror = function () {
if (!img) return;
img = undefined;
callback(target, port, "open");
};
img.onload = img.onerror;
img.src = "http://" + target + ":" + port;
setTimeout(function () {
if (!img) return;
img = undefined;
callback(target, port, "closed");
}, timeout);
};
AttackAPI.PortScanner.scanTarget = function (callback, target, ports, timeout)
{
for (index = 0; index < ports.length; index++)
AttackAPI.PortScanner.scanPort(callback, target, ports[index], timeout);
};
</script>
<script>
var result = document.getElementById("result");
var callback = function (target, port, status) {
result.value += target + ":" + port + status + " \n";
};
var scan = function (form) {
AttackAPI.PortScanner.scanTarget(callback, form.target.value, form.port.value.split(","), form.timeout.value);
};
</script>
</html>
使用JavaScript扫描端口的更多相关文章
- JavaScript 扫描枪使用(一)
JavaScript 扫描枪应用(一)com.js为主要的代码实现,test.html文件为测试的页面,其中包括了com.js文件中方法的调用.以下为测试成功代码:com.js //com.js /* ...
- 使用Python扫描端口情况
#!/usr/bin/python# -*- coding:utf8 -*-# Python: 2.7.8# Platform: Windows# Authro: ...
- python扫描端口脚本
# -*- coding:utf8 -*- # # Python: 2.7.8 # Platform: Windows # Authro: wucl # Program: 端口扫描 # History ...
- nmap扫描端口导致线上大量Java服务FullGC甚至OOM
nmap扫描端口导致线上大量Java服务FullGC甚至OOM 最近公司遇到了一次诡异的线上FullGC保障,多个服务几乎所有的实例集中报FullGC,个别实例甚至出现了OOM,直接被docker杀掉 ...
- X-Scan扫描端口80,443提示http TRACE 跨站攻击漏洞解决办法
在用X-Scan-v3.3扫描主机端口提示http TRACE 跨站攻击漏洞; 一,修改配置文件httpd.conf 1.1 apache下面修改httpd.conf文件,在文件最后面新建一行加入:T ...
- 获取mac地址和扫描端口
获取IP mac地址 arp -a 10.0.0.34 扫描指定IP 1到30000端口 nmap -p1-30000 10.0.0.36
- 关于nmap扫描端口
nmap查看一个服务器的端口,是通过扫描来实现的.所以在本机执行nmap扫描的端口有可能被防火墙阻止,在外部是访问不了的. 如:开启ORACLE监听后,在本机使用nmap 127.0.0.1是可以扫描 ...
- (转)使用NMAP工具扫描端口
原文:http://www.linuxde.net/2013/02/12354.html nmap 是一个用于网络探索或安全评测的工具.它支持 ping 扫描(判定哪些主机在运行),多端口扫描技术(判 ...
- nmap 扫描端口 + iftop 实时监控流量
sleep 1|telnet 127.0.0.1 223 nmap 127.0.0.1 -p 223 -PN (对禁ping IP) iftop -P -n -B -B 按字节显示 -N 切换 端 ...
随机推荐
- C#中如何正确的操作字符串?
字符串应该是所有编程语言中使用最频繁的一种基础数据类型.如果使用不慎,我们就会为一次字符串的操作所带来的额外性能开销而付出代价.本条建议将从两个方面来探讨如何规避这类性能开销: 1. 确保尽量少的装箱 ...
- 345. Reverse Vowels of a String(C++)
345. Reverse Vowels of a String Write a function that takes a string as input and reverse only the v ...
- gpfdist工具的初级使用
gpfdist工具的使用主要两步: 第一步:打开gpfdist服务: gpfdist -d /home/admin -p -l /tmp/gpfdist.log & 参数解释: -d 数据文件 ...
- Leetcode系列-Search in Rotated Sorted Array
做Leetcode题有一段时间了,但都是断断续续的,到现在才做了30题左右,感觉对自己来说还是有点难度的.希望自己能继续坚持下去,在校招前能解决超过一百题吧. 其实这些题就是用来训练你的解题思路的,做 ...
- [转] 小tip: 使用CSS将图片转换成模糊(毛玻璃)效果 ---张鑫旭
by zhangxinxu from http://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=3804 去年盛夏之时, ...
- apache2.4配置虚拟目录
刚开始学习,跟着韩顺平老师的视频课件学习ing~ 这是自己在配置虚拟目录时遇到的问题以及解决办法,记录下来~ ---------------------------分割线君-------------- ...
- JavaScript OOP 创建对象的7种方式
我写JS代码,可以说一直都是面向过程的写法,除了一些用来封装数据的对象或者jQuery插件,可以说对原生对象了解的是少之又少.所以我拿着<JavaScript高级程序设计 第3版>恶补了一 ...
- Apache .htaccess Rewrite解决问号匹配的写法
如news.asp?id=123 需要把它定向到 news/123.html 这个用 RewriteRule 怎么写啊? RewriteRule ^news\.asp\?id=(\d+)$ news/ ...
- iOS: 学习笔记, 添加一个带界面约束的控制器
1. 创建一个空iOS应用程序(Empty Application). 2. 添加加控制器类. 修改控制器类的viewDidLoad - (void)viewDidLoad { [super view ...
- Javascript异步编程的4种方法(转载)
原博地址: http://www.ruanyifeng.com/blog/2012/12/asynchronous%EF%BC%BFjavascript.html