Hello Matt,

Thanks for the new perl script. I have spent some time trying to get it to 
work and unfortunately it doesn't seem to work with the syntax given. Just 
for background I am running a raspberry pi w/ the latest version of 
raspian. It has two ethernet devices running in bridge mode. The acurite 
bridge is connected to eth1 and the router is plugged into eth0. I have 
attached an ifconfig -a so you can see the network setup:

br0       Link encap:Ethernet  HWaddr 00:1f:f3:8b:40:f4
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:f3ff:fe8b:40f4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:397718 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101956 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:48136637 (45.9 MiB)  TX bytes:53601798 (51.1 MiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:ab:27:9a
          inet addr:169.254.173.171  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:616661 errors:0 dropped:0 overruns:0 frame:0
          TX packets:308956 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:78114140 (74.4 MiB)  TX bytes:72282022 (68.9 MiB)

eth1      Link encap:Ethernet  HWaddr 00:1f:f3:8b:40:f4
          inet addr:169.254.197.59  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:205873 errors:0 dropped:0 overruns:0 frame:0
          TX packets:455102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12516899 (11.9 MiB)  TX bytes:63064200 (60.1 MiB)


Closest thing I could get is with this:

sudo tcpdump -A -n -p -l -i eth0 -s0 -w - tcp dst port 80 | stdbuf -oL 
strings -n8 | ./combine.pl

output looks like this:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 
262144 bytes
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=tower&sensor=00008384&humidity=31&tempf=80.2&baromin=29.30&battery=normal&rssi=2hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=5N1x31&sensor=00002179&windspeedmph=2&winddir=225&rainin=0.00&dailyrainin=0.20&humidity=20&tempf=87.6&dewptf=42&baromin=29.30&battery=normal&rssi=3hubapi.myacurite.com
ID=KCATHOUS110&PASSWORD=XXXXXXXX&dateutc=now&action=updateraw&realtime=1&rtfreq=36&id=24C86E06B15C&mt=5N1x31&sensor=00002179&windspeedmph=2&winddir=225&rainin=0.00&dailyrainin=0.20&humidity=20&tempf=87.6&dewptf=42&baromin=29.30&battery=normal&rssi=3rtupdate.wunderground.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=tower&sensor=00008384&humidity=31&tempf=80.2&baromin=29.30&battery=normal&rssi=2hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=tower&sensor=00008384&humidity=31&tempf=80.2&baromin=29.30&battery=normal&rssi=2hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=tower&sensor=00012694&humidity=49&tempf=71.2&baromin=29.30&battery=normal&rssi=3hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=5N1x31&sensor=00002179&windspeedmph=2&winddir=270&rainin=0.00&dailyrainin=0.20&humidity=20&tempf=87.6&dewptf=42&baromin=29.30&battery=normal&rssi=3hubapi.myacurite.com
ID=KCATHOUS110&PASSWORD=XXXXXXXX&dateutc=now&action=updateraw&realtime=1&rtfreq=36&id=24C86E06B15C&mt=5N1x31&sensor=00002179&windspeedmph=2&winddir=270&rainin=0.00&dailyrainin=0.20&humidity=20&tempf=87.6&dewptf=42&baromin=29.30&battery=normal&rssi=3rtupdate.wunderground.com
dateutc=now&action=updateraw&realtime=1&id=24C86E06B15C&mt=tower&sensor=00008384&humidity=31&tempf=80.2&baromin=29.30&battery=normal&rssi=2hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1#E&id=24C86E06B15C&mt=tower&sensor=00012694#E&humidity=49&tempf=71.2#E&baromin=29.30&battery=normal&rssi=3#E
hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1&E&id=24C86E06B15C&mt=5N1x38&sensor=00002179&E&windspeedmph=1&humidity=22&E&tempf=87.1&E&baromin=29.30&battery=normal&rssi=3&E
hubapi.myacurite.com&E
dateutc=now&action=updateraw&realtime=1,E&id=24C86E06B15C&mt=tower&sensor=00008384,E&humidity=31&tempf=80.2,E&baromin=29.30&battery=normal&rssi=2,E
hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=14E&id=24C86E06B15C&mt=tower&sensor=000126944E&humidity=49&tempf=71.24E&baromin=29.30&battery=normal&rssi=44E
hubapi.myacurite.com
dateutc=now&action=updateraw&realtime=1CE&id=24C86E06B15C&mt=5N1x31&sensor=00002179CE&windspeedmph=3&winddir=113CE&rainin=0.00&dailyrainin=0.20&humidity=22&tempf=87.1&dewptf=43CE&baromin=29.30&battery=normal&rssi=3CE
hubapi.myacurite.com



If I would try to to use something similar to the syntax provided I would 
get acks and seq w/o and info in the dump:
sudo tcpdump -i eth1 port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
14:29:45.633996 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [S], seq 458494429, 
win 400, options [mss 536], length 0
14:29:45.708706 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [S.], seq 825064456, ack 458494430, win 17922, 
options [mss 1460], length 0
14:29:45.710630 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [.], ack 1, win 400, 
length 0
14:29:45.712456 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 1:81, ack 1, 
win 400, length 80
14:29:45.788645 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 81, win 17922, length 0
14:29:45.792628 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 81:122, ack 
1, win 400, length 41
14:29:45.795496 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 122:145, ack 
1, win 400, length 23
14:29:45.801577 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 145:181, ack 
1, win 400, length 36
14:29:45.803026 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 181:198, ack 
1, win 400, length 17
14:29:45.804895 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 198:239, ack 
1, win 400, length 41
14:29:45.868009 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 122, win 17922, length 0
14:29:45.871427 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 145, win 17922, length 0
14:29:45.873747 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [P.], seq 239:262, ack 
1, win 400, length 23
14:29:45.875715 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 181, win 17922, length 0
14:29:45.879692 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 198, win 17922, length 0
14:29:45.879807 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 239, win 17922, length 0
14:29:45.947971 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [.], ack 262, win 17922, length 0
14:29:45.989474 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [P.], seq 1:401, ack 262, win 17922, length 400
14:29:45.996607 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [.], ack 401, win 400, 
length 0
14:29:46.072238 IP ec2-52-4-188-138.compute-1.amazonaws.com.http > 
192.168.1.18.3868: Flags [FP.], seq 401:412, ack 262, win 17922, length 11
14:29:46.073935 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [.], ack 413, win 389, 
length 0
14:29:46.074997 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [.], ack 413, win 400, 
length 0
14:29:46.076078 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [F.], seq 262, ack 
413, win 400, length 0
14:29:46.076624 IP 192.168.1.18.3868 > 
ec2-52-4-188-138.compute-1.amazonaws.com.http: Flags [R.], seq 262, ack 
413, win 400, length 0



as soon as I attempt to send it to curl it stops working. It doesn't seem 
to like the curl syntax provided. has a problem with -d...
pi@new-host-9:~ $ sudo tcpdump -A -n -p -l -i eth0 -s0 -w - tcp dst port 80 
| stdbuf -oL strings -n8 | ./combine.pl | curl http://192.168.1.7:8080 -s -d
curl: option -d: requires parameter


It then just sits there with no output. I tried reading the man page but I 
don't understand what parameter its looking for me to put in.
       -d, --data <data>
              (HTTP) Sends the specified data in a POST request to the HTTP 
server, in the same way that a browser does when a user has filled in an 
HTML form and presses the submit button.  This  will
              cause curl to pass the data to the server using the 
content-type application/x-www-form-urlencoded.  Compare to -F, --form.

              -d, --data is the same as --data-ascii. To post data purely 
binary, you should instead use the --data-binary option. To URL-encode the 
value of a form field you may use --data-urlencode.

              If  any  of  these  options  is  used more than once on the 
same command line, the data pieces specified will be merged together with a 
separating &-symbol. Thus, using '-d name=daniel -d
              skill=lousy' would generate a post chunk that looks like 
'name=daniel&skill=lousy'.

              If you start the data with the letter @, the rest should be a 
file name to read the data from, or - if you want curl to read the data 
from stdin. Multiple files  can  also  be  specified.
              Posting data from a file named 'foobar' would thus be done 
with --data @foobar. When --data is told to read from a file like that, 
carriage returns and newlines will be stripped out.


Ive spent a couple hours now trying, but Im just not getting anywhere. I am 
defeated :(

Thanks,
Brad




On Saturday, November 5, 2016 at 11:58:03 AM UTC-7, mwall wrote:
>
> On Saturday, November 5, 2016 at 2:14:55 PM UTC-4, Brad Tucker wrote:
>>
>> Mwall, Im using tcpdump and a perl script by radar attached below. Could 
>> this be a sensor map issue???
>>>
>>>
>>>
> brad, before we can determine if it is a sensor_map issue, we need to see 
> what is actually getting to the interceptor.
>
> please try the attached combine-lines.pl
>
> use it something like this:
>
> tcpdump -i eth0 src X.X.X.X and port 80 | combine-lines.pl | curl 
> http://localhost:9999 -s -d
>
> first do the tcpdump piped to combine-lines to be sure that we're getting 
> what we need.  once that works, add the curl to connect it to the 
> interceptor.
>
> tcpdump captures the traffic and spits it out in multiple lines, 
> combine-lines puts them together and strips off anything that is not cgi 
> args, then curl posts those args to the interceptor web server.
>
> m
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to