@@ -276,6 +276,80 @@ def myworkspace
276276 ) )
277277 end
278278
279+ context 'deals tacplus-server blocks' do
280+ it 'with one cred' do
281+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'tacplus server 1.1.1.1 with password hash $9$aaAAAAAeAA1AAAb2AAjAqmAA' )
282+ expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
283+ expect ( aux_juniper ) . to receive ( :store_loot ) . with ( 'juniper.junos.config' , 'text/plain' , '127.0.0.1' ,
284+ "tacplus-server {\n 1.1.1.1 secret \" $9$aaAAAAAeAA1AAAb2AAjAqmAA\" ; ## SECRET-DATA\n }" ,
285+ 'config.txt' , 'Juniper JunOS Configuration' )
286+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
287+ {
288+ address : '127.0.0.1' ,
289+ port : 1337 ,
290+ protocol : 'tcp' ,
291+ workspace_id : workspace . id ,
292+ origin_type : :service ,
293+ service_name : '' ,
294+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
295+ jtr_format : '' ,
296+ private_data : '$9$aaAAAAAeAA1AAAb2AAjAqmAA' ,
297+ private_type : :nonreplayable_hash ,
298+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
299+ }
300+ )
301+
302+ aux_juniper . juniper_junos_config_eater ( '127.0.0.1' , 1337 ,
303+ %q(tacplus-server {
304+ 1.1.1.1 secret "$9$aaAAAAAeAA1AAAb2AAjAqmAA"; ## SECRET-DATA
305+ }) )
306+ end
307+ it 'with two cred' do
308+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'tacplus server 1.1.1.1 with password hash $9$aaAAAAAeAA1AAAb2AAjAqmAA' )
309+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'tacplus server 2.2.2.2 with password hash $9$aaaAa/1aAAAa1aaaAAaa11aAA' )
310+ expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
311+ expect ( aux_juniper ) . to receive ( :store_loot ) . with ( 'juniper.junos.config' , 'text/plain' , '127.0.0.1' ,
312+ "tacplus-server {\n 1.1.1.1 secret \" $9$aaAAAAAeAA1AAAb2AAjAqmAA\" ; ## SECRET-DATA\n 2.2.2.2 secret \" $9$aaaAa/1aAAAa1aaaAAaa11aAA\" ; ## SECRET-DATA\n }" ,
313+ 'config.txt' , 'Juniper JunOS Configuration' )
314+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
315+ {
316+ address : '127.0.0.1' ,
317+ port : 1337 ,
318+ protocol : 'tcp' ,
319+ workspace_id : workspace . id ,
320+ origin_type : :service ,
321+ service_name : '' ,
322+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
323+ private_data : '$9$aaAAAAAeAA1AAAb2AAjAqmAA' ,
324+ jtr_format : '' ,
325+ private_type : :nonreplayable_hash ,
326+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
327+ }
328+ )
329+
330+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
331+ {
332+ address : '127.0.0.1' ,
333+ port : 1337 ,
334+ protocol : 'tcp' ,
335+ workspace_id : workspace . id ,
336+ origin_type : :service ,
337+ service_name : '' ,
338+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
339+ private_data : '$9$aaaAa/1aAAAa1aaaAAaa11aAA' ,
340+ jtr_format : '' ,
341+ private_type : :nonreplayable_hash ,
342+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
343+ }
344+ )
345+
346+ aux_juniper . juniper_junos_config_eater ( '127.0.0.1' , 1337 ,
347+ %q(tacplus-server {
348+ 1.1.1.1 secret "$9$aaAAAAAeAA1AAAb2AAjAqmAA"; ## SECRET-DATA
349+ 2.2.2.2 secret "$9$aaaAa/1aAAAa1aaaAAaa11aAA"; ## SECRET-DATA
350+ }) )
351+ end
352+ end
279353 context 'deals with user account with password hash' do
280354 it 'with super-user' do
281355 expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'User 2000 named newuser in group super-user found with password hash $1$rm8FaMFY$k4LFxqsVAiGO5tKqyO9jJ/.' )
@@ -579,36 +653,81 @@ class unauthorized;
579653 ) )
580654 end
581655 end
656+ context 'deals radius-server blocks' do
657+ it 'with one credential' do
658+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'radius server 1.1.1.1 password hash: $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' )
659+ expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
660+ expect ( aux_juniper ) . to receive ( :store_loot ) . with ( 'juniper.junos.config' , 'text/plain' , '127.0.0.1' ,
661+ "access {\n radius-server {\n 1.1.1.1 secret \" $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV\" ; ## SECRET-DATA\n }\n }" ,
662+ 'config.txt' , 'Juniper JunOS Configuration' )
663+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
664+ {
665+ address : '1.1.1.1' ,
666+ port : 1812 ,
667+ protocol : 'udp' ,
668+ workspace_id : workspace . id ,
669+ origin_type : :service ,
670+ service_name : 'radius' ,
671+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
672+ private_data : '$9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' ,
673+ private_type : :nonreplayable_hash ,
674+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
675+ }
676+ )
677+ aux_juniper . juniper_junos_config_eater ( '127.0.0.1' , 1337 ,
678+ %q(access {
679+ radius-server {
680+ 1.1.1.1 secret "$9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV"; ## SECRET-DATA
681+ }
682+ }
683+ ) )
684+ end
582685
583- it 'deals with radius' do
584- expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'radius server 1.1.1.1 password hash: $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' )
585- expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
586- expect ( aux_juniper ) . to receive ( :store_loot ) . with ( 'juniper.junos.config' , 'text/plain' , '127.0.0.1' ,
587- "access {\n radius-server {\n 1.1.1.1 secret \" $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV\" ; ## SECRET-DATA\n }\n }" ,
588- 'config.txt' , 'Juniper JunOS Configuration' )
589- expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
590- {
591- address : '1.1.1.1' ,
592- port : 1812 ,
593- protocol : 'udp' ,
594- workspace_id : workspace . id ,
595- origin_type : :service ,
596- service_name : 'radius' ,
597- module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
598- private_data : '$9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' ,
599- private_type : :nonreplayable_hash ,
600- status : Metasploit ::Model ::Login ::Status ::UNTRIED
601- }
602- )
603- aux_juniper . juniper_junos_config_eater ( '127.0.0.1' , 1337 ,
604- %q(access {
686+ it 'with two credentials' do
687+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'radius server 2.2.2.2 password hash: $9$Y-11ikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKv111' )
688+ expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'radius server 1.1.1.1 password hash: $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' )
689+ expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
690+ expect ( aux_juniper ) . to receive ( :store_loot ) . with ( 'juniper.junos.config' , 'text/plain' , '127.0.0.1' ,
691+ "access {\n radius-server {\n 1.1.1.1 secret \" $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV\" ; ## SECRET-DATA\n 2.2.2.2 secret \" $9$Y-11ikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKv111\" ; ## SECRET-DATA\n }\n }" ,
692+ 'config.txt' , 'Juniper JunOS Configuration' )
693+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
694+ {
695+ address : '1.1.1.1' ,
696+ port : 1812 ,
697+ protocol : 'udp' ,
698+ workspace_id : workspace . id ,
699+ origin_type : :service ,
700+ service_name : 'radius' ,
701+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
702+ private_data : '$9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV' ,
703+ private_type : :nonreplayable_hash ,
704+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
705+ }
706+ )
707+ expect ( aux_juniper ) . to receive ( :create_credential_and_login ) . with (
708+ {
709+ address : '2.2.2.2' ,
710+ port : 1812 ,
711+ protocol : 'udp' ,
712+ workspace_id : workspace . id ,
713+ origin_type : :service ,
714+ service_name : 'radius' ,
715+ module_fullname : 'auxiliary/scanner/snmp/juniper_dummy' ,
716+ private_data : '$9$Y-11ikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKv111' ,
717+ private_type : :nonreplayable_hash ,
718+ status : Metasploit ::Model ::Login ::Status ::UNTRIED
719+ }
720+ )
721+ aux_juniper . juniper_junos_config_eater ( '127.0.0.1' , 1337 ,
722+ %q(access {
605723 radius-server {
606724 1.1.1.1 secret "$9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV"; ## SECRET-DATA
725+ 2.2.2.2 secret "$9$Y-11ikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKv111"; ## SECRET-DATA
607726 }
608727 }
609728 ) )
729+ end
610730 end
611-
612731 it 'deals with pap' do
613732 expect ( aux_juniper ) . to receive ( :print_good ) . with ( 'PPTP username \'pap_username\' hash $9$he4revM87-dsevm5TQCAp0BErvLxd4JDNdkPfT/9BIR via PAP' )
614733 expect ( aux_juniper ) . to receive ( :report_host ) . with ( { host : '127.0.0.1' , os_name : 'Juniper JunOS' } )
0 commit comments