port-scanning

Making a Fast Port Scanner

元气小坏坏 提交于 2019-12-31 10:48:53
问题 So I'm making a port scanner in python... import socket ip = "External IP" s = socket.socket(2, 1) #socket.AF_INET, socket.SOCK_STREAM def porttry(ip, port): try: s.connect((ip, port)) return True except: return None for port in range(0, 10000): value = porttry(ip, port) if value == None: print("Port not opened on %d" % port) else: print("Port opened on %d" % port) break raw_input() But this is too slow, I want to somehow be able to some how close or break code after a period of time of not

what is difference between syn flood and port scan attack?

雨燕双飞 提交于 2019-12-25 09:08:49
问题 i am confused based on the difference between SYN Flood and Port scan attack. knowing that TCP SYN Flood is often referred to as "half-open" scanning, because you don't open a full TCP connection. You send a SYN packet, as if you are going to open a real connection and wait for a response. Port Scan varies destination port but i think they have similar operations, if not please i need clarifications. 回答1: The purpose is to consume tcp backlog for both 'half-open' and 'open'. http://www

Portscanner producing possible error

只愿长相守 提交于 2019-12-12 03:28:54
问题 I have written a simple portscanner in python. I have already asked something about it, you can find the code here. I corrected the code and now am able to create a connection to e.g. stackoverflow.net But the output I get is more or less cryptic for me: [+] Scan results for: li547-15.members.linode.com , 198.74.50.15 [+]80/tcpopen [+] b'HTTP/1.1 400 Bad Request\r\nDate: Sat, 09 Sep 2017 18:16:50 GMT\r\nServer: Apache/2.4.7 (Ubuntu)\r\nConten' I want to understand what the last line means

Portscanner not working properly, probably semantic error

自闭症网瘾萝莉.ら 提交于 2019-12-11 14:52:27
问题 I asked in Any servers with open tcp ports known? about open tcp ports on websites and was told that stackoverflow itself has tcp port 80 open. I executed my program and it kind of misbehaved. import optparse from socket import * from threading import * screenLock = Semaphore(value=1) def connScan(tgtHost, tgtPort): try: connSkt = Socket(AF_INET, SOCK_STREAM) connSkt.connect((tgtHost, tgtPort)) connSkt.send('ExploitMessage\r\n') results = connSkt.recv(100) screenLock.acquire() print('[+]%d

How to retrieve both TCP and UDP ports with Nmap? [closed]

喜欢而已 提交于 2019-12-03 05:41:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I need to retrieve both TCP and UDP ports in the same scan with Nmap in the fastest way possible. I'll try to explain it better. If I use the most common command: nmap 192.168.1.1 It retrieves ONLY TCP ports and it is really fast. If I use the following command: nmap -sU 192.168.1.1 It retrieves ONLY UDP ports

c# tcp port scanner resources [closed]

流过昼夜 提交于 2019-12-01 06:25:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Does anyone knows of any .Net library or resources that will assist me to implement a TCP port scanner? 回答1: For simple one, that will just try to connect to each port and report success / failure, without any "tricks", like sending only ACK packets etc. - you won't need anything else than System.Net and System

C# How do I check USB Ports with USB Hub and used Controller?

落爺英雄遲暮 提交于 2019-11-30 22:41:31
I am currently trying to scan all USB Ports with their USB Hub (check if it is Root or not) and to which controller they are connectet. To make it more visible: USB Port1 (nothing plugged in) -> USB Hub1 | |-> Controller 1 USB Port2 (Keyboard plugged in) -> |-> USB Root Hub |-> Controller 2 USB Port3 (nothing plugged in) -> USB Hub2 | | USB Port4 (nothing plugged in) -> |-> USB Root Hub |-> Controller3 (Mainboard) I want to show the User all ports and connected Hubs as a tree. And if the USB Port with its controller are in use or not. I hope you guys can understand what I am trying to describe

C# How do I check USB Ports with USB Hub and used Controller?

坚强是说给别人听的谎言 提交于 2019-11-30 17:59:00
问题 I am currently trying to scan all USB Ports with their USB Hub (check if it is Root or not) and to which controller they are connectet. To make it more visible: USB Port1 (nothing plugged in) -> USB Hub1 | |-> Controller 1 USB Port2 (Keyboard plugged in) -> |-> USB Root Hub |-> Controller 2 USB Port3 (nothing plugged in) -> USB Hub2 | | USB Port4 (nothing plugged in) -> |-> USB Root Hub |-> Controller3 (Mainboard) I want to show the User all ports and connected Hubs as a tree. And if the USB

Checking open UDP Port in C++

假装没事ソ 提交于 2019-11-28 04:27:06
问题 How can I check if a remote UDP port is open by using native C++? Since UDP is connection-less, calling connect() is not helpful. I cannot try binding it since it is not local. nmap cannot also indicate. (however netstat can find out, but I think it looks at internal information about open ports/files). Is there anyway to detect it? If I go a layer down on network level, is it possible to send a ICMP message by C++ to check port-unreachable status? I mean, would that give enough information

Fastest way to scan ports with Java

匆匆过客 提交于 2019-11-27 10:45:18
I made a very simple port scanner, but it runs too slow, so I'm looking for a way to make it scan faster. Here is my code: public boolean portIsOpen(String ip, int port, int timeout) { try { Socket socket = new Socket(); socket.connect(new InetSocketAddress(ip, port), timeout); socket.close(); return true; } catch (Exception ex) { return false; } } This code tests if a specific port is open on a specific ip. For timeout I used a minimum value of 200 because when I go lower it doesn't have enough time to test the port. It works well, but takes too much to scan from 0 to 65535. Is there any