Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 186 lines (131 sloc) 7.366 kb
aebb535c »
2010-02-21 v2.1d updates
1 RTMP Dump v2.1d
7d67491a »
2009-12-16 Use trunk for main development
2 (C) 2009 Andrej Stepanchuk
066b686b »
2010-01-01 2.1a updates: copyright year, streams description in README
3 (C) 2009-2010 Howard Chu
7d67491a »
2009-12-16 Use trunk for main development
4 License: GPLv2
5cbd51a9 »
2010-01-08 More 2.1c misc
5 http://rtmpdump.mplayerhq.hu/
7d67491a »
2009-12-16 Use trunk for main development
6
aebb535c »
2010-02-21 v2.1d updates
7 To compile type "make" with platform name, e.g.
7d67491a »
2009-12-16 Use trunk for main development
8
aebb535c »
2010-02-21 v2.1d updates
9 $ make posix
7d67491a »
2009-12-16 Use trunk for main development
10
aebb535c »
2010-02-21 v2.1d updates
11 for Linux, MacOSX, Unix, etc. or
7d67491a »
2009-12-16 Use trunk for main development
12
aebb535c »
2010-02-21 v2.1d updates
13 $ make mingw
7d67491a »
2009-12-16 Use trunk for main development
14
aebb535c »
2010-02-21 v2.1d updates
15 for Windows.
16
17 You can cross-compile for other platforms using
18
19 $ make cross
7d67491a »
2009-12-16 Use trunk for main development
20
21 but you may need to override the CROSS_COMPILE and INC variables, e.g.
22
23 $ make arm CROSS_COMPILE=arm-none-linux- INC=-I/my/cross/includes
24
25 Please read the Makefile to see what other make variables are used.
26
09a0535d »
2009-12-29 Drop libcurl stuff
27 This code also requires you to have OpenSSL and zlib installed.
a45cfbe6 »
2009-12-28 Note that Curl and Zlib are now required
28
7d67491a »
2009-12-16 Use trunk for main development
29
30 SWF Verification
31 ----------------
32
33 Download the swf player you want to use for SWFVerification, unzip it using
34
35 $ flasm -x file.swf
36
37 It will show the decompressed filesize, use it for --swfsize
38
39 Now generate the hash
40
41 $ openssl sha -sha256 -hmac "Genuine Adobe Flash Player 001" file.swf
42
43 and use the --swfhash "01234..." option to pass it.
44
45 e.g. $ ./rtmpdump --swfhash "123456..." --swfsize 987...
46
aebb535c »
2010-02-21 v2.1d updates
47 Note: all of this is done automatically if you provide the SWF URL using
48 the -W (--swfVfy) option instead of the -s (--swfUrl) option. Also, the
49 hash info is cached in ~/.swfinfo so it doesn't need to be ecalculated
50 all the time.
6fbcac48 »
2009-12-28 Add note about automatic SWF verification
51
f267ce2b »
2010-01-09 Notes for connect params
52 Connect Parameters
53 ------------------
54
55 Some servers expect additional custom parameters to be attached to the
56 RTMP connect request. The "--auth" option handles a specific case, where
57 a boolean TRUE followed by the given string are added to the request.
58 Other servers may require completely different parameters, so the new
59 "--conn" option has been added. This option can be set multiple times
60 on the command line, adding one parameter each time.
61
62 The argument to the option must take the form <type> : <value> where
63 type can be B for boolean, S for string, N for number, and O for object.
64 For booleans the value must be 0 or 1. Also, for objects the value must
65 be 1 to start a new object, or 0 to end the current object.
66
67 Examples:
68 --conn B:0 --conn S:hello --conn N:3.14159
69
70 Named parameters can be specified by prefixing 'N' to the type. Then the
71 name should come next, and finally the value:
72 --conn NB:myflag:1 --conn NS:category:something --conn NN:pi:3.14159
73
74 Objects may be added sequentially:
75 -C O:1 -C NB:flag:1 -C NS:status:success -C O:0 -C O:1 -C NN:time:12.30 -C O:0
76 or nested:
77 -C O:1 -C NS:code:hello -C NO:extra:1 -C NS:data:stuff -C O:0 -C O:0
78
79
7d67491a »
2009-12-16 Use trunk for main development
80 Building OpenSSL 0.9.8k
81 -----------------------
82 arm:
83 ./Configure -DL_ENDIAN --prefix=`pwd`/armlibs linux-generic32
84
85 Then replace gcc, cc, ar, ranlib in Makefile and crypto/Makefile by arm-linux-* variants and use make && make install_sw
86
87 win32:
88 Try ./Configure mingw --prefix=`pwd`/win32libs -DL_ENDIAN -DOPENSSL_NO_HW
89 Replace gcc, cc, ... by mingw32-* variants in Makefile and crypto/Makefile
90 make && make install_sw
91
92 OpenSSL cross-compiling can be a difficult beast.
93
94
d5052931 »
2009-12-17 Notes for 2.0
95 Credit goes to team boxee for the XBMC RTMP code originally used in RTMPDumper.
96 The current code is based on the XBMC code but rewritten in C by Howard Chu.
7d67491a »
2009-12-16 Use trunk for main development
97
066b686b »
2010-01-01 2.1a updates: copyright year, streams description in README
98 Example Servers
99 ---------------
100 Three different types of servers are also present in this distribution:
101 rtmpsrv - a stub server
102 rtmpsuck - a transparent proxy
103 streams - an RTMP to HTTP gateway
091881d0 »
2009-12-28 Add note about rtmpsrv
104
066b686b »
2010-01-01 2.1a updates: copyright year, streams description in README
105 rtmpsrv - Note that this is very incomplete code, and I haven't yet decided
aebb535c »
2010-02-21 v2.1d updates
106 whether or not to finish it. It is useful for obtaining all the parameters
107 that a real Flash client would send to an RTMP server, so that they can be
108 used with rtmpdump. The current version now invokes rtmpdump automatically
109 after parsing a client request.
066b686b »
2010-01-01 2.1a updates: copyright year, streams description in README
110
111 rtmpsuck - proxy server. See below...
d0ef6998 »
2009-12-30 Notes about rtmpsuck.
112
091881d0 »
2009-12-28 Add note about rtmpsrv
113 All you need to do is redirect your Flash clients to the machine running this
114 server and it will dump out all the connect / play parameters that the Flash
115 client sent. The simplest way to cause the redirect is by editing /etc/hosts
116 when you know the hostname of the RTMP server, and point it to localhost while
117 running rtmpsrv on your machine. (This approach should work on any OS; on
118 Windows you would edit %SystemRoot%\system32\drivers\etc\hosts.)
119
3afa522f »
2010-02-21 Cleanup iptables / ipfw info
120 On Linux you can also use iptables to redirect all outbound RTMP traffic. You
121 need to be running as root in order to use the iptables command.
091881d0 »
2009-12-28 Add note about rtmpsrv
122
123 In my original plan I would have the transparent proxy running as a special
124 user (e.g. user "proxy"), and regular Flash clients running as any other user.
125 In that case the proxy would make the connection to the real RTMP server. The
126 iptables rule would look like this:
127
128 iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner proxy \
129 -j REDIRECT
130
3afa522f »
2010-02-21 Cleanup iptables / ipfw info
131 A rule like the above will be needed to use rtmpsuck. Note that you should
132 replace "proxy" in the above command with an account that actually exists
133 on your machine.
091881d0 »
2009-12-28 Add note about rtmpsrv
134
135 Using it in this mode takes advantage of the Linux support for IP redirects;
136 in particular it uses a special getsockopt() call to retrieve the original
137 destination address of the connection. That way the proxy can create the
013740de »
2010-01-04 Updates for 2.1b
138 real outbound connection without any other help from the user. The equivalent
139 functionality may exist on other OSs but needs more investigation.
140
3afa522f »
2010-02-21 Cleanup iptables / ipfw info
141 (Based on reading the BSD ipfw manpage, this rule ought to work on BSD:
013740de »
2010-01-04 Updates for 2.1b
142
3afa522f »
2010-02-21 Cleanup iptables / ipfw info
143 ipfw add 40 fwd 127.0.0.1,1935 tcp from any to any 1935 not uid proxy
013740de »
2010-01-04 Updates for 2.1b
144
145 Some confirmation from any BSD users would be nice.)
146
147 (We have a solution for Windows based on a TDI driver; this is known to
148 work on Win2K and WinXP but is assumed to not work on Vista or Win7 as the
149 TDI is no longer used on those OS versions. Also, none of the known
150 solutions are available as freeware.)
d0ef6998 »
2009-12-30 Notes about rtmpsuck.
151
152 The rtmpsuck command has only one option: "-z" to turn on debug logging.
153 It listens on port 1935 for RTMP sessions, but you can also redirect other
154 ports to it as needed (read the iptables docs). It first performs an RTMP
155 handshake with the client, then waits for the client to send a connect
156 request. It parses and prints the connect parameters, then makes an
157 outbound connection to the real RTMP server. It performs an RTMP handshake
158 with that server, forwards the connect request, and from that point on it
159 just relays packets back and forth between the two endpoints.
160
161 It also checks for a few packets that it treats specially: a play packet
162 from the client will get parsed so that the playpath can be displayed. It
163 also handles SWF Verification requests from the server, without forwarding
164 them to the client. (There would be no point, since the response is tied to
165 each session's handshake.)
166
167 Once the play command is processed, all subsequent audio/video data received
168 from the server will be written to a file, as well as being delivered back
169 to the client.
170
171 The point of all this, instead of just using a sniffer, is that since rtmpsuck
172 has performed real handshakes with both the client and the server, it can
173 negotiate whatever encryption keys are needed and so record the unencrypted
174 data.
066b686b »
2010-01-01 2.1a updates: copyright year, streams description in README
175
176 streams - HTTP gateway: this is an HTTP server that accepts requests that
177 consist of rtmpdump parameters. It then connects to the specified RTMP
178 server and returns the retrieved data in the HTTP response. The only valid
179 HTTP request is "GET /" but additional options can be provided in normal
180 URL-encoded fashion. E.g.
181 GET /?r=rtmp:%2f%2fserver%2fmyapp&y=somefile HTTP/1.0
182
183 is equivalent the rtmpdump parameters "-r rtmp://server/myapp -y somefile".
184
185 Note that only the shortform (single letter) rtmpdump options are supported.
Something went wrong with that request. Please try again.