LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-17-2015, 07:47 PM   #1
Werber
LQ Newbie
 
Registered: Jul 2015
Posts: 3

Rep: Reputation: Disabled
Connect to an account


Greetings,

My goal is to connect to my account on Shodan.io. I wrote a script but it doesn't make me logged in. I got headers, data etc. from Chrome's tools developer ("curl URL").

Code:
curl -X POST "https://account.shodan.io/login" \
--cookie cjar --cookie-jar cjar \
-H "Origin: https://account.shodan.io" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4" \
-H "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: max-age=0" -H "Referer: https://account.shodan.io/login" -H "Connection: keep-alive" \
--data "username=TEST&password=TEST&grant_type=password&continue=https"%"3A"%"2F"%"2Fwww.shodan.io"%"2F&login_submit=Log+in" \
>./tmp.html
curl --cookie cjar \
-H "Origin: https://account.shodan.io" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4" \
-H "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: max-age=0" -H "Referer: https://account.shodan.io/login" -H "Connection: keep-alive" \
 -L "https://www.shodan.io/" \
>./tmp2.html
curl --cookie cjar\
-H "accept-encoding: gzip, deflate, sdch" -H "accept-language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4" \
-H "user-agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" \
-H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "referer: https://www.shodan.io/?language=en" \
-L "https://www.shodan.io/search?query=test+country%3A%22US%22"\
> ./tmp3.html
tmp.html :

Code:
302 Found
The resource was found at /; you should be redirected automatically.
tmp2.html :
Code:
:ms6+P&r"q,K=zi.I  d]~)K}q$].}͛N[RR:Gx!|ph:YnNRyQ VPmNf\^ bJАMq%jJ"x8^ƻ݃Fn\)c&:S(mYm gJj,Eqy9n*.+97CI.~D5V*f>E83%mH`T n4rTrh\}A/^^́YKZh~FN'@~=0h-4a!ˊg0*з2jinS"Tu;XZ62Vʅc-ˊJ(n&{qJQ j4Xsv-jώK!kAl2ʢN66/הoE4Q+*ҚaÂE: &jo/kVU>RC\IKfip+D02'Fq3ʕπTi-3/fEx3KBJNؿH P4xjdV76 .zX/d@hmUXm!oW]1:em* bS'%J$V%KwoJ*igG,z. n!ޡ*Ś|*œ`<|JC\B pWS Ϝ0 R*RKC\4(V9f'~LPq0{-TЦ]inP=9f)$ #U-Dy^Fwְ\[6\lFIFT-P4{. &[P)9QIJ~=V[g?yXf=[ d*VuFZ*8xb 7Y1 ܆bH\eDuU-Ӑ)a"(T4M2 ;T7`vVid%Lqr|![2@C`YenbFQ1 U-hq(J!n3"2%%0)Ia(4"/xj='PKةX\;5 97uN f'B_5Gebog+ƕjAILw`-99T[H7˗]4~M2  α̼G5z|7{+3K5TTنqn'T풟N|rbܞIGsb=`4mIaj,  _ZJƅ*@'<Q2%Bal(6#4rw@MB%k`_)x-9yrR﯐n]%TxlC}9sCJ-@JPiM~ 9hj6Ne RzCSKYǔIqP֟,v**M~P5˕) ~ʪ  Q;l8}5RY$=6|m]7la[<4Iƃa<؏:jђnz4xp?|l<5xY%qf4j,)*&ft0RL8M.`P=y?[e'I %P0'zh``I,$ ědz5G}Tq?UB|-B@oCe4?>DɃVܗh]HI؄s dnݑ )LpRN4,xVװצ+y)xe[*5g>4S71L) ^m 뺛Qh1A축Y ^s T.e% y~,YK ԺʔjCv Qކ?P.;Gj%st솕K]BI\}aYc7a7n&*,s/>fWC6d#6`F`gst4,aYXPSLwW0 +:*u7gEMVKW9NVk Ҟ]\Timo 54]f}+o%t^6 s[L '=u9\ck5Oj 04ZK0 ?nJÜڜDp0}}6)Cc6L@0 V!;i42ub^hB1B9z Z B&p;&fgpcė볨z|4T28)Hgϟ?3jY*{>zbF^G8Uދ;*{- 7{3q[ 4/*s;h [!I_#0VMP|jPGWFIOD1pXr!Bx+Z2ۖ#y +ۺ{/@e'#:Oݝg^! ~Ѳyx]sC y}޻{7":䢏]`0ϽI:[VtyU?>헽O|+\In93?%WTOo*eNM/zQUKufz_HX7B7S$&vU)z烋 YJ6NhV'zҀ!S(Rs2U~kWNǗi+#OWfӝޤgyOv>~+ka _T49#u?S{$
tmp3.html :

Code:
Error

Please login to use search filters.
(Shodan's error page)

Here the HTML code of login form

Code:
<form action='/login' method='post' class='well' id='login-form'>

		<h3>
			<img src='https://static.shodan.io/shodan/img/lock-icon.png' alt='' style='margin-top:-5px;' /> <em>Sign in</em> with Shodan
		</h3>

		<br/>

		<label>Username</label>
		<input type='text' name='username' autofocus='autofocus' required='required' />
		
		<br/>
		
		<label>Password</label>
		<input type='password' name='password' required='required' />
		
		<br/><br/>
		
		<input type='hidden' name='grant_type' value='password' />

		<input type='hidden' name='continue' value='https://www.shodan.io/search?query=netwave+ip+camera+country%3A%22FR%22&amp;page=2&amp;language=en' />
		
		<input type='submit' value='Log in' class='btn btn-success' name='login_submit' />

		<a href="#contactUsModal" data-toggle="modal" role="button" style='color: #444;font-size:11px;margin-left:20px;'>Forgot your password?</a>
		
	</form>
Thanks for the help.
 
Old 07-18-2015, 07:41 AM   #2
Werber
LQ Newbie
 
Registered: Jul 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Little up ...
 
Old 07-19-2015, 03:08 PM   #3
Werber
LQ Newbie
 
Registered: Jul 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Here the complete Chrome's "curl url", if that could help :

Code:
curl "https://account.shodan.io/login" \
-H "Cookie: __cfduid=d4381192eed9ff99645885de789513e3014312166 81; _LOCALE_=en; _gat=1; session=""04e457da7d4a6dd84c7c56ef42bff0549b687f2fgAJVQDY0OD FlY2IxOTgzZWVkMzk3NWY5NGZlZjk3OThkOTE0MWJjMGJhODll NGY5MjI0N2NkMGU5MzcwN2U2MTA1MDRxAS4\\075""; _ga=GA1.2.922719769.1431216716" \
-H "Origin: https://account.shodan.io" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4" \
-H "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: max-age=0" -H "Referer: https://account.shodan.io/login" \
-H "Connection: keep-alive" \
--data "username=TEST&password=TEST&grant_type=password&continue=https""3A""2F""2Fwww.shodan.io"%"2F&login_submit=Log+in" --compressed

Last edited by Werber; 07-19-2015 at 03:22 PM.
 
  


Reply



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
ssh, unable to connect to a machine, with any account, other than root WetFroggy Slackware 11 02-02-2012 01:55 AM
Cant connect to broadband internet account daie3 Ubuntu 2 04-26-2009 08:49 AM
Root cannot connect to X while on top of normal user account Dankles Debian 4 04-26-2006 11:24 AM
gaim - can't to connect to yahoo account kentri9 Linux - Software 5 05-15-2005 01:41 AM
Why can't my account connect via FTP? BrainScanning Linux - Networking 2 10-07-2004 04:00 AM

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

All times are GMT -5. The time now is 12:26 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