Automating a Challenge/Response Method.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automating a Challenge/Response Method.
# 1  
Old 09-26-2011
Java Automating a Challenge/Response Method.

Hi guys,

I will need some help with a to automate a challenge/response sequence when I try to SCP files from a server to another.

The scenario is like this :

After selecting in a script the option to send files via scp (case switch):

I get this output from linux term:

The authenticity of host 'healthcares8300 (10.100.255.3)' can't be established.
RSA key fingerprint is 10:2b:c9:4c:15:19:3c:cc:52:06:87:7d:4c:b6:0a:0f.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/home/defty/.ssh/known_hosts).

This system is restricted solely to authorized users for legitimate business
purposes only. The actual or attempted unauthorized access, use or modifications
of this system is strictly prohibited. Unauthorized users are subject to
company disciplinary procedures and or criminal and civil penalties under state,
federal or other applicable domestic and foreign laws.

The use of this system may be monitored and recorded for administrative and
security reasons. Anyone accessing this system expressly consents to such
monitoring and recording, and is advised that if it reveals possible evidence
of criminal activity, the evidence of such activity may be provided to law
enforcement officials.

All users must comply with all corporate instructions regarding the protection
of information assets.
Challenge: 000-4005 Product ID: 7000175677

Response:

The output of this response should be
~asg init 000-4005 7000175677
if this doesn´t work the script should send
~asg init 000-4005 7000175677 -K1 then if it doesnt work.
~asg init 000-4005 7000175677 -K2 then if it doesnt work.
~asg init 000-4005 7000175677 -K3 ....

Bare in mind the init is the login i am using to login to the server and this function would be part of another script that i will have to integrate.

ANY idea on how to do this?Smilie

Thanks for your support,

Fran
# 2  
Old 09-26-2011
Put the hosts you know in your .known_hosts so it won't ask that again.
# 3  
Old 09-26-2011
Hi corona,
Adding that will resolve the authenticity problem, but i still need my script automatically resolve the challenge/response.

when i do the SCP the linux shell keeps waiting till i resolve the challenge and like i told before the formt should be like this:

~asg init <challengue> <productid> -K1-3

Is there a way to that script could read from terminal and paste like this

Response ~asg init <challengue> <productid> -K1-3

to get response solve and continue the SCP transfer?

thanks for your suggestion

RexSmilieSmilie
# 4  
Old 09-27-2011
Hi Rex,

so to simplify, how do you differentiate the different responses? what do you consider as a success? is it the success of scp-ing?

From what i understand you are trying to intercept scp process in the middle between authenticating RSA keys and transfering the file. IMO, it will be easier do authenticate first, cross-reference to your challenge-response/product mapping, if all is well, then do the scp.
# 5  
Old 09-27-2011
Java for tarj

Hi tarj,

I will clarify the process so you can unsderstand what i am trying to automate.

When i do a SCP to transfer files from one server to another i get from linux term this:

The authenticity of host 'healthcares8300 (10.100.255.3)' can't be established.
RSA key fingerprint is 10:2b:c9:4c:15:19:3c:cc:52:06:87:7d:4c:b6:0a:0f.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/home/defty/.ssh/known_hosts).

This system is restricted solely to authorized users for legitimate business
purposes only. The actual or attempted unauthorized access, use or modifications
of this system is strictly prohibited. Unauthorized users are subject to
company disciplinary procedures and or criminal and civil penalties under state,
federal or other applicable domestic and foreign laws.

The use of this system may be monitored and recorded for administrative and
security reasons. Anyone accessing this system expressly consents to such
monitoring and recording, and is advised that if it reveals possible evidence
of criminal activity, the evidence of such activity may be provided to law
enforcement officials.

All users must comply with all corporate instructions regarding the protection
of information assets.
Challenge: 000-4005 Product ID: 7000175677

Response:

Here is what i am doing now is typing the "Response" MANUALLY VIA KEYBOARDS that has this format.
~asg init 000-4005 7000175677

when i enter this (~asg init 000-4005 7000175677) my server connects to EXTERNAL server that calculates the Response for me and then SCP start transferring the files.

MY GOAL is to make to a script that automatically paste for example in this case ~asg init 000-4005 7000175677 ((the generic format is (~asg init <challenge> <response>) instead of do it MANUALLY VIA THE KEYBOARD.

ALSO bare in mind that if i start another SCP transfer the challengue will change form the last one but not the product ID(is the same for a particular server).

Thans for reading & helping and let me know if you have any more doubt

RexSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Challenge in finding listing class method and its number of code lines

there are about 300 objectivec .m files and I need to print each file name and its method and number of lines inside the method there is a sample perl files that do perl brace matching... (0 Replies)
Discussion started by: steve32001
0 Replies

2. Shell Programming and Scripting

Anyone like a challenge?

I have searched through google, and this forum to try and find the answer, but alas, nothing quite hits the whole answer. I am trying to read the last line (or lines) of some log files. I do this often. The files are named sequentially, using the date as part of the file name, and appending... (18 Replies)
Discussion started by: BatterBits
18 Replies

3. UNIX for Dummies Questions & Answers

Touch Challenge

I've been given a directory full of subdirectories full of logfiles of the same name: /logfiles/day1/file1/blockednodes.csv day1-14 file1-48 The above is the actual directory structure for 14 days worth of a logfile that is generated every 30 minutes. It's been done this way to preserve the... (15 Replies)
Discussion started by: Cludgie
15 Replies

4. Solaris

svc:/network/physical:default: Method "/lib/svc/method/net-physical" failed with exit status 96. [ n

After a memory upgrade all network interfaces are misconfigued. How do i resolve this issue. Below are some out puts.thanks. ifconfig: plumb: SIOCLIFADDIF: eg000g0:2: no such interface # ifconfig eg1000g0:2 plumb ifconfig: plumb: SIOCLIFADDIF: eg1000g0:2: no such interface # ifconfig... (2 Replies)
Discussion started by: andersonedouard
2 Replies

5. Shell Programming and Scripting

PS1 challenge

Ok then i Have a challenge for you : Give me PS1 so that it always display the least 2 levels of directory (except if i am above of course) I want it this way : so if i go to / /home/ /home/user /home/user/whatever /home/user/whatever1/whatever2 my PS1 should respectively... (12 Replies)
Discussion started by: ctsgnb
12 Replies

6. Shell Programming and Scripting

regex challenge

Here's a regex substitution operation that has stumped me with sed: How do you convert lines like this: first.key ?{x.y.z} second.key ?{xa.ys.zz.s} third.key ?{xa.k} to: first.key ?{x_y_z} second.key ?{xa_ys_zz_s} third.key ?{xa_k} So i'm basically converting all the... (11 Replies)
Discussion started by: neked
11 Replies

7. Shell Programming and Scripting

AWK Challenge

I have the following text Microsoft iSCSI Initiator version 2.0 Build 3497 Targets List: iqn.2001-05.com.equallogic:0-8a0906-daef43402-138000002a4477ba-grsrv12-extra iqn.2001-05.com.equallogic:0-8a0906-986f43402-520000002b447951-exchange ... (9 Replies)
Discussion started by: netmedic
9 Replies

8. Cybersecurity

Password-based challenge-response

Hello all, I have this question, hope to get some guidance... Fora simple password-based challenge-response protocol between a user A and a server S, where Pa is A's password, n is a random nonce generated by the server, and h is a known cryptographic hash function. 1. S -> A:... (1 Reply)
Discussion started by: heroine
1 Replies

9. UNIX for Advanced & Expert Users

safeword challenge

Hi, there are some servers here at work which issue a Safeword challenge after I login. Can anyone tell me exactly how the challenge/response system works? In particular, how are the valid keys decided? (2 Replies)
Discussion started by: blowtorch
2 Replies

10. UNIX for Advanced & Expert Users

Email Authentication Gateway Software? (Challenge/Response)

Happy Holiday Season All, I once found a software package on the web that was pretty cool. The package was used in conjunction with sendmail or procmail (I think) and would compare the senders email address to a database on the server. If the senders address was not in the database, it would... (2 Replies)
Discussion started by: Neo
2 Replies
Login or Register to Ask a Question