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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
07-17-2015, 07:47 PM
#1
LQ Newbie
Registered: Jul 2015
Posts: 3
Rep:
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 P4xjdV76 .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-9yrRn]%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]HIs dnݑ )LpRN4,xVװצ+y)xe[*5g>4S71L) ^m 뺛Qh1A축Y ^s T.e% y~,YK ԺʔjCv Qކ?P.;Gj%st솕K]BI\}aYc7a7n&*,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&page=2&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.
07-18-2015, 07:41 AM
#2
LQ Newbie
Registered: Jul 2015
Posts: 3
Original Poster
Rep:
Little up ...
07-19-2015, 03:08 PM
#3
LQ Newbie
Registered: Jul 2015
Posts: 3
Original Poster
Rep:
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 .
All times are GMT -5. The time now is 12:26 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News