aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <0xc0decafe@users.noreply.github.com>2015-12-28 15:37:07 +0100
committerDaniel <0xc0decafe@users.noreply.github.com>2015-12-28 15:37:07 +0100
commit8447694de953f6664b9f39f2ead1e4f16ac08753 (patch)
tree55174946f6fa14a32966ce7f45a581ddff10f400
parent57e64d5b97e0103115b25773b4b9fbbed46efba9 (diff)
fixed typos in readme, modified tool output.
-rw-r--r--README.md11
-rw-r--r--src/ss7test_app.erl28
-rw-r--r--src/ss7test_helper.erl7
3 files changed, 30 insertions, 16 deletions
diff --git a/README.md b/README.md
index 471502f..37c3b18 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
# ss7MAPer
+
SS7 MAP (pen-)testing toolkit
## Get it running
@@ -84,19 +85,19 @@ You will need:
The config file is split in 4 section, sctp, m3ua, sccp and target.
-In the sctp section source and destination ip as well as source and destination port of the SCTP connection are configured.
+In the *sctp* section source and destination ip as well as source and destination port of the SCTP connection are configured.
-In the m3ua section all the M3UA parameters, like local and remote point code are configured.
+In the *m3ua* section all the M3UA parameters, like local and remote point code are configured.
-In the sccp section currently only the local (or source) global title needs to be configured.
+In the *sccp* section currently only the local (or source) global title needs to be configured.
-Last but not least in the target section information about the tested environment need to be configured, like the global title of the HLR, or the MSISDN of the tested phone are configured.
+Last but not least in the *target* section information about the tested environment need to be configured, like the global title of the HLR, or the MSISDN of the tested phone.
Be sure to modify it to your needs.
## Running the tool
-To run the tool one needs to start an rebar shell:
+To run the tool one needs to start a rebar shell:
cd ss7MAPer
rebar shell
diff --git a/src/ss7test_app.erl b/src/ss7test_app.erl
index cc0bb22..b13f46d 100644
--- a/src/ss7test_app.erl
+++ b/src/ss7test_app.erl
@@ -217,7 +217,7 @@ test_sri(Gts, L) ->
{local,22},_}}}}|_] ->
io:format("\e[91;1mReceived SendRoutingInfoRes~n\e[39;49;0m");
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding SendRoutingInfo\n\e[39;49;0m")
@@ -241,15 +241,23 @@ test_srifs(Gts, L) ->
{ok, Results} ->
io:format("\e[97;1mGot answer for sendRoutingInfoForSM\n~w\n\e[39;49;0m", [Results]),
case Results of
- [{basicROS, {returnError, {_, {present, Present}, {local, Local}, _}}}|_] ->
+ [{basicROS, {returnError, {_, {present, Present}, {local, Local}, Res}}}|_] ->
case {Present, Local} of
{1, 6} ->
io:format("\e[91;1mSubscriber is absent~n\e[39;49;0m");
_ ->
io:format("\e[92;1mReceived Error: Present ~w, Local ~w~n\e[39;49;0m", [Present, Local])
end;
+ [{basicROS,
+ {returnResult,
+ {'MapSpecificPDUs_end_components_SEQOF_basicROS_returnResult',
+ {present,1},{'MapSpecificPDUs_end_components_SEQOF_basicROS_returnResult_result',
+ {local,45}, Res}}}}|_] ->
+ {'RoutingInfoForSM-Res',_,
+ {'LocationInfoWithLMSI',Loc,_,_,_,_},_,_} = Res,
+ io:format("\e[91;1mReceived routingInfoForSM, Mobile Station ~w", [ss7test_helper:decode_phonenumber(Loc)]);
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding SendRoutingInfoForSM\n\e[39;49;0m")
@@ -283,7 +291,7 @@ test_si(Gts, L) ->
{'MapSpecificPDUs_end_components_SEQOF_basicROS_returnResult_result',
{local,58},
Imsi }}}}|_] ->
- io:format("\e[91;1mReceived IMSI ~w~n\e[39;49;0m", [Imsi]),
+ io:format("\e[91;1mReceived IMSI ~w~n\e[39;49;0m", [ss7test_helper:decode_imsi(Imsi)]),
L#loop_dat{imsi = Imsi}
end;
_->
@@ -336,7 +344,7 @@ test_sai(Gts, L, Nr) ->
end
end;
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding sendAuthenticationInfo\n\e[39;49;0m")
@@ -369,7 +377,7 @@ test_rss(Gts, L) ->
{local,10},_}}}}|_] ->
io:format("\e[91;1mReceived forwardingInfo, registerSS is working~n\e[39;49;0m");
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding registerSS\n\e[39;49;0m")
@@ -402,7 +410,7 @@ test_ess(Gts, L) ->
{local,11},_}}}}|_] ->
io:format("\e[91;1mReceived forwardingInfo, eraseSS is working~n\e[39;49;0m");
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding eraseSS\n\e[39;49;0m")
@@ -431,7 +439,7 @@ test_ul(Gts, L) ->
[{basicROS,{invoke,{'MapSpecificPDUs_continue_components_SEQOF_basicROS_invoke',{present,2},asn1_NOVALUE,{local,7},_}}}|_] ->
io:format("\e[91;1mReceived insertSubscriberData, updateLocation is working~n\e[39;49;0m");
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding updateLocation\n\e[39;49;0m")
@@ -463,7 +471,7 @@ test_ati(Gts, L) ->
io:format("\e[91;1mReceived Error: Present ~w, Local ~w~n\e[39;49;0m", [Present, Local])
end;
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding anyTimeInerrogation\n\e[39;49;0m")
@@ -496,7 +504,7 @@ test_pms(Gts, L) ->
{local,67},_}}}}|_] ->
io:format("\e[91;1mReceived purgeMS-Res, purgeMS is working~n\e[39;49;0m");
_ ->
- io:format("\e[92;1mNo Error.~n\e[39;49;0m")
+ io:format("\e[93;1mNo Error.~n\e[39;49;0m")
end;
_->
io:format("\e[91;1mError decoding purgeMs\n\e[39;49;0m")
diff --git a/src/ss7test_helper.erl b/src/ss7test_helper.erl
index f6821b0..e66ca15 100644
--- a/src/ss7test_helper.erl
+++ b/src/ss7test_helper.erl
@@ -1,7 +1,9 @@
-module(ss7test_helper).
-author('Daniel Mende <mail@c0decafe.de>').
--export([encode_phonenumber/4, encode_msisdn/4,
+-export([encode_phonenumber/4,
+ decode_phonenumber/1,
+ encode_msisdn/4,
decode_imsi/1,
remove_firstN/2,
tup2bin/1]).
@@ -31,6 +33,9 @@ encode_phonenumber([Last]) ->
encode_phonenumber([]) ->
{<<>>, 0}.
+decode_phonenumber(<<_Extension:1, _NatureOfNumber:1, _NumberPlan:4, Number/binary>>) ->
+ decode_imsi(Number).
+
encode_msisdn(Extension, NatureOfNumber, NumberPlan, Number) ->
{EncNumber, _} = encode_phonenumber(Number),
<<Extension:1, NatureOfNumber:3, NumberPlan:4, EncNumber/binary>>.