
This is the second article in a three-part blog series intended to introduce and acquaint the user with Farsight’s AXA suite of tools and library code. Thispiece introduces
sratool
and will show useful examples of how to invoke the tool using common use cases. This article is not an exhaustive treatise on
sratool
. For that, the reader is directed to the man page and the source code.
First, a recap. When we last convened, you learned about Farsight Security’sfabled Security Internet Exchange (SIE) and the arcane magic used to remotelyconsume it, the Advanced Exchange Access (AXA). Interest piqued, you mused “how can I get me some of that?”. Dear reader,
sratool
is how you get you some of that. Let’s learn more.
sratool
is the AXA Swiss Army knife. It is a versatile tool used to test, debug, inspect, or stream AXA connections. In its most common invocation,
sratool
connects to an SRA server, issues a few AXA protocol messages, and displays the responses.
So let’s get to it!
As a stalwart protector of your organization’s network you’ve already contacted Farsight sales and signed up to receive Farsight’s Newly Observed Domains (NOD) datafeed to watch newly active domains and ensure your users don’t visit any newly minted — often malicious — domains.This tutorial will show you, venturesome new Farsight datafeed subscriber, how to examine the Newly Observed Domains (NOD) feed in real time. Commands and their output are listed with discussion below.
1 $ sratool
2 > connect ssh:
3 * HELLO srad version 0.2.5 sra-eft AXA protocol 1
4 > 1 watch ch=211
5 1 OK WATCH started
6 > count 5
7 > channel 211 on
8 * OK CHANNEL ON/OFF channel ch211 on
9 1 ch211 SIE newdomain
10 flyinghorse-colorado.com/A: flyinghorse-colorado.com
11 1 ch211 SIE newdomain
12 treatmentforboils.com/NS: treatmentforboils.com
13 1 ch211 SIE newdomain
14 servicedeck.com/NS: servicedeck.com
15 1 ch211 SIE newdomain
16 www.markenmacher.eu/A: markenmacher.eu
17 1 ch211 SIE newdomain
18 recruitniks.com/NS: recruitniks.com
19 packet count limit exceeded
20 > count
21 packet printing stopped by count 1990 packets ago
sratool
connect
sratool
AXA_P_OP_HELLO
watch SIE channel 211 traffic(this is the NOD channel). The server responds with the current watch status. The watch is the most fundamental sratool command. This is how sratool “signs up” to receive data from the SRA server. As its name implies, watch sets up a watch which is a low-level primitive that tellsthe SRA server that the client is interested in nmsg messages or IP packetsthat meet one of the following criteria:sratool allowsonly a single SRA connection at a time.count
sratool
sratool
channel
sratool
channel
sratool
count
Continuing in the session above, let’s tweak a few knobs and press a few buttons.
22 > list watches
23 1 ch=ch211
24 > 1 delete
25 1 OK STOP watch deleted
26 > rate
27 RATE LIMITS
28 unlimited per second; current value=307
29 10 seconds between reports
30 > rate 1
31 RATE LIMITS
32 1 per second; current value=2
33 10 seconds between reports
list watches command prints all of the active watches. We’ve still got one going, we’re just not emitting any packets to the screen.deletecommand.rate allows us to query the rate limiter and control it. Currently, there is no rate limiting in play —packets will be emitted as quickly as they appear. For lower bandwidthchannels, like NOD, this is might not be a problem. For the DNSDB channels,which are much higher bandwidth, we’ll want to limit the rate at which thosepackets are sent by the server to sratool
rate command, we set a rate limit of 1 packet persecond. This will come in handy in the last part of the tutorial where we’llexamine DNSDB.As a bonus, let’s peek at SIE channel 202 traffic, Farsight’s raw passive DNSfeed.
34 > 2 watch dns=*.github.com
35 2 OK WATCH started
36 > channel 202 on
37 * OK CHANNEL ON/OFF channel ch202 on
38 2 ch202 base dnsqr response UDP_QUERY_RESPONSE
39 204.13.250.16.53 > 68.105.29.142.17296 IP TTL=58 UDP 86 bytes
40 DNS: raw.github.com IN A qr aa NOERROR 1 ans, 0 auth, 0 add RRs
41 2 ch202 base dnsqr response UDP_QUERY_RESPONSE
42 208.78.71.16.53 > 208.106.17.39.64372 IP TTL=56 UDP 153 bytes
43 DNS: api.github.com IN A qr aa cd NOERROR 1 ans, 4 auth, 0 add RRs
44 2 ch202 base dnsqr response UDP_QUERY_RESPONSE
45 204.13.250.16.53 > 68.105.28.174.52707 IP TTL=58 UDP 89 bytes
46 DNS: malsup.github.com IN A qr aa NOERROR 1 ans, 0 auth, 0 add RRs
47 * MISSED
48 lost 0 input packets, dropped 0 for congestion,
49 121 for per sec limit
50 since 2014/12/08 17:29:38
51 2 ch202 base dnsqr response UDP_QUERY_RESPONSE
52 204.13.250.16.53 > 68.105.28.174.47116 IP TTL=58 UDP 149 bytes
53 DNS: github.com IN A qr aa NOERROR 1 ans, 4 auth, 0 add RRs
www.github.com and github.com
This should be enough to get you started! Next week, we’ll cover
sratunnel
!
We learned how to invoke
sratool
, issue some fundamental commands to turn on,off, and control the flow of SIE data.
Our next and final installment in this introductory tutorial will be a discussion of
sratunnel
.
Mike Schiffman is a Senior Distributed Systems Engineer for Farsight Security,Inc.
Read the next part in this series: Farsight’s Advanced Exchange Access, part 3 of 3