bot.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Facciamo finta di avere una vita sociale</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6. <style type="text/css">
  7. @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
  8. @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
  9. @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
  10. body { font-family: 'Droid Serif'; }
  11. h1, h2, h3 {
  12. font-family: 'Yanone Kaffeesatz';
  13. font-weight: normal;
  14. }
  15. .remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
  16. .inverse {
  17. background: #272822;
  18. color: #777872;
  19. text-shadow: 0 0 20px #333;
  20. }
  21. .inverse h1, .inverse h2 {
  22. color: #f3f3f3;
  23. line-height: 0.8em;
  24. }
  25. /* Slide-specific styling */
  26. #slide-inverse .footnote {
  27. bottom: 12px;
  28. left: 20px;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <textarea id="source">
  34. class: center, middle, inverse
  35. ## Facciamo finta di avere una vita sociale
  36. Mettiamo dei bot a fare amici al posto nostro
  37. ---
  38. layout: false
  39. # Summary
  40. (there's not much, actually)
  41. 1. The tools we have
  42. 2. The fun I imagine
  43. 3. How much is too much?
  44. ---
  45. # The tools we have
  46. * Simulating web behaviour with browsers bots
  47. * It's easier than API!
  48. * we don't need oauth, authorization, etc
  49. * it's (arguably) more similar to a 'normal' user behaviour
  50. ---
  51. ## Splinter
  52. A wrapper on selenium (and something else actually) which is an implementation of the webdriver interface.
  53. Which means that...
  54. ```
  55. from splinter import Browser
  56. browser = Browser('chrome')
  57. browser.visit('http://google.com')
  58. browser.fill('q', 'the answer to life the universe and everything')
  59. # find the submit buttom by the class atribute and click it
  60. browser.find_by_css('.lsb').first.click()
  61. # Note: find_by_css find elements in html using css selectors
  62. # like we use in a css file
  63. print browser.find_by_css('#topstuff .std h2').first.value
  64. browser.quit()
  65. ```
  66. ---
  67. ## Splinter: smilar stuff
  68. There is plenty of similar stuff in your favourite language
  69. ---
  70. # The fun I see
  71. * noone is stupid enough to appear as such on twitter
  72. * not even a bot
  73. * so go making crazy bots everywhere
  74. * is not a new idea: even at hackit0x0F there was something similar
  75. * but it was based on Facebook API (less stealth) + JS extension (more burden to write)
  76. ---
  77. # How much is too much?
  78. Why don't we record everything we see with forensic data management tools? Maltego!
  79. ![maltego shot](bot/maltego-small.jpg)
  80. ---
  81. # How much is too much?
  82. Why don't we record everything we see with forensic data management tools? Maltego!
  83. È un accrocco in cui tu ci metti i dati che hai raccolto, così li puoi visualizzare in un modo intuititivo.
  84. ---
  85. # The fun I see
  86. * scriviamo bot in giro
  87. * vediamo che cosa scoprono
  88. * tipo spettegolare sul quartiere, ma coi quartieri degli altri
  89. </textarea>
  90. <script src="remark-latest.min.js">
  91. </script>
  92. <script>
  93. var slideshow = remark.create({
  94. 'highlightLanguage': 'python',
  95. 'highlightStyle': 'monokai'
  96. });
  97. </script>
  98. </body>
  99. </html>