summaryrefslogtreecommitdiffstats
path: root/ncat/docs/examples
diff options
context:
space:
mode:
Diffstat (limited to 'ncat/docs/examples')
-rw-r--r--ncat/docs/examples/README15
-rw-r--r--ncat/docs/examples/ipaccess23
-rw-r--r--ncat/docs/examples/logs/ascii-output3
-rw-r--r--ncat/docs/examples/logs/hex-output47
-rw-r--r--ncat/docs/examples/scripts/README6
-rwxr-xr-xncat/docs/examples/scripts/http-proxy5
-rw-r--r--ncat/docs/examples/scripts/http-scan/README14
-rw-r--r--ncat/docs/examples/scripts/http-scan/get.request3
-rw-r--r--ncat/docs/examples/scripts/http-scan/iplist5
-rwxr-xr-xncat/docs/examples/scripts/http-scan/scan-example7
-rw-r--r--ncat/docs/examples/scripts/http-scan/scanner-output57
11 files changed, 185 insertions, 0 deletions
diff --git a/ncat/docs/examples/README b/ncat/docs/examples/README
new file mode 100644
index 0000000..7e253fc
--- /dev/null
+++ b/ncat/docs/examples/README
@@ -0,0 +1,15 @@
+/examples/scripts
+~~~~~~~~~~~~~~~~~
+These are a set of small scripts to further demonstrate some
+uses for Ncat. You *will* have to change some values yourself,
+such as in "http-proxy", if your proxy server requires authorization,
+you'll have to add your own authorization information.
+
+
+/examples/logs/
+~~~~~~~~~~~~~~~
+These are a set of output logfiles generated by Ncat to briefly
+demonstrate Ncat's logging abilities.
+
+
+--Chris Gibson, <chris@linuxops.net>
diff --git a/ncat/docs/examples/ipaccess b/ncat/docs/examples/ipaccess
new file mode 100644
index 0000000..356bea1
--- /dev/null
+++ b/ncat/docs/examples/ipaccess
@@ -0,0 +1,23 @@
+#
+# This is a sample IP access list that
+# could potentially be used with Ncat
+# to allow or deny specific users from
+# connecting to an Ncat process, such as
+# a standard listen operation to being
+# able to access your newly spawned SOCKS4
+# server.
+#
+# Obviously, these IP addresses are pretty
+# useless to most people. It is an example
+# afterall. :)
+#
+# Chris Gibson, <chris@linuxops.net>
+
+# lo interface.
+127.0.0.1/8
+
+# eth0 internal network.
+192.168.0.0/24
+
+# eth1 to outside world.
+55.20.30.1/32
diff --git a/ncat/docs/examples/logs/ascii-output b/ncat/docs/examples/logs/ascii-output
new file mode 100644
index 0000000..324f2a1
--- /dev/null
+++ b/ncat/docs/examples/logs/ascii-output
@@ -0,0 +1,3 @@
+HELO xxx.xxx.xxx
+220 smtp.google.com ESMTP
+250 smtp.google.com Hello xxx.xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you
diff --git a/ncat/docs/examples/logs/hex-output b/ncat/docs/examples/logs/hex-output
new file mode 100644
index 0000000..0114db5
--- /dev/null
+++ b/ncat/docs/examples/logs/hex-output
@@ -0,0 +1,47 @@
+[0000] 47 45 54 20 2F 69 6E 64 65 78 2E 68 74 6D 6C 20 GET..ind ex.html.
+[0010] 48 54 54 50 2F 31 2E 30 0A HTTP.1.0 .
+[0000] 55 73 65 72 2D 41 67 65 6E 74 3A 20 4E 63 61 74 User.Age nt..Ncat
+[0010] 0A .
+[0000] 48 6F 73 74 3A 20 77 77 77 2E 67 6F 6F 67 6C 65 Host..ww w.google
+[0010] 2E 63 6F 6D 0A .com.
+[0000] 0A .
+[0000] 48 54 54 50 2F 31 2E 30 20 33 30 32 20 46 6F 75 HTTP.1.0 .302.Fou
+[0010] 6E 64 0D 0A 4C 6F 63 61 74 69 6F 6E 3A 20 68 74 nd..Loca tion..ht
+[0020] 74 70 3A 2F 2F 77 77 77 2E 67 6F 6F 67 6C 65 2E tp...www .google.
+[0030] 63 6F 2E 75 6B 2F 63 78 66 65 72 3F 63 3D 50 52 co.uk.cx fer.c.PR
+[0040] 45 46 25 33 44 3A 54 4D 25 33 44 31 31 32 34 37 EF.3D.TM .3D11247
+[0050] 35 35 38 30 32 3A 53 25 33 44 48 75 52 73 51 62 55802.S. 3DHuRsQb
+[0060] 51 69 43 59 52 71 4A 6E 5A 32 26 70 72 65 76 3D QiCYRqJn Z2.prev.
+[0070] 2F 69 6E 64 65 78 2E 68 74 6D 6C 0D 0A 53 65 74 .index.h tml..Set
+[0080] 2D 43 6F 6F 6B 69 65 3A 20 50 52 45 46 3D 49 44 .Cookie. .PREF.ID
+[0090] 3D 31 63 31 31 36 32 63 66 36 63 63 33 65 35 63 .1c1162c f6cc3e5c
+[00a0] 64 3A 43 52 3D 31 3A 54 4D 3D 31 31 32 34 37 35 d.CR.1.T M.112475
+[00b0] 35 38 30 32 3A 4C 4D 3D 31 31 32 34 37 35 35 38 5802.LM. 11247558
+[00c0] 30 32 3A 53 3D 5F 38 33 69 47 45 53 67 6F 7A 6E 02.S..83 iGESgozn
+[00d0] 33 49 4F 6D 34 3B 20 65 78 70 69 72 65 73 3D 53 3IOm4..e xpires.S
+[00e0] 75 6E 2C 20 31 37 2D 4A 61 6E 2D 32 30 33 38 20 un..17.J an.2038.
+[00f0] 31 39 3A 31 34 3A 30 37 20 47 4D 54 3B 20 70 61 19.14.07 .GMT..pa
+[0100] 74 68 3D 2F 3B 20 64 6F 6D 61 69 6E 3D 2E 67 6F th....do main..go
+[0110] 6F 67 6C 65 2E 63 6F 6D 0D 0A 43 6F 6E 74 65 6E ogle.com ..Conten
+[0120] 74 2D 54 79 70 65 3A 20 74 65 78 74 2F 68 74 6D t.Type.. text.htm
+[0130] 6C 0D 0A 53 65 72 76 65 72 3A 20 47 57 53 2F 32 l..Serve r..GWS.2
+[0140] 2E 31 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 .1..Cont ent.Leng
+[0150] 74 68 3A 20 32 32 37 0D 0A 44 61 74 65 3A 20 54 th..227. .Date..T
+[0160] 75 65 2C 20 32 33 20 41 75 67 20 32 30 30 35 20 ue..23.A ug.2005.
+[0170] 30 30 3A 31 30 3A 30 32 20 47 4D 54 0D 0A 43 6F 00.10.02 .GMT..Co
+[0180] 6E 6E 65 63 74 69 6F 6E 3A 20 4B 65 65 70 2D 41 nnection ..Keep.A
+[0190] 6C 69 76 65 0D 0A 0D 0A 3C 48 54 4D 4C 3E 3C 48 live.... .HTML..H
+[01a0] 45 41 44 3E 3C 54 49 54 4C 45 3E 33 30 32 20 4D EAD..TIT LE.302.M
+[01b0] 6F 76 65 64 3C 2F 54 49 54 4C 45 3E 3C 2F 48 45 oved..TI TLE...HE
+[01c0] 41 44 3E 3C 42 4F 44 59 3E 0A 3C 48 31 3E 33 30 AD..BODY ...H1.30
+[01d0] 32 20 4D 6F 76 65 64 3C 2F 48 31 3E 0A 54 68 65 2.Moved. .H1..The
+[01e0] 20 64 6F 63 75 6D 65 6E 74 20 68 61 73 20 6D 6F .documen t.has.mo
+[01f0] 76 65 64 0A 3C 41 20 48 52 45 46 3D 22 68 74 74 ved..A.H REF..htt
+[0200] 70 3A 2F 2F 77 77 77 2E 67 6F 6F 67 6C 65 2E 63 p...www. google.c
+[0210] 6F 2E 75 6B 2F 63 78 66 65 72 3F 63 3D 50 52 45 o.uk.cxf er.c.PRE
+[0220] 46 25 33 44 3A 54 4D 25 33 44 31 31 32 34 37 35 F.3D.TM. 3D112475
+[0230] 35 38 30 32 3A 53 25 33 44 48 75 52 73 51 62 51 5802.S.3 DHuRsQbQ
+[0240] 69 43 59 52 71 4A 6E 5A 32 26 61 6D 70 3B 70 72 iCYRqJnZ 2.amp.pr
+[0250] 65 76 3D 2F 69 6E 64 65 78 2E 68 74 6D 6C 22 3E ev..inde x.html..
+[0260] 68 65 72 65 3C 2F 41 3E 2E 0D 0A 3C 2F 42 4F 44 here..A. .....BOD
+[0270] 59 3E 3C 2F 48 54 4D 4C 3E 0D 0A Y...HTML ...
diff --git a/ncat/docs/examples/scripts/README b/ncat/docs/examples/scripts/README
new file mode 100644
index 0000000..e50372f
--- /dev/null
+++ b/ncat/docs/examples/scripts/README
@@ -0,0 +1,6 @@
+These are various scripts that demonstrate some
+potential usage for Ncat.
+
+If you find a neat usage for Ncat and possibly
+write a few lines of code to automate something,
+then please email them over to Chris Gibson (chris@linuxops.net)
diff --git a/ncat/docs/examples/scripts/http-proxy b/ncat/docs/examples/scripts/http-proxy
new file mode 100755
index 0000000..904c20f
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-proxy
@@ -0,0 +1,5 @@
+NCAT_PATH=../../..
+PROXY_HOST=www.cnn.com:80
+PROXY_AUTH=user:pass
+
+$NCAT_PATH/ncat --http-proxy "$PROXY_HOST" --proxy-auth "$PROXY_AUTH" localhost 3128
diff --git a/ncat/docs/examples/scripts/http-scan/README b/ncat/docs/examples/scripts/http-scan/README
new file mode 100644
index 0000000..bb5c8be
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-scan/README
@@ -0,0 +1,14 @@
+HTTP-SCAN with Ncat
+~~~~~~~~~~~~~~~~~~~
+
+This is a simple exercise that uses a small amount of
+scripted automation that will throw out the banner
+information of n number of hosts listed in the file "iplist".
+
+Ncat uses the "get.request" HTTP header to get the newly
+connected webserver to tell you about itself.
+
+Usage: ./scan-example
+
+Variables to change: None, but you may want to change "iplist"
+ to other more informative hosts.
diff --git a/ncat/docs/examples/scripts/http-scan/get.request b/ncat/docs/examples/scripts/http-scan/get.request
new file mode 100644
index 0000000..778a569
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-scan/get.request
@@ -0,0 +1,3 @@
+HEAD / HTTP/1.0
+
+
diff --git a/ncat/docs/examples/scripts/http-scan/iplist b/ncat/docs/examples/scripts/http-scan/iplist
new file mode 100644
index 0000000..f0417e9
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-scan/iplist
@@ -0,0 +1,5 @@
+www.google.com
+www.microsoft.com
+www.apache.org
+www.freebsd.org
+www.apple.com
diff --git a/ncat/docs/examples/scripts/http-scan/scan-example b/ncat/docs/examples/scripts/http-scan/scan-example
new file mode 100755
index 0000000..1fe7f75
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-scan/scan-example
@@ -0,0 +1,7 @@
+NCAT_PATH=../../../..
+if [ -a "$NCAT_PATH/ncat" ]
+ then
+ for addr in `cat iplist`; do $NCAT_PATH/ncat --disable-eof-exit $addr 80 < get.request; done;
+else
+ echo "Ncat is not buit. Please build Ncat before you use these scripts";
+fi
diff --git a/ncat/docs/examples/scripts/http-scan/scanner-output b/ncat/docs/examples/scripts/http-scan/scanner-output
new file mode 100644
index 0000000..5c69d59
--- /dev/null
+++ b/ncat/docs/examples/scripts/http-scan/scanner-output
@@ -0,0 +1,57 @@
+Connected to 66.102.9.147:80
+HTTP/1.0 302 Found
+Location: http://www.google.co.uk/
+Set-Cookie: PREF=ID=b6262fee80b28ffc:TM=1137945347:LM=1137945347:S=s7TLf6mcMNGW-33R; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
+Content-Type: text/html
+Server: GWS/2.1
+Content-Length: 224
+Date: Sun, 22 Jan 2006 15:55:47 GMT
+Connection: Keep-Alive
+
+Connected to 207.46.198.30:80
+HTTP/1.1 200 OK
+Connection: close
+Date: Sun, 22 Jan 2006 15:55:48 GMT
+Server: Microsoft-IIS/6.0
+P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
+X-Powered-By: ASP.NET
+X-AspNet-Version: 2.0.50727
+Cache-Control: private
+Content-Type: text/html; charset=utf-8
+Content-Length: 21061
+
+Connected to 209.237.227.195:80
+HTTP/1.1 200 OK
+Date: Sun, 22 Jan 2006 15:55:48 GMT
+Server: Apache/2.2.0 (Unix)
+Last-Modified: Wed, 18 Jan 2006 03:00:54 GMT
+ETag: "997bf1-2d93-419e2580"
+Accept-Ranges: bytes
+Content-Length: 11667
+Cache-Control: max-age=86400
+Expires: Mon, 23 Jan 2006 15:55:48 GMT
+Connection: close
+Content-Type: text/html; charset=ISO-8859-1
+
+Connected to 216.136.204.117:80
+HTTP/1.1 200 OK
+Date: Sun, 22 Jan 2006 15:55:49 GMT
+Server: Apache/1.3.x LaHonda (Unix)
+Last-Modified: Fri, 20 Jan 2006 21:24:33 GMT
+ETag: "26f8f7-9839-43d15511"
+Accept-Ranges: bytes
+Content-Length: 38969
+Connection: close
+Content-Type: text/html
+X-Pad: avoid browser bug
+
+Connected to 17.112.152.32:80
+HTTP/1.0 200 OK
+Age: 328
+Date: Sun, 22 Jan 2006 15:50:20 GMT
+Content-Length: 26131
+Content-Type: text/html
+Expires: Sun, 22 Jan 2006 16:10:20 GMT
+Cache-Control: max-age=1200
+Server: Apache/1.3.29 (Darwin) PHP/4.3.1
+