Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Shareware & Freeware

Shareware & Freeware Bertukar informasi mengenai Software berbayar ataupun gratis.

Reply
 
Thread Tools
  #1  
Old 24th October 2012
CaraCepet's Avatar
CaraCepet CaraCepet is offline
Ceriwiser
 
Join Date: Oct 2012
Posts: 786
Rep Power: 14
CaraCepet mempunyai hidup yang Normal
Default Cookie Injection Using Greasemonkey

Cookie Injection Using Greasemonkey

kredit to : Views From The Hill



There are several Firefox plugins which allow the user to manipulate their browser cookies. However, most of these plugins force the user to manipulate cookies individually. This can become tedious if the user is simply �importing� cookies from, say, a wireshark dump.



The CookieInjector userscript simplifies this process, by allowing the user to copy-paste the cookie portion of the dump and have the cookies from the dump automatically created on the currently viewed web page.



To Use The Script:



Fire up Wireshark, formally Ethereal, if you don�t have Wireshark you can grab it from: Wireshark � Go deep.. Start listening for traffic on the same interface you use to access the internet. To cut down on extra packets, enter tcp as a capture filter. TCP is a transport layer protocol featuring reliable transport, congestion control and connection oriented transfers. Since HTTP uses connections between client and server and therefore the TCP protocol, is is safe to filter out all non-TCP packets. To further filter the packets that Wireshark is displaying enter http.cookie in the filter field. This will filter out all packets which are not using the HTTP application layer protocol and all HTTP packets which do not contain cookies.



Next go to a website that uses cookies. Most websites which support user logins or shopping carts use cookies for these purposes. Make sure that the website that you visit does not encrypt the entire session (such as a banking website), otherwise the packets will be encrypted and not viewable in wireshark. After capturing a couple packets which contain cookies scroll down to the Hypertext Transfer Protocol portion of the packet preview, expand it, and scroll down to the cookie line. Right click on the line, and select copy->Bytes (Printable Text Only). This will copy the human-readable portion of the packet which represents the Cookies associated with this website.



If you haven�t already, install Greasemonkey, and the CookieInjector userscript. Clear your private data, ensuring that the Cookies and Authenticated Sessions options are selected. This will delete all your cookies, so we can see the script in action. Press alt-c to view the CookieInjector dialogue, paste the cookie string from wireshark into the text box and click OK.



Congratulations! Your cookies have now been restored!



How The Script Works:



After the page has loaded the CookieInjector class is initialized. This involves setting up the dialogue and binding a function to the onkeydown event. When the user presses the ALT-C key combination, the CookieInjector keyPress function is called, which checks to see if the correct key combination has been triggered. If it is valid, the dialogue�s display style is changed, making it visible in the middle of the page.



After the user enters the cookie that was copied from Wireshark, the script does a quick cleanup of the string, and then adds the cookies to the browsing session.



Note that the cookie�s host will be the domain that is loaded in the browser when the cookie is injected. The root path will be used for the root of the cookie to ensure that the cookie is persistent across the entire domain. Finally, the cookie is a session cookie, which means that the cookie will expire when the browser is closed.



Security Implications Of Cookies



The use of cookies for identification and authentication presents a dangerous security risk for un-encrypted connections. Most websites (such as Hotmail, Facebook and Gmail), only encrypt the username and password when initially authenticating the user and all traffic following the initial handshake is un-encrypted. As a result, the cookie information is readable by anyone who is listening with appropriate software, and malicious users can steal the cookies of other users on the network, possibly gaining access to their accounts. Un-encrypted or weakly encrypted wireless connections (those which do not use WPA or stronger encryption schemes) are especially susceptible to cookie stealing. This is because anyone with a wireless card can simply listen to all network traffic as it is broadcast through the air, intercepting cookies, images, web pages and any other traffic which may or not be intended for them. Intercepting traffic on a switched network (most LANs) is more complex, but can be accomplished using ARP Poisoning or software such as Ettercap



The take-home lesson is to use encrypted connections, like https, whenever privacy is important. Always remember that if the connection is not encrypted anyone could be listening in.



Download CookieInjection Userscript






Edit: Several people have been reporting the cookie injector window appearing in Gmail emails. All WYSIWYG editors may be affected depending on their implementation. If you experience problems with the cookie injector window showing up where it shouldn�t, edit the userscript to exclude the problem site.



For example, I have updated the userscript to ignore gmail / mail.google.com domains with the following in the header:




Code:

// @exclude https?://gmail.com/*
// @exclude https?://mail.google.com/

Please make the change yourself, or download the new version of the script to suppress its operation on Gmail pages.




[/quote][quote]





Ensure you have Greasemonkey 0.9.8 installed. https://addons.mozilla.org/en-US/fir...#version-0.9.8

They recently introduced support for full regular expression matching in the include / exclude directives.

Apparently there are problems with the 0.9.10 version so beware of that.





External Links:



Greasemonkey: https://addons.mozilla.org/en-US/firefox/addon/748

HTTP Protocol: Hypertext Transfer Protocol - Wikipedia, the free encyclopedia

TCP Protocol: TCP - Wikipedia, the free encyclopedia

Cookies: HTTP cookie - Wikipedia, the free encyclopedia

Wireshark: Wireshark � Go deep.

Ettercap: Ettercap Home Page

ARP Poisoning: ARP spoofing - Wikipedia, the free encyclopedia

Ethereal: Ethereal: A Network Protocol Analyzer



sumber



Scripts cookie injection versi lainnya :


Reply With Quote
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 On
HTML code is Off


 


All times are GMT +7. The time now is 10:58 PM.


no new posts