LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2017, 02:55 PM   #1
Mablo5
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Rep: Reputation: Disabled
Log in to site issue - CLI bash


First of all hello, whilst i'm new to these forums i have been using Linux for a while now. I don't profess to be a whizz with any flavor but can mostly get by using Ubuntu for day to day tasks and the like.

I have searched hi and low all over the Internet for some days and still cannot find a definitive answer to push on with my issue.

I'm trying to log in to a site so that i can then click a link, log in to another portion of the site and scrape data...i'm falling at the first hurdle.

The site in question is https://weblinks.nl.cgi.com/dana-na/...12/welcome.cgi

I am having issues as i need to select a "realm" which is the drop down box and then possibly hit the submit button.

Code so far:

--------------------------------------------------------------
#!usr/bin/bash

# Log in to the server. This only needs to be done once.
wget --save-cookies cookies.txt \
--keep-session-cookies \
--post-data 'username=********&password=**********' \
--delete-after \
https://weblinks.nl.cgi.com/dana/home/welcome.cgi

# Now grab the page or pages we care about.
wget --load-cookies cookies.txt \
-p https://weblinks.nl.cgi.com/dana/home/login.cgi

---------------------------------------------------------------

I have also tried the Curl method:

curl --user *************:************ https://weblinks.nl.cgi.com/dana-na/...12/welcome.cgi

---------------------------------------------------------------

both methods come up successful but with a 302 redirect in place and the webpage i end up saving is the first welcome page.

The process that i need is as follows: -

Start at: https://weblinks.nl.cgi.com/dana-na/...12/welcome.cgi

Redirect through: https://weblinks.nl.cgi.com/dana-na/...l_12/login.cgi

End up at: https://weblinks.nl.cgi.com/dana-na/...l_12/index.cgi

I am assuming that my first hurdle is to add the realm to my log in as there are 2 choices in a drop down menu system. I need to select the second option.

Any help would be much appreciated.

Thank you in advance.

EDIT: just in case needed i am using Ubuntu 14.04.5 LTS

Last edited by Mablo5; 10-28-2017 at 02:56 PM.
 
Old 10-28-2017, 03:58 PM   #2
Jackpot
Member
 
Registered: Jul 2016
Location: Bumblefuck
Distribution: Windows7 Windows10 Ubuntu16 KaliRolling
Posts: 60

Rep: Reputation: Disabled
Are you connected to your organizations vpn when attempting to sign-in? Will have to use domain/username format unless your connected to your organizations vpn, then just standard username/password....Also have you attempted to go through the links above the sign-in? "OWA" looks promising because only requesting your domain/username and password so dont have to be on vpn so once signed in through OWA email, you might be able to direct your self toward step 2...not sure about "CGI NL Weblinks" but not requesting realm so idk

Organizations always have a secondary links to access a resource. Either through the orgnizations intranet or another application/website. Also because you have prob attempted to login multiple times with no success, you might be locked out in Active Directory which can last up to a day.
 
1 members found this post helpful.
Old 10-28-2017, 04:18 PM   #3
Mablo5
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi Jackpot, thanks for your reply.

I shall try and break down your questions/comments.

The weblink site acts as a gateway to allow connectivity to certain parts of the network, such as Intranet page, OWA, etc etc. So to answer your first question, no I am not connected to the organisations VPN.
It was suggested by a colleague to try the domain\usernameassword. I should probably dry run test that on the webpage outright to see output.
Due to me using the portal fairly easy I've never thought to try login in to OWA and seeing what I can get from that, thanks for the tip.
I do have access to the organisation vpn, if I cannot log in through the web portal I guess my next step would be to install the VPN on to the Linux box. Maybe I am over complicating matters.

Thanks again for helping me expand my options. I'll be back with the outcome either way.
 
Old 10-28-2017, 06:38 PM   #4
Jackpot
Member
 
Registered: Jul 2016
Location: Bumblefuck
Distribution: Windows7 Windows10 Ubuntu16 KaliRolling
Posts: 60

Rep: Reputation: Disabled
I deal with this stuff at my work all the time lol pain in the balls man....I would deff try the domain/username first then the "OWA"/"CGI NL Gateway" sign-in but if all else fails then deff the VPN. VPN will deff make it easier but good luck and let me know whats up
 
Old 10-29-2017, 04:09 AM   #5
Mablo5
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
This was all done browser side in Windows before attempting to script any solution as i want to see success/failure rate.

tried the domain\username : password combination on the webpage but due to the 2FA realm being selected, that failed with the error: invalid username/password.
Successfully logged in to the OWA, but got a handy message it is changing to 2FA November 3rd. That won't work for me for obvious reasons. After logging in to OWA I tried going directly to the page i need but it seems to be walled off - OWA creds are only for there and do not filter through at all.
I looked at the VPN, there is a Linux version but i need to sign up with my company name. That's not going to happen simply because its already been bought but i do not have the credentials to sign in to the account. I have also checked the organisation software share but there is only the Windows version of the software. I'm not wanting to torrent it really as its going to be for business usage.

Looking at using something to help me i discovered formfind. My output is:

--- FORM report. Uses POST to URL "login.cgi"
Input: NAME="tz_offset" (HIDDEN)
Input: NAME="username" (TEXT)
Input: NAME="password" (PASSWORD)
Select: NAME="realm"
Option VALUE="Entrust_2FA_NL"
Option VALUE="Groupinfra_only_username"
[end of select]
Input: NAME="btnSubmit" VALUE="Sign In" (SUBMIT)
--- end of FORM

So I tried
---------------

curl -d username="*********" -d password="***********" -d realm="Groupinfra_only_username" https://weblinks.nl.cgi.com/dana-na/...l_12/login.cgi > signin.html

but it gave me an empty signin.html file output.


Still working on it....

Using the address https://gateway3.cgi.com found on the OWA page will not log me in, i'm assuming that this is because on Windows it opens a host checker box. On the Linux CLI the address simply hangs before returning to a command prompt.

Last edited by Mablo5; 10-29-2017 at 06:47 AM. Reason: more info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
One site can't connect to database via apache but via cli pingu Linux - Server 14 09-15-2014 05:13 AM
PHP Site - Controlling User Environment for the Session During Log-in and Log-out devUnix Programming 2 03-27-2012 10:14 PM
[SOLVED] Can't log in with GDM (or GUI) but can log in via CLI with no password after updates. anon112 Sabayon 1 09-12-2010 06:12 PM
Can't log in as root in KDE but alright at CLI? lugoteehalt Debian 7 10-11-2008 05:29 AM
LXer: CLI Magic: Use cURL to measure Web site statistics LXer Syndicated Linux News 0 10-16-2006 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration