DOSCAN(1)
DOSCAN(1) π
Okay bestie, this is the manual page for doscan, and it is a lot. Grab a boba, we're doing this. π
NAME β¨
doscan β Denial Of Service Capable Auditing of Networks. That's the whole government name, periodt. π
SYNOPSIS πΈ
doscan options prefix...
DESCRIPTION π¦
Okay so doscan is a tool to discover TCP services on your network. It is designed for scanning a single port on a large network. (There are better tools for scanning many ports on a small set of hosts, for example nmap(8).) Not me saying use the right tool for the right job, but here we are. π
The prefix parameter instructs doscan to scan all addresses in this prefix. Prefix notation is, as usual, A.B.C.D/L, where A.B.C.D is an IP address in dotted-quad notation, and L is a prefix length from 1 to 32. If the /L part is omitted, /32 is assumed (and a single host is scanned). Slay, simple.
doscan uses a random scatter technology to distribute the load across the network. Within a given prefix, hosts are not scanned sequentially, but in a random-looking, but reproducible order. As a result, doscan will not stress-test the network edge (just the next hop). (The prefixes themselves are scanned in order.) Main character energy, honestly. β¨
OPTIONS π
The --port option is mandatory, all other options are optional. Yes bestie, mandatory mandatory. π
-a timeout,--add-timeout timeoutβ this sets the timeout (in milliseconds) before new connections are added. It's part of a duo with-A, so read that one too, bestie.-A count,--add-burst countβ this sets the number of new connections or hosts to add in one burst. Each timeout millisecond,countnew hosts are contacted. (The per-host timeout controlled by the--timeoutoption is independent. It specifies the timeout once the first packet has been sent.)-b count,--banner countβ doscan reads at mostcountbytes from the remote host. The exact effect of this option varies among protocol modules, see the PROTOCOL MODULES section for details. The vibes are protocol-dependent, iykyk.-c count,--connections countβ At mostcountconnections are established in parallel. See CAVEATS below for problems resulting from system file descriptor limits, and instructions for choosing this parameter. By default, at most50parallel connections are established. Fifty is the default, no cap.-E,--no-epollβ Do not use theepollkernel interface even if it's available (useful for debugging). Sometimes you gotta turn off the fancy kernel thing, bestie.-f,--file nameβ doscan reads prefixes from the filename, in addition to the command line. The file shall contain one prefix per line. See the DESCRIPTION section above for the prefix format. To better distribute scanning of long prefix lists, all prefixies are reorded randomly if the--fileoption is used. (Okay the typo is in the original, but you get it. π)-i,--indicatorβ Display a progress indicator. If doscan is invoked with this option, the number of connections which have been established so far, the total number of addresses to be scanned, the number of currently active connections, and the number of hosts for which a report entry has been generated are displayed periodically. It's giving live updates. π-n,--net-errorsβ Instructs doscan to report network errors even if they prevent a connection. Normally, such errors are suppressed. Not all errors wanna be seen, but this makes them show up. π-o format,--output formatβ This option changes the format which doscan uses to report its findings. See the OUTPUT FORMAT section below for details.-p port,--port portβ The--portoption controls to which TCP port doscan connects when scanning a host.--protocol Istring,-P Istringβ Chooses the protocol modulestring. See the PROTOCOL MODULES section for information on available protocol modules.--send string,-s stringβ The effects of this option depend on the protocol module. See the PROTOCOL MODULES section for details.--receive regexp,-r regexpβ The effects of this option depend on the protocol module. See the PROTOCOL MODULES section for details.--style style,-S styleβ This option controls the output style. See the OUTPUT FORMAT section for details.-t timeout,--timeout timeoutβ This option sets the connect timeout totimeoutmilliseconds. If this time passes without a successfully established connection, doscan skips the hosts. No connection? Skipped, periodt.-v,--verboseβ Turn on additional reporting to standard error.-h,--helpβ Display help message and exit.-V,--versionβ Output version information and exit.
PROTOCOL MODULES π
doscan supports several protocol modules. By default, the generic tcp module is used, but you can choose another module using the --protocol option. The effect of the --banner, --send and --receive options depends on the protocol module. Available modules include:
http π
- This module causes doscan to connect to HTTP servers, send a request, and collect the server identification from the response.
- The
--banneroption specifies the maximum receive buffer size. It defaults to4000bytes. - The
--sendoption specifies the request that is send to the server. The string can include C escape sequences to send control characters. By default, the requestGET / HTTP/1.0\r\n\r\n(that is,GET / HTTP/1.0followed by the four characters CR, LF, CR, LF) is sent. - The
--receiveoption is not supported by this protocol module.
http_proxy π΅οΈ
- This protocol module probes hosts for open HTTP proxies.
- The
--portoption controls the port that is probed. - The required
--receiveoption must be an integer in the range from1to65534, the number specifies the port on which doscan listens for the connections from open proxies. - The required
--sendoption specifies the HTTP request method, either"GET"or"CONNECT". - The
--banneroption is not supported by this protocol module.
Warning: In the worst case, the amount of file descriptors is slightly more than twice the number of parallel connections given by the --connections options. The additional file descriptors are used by doscan's HTTP server component to process the connections from open proxies.
- See the EXAMPLES section for some convenient combinations of those options.
ident_check πͺͺ
- This protocol module reports hosts which have TCP service listening on the specified port which is not a proper IDENT/AUTH daemon.
- It is most useful with a
--port 113command line argument. - None of the
--banner,--receiveand--sendoptions are supported.
tcp π₯
- This module is intended for generic TCP service probing and fingerprinting.
- The
--banneroption controls the maximum length of banner strings which are collected. If its argument is zero or if the option is not specified, no banner strings are collected. In this case, doscan closes connections immediately after they have been established (which results in an increased scanning rate). - After establishing a connection, doscan sends the string specified by the
--sendoption to the remote host. The string can contain the usual C escape sequences (including\000), to send non-printable characters. - The
--receiveoption specifies a Perl-compatible regular expression (PCRE), and doscan uses it to analyze the data returned by a remote host. The regular expression may contain at least one capturing subpattern, it is always anchored at the beginning of the received data. The character.(period) matches all characters (including newline).$(dollar sign) matches the very end of the received data (which may, however, still be incomplete). Seepcrepattern(3)for details about the syntax of Perl-compatible regular expression. - The
--receiveregular expression is used by doscan for several purposes. If data is received from a remote host, and if the regular expression ends with$, doscan immediately closes the connection if all the data received so far from this host matches the regular expression. (doscan assumes that the reply is complete; increased scanning speed is the result.) When a connection is terminated for any reason, doscan checks if the regular expression matches the collected data. If it doesn't, a no match error is recorded (if no other error occured). If it does, and the regular expression contains a capturing subpattern, that subpattern is recorded. Otherwise, the whole data is recorded. - In order to use the
--receiveoption, you have to specify the--banneroption as well.
udp π‘
- This module is a generic UDP scanner, as far such a thing is possible. It sends up to five UDP packets (whose payload is controlled by the mandatory
--sendoption) to the specified port. Replies are collected. The--banneroption is implicit and set to the maximum payload size. Retransmission is stopped when the first reply is received. - In verbose mode (with both
--verboseand--net-errorsoptions), a warning like"stray UDP packet from 192.0.2.4:7"is printed to standard error when an unexpected UDP packet is received. Packets sent to network or broadcast addresses trigger such packets, and poorly implemented UDP services on multi-homed machines answer with a different source IP address.
β¨ OUTPUT FORMAT β¨
okay so when doscan is done and about to dip, it prints literally everything it gathered about the scanned prefixes to standard output. You can switch up the whole vibe with --output. The format argument is a string with % substitutions, kinda like printf(3) but make it scanning. Here's every substitution, no skips:
%%β a literal percent character.%aβ the address of the remote host.%bβ the banner returned by the host.%eβ the error code as a string, empty if no error happened while scanning the host.
This is either a system error constant (like ECONNREFUSED), or the string unknown (unknown error code). And if --receive is active and the received data doesn't match the regular expression you specified, and no other error occurred, the column contains no match.
%Eβ the numeric error code that goes with the%eerror message, or zero if no error happened. Negative error numbers get returned for internal errors (like a failed match against the--receiveregular expression).%nβ the host name corresponding to the scanned IP address (based on a DNS lookup). Heads up bestie, this slows down reporting a LOT in general. Which is exactly why it's not recommended to use%ntogether with--style unsorted.%Nβ a verbatim ASCII LF (newline) character.%rβ the time when the information was gathered, measured in seconds since the scanning started.%tβ the time when the information was gathered, in local time.%Tβ same as%t, but in UTC (also known as GMT).%%β a verbatim percent sign (%).
(yes, %% really is listed twice in the original and we are NOT gatekeeping it, both entries stay π
)
The default value for the --output option is %T\t%a\t%e\t%b, where \t denotes an ASCII HTAB character.
The --style or -S option supports these arguments:
sort-by-hostβ the output is sorted by the IP address of the scanned host. (This is the default.)unsortedβ the output is not sorted and appears in the order the hosts responded.
Caution: do not use this style together with an--outputargument that includes%n, and do not pipe the output of doscan to a process which cannot read its standard input quickly. Output is performed synchronously, and if it is delayed, this might impact the scanning activity. π
In all cases except unsorted, output is delayed just before the termination of the program.
π EXAMPLES π
okay these are the real ones, copy-paste energy:
doscan --banner 100 --port 13 192.0.2.1
Prints the time on the host 192.0.2.1 (if it runs a daytime server).
doscan --banner 100 --receive '(.*)\n$' --port 22 192.0.2.0/24
Scan for SSH servers and record the banners (usually containing version information about the SSH server).
doscan --banner 200 --receive '(.*?)\r?\n$' --port 25 192.0.2.0/24
Scan for SMTP servers and record their greeting messages. Works for FTP as well, with --port 21 instead of --port 25.
doscan --banner 2000 --send 'GET / HTTP/1.0\r\n\r\n' \
--receive '.*?\nServer: *([^\r\n]*) *\r?\n.*$' \
--port 80 192.0.2.0/24
Scan for HTTP servers and record their version strings.
doscan --protocol http_proxy --port 3128 \
--send GET --receive 80 192.0.2.0/24
Scan for open proxies on TCP port 3128, using the GET HTTP request method. Try to connect back to port 80 on the scanning host.
It is recommended that you use port 80 for the listening port if you scan using GET requests. For CONNECT requests, port 443 should be used (see below). Some administrators might restrict CONNECT to TCP port 443 (or filter it for the GET request method), so these choices give best results.
doscan --protocol http_proxy --port 8080 \
--send CONNECT --receive 443 192.0.2.0/24
Scan for open proxies on TCP port 8080, using the CONNECT HTTP request method. Try to connect back to port 443 on the scanning host.
π CAVEATS π
The most important option for tuning is --connections. Raising it can greatly increase scanning performance. But there are two caveats, and they are not cute: many connections require many sockets, and your system might not support that many. Also, a large number of parallel connections generates significant numbers of packets plus a high CPU load, and both of those can lead to spurious connection failures (false negatives). π
To increase the number of connections your system can process, you usually have to raise the corresponding ulimit value in your shell, and that requires root privileges. For example, in bash(1), you can invoke
ulimit -n 10030
to raise the descriptor limit to 10030. You can then pass --connections 10000 to doscan. (Some file descriptors are not used for scanning, but have to be open nonetheless, and count towards the ulimit -n limit.)
On Linux-based systems, you might have to adjust some sysctl values which control system-wide descriptor limits. Refer to sysctl.conf(5), the Documentation directory in the Linux source tree, or the source code itself for details.
Note, however, that if you increase the number of parallel connections beyond a certain value, you will lose some hosts β meaning they will not be reported even though they are running a service on the scanned port. So you should watch both network and CPU utilization to detect bottlenecks. Although the random scatter technique employed by doscan tries to split the load across your whole network, this obviously fails if the next hop cannot bear the traffic.
π AUTHOR π
doscan was written by Florian Weimer.
π¦ SEE ALSO π¦
nmap(8)pcrepattern(3)sysctl.conf(5)(on GNU/Linux systems)- shell documentation for the
ulimitinterface
and that's the whole page bestie, you ate it π«Ά this version is dated 2003-07-27 and it lives under the name DOSCAN(1) β go scan something responsibly, mwah πβ¨
π¦ where this page comes from
- debian bookworm: doscan 0.3.3-1.2
- ubuntu jammy: doscan 0.3.3-1.1build1
- Copyright (C) 2003 Florian Weimer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms