Results 1 to 3 of 3

Thread: bash automatic website authentication

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Beans
    125

    bash automatic website authentication

    Hello all,

    I'm on a campus network, and they use Cisco Clean Access (NAC) to force users to authenticate via a web interface. This is fine for my desktop, but I'm also operating a separate file server (which is often not immediately available for me to login and authenticate on). I'm looking to automate the process somehow, probably by cron job, but I'd first like to get some code going that automatically authenticates my computer with Cisco's NAC web interface. I've tried several methods (curl, wget, various php scripts I edited from online)... nothing has even remotely worked. I believe this is possible because I found this:
    post on a MAC forum, and several very general curl and wget examples online where people have accomplished similar things, but I've been unable to edit them for my needs. I've accessed the page source to the Cisco NAC login webpage; the relevant part seems to be:

    Code:
    <form method="post" name="loginform" action="../auth/perfigo_cm_validate.jsp" target="_parent">
            <div align="center">
                <input type="hidden" name="reqFrom" value="perfigo_login.jsp"/>
                <input type="hidden" name="uri" value=""/>
                <input type="hidden" name="cm" value=""/>
                <input type="hidden" name="userip" value="xxx.xxx.xxx.xxx"/>
                <input type="hidden" name="session" value=""/>
                <input type="hidden" name="pm"/>
                <input type="hidden" name="index" value="0"/>
                <input type="hidden" name="pageid" value="-1"/>
                <input type="hidden" name="compact" value="false"/>
             
        <input type="hidden" name="registerGuest" value="NO"/>
                <input type="hidden" name="userNameLabel" value="netID"/>
                <input type="hidden" name="passwordLabel" value="Password"/>
                <input type="hidden" name="guestUserNameLabel" value="Guest ID"/>
                <input type="hidden" name="guestPasswordLabel" value="Password"/>
                
                <table id='loginTable' cellspacing='8' class='loginForm'>
    <tr><td id='userNameCell' align='right'>netID</td><td align='left'><input type='text' name='username' size='15' /></td></tr>
    <tr><td id='passwordCell' align='right'>Password</td><td align='left'><input type='password' name='password' size='15' value=''/></td></tr>
    <tr><td><input type='hidden' name='provider' value='netID Login'/></td></tr>
    <tr><td colspan='2' align='center'><input type='submit' value='Continue'></td></tr>
    </table>
    </div>
    Any help you can provide would be MUCH appreciated.
    Last edited by e64462; November 22nd, 2012 at 05:20 AM.

  2. #2
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: bash automatic website authentication

    look into curl/wget to submit the form.

    another thing to look at is wwww::mechanize (perl library)
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  3. #3
    Join Date
    Nov 2008
    Beans
    125

    Re: bash automatic website authentication

    If I find an answer I'll post back here for you. Best of luck!

    e

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •