Sponsored Content
Special Forums Cybersecurity Openssl s_client Adding Headers Manually Post 302925860 by metallica1973 on Wednesday 19th of November 2014 06:15:36 PM
Old 11-19-2014
Openssl s_client Adding Headers Manually

Daily stupid question:

How can I successfully add/pass HTTP options to openssl? I am trying to get a response from our test web server /vpn/index.html for testing an application. I can successfully get it doing it the manually way like:
Code:
openssl s_client -connect 192.168.3.20:443
 blah blah blah
 PSK identity: None
 PSK identity hint: None
 Start Time: 1416438768
 Timeout   : 300 (sec)
 Verify return code: 0 (ok)
---
GET /vpn/index.html HTTP/1.0\r\nHost: 192.168.3.20\r\nUser-Agent: Mozilla/5.0\r\n\r\n\n
blah blah blah
                </div>
            </div>
            <div id="logonbelt-bottomshadow">
            </div>
        </div>
<DIV id=scriptArea></DIV>
<script type="text/javascript" language="javascript">
Resources.Load();
</script>
</BODY>
</HTML>
closed

I need the output via
Code:
echo -ne "GET /vpn/index.html HTTP/1.0\r\nHost: 192.168.3.20\r\nUser-Agent: Mozilla/5.0\r\n\r\n\n" | openssl s_client -connect 192.168.3.20:443

so I dont have to do it the manual way like above but for some odd reason my one liner displays nothing. ????

Last edited by metallica1973; 11-20-2014 at 03:06 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

2. UNIX for Dummies Questions & Answers

cron-apt - adding X-headers

Hi, We use a ticket system for our IT queries called OTRS. Emails sent to that system are placed in ticket queues. OTRS reads X- headers in emails as described here: http://dev.jasonpruim.com/otrs/doc/X-OTRS-Headers.txt We would like to be able to configure cron-apt to place certain X-... (1 Reply)
Discussion started by: karuna
1 Replies

3. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

4. Shell Programming and Scripting

How to use s_client command

HI, Am not able to close open ssl session once after excuting the s_client command.Please help me. Find below command which am using in my script: ===================================== openssl s_client -connect localhost:443 -debug >/tmp/tempfile.txt 2>&1 after this can you please... (2 Replies)
Discussion started by: sparks
2 Replies

5. Shell Programming and Scripting

Transpose multipe columns to rows and adding headers

Hi, I found the following awk script to transpose multiple (3) columns to multiple rows: #=== BEGIN {FS=","} { for (i=1;i<=NF;i++) { arr=$i; if(nf<= NF) nf=NF; } nr=NR } END { for(i=1;i<=nf;i++) { (8 Replies)
Discussion started by: Gery
8 Replies

6. Solaris

Adding Broastcaste i.p manually

Hi, I am trying to add one interface manually using plumb command. After that it is showing point to point communication. But it should show broadcaste. ce3: flags=1000851<UP,POINTOPOINT,RUNNING,MULTICAST,IPv4> mtu 1500 index 6 inet 10.136.11.225 --> 10.136.11.1 netmask... (2 Replies)
Discussion started by: kkarthik_kaja
2 Replies

7. Shell Programming and Scripting

Help with joining files and adding headers to files

Hi, I have about 20 tab delimited text files that have non sequential numbering such as: UCD2.summary.txt UCD45.summary.txt UCD56.summery.txt The first column of each file has the same number of lines and content. The next 2 column have data points: i.e UCD2.summary.txt: a 8.9 ... (8 Replies)
Discussion started by: rrdavis
8 Replies

8. Programming

Check The value a pointer returned by struct s_client != 0

Hi guys , i got segment fault , and when i trace , found it happens since the value of pointer which is returned by Struct S_client (*ptr) is zero if (ptr !=0)i know , adding above line of code is not the solution and not correct for the case since above line only check for the pointer... (1 Reply)
Discussion started by: pooyair
1 Replies

9. Red Hat

Issue w/manually installing OpenSSL 1.0.1j

My Redhat Enterprise 5 system is vulnerable to POODLE and there does not seem to be a Redhat fix coming down the pipe. So I have downloaded OpenSSL 1.0.1j from source and built it. My question is ho do I make sure the Apache and Tomcat use the1.0.1j version and not the distro version. Thanks,... (0 Replies)
Discussion started by: caspersgrin
0 Replies

10. UNIX for Beginners Questions & Answers

Adding to an array in an external file, and adding elements to it.

I have an array in an external file, "array.txt", which contains: char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies
Net::SOCKS(3pm) 					User Contributed Perl Documentation					   Net::SOCKS(3pm)

NAME
Net::SOCKS - a SOCKS client class SYNOPSIS
Establishing a connection: my $sock = new Net::SOCKS(socks_addr => '192.168.1.3', socks_port => 1080, user_id => 'the_user', user_password => 'the_password', force_nonanonymous => 1, protocol_version => 5); # connect to finger port and request finger information for some_user my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79); print $f "some_user "; # example writing to socket while (<$f>) { print } # example reading from socket $sock->close(); Accepting an incoming connection: my $sock = new Net::SOCKS(socks_addr => '192.168.1.3', socks_port => 1080, user_id => 'the_user', user_password => 'the_password', force_nonanonymous => 1, protocol_version => 5); my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "128.10.10.11", peer_port => 9999); $f= $sock->accept(); print $f "Hi! Type something. "; # example writing to socket while (<$f>) { print } # example reading from socket $sock->close(); DESCRIPTION
my $sock = new Net::SOCKS(socks_addr => '192.168.1.3', socks_port => 1080, user_id => 'the_user', user_password => 'the_password', force_nonanonymous => 1, protocol_version => 5); To connect to a SOCKS server, specify the SOCKS server's hostname, port number, SOCKS protocol version, username, and password. Username and password are optional if you plan to use a SOCKS server that doesn't require any authentication. If you would like to force the connection to be nonanoymous, set the force_nonanonymous parameter. my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79); To connect to another machine using SOCKS, use the connect method. Specify the host and port number as parameters. my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "192.168.1.3", peer_port => 9999); If you wanted to accept a connection with SOCKS, specify the host and port of the machine you expect a connection from. Upon success, bind() returns the ip address and port number that the SOCKS server is listening at on your behalf. $f= $sock->accept(); If a call to bind() returns a success status code SOCKS_OKAY, a call to the accept() method will return when the peer host connects to the host/port that was returned by the bind() method. Upon success, accept() returns SOCKS_OKAY. $sock->close(); Closes the connection. SEE ALSO
RFC 1928, RFC 1929. AUTHOR
Clinton Wong, clintdw@netcom.com COPYRIGHT
Copyright (c) 1997-1998 Clinton Wong. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-18 Net::SOCKS(3pm)
All times are GMT -4. The time now is 11:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy