gtkcontroller.py 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-"
  3. # vim: set expandtab tabstop=4 shiftwidth=4:
  4. """
  5. This file is part of the XSSer project, https://xsser.03c8.net
  6. Copyright (c) 2010/2019 | psy <epsylon@riseup.net>
  7. xsser is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation version 3 of the License.
  10. xsser is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  13. details.
  14. You should have received a copy of the GNU General Public License along
  15. with xsser; if not, write to the Free Software Foundation, Inc., 51
  16. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. """
  18. import sys
  19. import os, datetime
  20. import math
  21. import gtk
  22. import socket
  23. import urlparse
  24. import webbrowser
  25. import threading
  26. import gobject
  27. from threading import Thread
  28. from xml.dom import minidom
  29. gtk.gdk.threads_init()
  30. use_twisted = False
  31. if use_twisted:
  32. from twisted.internet import gtk2reactor
  33. gtk2reactor.install()
  34. from twisted.internet import reactor
  35. else:
  36. reactor = None
  37. from core.main import xsser
  38. from core.globalmap import GlobalMap
  39. from core.reporter import XSSerReporter
  40. from core.mozchecker import MozChecker
  41. class Controller(XSSerReporter):
  42. def __init__(self, uifile, mothership, window='window1'):
  43. wTree = gtk.Builder()
  44. self.xsser = xsser()
  45. self.mothership = mothership
  46. self._flying = None
  47. self._quitting = False
  48. self.map = None
  49. self.wTree = wTree
  50. path = self.mothership.get_gtk_directory()
  51. wTree.add_from_file(os.path.join(path, uifile))
  52. self.fill_combos()
  53. wTree.connect_signals(self)
  54. window = wTree.get_object(window)
  55. window.set_size_request(800, 600)
  56. window.maximize()
  57. window.show()
  58. self._window = window
  59. self.output = wTree.get_object('textview_main')
  60. self.status = wTree.get_object('status_bar')
  61. self.output_wizard = wTree.get_object('textview_w_start')
  62. self._wizard_buffer = self.output_wizard.get_buffer()
  63. self.counters_label = wTree.get_object('counters_label')
  64. self._report_vulnerables = wTree.get_object('report_vulnerables').get_buffer()
  65. self._report_success = wTree.get_object('report_success').get_buffer()
  66. self._report_failed = wTree.get_object('report_failed').get_buffer()
  67. self._report_errors = wTree.get_object('report_errors').get_buffer()
  68. self._report_crawling = wTree.get_object('report_crawling').get_buffer()
  69. # GUI spinner inits
  70. threads_spin = self.wTree.get_object('threads')
  71. threads_spin.set_range(0,100)
  72. threads_spin.set_value(5)
  73. threads_spin.set_increments(1, 1)
  74. timeout_spin = self.wTree.get_object('timeout')
  75. timeout_spin.set_range(0,100)
  76. timeout_spin.set_value(30)
  77. timeout_spin.set_increments(1, 1)
  78. retries_spin = self.wTree.get_object('retries')
  79. retries_spin.set_range(0,10)
  80. retries_spin.set_value(1)
  81. retries_spin.set_increments(1, 1)
  82. delay_spin = self.wTree.get_object('delay')
  83. delay_spin.set_range(0,100)
  84. delay_spin.set_value(0)
  85. delay_spin.set_increments(1, 1)
  86. follow_spin = self.wTree.get_object('follow-limit')
  87. follow_spin.set_range(0,100)
  88. follow_spin.set_value(0)
  89. follow_spin.set_increments(1, 1)
  90. alive_spin = self.wTree.get_object('alive-limit')
  91. alive_spin.set_range(0,100)
  92. alive_spin.set_value(0)
  93. alive_spin.set_increments(1, 1)
  94. crawler2_spin = self.wTree.get_object('combobox5')
  95. crawler2_spin.set_range(1, 99999)
  96. crawler2_spin.set_value(50)
  97. crawler2_spin.set_increments(1, 1)
  98. window.connect("destroy", self.on_quit)
  99. # geoip + geomap inits
  100. self.domaintarget = ""
  101. # wizard options inits
  102. self.text_ascii = ""
  103. # step 1
  104. self.target_option = ""
  105. self.dork_option = ""
  106. self.dorkengine_option = ""
  107. self.combo_step1_choose = ""
  108. # step 2
  109. self.payload_option = ""
  110. self.combo_step2_choose = ""
  111. # step 3
  112. self.combo_step3_choose = ""
  113. self.proxy_option = ""
  114. self.useragent_option = ""
  115. self.referer_option = ""
  116. # step 4
  117. self.combo_step4_choose = ""
  118. self.cem_option = ""
  119. # step 5
  120. self.combo_step5_choose = ""
  121. self.scripts_option = ""
  122. self.mothership.add_reporter(self)
  123. # text buffered on wizard startup
  124. wizard_output = wTree.get_object('textview_w_start')
  125. buffer_wizard = wizard_output.get_buffer()
  126. file = self.open_wizard_file("wizard0")
  127. self.text_ascii = file.read()
  128. file.close()
  129. buffer_wizard.set_text(self.text_ascii)
  130. # text buffered on wizard1
  131. wizard1_output = wTree.get_object('textview_w_1')
  132. buffer = wizard1_output.get_buffer()
  133. file = self.open_wizard_file("wizard1")
  134. text_ascii = file.read()
  135. file.close()
  136. buffer.set_text(text_ascii)
  137. # text buffered on wizard2
  138. wizard2_output = wTree.get_object('textview_w_2')
  139. buffer = wizard2_output.get_buffer()
  140. file = self.open_wizard_file("wizard2")
  141. text_ascii = file.read()
  142. file.close()
  143. buffer.set_text(text_ascii)
  144. # text buffered on wizard3
  145. wizard3_output = wTree.get_object('textview_w_3')
  146. buffer = wizard3_output.get_buffer()
  147. file = self.open_wizard_file("wizard3")
  148. text_ascii = file.read()
  149. file.close()
  150. buffer.set_text(text_ascii)
  151. # text buffered on wizard4
  152. wizard4_output = wTree.get_object('textview_w_4')
  153. buffer = wizard4_output.get_buffer()
  154. file = self.open_wizard_file("wizard4")
  155. text_ascii = file.read()
  156. file.close()
  157. buffer.set_text(text_ascii)
  158. # text buffered on wizard5
  159. wizard5_output = wTree.get_object('textview_w_5')
  160. buffer = wizard5_output.get_buffer()
  161. file = self.open_wizard_file("wizard5")
  162. text_ascii = file.read()
  163. file.close()
  164. buffer.set_text(text_ascii)
  165. # text buffered on wizard end
  166. wizard_end_output = wTree.get_object('textview_w_end')
  167. buffer = wizard_end_output.get_buffer()
  168. file = self.open_wizard_file("wizard6")
  169. text_ascii = file.read()
  170. file.close()
  171. buffer.set_text(text_ascii)
  172. # text buffered on wizard about
  173. index_output = wTree.get_object('textview_about')
  174. buffer = index_output.get_buffer()
  175. file = self.open_wizard_file("about")
  176. text_ascii = file.read()
  177. file.close()
  178. buffer.set_text(text_ascii)
  179. self.setup_mozembed()
  180. def open_wizard_file(self, name):
  181. path = self.mothership.get_gtk_directory()
  182. file = open(os.path.join(path, 'docs', name+'.txt'), 'r')
  183. return file
  184. def fill_with_options(self, combobox, options):
  185. model = gtk.ListStore(str)
  186. for option in options:
  187. model.append([option])
  188. combobox.set_active(0)
  189. combobox.set_model(model)
  190. cell = gtk.CellRendererText()
  191. combobox.pack_start(cell, True)
  192. combobox.add_attribute(cell, 'text', 0)
  193. def start_crawl(self, dest_url):
  194. gtk.gdk.threads_enter()
  195. self.status.set_text("scanning")
  196. self.status.pulse()
  197. gtk.gdk.threads_leave()
  198. self.add_report_text(self._report_crawling, dest_url)
  199. def add_checked(self, dest_url):
  200. self.add_report_text(self._report_success, dest_url)
  201. def add_success(self, dest_url):
  202. self.add_report_text(self._report_vulnerables, dest_url)
  203. totalhits = self.wTree.get_object('totalhits')
  204. totalhits.set_property("label", int(totalhits.get_property("label"))+1)
  205. successhits = self.wTree.get_object('successhits')
  206. successhits.set_property("label", int(successhits.get_property("label"))+1)
  207. def report_error(self, error_msg):
  208. self.add_report_text(self._report_failed, error_msg)
  209. def mosquito_crashed(self, dest_url, reason):
  210. self.add_report_text(self._report_errors, dest_url+" ["+reason+"]")
  211. def add_failure(self, dest_url):
  212. self.add_report_text(self._report_failed, dest_url)
  213. totalhits = self.wTree.get_object('totalhits')
  214. totalhits.set_property("label", int(totalhits.get_property("label"))+1)
  215. failedhits = self.wTree.get_object('failedhits')
  216. failedhits.set_property("label", int(failedhits.get_property("label"))+1)
  217. def add_report_text(self, gtkbuffer, text):
  218. gtk.gdk.threads_enter()
  219. iter = gtkbuffer.get_end_iter()
  220. gtkbuffer.insert(iter, text+'\n')
  221. gtk.gdk.threads_leave()
  222. def setup_mozembed(self):
  223. self.moz = MozChecker(self)
  224. self.mothership.set_webbrowser(self.moz)
  225. #self.moz.hide()
  226. def fill_combos(self):
  227. # ui comboboxes
  228. dorker2_options_w = self.wTree.get_object('combobox4')
  229. dorker3_options_w = self.wTree.get_object('combobox6')
  230. crawlerdeep_options_w = self.wTree.get_object('combobox_deep1')
  231. connect_geomap_w = self.wTree.get_object('combobox7')
  232. checkmethod_options_w = self.wTree.get_object('combobox1')
  233. # wizard steps comboboxes
  234. step1_options_w = self.wTree.get_object('combobox_step1')
  235. step2_options_w = self.wTree.get_object('combobox_step2')
  236. step3_options_w = self.wTree.get_object('combobox_step3')
  237. step4_options_w = self.wTree.get_object('combobox_step4')
  238. step5_options_w = self.wTree.get_object('combobox_step5')
  239. # ui comboboxes content
  240. dorker_options = [ 'duck', 'startpage', 'yahoo', 'bing']
  241. crawlerdeep_options = ['1', '2', '3', '4', '5']
  242. checkmethod_options = ['GET', 'POST']
  243. connect_geomap = ['OFF', 'ON']
  244. # wizard comboboxes content
  245. step1_options = ['0', '1', '2']
  246. step2_options = ['0', '1', '2', '3', '4']
  247. step3_options = ['0', '1', '2', '3', '4']
  248. step4_options = ['0', '1', '2', '3', '4', '5']
  249. step5_options = ['0', '1', '2', '3']
  250. # all comboboxes handlered
  251. self.fill_with_options(dorker2_options_w, dorker_options)
  252. self.fill_with_options(dorker3_options_w, dorker_options)
  253. self.fill_with_options(crawlerdeep_options_w, crawlerdeep_options)
  254. self.fill_with_options(connect_geomap_w, connect_geomap)
  255. self.fill_with_options(checkmethod_options_w, checkmethod_options)
  256. self.fill_with_options(step1_options_w, step1_options)
  257. self.fill_with_options(step2_options_w, step2_options)
  258. self.fill_with_options(step3_options_w, step3_options)
  259. self.fill_with_options(step4_options_w, step4_options)
  260. self.fill_with_options(step5_options_w, step5_options)
  261. def on_set_clicked(self, widget):
  262. """
  263. Set your mosquito(s) options
  264. """
  265. # control authmode
  266. auth_none = self.wTree.get_object('auth_none')
  267. auth_cred = self.wTree.get_object('auth_cred')
  268. if auth_cred.get_property('text') == "":
  269. auth_none.set_property('active', True)
  270. commandsenter = self.wTree.get_object('commandsenter')
  271. cmd = self.generate_command()
  272. commandsenter.set_property("text"," ".join(cmd))
  273. app = xsser()
  274. options = app.create_options(cmd)
  275. app.set_options(options)
  276. app.set_reporter(self)
  277. pass
  278. # set visor counters to zero
  279. totalhits = self.wTree.get_object('totalhits')
  280. totalhits.set_property("label", "0")
  281. failedhits = self.wTree.get_object('failedhits')
  282. failedhits.set_property("label", "0")
  283. successhits = self.wTree.get_object('successhits')
  284. successhits.set_property("label", "0")
  285. def end_attack(self):
  286. #self._flying.join()
  287. gtk.gdk.threads_enter()
  288. self.status.set_text("idle")
  289. self.status.set_fraction(0.0)
  290. fly_button = self.wTree.get_object('fly')
  291. fly_button.set_label('FLY!!!')
  292. fly_button.set_sensitive(True)
  293. if self._quitting:
  294. pass
  295. #self.do_quit()
  296. else:
  297. gobject.timeout_add(0, self.park_mosquito)
  298. gtk.gdk.threads_leave()
  299. def park_mosquito(self):
  300. self._flying.join()
  301. self._flying = None
  302. def on_stop_attack(self):
  303. if self._flying:
  304. self._flying.app.land()
  305. def on_quit(self, widget, data=None):
  306. """
  307. Callback called when the window is destroyed (close button clicked)
  308. """
  309. if self._flying:
  310. print("[Info] Exiting... please wait until all mosquitoes return to mothership!\n")
  311. self._quitting = True
  312. self.on_stop_attack()
  313. self.do_quit()
  314. else:
  315. print("byezZZZzzzz!\n")
  316. self.do_quit()
  317. def do_quit(self):
  318. self.mothership.land(True)
  319. #if self.moz:
  320. # self.moz.shutdown()
  321. if reactor:
  322. threadpool = reactor.getThreadPool()
  323. threadpool.stop()
  324. reactor.stop()
  325. else:
  326. # doing it here doesnt seem to give time to
  327. # the mothership to land but should be ok
  328. gtk.main_quit()
  329. def start_token_check(self, dest_url):
  330. self.update_counters_label()
  331. def update_counters_label(self):
  332. rem = str(self.moz.remaining())
  333. th_count = str(threading.activeCount()-1)
  334. if self._flying:
  335. work_count = str(len(self._flying.app.pool.workRequests))
  336. app = self._flying.app
  337. crawled = str(len(app.crawled_urls))+"/"+str(app.options.crawling)
  338. else:
  339. work_count = ""
  340. crawled = "X"
  341. pars = [crawled, rem, th_count, work_count]
  342. gtk.gdk.threads_enter()
  343. self.counters_label.set_text(" ".join(pars))
  344. if pars[3]:
  345. pars[3] = "\nworks in queue: %s"%(pars[3],)
  346. self.counters_label.set_tooltip_text('crawled during last attack: %s\nremaining checks: %s\nalive threads: %s %s' % tuple(pars))
  347. gtk.gdk.threads_leave()
  348. def report_state(self, state, val=-1):
  349. if not gtk:
  350. # exiting..
  351. return
  352. gtk.gdk.threads_enter()
  353. self.status.set_text(state)
  354. if val == -1:
  355. self.status.pulse()
  356. else:
  357. self.status.set_fraction(val)
  358. gtk.gdk.threads_leave()
  359. self.update_counters_label()
  360. def on_fly_clicked(self, widget):
  361. """
  362. Fly your mosquito(s)
  363. """
  364. fly_button = self.wTree.get_object('fly')
  365. if self._flying:
  366. self.on_stop_attack()
  367. fly_button.set_label('LANDING!!!')
  368. fly_button.set_sensitive(False)
  369. return
  370. self.output.get_buffer().set_property("text", "")
  371. auth_none = self.wTree.get_object('auth_none')
  372. auth_cred = self.wTree.get_object('auth_cred')
  373. if auth_cred.get_property('text') == "":
  374. auth_none.set_property('active', True)
  375. commandsenter = self.wTree.get_object('commandsenter')
  376. cmd = self.generate_command()
  377. commandsenter.set_property("text"," ".join(cmd))
  378. t = XSSerThread(cmd, self.mothership)
  379. t.daemon = True
  380. t.add_reporter(self)
  381. t.set_webbrowser(self.moz)
  382. if self.map:
  383. t.add_reporter(self.map)
  384. self.mothership.add_reporter(self.map)
  385. targetenter = self.wTree.get_object('targetenter')
  386. explorer_enter = self.wTree.get_object('explorer_enter')
  387. if t.app.options == None:
  388. pass
  389. elif targetenter.get_text() == None and explorer_enter.get_text() == None:
  390. pass
  391. else:
  392. t.start()
  393. self._flying = t
  394. fly_button.set_label('LAND!!!')
  395. # set visor counters to zero
  396. totalhits = self.wTree.get_object('totalhits')
  397. totalhits.set_property("label", "0")
  398. failedhits = self.wTree.get_object('failedhits')
  399. failedhits.set_property("label", "0")
  400. successhits = self.wTree.get_object('successhits')
  401. successhits.set_property("label", "0")
  402. # control on/off 'sensitive' switches
  403. def on_intruder_toggled(self, widget):
  404. """
  405. Active intruder mode
  406. """
  407. intruder = self.wTree.get_object('intruder')
  408. targetenter = self.wTree.get_object('targetenter')
  409. targetall = self.wTree.get_object('targetall')
  410. explorer_enter = self.wTree.get_object('explorer_enter')
  411. combobox4 = self.wTree.get_object('combobox4')
  412. if intruder.get_property('active') == True:
  413. targetenter.set_property('visible', True)
  414. targetall.set_property('visible', True)
  415. explorer_enter.set_property('visible', False)
  416. combobox4.set_property('visible', False)
  417. else:
  418. targetenter.set_property("text", "")
  419. targetenter.set_property('visible', False)
  420. targetall.set_property('visible', False)
  421. explorer_enter.set_property('visible', True)
  422. combobox4.set_property('visible', True)
  423. def on_explorer_toggled(self, widget):
  424. """
  425. Toggle ON/OFF explorer entry
  426. """
  427. explorer = self.wTree.get_object('explorer')
  428. targetenter = self.wTree.get_object('targetenter')
  429. targetall = self.wTree.get_object('targetall')
  430. explorer_enter = self.wTree.get_object('explorer_enter')
  431. combobox4 = self.wTree.get_object('combobox4')
  432. if explorer.get_property('active') == True:
  433. explorer_enter.set_property('visible', True)
  434. targetenter.set_property('visible', False)
  435. targetall.set_property('visible', False)
  436. combobox4.set_property('visible', True)
  437. else:
  438. explorer_enter.set_property("text", "")
  439. explorer_enter.set_property("visible", False)
  440. targetenter.set_property('visible', True)
  441. targetall.set_property('visible', True)
  442. combobox4.set_property('visible', False)
  443. def on_targetall_toggled(self, widget):
  444. """
  445. Autoconfigure XSSer options to perform an automatic XSS pentesting
  446. """
  447. targetall = self.wTree.get_object('targetall')
  448. crawler = self.wTree.get_object('crawler')
  449. crawler2_spin = self.wTree.get_object('combobox5')
  450. localonly1 = self.wTree.get_object('localonly1')
  451. statistics = self.wTree.get_object('statistics')
  452. threads_spin = self.wTree.get_object('threads')
  453. timeout_spin = self.wTree.get_object('timeout')
  454. retries_spin = self.wTree.get_object('retries')
  455. delay_spin = self.wTree.get_object('delay')
  456. followredirects = self.wTree.get_object('followredirects')
  457. no_head = self.wTree.get_object('no-head')
  458. reverse_check = self.wTree.get_object('reverse-check')
  459. automatic_payload = self.wTree.get_object('automatic_payload')
  460. cookie_injection = self.wTree.get_object('cookie_injection')
  461. xas = self.wTree.get_object('xas')
  462. xsr = self.wTree.get_object('xsr')
  463. dom = self.wTree.get_object('dom')
  464. dcp = self.wTree.get_object('dcp')
  465. induced = self.wTree.get_object('induced')
  466. save = self.wTree.get_object('save')
  467. exportxml = self.wTree.get_object('exportxml')
  468. if targetall.get_property('active') == True:
  469. crawler.set_property("active", True)
  470. localonly1.set_property("active", True)
  471. crawler2_spin.set_value(99999)
  472. statistics.set_property("active", True)
  473. threads_spin.set_value(10)
  474. timeout_spin.set_value(60)
  475. retries_spin.set_value(2)
  476. delay_spin.set_value(5)
  477. followredirects.set_property("active", True)
  478. no_head.set_property("active", True)
  479. reverse_check.set_property("active", True)
  480. automatic_payload.set_property("active", True)
  481. cookie_injection.set_property("active", True)
  482. xas.set_property("active", True)
  483. xsr.set_property("active", True)
  484. dom.set_property("active", True)
  485. dcp.set_property("active", True)
  486. induced.set_property("active", True)
  487. save.set_property("active", True)
  488. exportxml.set_property("active", True)
  489. else:
  490. crawler.set_property("active", False)
  491. localonly1.set_property("active", True)
  492. crawler2_spin.set_value(50)
  493. statistics.set_property("active", True)
  494. threads_spin.set_value(5)
  495. timeout_spin.set_value(30)
  496. retries_spin.set_value(1)
  497. delay_spin.set_value(0)
  498. followredirects.set_property("active", False)
  499. no_head.set_property("active", False)
  500. reverse_check.set_property("active", False)
  501. automatic_payload.set_property("active", False)
  502. cookie_injection.set_property("active", False)
  503. xas.set_property("active", False)
  504. xsr.set_property("active", False)
  505. dom.set_property("active", False)
  506. dcp.set_property("active", False)
  507. induced.set_property("active", False)
  508. save.set_property("active", False)
  509. exportxml.set_property("active", False)
  510. def on_torproxy_toggled(self, widget):
  511. """
  512. Sync tor mode with expert visor
  513. """
  514. torproxy = self.wTree.get_object('torproxy')
  515. proxy = self.wTree.get_object('proxy')
  516. if torproxy.get_property('active') == True:
  517. proxy.set_property('text', 'http://127.0.0.1:8118')
  518. else:
  519. proxy.set_property('text', "")
  520. def on_automatic_toggled(self, widget):
  521. """
  522. Sync automatic mode with expert visor
  523. """
  524. automatic = self.wTree.get_object('automatic')
  525. automatic_payload = self.wTree.get_object('automatic_payload')
  526. if automatic.get_property('active') == True:
  527. automatic_payload.set_property('active', True)
  528. else:
  529. automatic_payload.set_property('active', False)
  530. def on_automatic_payload_toggled(self, widget):
  531. """
  532. Syn. automatic_payload mode with other automatic switches
  533. """
  534. automatic = self.wTree.get_object('automatic')
  535. automatic_payload = self.wTree.get_object('automatic_payload')
  536. if automatic_payload.get_property('active') == True:
  537. automatic.set_property('active', True)
  538. else:
  539. automatic.set_property('active', False)
  540. def on_crawler_toggled(self, widget):
  541. """
  542. Toggle ON/OFF crawling on main visor
  543. """
  544. crawler = self.wTree.get_object('crawler')
  545. combobox5 = self.wTree.get_object('combobox5')
  546. combobox_deep1 = self.wTree.get_object('combobox_deep1')
  547. localonly1 = self.wTree.get_object('localonly1')
  548. if crawler.get_property('active') == True:
  549. combobox5.set_property('visible', True)
  550. combobox_deep1.set_property('visible', True)
  551. localonly1.set_property('visible', True)
  552. else:
  553. connection_none = self.wTree.get_object('connection_none')
  554. connection_none.set_property('active', True)
  555. combobox5.set_property("visible", False)
  556. combobox_deep1.set_property('visible', False)
  557. localonly1.set_property('visible', False)
  558. def on_get_toggled(self, widget):
  559. """
  560. Toggle ON/OFF payloading entry for GET
  561. """
  562. get = self.wTree.get_object('get')
  563. hbox41 = self.wTree.get_object('hbox41')
  564. if get.get_property('active') == True:
  565. hbox41.set_property('visible', True)
  566. else:
  567. hbox41.set_property("visible", False)
  568. def on_post_toggled(self, widget):
  569. """
  570. Toggle ON/OFF payloading entry for POST
  571. """
  572. post = self.wTree.get_object('post')
  573. hbox41 = self.wTree.get_object('hbox41')
  574. if post.get_property('active') == True:
  575. hbox41.set_property('visible', True)
  576. else:
  577. hbox41.set_property('visible', False)
  578. def on_followredirects_toggled(self, widget):
  579. """
  580. Toggle ON/OFF follow redirects entry
  581. """
  582. followredirects = self.wTree.get_object('followredirects')
  583. follow_limit = self.wTree.get_object('follow-limit')
  584. hbox8 = self.wTree.get_object('hbox8')
  585. if followredirects.get_property('active') == True:
  586. hbox8.set_property('visible', True)
  587. follow_limit.set_value(50)
  588. else:
  589. hbox8.set_property('visible', False)
  590. follow_limit.set_value(0)
  591. def on_alive_toggled(self, widget):
  592. """
  593. Toggle ON/OFF alive checker
  594. """
  595. alive = self.wTree.get_object('alive')
  596. alive_limit = self.wTree.get_object('alive-limit')
  597. hbox58 = self.wTree.get_object('hbox58')
  598. hbox77 = self.wTree.get_object('hbox77')
  599. if alive.get_property('active') == True:
  600. hbox58.set_property('visible', True)
  601. hbox77.set_property('visible', False)
  602. alive_limit.set_value(5)
  603. else:
  604. hbox58.set_property('visible', False)
  605. hbox77.set_property('visible', True)
  606. alive_limit.set_value(0)
  607. def on_auth_none_toggled(self, widget):
  608. auth_cred = self.wTree.get_object('auth_cred')
  609. auth_cred.set_property('text', "")
  610. def on_auth_basic_toggled(self, widget):
  611. hbox17 = self.wTree.get_object('hbox17')
  612. auth_basic = self.wTree.get_object('auth_basic')
  613. if auth_basic.get_property('active') == True:
  614. hbox17.set_property('visible', True)
  615. else:
  616. hbox17.set_property('visible', False)
  617. def on_auth_digest_toggled(self, widget):
  618. hbox17 = self.wTree.get_object('hbox17')
  619. auth_digest = self.wTree.get_object('auth_digest')
  620. if auth_digest.get_property('active') == True:
  621. hbox17.set_property('visible', True)
  622. else:
  623. hbox17.set_property('visible', False)
  624. def on_auth_gss_toggled(self, widget):
  625. hbox17 = self.wTree.get_object('hbox17')
  626. auth_digest = self.wTree.get_object('auth_gss')
  627. if auth_digest.get_property('active') == True:
  628. hbox17.set_property('visible', True)
  629. else:
  630. hbox17.set_property('visible', False)
  631. def on_auth_ntlm_toggled(self, widget):
  632. hbox17 = self.wTree.get_object('hbox17')
  633. auth_digest = self.wTree.get_object('auth_ntlm')
  634. if auth_digest.get_property('active') == True:
  635. hbox17.set_property('visible', True)
  636. else:
  637. hbox17.set_property('visible', False)
  638. def on_finalnone_toggled(self, widget):
  639. payload_entry = self.wTree.get_object('payload_entry')
  640. payload_entry.set_property('text', "")
  641. def on_normalfinal_toggled(self, widget):
  642. hbox25 = self.wTree.get_object('hbox25')
  643. normalfinal = self.wTree.get_object('normalfinal')
  644. if normalfinal.get_property('active') == True:
  645. hbox25.set_property('visible', True)
  646. else:
  647. hbox25.set_property('visible', False)
  648. def on_remotefinal_toggled(self, widget):
  649. hbox25 = self.wTree.get_object('hbox25')
  650. remotefinal = self.wTree.get_object('remotefinal')
  651. if remotefinal.get_property('active') == True:
  652. hbox25.set_property('visible', True)
  653. else:
  654. hbox25.set_property('visible', False)
  655. # wizard helper buttons
  656. def on_startwizard_clicked(self, widget):
  657. self.output_wizard.set_buffer(self._wizard_buffer)
  658. step_view_start = self.wTree.get_object('vbox_start')
  659. step_view_start.set_property("visible", False)
  660. step_view1 = self.wTree.get_object('vbox_step1')
  661. step_view1.set_property("visible", True)
  662. commandsenter = self.wTree.get_object('commandsenter')
  663. commandsenter.set_property("text", "xsser")
  664. target_enter = self.wTree.get_object('targetenter')
  665. target_enter.set_property("text", "")
  666. explorer_enter = self.wTree.get_object('explorer_enter')
  667. explorer_enter.set_property("text", "")
  668. combo_choose1 = self.wTree.get_object('combobox_step1')
  669. combo_choose2 = self.wTree.get_object('combobox_step2')
  670. combo_choose3 = self.wTree.get_object('combobox_step3')
  671. combo_choose4 = self.wTree.get_object('combobox_step4')
  672. combo_choose5 = self.wTree.get_object('combobox_step5')
  673. #wizard auto-way options
  674. combo_choose1.set_active(2)
  675. combo_choose2.set_active(4)
  676. combo_choose3.set_active(3)
  677. combo_choose4.set_active(5)
  678. combo_choose5.set_active(3)
  679. combobox6 = self.wTree.get_object('combobox6')
  680. combobox6.set_active(0)
  681. combobox_deep1 = self.wTree.get_object('combobox_deep1')
  682. combobox_deep1.set_active(0)
  683. verbose = self.wTree.get_object('verbose')
  684. automatic = self.wTree.get_object('automatic')
  685. explorer = self.wTree.get_object('explorer')
  686. crawler = self.wTree.get_object('crawler')
  687. torproxy = self.wTree.get_object('torproxy')
  688. verbose.set_property("active", False)
  689. automatic.set_property("active", False)
  690. explorer.set_property("active", False)
  691. crawler.set_property("active", False)
  692. torproxy.set_property("active", False)
  693. self.target_option = ""
  694. self.file_option = None
  695. self.dork_option = ""
  696. self.dorkengine_option = ""
  697. def on_combobox_step1_changed(self, widget):
  698. combo_choose = self.wTree.get_object('combobox_step1')
  699. vbox_step = self.wTree.get_object('vbox_step')
  700. hboxurl = self.wTree.get_object('hboxurl')
  701. vboxdork = self.wTree.get_object('vboxdork')
  702. next1 = self.wTree.get_object('next1')
  703. if combo_choose.get_active_text() == '0':
  704. vbox_step.set_property("visible", False)
  705. next1.set_property("visible", False)
  706. if combo_choose.get_active_text() == '1':
  707. vbox_step.set_property("visible", True)
  708. hboxurl.set_property("visible", True)
  709. vboxdork.set_property("visible", False)
  710. next1.set_property("visible", True)
  711. elif combo_choose.get_active_text() == '2':
  712. vbox_step.set_property("visible", True)
  713. hboxurl.set_property("visible", False)
  714. vboxdork.set_property("visible", True)
  715. next1.set_property("visible", True)
  716. def on_previous1_clicked(self, widget):
  717. step_view1 = self.wTree.get_object('vbox_step1')
  718. step_view1.set_property("visible", False)
  719. step_view_start = self.wTree.get_object('vbox_start')
  720. step_view_start.set_property("visible", True)
  721. alert_step1_url = self.wTree.get_object('alert_step1_url')
  722. alert_step1_url.set_property("visible", False)
  723. alert_step1_dork = self.wTree.get_object('alert_step1_dork')
  724. alert_step1_dork.set_property("visible", False)
  725. combo_choose = self.wTree.get_object('combobox_step1')
  726. step1_entry_url = self.wTree.get_object('step1_entry_url')
  727. step1_entry_dork = self.wTree.get_object('step1_entry_dork')
  728. step1_entry_url.set_property("text", "")
  729. step1_entry_dork.set_property("text", "")
  730. self.combo_step1_choose = ""
  731. self.target_option = ""
  732. self.dork_option = ""
  733. def on_next1_clicked(self, widget):
  734. step_view1 = self.wTree.get_object('vbox_step1')
  735. step_view2 = self.wTree.get_object('vbox_step2')
  736. combo_choose = self.wTree.get_object('combobox_step1')
  737. step1_entry_url = self.wTree.get_object('step1_entry_url')
  738. step1_entry_dork = self.wTree.get_object('step1_entry_dork')
  739. step1_entry_dorkengine = self.wTree.get_object('combobox6')
  740. alert_step1_url = self.wTree.get_object('alert_step1_url')
  741. alert_step1_dork = self.wTree.get_object('alert_step1_dork')
  742. if step1_entry_url.get_text() == '' and (combo_choose.get_active_text() == '1'):
  743. alert_step1_url.set_property("visible", True)
  744. step_view1.set_property("visible", True)
  745. step_view2.set_property("visible", False)
  746. elif step1_entry_dork.get_text() == '' and (combo_choose.get_active_text() == '2'):
  747. alert_step1_dork.set_property("visible", True)
  748. step_view1.set_property("visible", True)
  749. step_view2.set_property("visible", False)
  750. else:
  751. alert_step1_url.set_property("visible", False)
  752. alert_step1_dork.set_property("visible", False)
  753. step_view1.set_property("visible", False)
  754. step_view2.set_property("visible", True)
  755. self.combo_step1_choose = combo_choose.get_active_text()
  756. self.target_option = step1_entry_url.get_text()
  757. self.dork_option = step1_entry_dork.get_text()
  758. self.dorkengine_option = step1_entry_dorkengine.get_active_text()
  759. def on_combobox_step2_changed(self, widget):
  760. combo_choose = self.wTree.get_object('combobox_step2')
  761. vbox_step2 = self.wTree.get_object('vbox_step2_payload')
  762. step2_entry_payload = self.wTree.get_object('step2_entry_payload')
  763. alert_step2 = self.wTree.get_object('alert_step2')
  764. next2 = self.wTree.get_object('next2')
  765. if combo_choose.get_active_text() == '0':
  766. vbox_step2.set_property("visible", False)
  767. alert_step2.set_property("visible", False)
  768. next2.set_property("visible", False)
  769. step2_entry_payload.set_property("text", "")
  770. if combo_choose.get_active_text() == '1':
  771. vbox_step2.set_property("visible", True)
  772. alert_step2.set_property("visible", False)
  773. next2.set_property("visible", True)
  774. step2_entry_payload.set_property("text", "")
  775. elif combo_choose.get_active_text() == '2':
  776. vbox_step2.set_property("visible", True)
  777. next2.set_property("visible", True)
  778. alert_step2.set_property("visible", False)
  779. step2_entry_payload.set_property("text", "")
  780. elif combo_choose.get_active_text() == '3':
  781. vbox_step2.set_property("visible", False)
  782. next2.set_property("visible", True)
  783. alert_step2.set_property("visible", False)
  784. elif combo_choose.get_active_text() == '4':
  785. vbox_step2.set_property("visible", False)
  786. next2.set_property("visible", True)
  787. alert_step2.set_property("visible", False)
  788. def on_previous2_clicked(self, widget):
  789. step_view2 = self.wTree.get_object('vbox_step2')
  790. step_view2.set_property("visible", False)
  791. step_view1 = self.wTree.get_object('vbox_step1')
  792. step_view1.set_property("visible", True)
  793. alert_step2 = self.wTree.get_object('alert_step2')
  794. alert_step2.set_property("visible", False)
  795. step1_entry_url = self.wTree.get_object('step1_entry_url')
  796. step1_entry_url.set_property("text", "")
  797. step1_entry_dork = self.wTree.get_object('step1_entry_dork')
  798. step1_entry_dork.set_property("text", "")
  799. self.combo_step2_choose = ""
  800. self.target_option = ""
  801. self.dork_option = ""
  802. combo_choose = self.wTree.get_object('combobox_step2')
  803. step2_entry_payload = self.wTree.get_object('step2_entry_payload')
  804. step2_entry_payload.set_property("text", "")
  805. self.combo_step2_choose = ""
  806. self.payload_option = ""
  807. def on_next2_clicked(self, widget):
  808. step_view2 = self.wTree.get_object('vbox_step2')
  809. step_view3 = self.wTree.get_object('vbox_step3')
  810. combo_choose = self.wTree.get_object('combobox_step2')
  811. step2_entry_payload = self.wTree.get_object('step2_entry_payload')
  812. alert_step2 = self.wTree.get_object('alert_step2')
  813. if step2_entry_payload.get_text() == '' and (combo_choose.get_active_text() == '1' or combo_choose.get_active_text() == '2') :
  814. alert_step2.set_property("visible", True)
  815. step_view2.set_property("visible", True)
  816. step_view3.set_property("visible", False)
  817. else:
  818. alert_step2.set_property("visible", False)
  819. step_view2.set_property("visible", False)
  820. step_view3.set_property("visible", True)
  821. self.combo_step2_choose = combo_choose.get_active_text()
  822. self.payload_option = step2_entry_payload.get_text()
  823. def on_combobox_step3_changed(self, widget):
  824. combo_choose = self.wTree.get_object('combobox_step3')
  825. vbox_step3 = self.wTree.get_object('vbox_st')
  826. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  827. alert_step3 = self.wTree.get_object('alert_step3')
  828. next3 = self.wTree.get_object('next3')
  829. if combo_choose.get_active_text() == '0':
  830. vbox_step3.set_property("visible", False)
  831. alert_step3.set_property("visible", False)
  832. next3.set_property("visible", False)
  833. step3_entry_proxy.set_property("text", "")
  834. if combo_choose.get_active_text() == '1':
  835. vbox_step3.set_property("visible", True)
  836. alert_step3.set_property("visible", False)
  837. next3.set_property("visible", True)
  838. step3_entry_proxy.set_property("text", "")
  839. elif combo_choose.get_active_text() == '2':
  840. vbox_step3.set_property("visible", False)
  841. next3.set_property("visible", True)
  842. alert_step3.set_property("visible", False)
  843. elif combo_choose.get_active_text() == '3':
  844. vbox_step3.set_property("visible", False)
  845. next3.set_property("visible", True)
  846. alert_step3.set_property("visible", False)
  847. elif combo_choose.get_active_text() == '4':
  848. vbox_step3.set_property("visible", False)
  849. next3.set_property("visible", True)
  850. alert_step3.set_property("visible", False)
  851. def on_previous3_clicked(self, widget):
  852. step_view3 = self.wTree.get_object('vbox_step3')
  853. step_view3.set_property("visible", False)
  854. step_view2 = self.wTree.get_object('vbox_step2')
  855. step_view2.set_property("visible", True)
  856. alert_step3 = self.wTree.get_object('alert_step3')
  857. alert_step3.set_property("visible", False)
  858. combo_choose = self.wTree.get_object('combobox_step3')
  859. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  860. step3_entry_proxy.set_property("text", "")
  861. self.combo_step3_choose = ""
  862. self.proxy_option = ""
  863. self.useragent_option = ""
  864. self.referer_option = ""
  865. def on_next3_clicked(self, widget):
  866. step_view3 = self.wTree.get_object('vbox_step3')
  867. step_view4 = self.wTree.get_object('vbox_step4')
  868. combo_choose = self.wTree.get_object('combobox_step3')
  869. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  870. alert_step3 = self.wTree.get_object('alert_step3')
  871. if step3_entry_proxy.get_text() == '' and combo_choose.get_active_text() == '1':
  872. alert_step3.set_property("visible", True)
  873. step_view3.set_property("visible", True)
  874. step_view4.set_property("visible", False)
  875. else:
  876. alert_step3.set_property("visible", False)
  877. step_view3.set_property("visible", False)
  878. step_view4.set_property("visible", True)
  879. self.combo_step3_choose = combo_choose.get_active_text()
  880. self.proxy_option = step3_entry_proxy.get_text()
  881. if combo_choose.get_active_text() == '2':
  882. self.proxy_option = "http://127.0.0.1:8118"
  883. def on_combobox_step4_changed(self, widget):
  884. combo_choose = self.wTree.get_object('combobox_step4')
  885. vbox_step4 = self.wTree.get_object('vboxstep4')
  886. step4_entry_cem = self.wTree.get_object('step4_entry_cem')
  887. alert_step4 = self.wTree.get_object('alert_step4')
  888. next4 = self.wTree.get_object('next4')
  889. if combo_choose.get_active_text() == '0':
  890. vbox_step4.set_property("visible", False)
  891. alert_step4.set_property("visible", False)
  892. next4.set_property("visible", False)
  893. step4_entry_cem.set_property("text", "")
  894. elif combo_choose.get_active_text() == '1':
  895. vbox_step4.set_property("visible", False)
  896. alert_step4.set_property("visible", False)
  897. next4.set_property("visible", True)
  898. elif combo_choose.get_active_text() == '2':
  899. vbox_step4.set_property("visible", False)
  900. alert_step4.set_property("visible", False)
  901. next4.set_property("visible", True)
  902. elif combo_choose.get_active_text() == '3':
  903. vbox_step4.set_property("visible", False)
  904. alert_step4.set_property("visible", False)
  905. next4.set_property("visible", True)
  906. elif combo_choose.get_active_text() == '4':
  907. vbox_step4.set_property("visible", True)
  908. next4.set_property("visible", True)
  909. elif combo_choose.get_active_text() == '5':
  910. vbox_step4.set_property("visible", False)
  911. next4.set_property("visible", True)
  912. alert_step4.set_property("visible", False)
  913. def on_previous4_clicked(self, widget):
  914. step_view4 = self.wTree.get_object('vbox_step4')
  915. step_view4.set_property("visible", False)
  916. step_view3 = self.wTree.get_object('vbox_step3')
  917. step_view3.set_property("visible", True)
  918. alert_step4 = self.wTree.get_object('alert_step4')
  919. alert_step4.set_property("visible", False)
  920. combo_choose = self.wTree.get_object('combobox_step4')
  921. step4_entry_cem = self.wTree.get_object('step4_entry_cem')
  922. step4_entry_cem.set_property("text", "")
  923. self.combo_step4_choose = ""
  924. self.cem_option = ""
  925. def on_next4_clicked(self, widget):
  926. step_view4 = self.wTree.get_object('vbox_step4')
  927. step_view5 = self.wTree.get_object('vbox_step5')
  928. combo_choose = self.wTree.get_object('combobox_step4')
  929. step4_entry_cem = self.wTree.get_object('step4_entry_cem')
  930. alert_step4 = self.wTree.get_object('alert_step4')
  931. if step4_entry_cem.get_text() == '' and combo_choose.get_active_text() == '4':
  932. alert_step4.set_property("visible", True)
  933. step_view4.set_property("visible", True)
  934. step_view5.set_property("visible", False)
  935. else:
  936. alert_step4.set_property("visible", False)
  937. step_view4.set_property("visible", False)
  938. step_view5.set_property("visible", True)
  939. self.combo_step4_choose = combo_choose.get_active_text()
  940. self.cem_option = step4_entry_cem.get_text()
  941. def on_combobox_step5_changed(self, widget):
  942. combo_choose = self.wTree.get_object('combobox_step5')
  943. vbox_step5 = self.wTree.get_object('vboxstep5')
  944. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  945. alert_step5 = self.wTree.get_object('alert_step5')
  946. next5 = self.wTree.get_object('next5')
  947. if combo_choose.get_active_text() == '0':
  948. vbox_step5.set_property("visible", False)
  949. alert_step5.set_property("visible", False)
  950. next5.set_property("visible", False)
  951. step5_entry_scripts.set_property("text", "")
  952. elif combo_choose.get_active_text() == '1':
  953. vbox_step5.set_property("visible", False)
  954. alert_step5.set_property("visible", False)
  955. next5.set_property("visible", True)
  956. elif combo_choose.get_active_text() == '2':
  957. vbox_step5.set_property("visible", True)
  958. alert_step5.set_property("visible", False)
  959. next5.set_property("visible", True)
  960. elif combo_choose.get_active_text() == '3':
  961. vbox_step5.set_property("visible", False)
  962. alert_step5.set_property("visible", False)
  963. next5.set_property("visible", True)
  964. def on_previous5_clicked(self, widget):
  965. step_view5 = self.wTree.get_object('vbox_step5')
  966. step_view5.set_property("visible", False)
  967. step_view4 = self.wTree.get_object('vbox_step4')
  968. step_view4.set_property("visible", True)
  969. alert_step5 = self.wTree.get_object('alert_step5')
  970. alert_step5.set_property("visible", False)
  971. combo_choose = self.wTree.get_object('combobox_step5')
  972. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  973. step5_entry_scripts.set_property("text", "")
  974. self.combo_step5_choose = ""
  975. self.scripts_option = ""
  976. def on_next5_clicked(self, widget):
  977. step_view5 = self.wTree.get_object('vbox_step5')
  978. step_view5.set_property("visible", False)
  979. step_view_end = self.wTree.get_object('vbox_end')
  980. step_view_end.set_property("visible", True)
  981. combo_choose = self.wTree.get_object('combobox_step5')
  982. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  983. alert_step5 = self.wTree.get_object('alert_step5')
  984. if step5_entry_scripts.get_text() == '' and combo_choose.get_active_text() == '2':
  985. alert_step5.set_property("visible", True)
  986. step_view5.set_property("visible", True)
  987. step_view_end.set_property("visible", False)
  988. else:
  989. alert_step5.set_property("visible", False)
  990. step_view5.set_property("visible", False)
  991. step_view_end.set_property("visible", True)
  992. self.combo_step5_choose = combo_choose.get_active_text()
  993. self.scripts_option = step5_entry_scripts.get_text()
  994. # building end form
  995. end_entry_target = self.wTree.get_object('end_entry_target')
  996. end_entry_shadow = self.wTree.get_object('end_entry_shadow')
  997. end_entry_connection = self.wTree.get_object('end_entry_connection')
  998. end_entry_bypasser = self.wTree.get_object('end_entry_bypasser')
  999. end_entry_exploit = self.wTree.get_object('end_entry_exploit')
  1000. # step 1
  1001. if self.combo_step1_choose == "1":
  1002. end_entry_target.set_property("text", "URL: " + self.target_option)
  1003. if self.combo_step1_choose == "2":
  1004. end_entry_target.set_property("text", ("Dork: " + self.dork_option + " // Engine: " + self.dorkengine_option))
  1005. # step 2
  1006. if self.combo_step2_choose == "1":
  1007. end_entry_connection.set_property("text", ("Type: GET " + " // Payload: " + self.payload_option))
  1008. if self.combo_step2_choose == "2":
  1009. end_entry_connection.set_property("text", ("Type: POST " + " // Payload: " + self.payload_option))
  1010. if self.combo_step2_choose == "3":
  1011. end_entry_connection.set_property("text", "Type: Crawler")
  1012. if self.combo_step2_choose == "4":
  1013. end_entry_connection.set_property("text", "Type: AUTO")
  1014. # step 3
  1015. if self.combo_step3_choose == "1":
  1016. shadow_proxy = end_entry_shadow.set_property("text", self.proxy_option)
  1017. shadow_useragent = end_entry_shadow.set_property("text", self.useragent_option)
  1018. shadow_referer = end_entry_shadow.set_property("text", self.referer_option)
  1019. proxy = "PROXY listening on: " + self.proxy_option
  1020. end_entry_shadow.set_property("text", proxy)
  1021. if self.useragent_option != "":
  1022. end_entry_shadow.set_property("text", proxy + " + UA spoofing")
  1023. if self.referer_option != "":
  1024. end_entry_shadow.set_property("text", proxy + " + UA spoofing + RF spoofing")
  1025. else:
  1026. end_entry_shadow.set_property("text", proxy + " + UA spoofing(by default)")
  1027. if self.referer_option != "":
  1028. end_entry_shadow.set_property("text", proxy + " + UA spoofing(by default)+ RF spoofing")
  1029. if self.referer_option != "":
  1030. end_entry_shadow.set_property("text", proxy + " + RF spoofing")
  1031. if self.combo_step3_choose == "2":
  1032. proxy = "PROXY listening on: " + self.proxy_option
  1033. end_entry_shadow.set_property("text", proxy)
  1034. if self.combo_step3_choose == "3":
  1035. end_entry_shadow.set_property("text", "NO PROXY + UA spoofing(by default)")
  1036. if self.combo_step3_choose == "4":
  1037. end_entry_shadow.set_property("text", "DIRECT + UA spoofing(by default)")
  1038. # step 4
  1039. if self.combo_step4_choose == "1":
  1040. end_entry_bypasser.set_property("text", "Encode: Nothing")
  1041. if self.combo_step4_choose == "2":
  1042. end_entry_bypasser.set_property("text", "Encode: Hexadecimal")
  1043. if self.combo_step4_choose == "3":
  1044. end_entry_bypasser.set_property("text", "Encode: mix 'String.FromCharCode()' and 'Unescape()'")
  1045. if self.combo_step4_choose == "4":
  1046. end_entry_bypasser.set_property("text", self.cem_option)
  1047. if self.combo_step4_choose == "5":
  1048. end_entry_bypasser.set_property("text", "Encode: Nothing")
  1049. # step 5
  1050. if self.combo_step5_choose == "1":
  1051. end_entry_exploit.set_property("text", "Code: Classic 'XSS' alert box")
  1052. if self.combo_step5_choose == "2":
  1053. end_entry_exploit.set_property("text", self.scripts_option)
  1054. if self.combo_step5_choose == "3":
  1055. end_entry_exploit.set_property("text", "Code: Classic 'XSS' alert box")
  1056. def on_previous6_clicked(self, widget):
  1057. step_view_end = self.wTree.get_object('vbox_end')
  1058. step_view_end.set_property("visible", False)
  1059. step_view5 = self.wTree.get_object('vbox_step5')
  1060. step_view5.set_property("visible", True)
  1061. alert_step5 = self.wTree.get_object('alert_step5')
  1062. alert_step5.set_property("visible", False)
  1063. combo_choose = self.wTree.get_object('combobox_step5')
  1064. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  1065. step5_entry_scripts.set_property("text", "")
  1066. self.combo_step5_choose = ""
  1067. self.scripts_option = ""
  1068. def on_cancel_template_clicked(self, widget):
  1069. step_view_end = self.wTree.get_object('vbox_end')
  1070. step_view_end.set_property("visible", False)
  1071. step_view_start = self.wTree.get_object('vbox_start')
  1072. step1_entry_url = self.wTree.get_object('step1_entry_url')
  1073. step1_entry_dork = self.wTree.get_object('step1_entry_dork')
  1074. step2_entry_payload = self.wTree.get_object('step2_entry_payload')
  1075. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  1076. step4_entry_cem = self.wTree.get_object('step4_entry_cem')
  1077. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  1078. step_view_start.set_property("visible", True)
  1079. # reseting wizard options
  1080. # step 1
  1081. self.target_option = ""
  1082. self.dork_option = ""
  1083. self.dorkengine_option = ""
  1084. self.combo_step1_choose = ""
  1085. step1_entry_url.set_property("text", "")
  1086. step1_entry_dork.set_property("text", "")
  1087. # step 2
  1088. self.payload_option = ""
  1089. self.combo_step2_choose = ""
  1090. step2_entry_payload.set_property("text", "")
  1091. # step 3
  1092. self.combo_step3_choose = ""
  1093. self.proxy_option = ""
  1094. self.useragent_option = ""
  1095. self.referer_option = ""
  1096. step3_entry_proxy.set_property("text", "")
  1097. # step 4
  1098. self.combo_step4_choose = ""
  1099. self.cem_option = ""
  1100. step4_entry_cem.set_property("text", "")
  1101. # step 5
  1102. self.combo_step5_choose = ""
  1103. self.scripts_option = ""
  1104. step5_entry_scripts.set_property("text", "")
  1105. # remove parameters on autocompleter
  1106. commandsenter = self.wTree.get_object('commandsenter')
  1107. commandsenter.set_property("text", "xsser")
  1108. # clean all buffers
  1109. self.output_wizard.set_buffer(self._wizard_buffer)
  1110. def on_accept_template_clicked(self, widget):
  1111. """
  1112. Fly your mosquito(s) from wizard
  1113. """
  1114. # clean startup wizard buffer
  1115. step_view_end = self.wTree.get_object('vbox_end')
  1116. step_view_end.set_property("visible", False)
  1117. step_view_start = self.wTree.get_object('vbox_start')
  1118. step_view_start.set_property("visible", True)
  1119. fly_button = self.wTree.get_object('fly')
  1120. if self._flying:
  1121. self.on_stop_attack()
  1122. fly_button.set_label('LANDING!!!')
  1123. fly_button.set_sensitive(False)
  1124. return
  1125. self._report_errors.set_text('')
  1126. self._report_vulnerables.set_text('')
  1127. self._report_success.set_text('')
  1128. self._report_failed.set_text('')
  1129. self._report_crawling.set_text('')
  1130. self.output_wizard.set_buffer(self.output.get_buffer())
  1131. commandsenter = self.wTree.get_object('commandsenter')
  1132. cmd = self.generate_command()
  1133. commandsenter.set_property("text"," ".join(cmd))
  1134. t = XSSerThread(cmd, self.mothership)
  1135. t.add_reporter(self)
  1136. t.set_webbrowser(self.moz)
  1137. if self.map:
  1138. t.add_reporter(self.map)
  1139. self.mothership.add_reporter(self.map)
  1140. t.start()
  1141. self._flying = t
  1142. fly_button.set_label('LAND!!!')
  1143. step1_entry_url = self.wTree.get_object('step1_entry_url')
  1144. step1_entry_dork = self.wTree.get_object('step1_entry_dork')
  1145. step2_entry_payload = self.wTree.get_object('step2_entry_payload')
  1146. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  1147. step4_entry_cem = self.wTree.get_object('step4_entry_cem')
  1148. step5_entry_scripts = self.wTree.get_object('step5_entry_scripts')
  1149. step_view_start.set_property("visible", True)
  1150. # reseting wizard options
  1151. # step 1
  1152. self.target_option = ""
  1153. self.dork_option = ""
  1154. self.dorkengine_option = ""
  1155. self.combo_step1_choose = ""
  1156. step1_entry_url.set_property("text", "")
  1157. step1_entry_dork.set_property("text", "")
  1158. # step 2
  1159. self.payload_option = ""
  1160. self.combo_step2_choose = ""
  1161. step2_entry_payload.set_property("text", "")
  1162. # step 3
  1163. self.combo_step3_choose = ""
  1164. self.proxy_option = ""
  1165. self.useragent_option = ""
  1166. self.referer_option = ""
  1167. # step 4
  1168. self.combo_step4_choose = ""
  1169. self.cem_option = ""
  1170. step4_entry_cem.set_property("text", "")
  1171. # step 5
  1172. self.combo_step5_choose = ""
  1173. self.scripts_option = ""
  1174. step5_entry_scripts.set_property("text", "")
  1175. # remove parameters on autocompleter
  1176. commandsenter = self.wTree.get_object('commandsenter')
  1177. commandsenter.set_property("text", "xsser")
  1178. def on_combobox7_changed(self, widget):
  1179. """
  1180. Generate Geoip
  1181. """
  1182. combo_choose = self.wTree.get_object('combobox7')
  1183. image_geomap = self.wTree.get_object('image_geomap')
  1184. vbox9 = self.wTree.get_object('vbox9')
  1185. if combo_choose.get_active_text() == 'OFF':
  1186. self.map.set_property("visible", False)
  1187. vbox9.set_property("visible", False)
  1188. if self._flying:
  1189. self._flying.remove_reporter(self.map)
  1190. self.mothership.remove_reporter(self.map)
  1191. elif combo_choose.get_active_text() == 'ON':
  1192. vbox9.set_property("visible", True)
  1193. if not self.map:
  1194. image_geomap.realize()
  1195. drawarea = GlobalMap(self, image_geomap.get_pixbuf(), self._flying)
  1196. vbox = image_geomap.parent
  1197. vbox.remove(image_geomap)
  1198. eventbox = gtk.EventBox()
  1199. eventbox.add(drawarea)
  1200. vbox.pack_end(eventbox)
  1201. eventbox.show()
  1202. drawarea.show()
  1203. self.map = drawarea
  1204. if self._flying:
  1205. self.mothership.add_reporter(self.map)
  1206. self._flying.add_reporter(self.map)
  1207. self.map.set_property("visible", True)
  1208. def on_update_clicked(self, widget):
  1209. """
  1210. Search for latest XSSer version
  1211. """
  1212. webbrowser.open("https://github.com/epsylon/xsser")
  1213. def on_reportbug_clicked(self, widget):
  1214. """
  1215. Report bugs, ideas...
  1216. """
  1217. webbrowser.open("https://lists.sourceforge.net/lists/listinfo/xsser-users")
  1218. def on_donate_clicked(self, widget):
  1219. """
  1220. Donate something
  1221. """
  1222. webbrowser.open("http://03c8.net")
  1223. def generate_command(self):
  1224. command = ["xsser"]
  1225. # set automatic audit a entire target
  1226. # get target from url
  1227. target_all = self.wTree.get_object('targetall')
  1228. target_entry = self.wTree.get_object('targetenter')
  1229. if target_all.get_active() == False:
  1230. pass
  1231. else:
  1232. if target_entry.get_text() == "":
  1233. pass
  1234. else:
  1235. command.append("--all")
  1236. command.append(target_entry.get_text())
  1237. # get target from url
  1238. target_entry = self.wTree.get_object('targetenter')
  1239. if target_all.get_active() == True:
  1240. pass
  1241. else:
  1242. if target_entry.get_text() == "":
  1243. pass
  1244. else:
  1245. command.append("-u")
  1246. command.append(target_entry.get_text())
  1247. # get explorer test mode
  1248. explorer = self.wTree.get_object('explorer')
  1249. if explorer.get_active() == False:
  1250. pass
  1251. else:
  1252. explorer_enter = self.wTree.get_object('explorer_enter')
  1253. dork_engine = self.wTree.get_object('combobox4')
  1254. if explorer_enter.get_text() == "":
  1255. pass
  1256. else:
  1257. command.append("-d")
  1258. command.append(explorer_enter.get_text())
  1259. command.append("--De")
  1260. command.append(dork_engine.get_active_text())
  1261. # get crawler test mode (common crawling c=50 Cw=3)
  1262. crawler = self.wTree.get_object('crawler')
  1263. combobox5 = self.wTree.get_object('combobox5')
  1264. combobox_deep1 = self.wTree.get_object('combobox_deep1')
  1265. localonly1 = self.wTree.get_object('localonly1')
  1266. if crawler.get_active() == False:
  1267. pass
  1268. else:
  1269. command.append("-c")
  1270. command.append(str(int(combobox5.get_value())))
  1271. command.append("--Cw")
  1272. iter = combobox_deep1.get_active_iter()
  1273. command.append(combobox_deep1.get_model().get_value(iter, 0))
  1274. if localonly1.get_active() == True:
  1275. command.append("--Cl")
  1276. # get statistics
  1277. target_entry = self.wTree.get_object('statistics')
  1278. if target_entry.get_active() == False:
  1279. pass
  1280. else:
  1281. command.append("-s")
  1282. # get verbose
  1283. target_entry = self.wTree.get_object('verbose')
  1284. if target_entry.get_active() == False:
  1285. pass
  1286. else:
  1287. command.append("-v")
  1288. # use GET connections
  1289. target_entry = self.wTree.get_object('get')
  1290. if target_entry.get_active() == False:
  1291. pass
  1292. else:
  1293. target_entry = self.wTree.get_object('connection_parameters')
  1294. if target_entry.get_text() == "":
  1295. pass
  1296. else:
  1297. command.append("-g")
  1298. command.append(target_entry.get_text())
  1299. # use POST connections
  1300. target_entry = self.wTree.get_object('post')
  1301. if target_entry.get_active() == False:
  1302. pass
  1303. else:
  1304. target_entry = self.wTree.get_object('connection_parameters')
  1305. if target_entry.get_text() == "":
  1306. pass
  1307. else:
  1308. command.append("-p")
  1309. command.append(target_entry.get_text())
  1310. # use checker system HEAD
  1311. target_entry = self.wTree.get_object('no-head')
  1312. if target_entry.get_active() == False:
  1313. pass
  1314. else:
  1315. command.append("--head")
  1316. # use checker system HASH
  1317. target_entry = self.wTree.get_object('hashing')
  1318. if target_entry.get_active() == False:
  1319. pass
  1320. else:
  1321. command.append("--hash")
  1322. # use checker system HEURISTIC
  1323. target_entry = self.wTree.get_object('heuristic')
  1324. if target_entry.get_active() == False:
  1325. pass
  1326. else:
  1327. command.append("--heuristic")
  1328. # get USER-AGENT
  1329. target_entry = self.wTree.get_object('useragent')
  1330. command.append("--user-agent")
  1331. command.append(target_entry.get_text())
  1332. # get REFERER
  1333. target_entry = self.wTree.get_object('referer')
  1334. if target_entry.get_text() == "":
  1335. pass
  1336. else:
  1337. command.append("--referer")
  1338. command.append(target_entry.get_text())
  1339. # get COOKIE
  1340. target_entry = self.wTree.get_object('cookie')
  1341. if target_entry.get_text() == "":
  1342. pass
  1343. else:
  1344. command.append("--cookie")
  1345. command.append(target_entry.get_text())
  1346. # get Authentication BASIC
  1347. target_entry = self.wTree.get_object('auth_basic')
  1348. if target_entry.get_active() == False:
  1349. pass
  1350. else:
  1351. command.append("--auth-type")
  1352. command.append("basic")
  1353. # get Authentication DIGEST
  1354. target_entry = self.wTree.get_object('auth_digest')
  1355. if target_entry.get_active() == False:
  1356. pass
  1357. else:
  1358. command.append("--auth-type")
  1359. command.append("digest")
  1360. # get Authentication GSS
  1361. target_entry = self.wTree.get_object('auth_gss')
  1362. if target_entry.get_active() == False:
  1363. pass
  1364. else:
  1365. command.append("--auth-type")
  1366. command.append("gss")
  1367. # get Authentication NTLM
  1368. target_entry = self.wTree.get_object('auth_ntlm')
  1369. if target_entry.get_active() == False:
  1370. pass
  1371. else:
  1372. command.append("--auth-type")
  1373. command.append("ntlm")
  1374. # get Authentication Credentials
  1375. target_entry = self.wTree.get_object('auth_cred')
  1376. if target_entry.get_text() == "":
  1377. pass
  1378. else:
  1379. command.append("--auth-cred")
  1380. command.append(target_entry.get_text())
  1381. # get PROXY
  1382. proxy = self.wTree.get_object('proxy')
  1383. if proxy.get_text() == "":
  1384. pass
  1385. else:
  1386. command.append("--proxy")
  1387. command.append(proxy.get_text())
  1388. if proxy.get_text() == "http://127.0.0.1:8118":
  1389. torproxy = self.wTree.get_object('torproxy')
  1390. torproxy.set_property('active', True)
  1391. else:
  1392. torproxy.set_property('active', False)
  1393. # get IGNORE-PROXY
  1394. target_entry = self.wTree.get_object('ignore-proxy')
  1395. if target_entry.get_active() == False:
  1396. pass
  1397. else:
  1398. command.append("--ignore-proxy")
  1399. # get DROP-COOKIE
  1400. target_entry = self.wTree.get_object('drop-cookie')
  1401. if target_entry.get_active() == False:
  1402. pass
  1403. else:
  1404. command.append("--drop-cookie")
  1405. # get XFORW
  1406. target_entry = self.wTree.get_object('xforw')
  1407. if target_entry.get_active() == False:
  1408. pass
  1409. else:
  1410. command.append("--xforw")
  1411. # get XCLIENT
  1412. target_entry = self.wTree.get_object('xclient')
  1413. if target_entry.get_active() == False:
  1414. pass
  1415. else:
  1416. command.append("--xclient")
  1417. # get TCP-NODELAY
  1418. target_entry = self.wTree.get_object('tcp-nodelay')
  1419. if target_entry.get_active() == False:
  1420. pass
  1421. else:
  1422. command.append("--tcp-nodelay")
  1423. # get REVERSE-CHECK
  1424. target_entry = self.wTree.get_object('reverse-check')
  1425. if target_entry.get_active() == False:
  1426. pass
  1427. else:
  1428. command.append("--reverse-check")
  1429. # get DISCARD CODE
  1430. target_entry = self.wTree.get_object('discode')
  1431. if target_entry.get_text() == "":
  1432. pass
  1433. else:
  1434. command.append("--discode")
  1435. command.append(target_entry.get_text())
  1436. # get FOLLOWREDIRECTS
  1437. target_entry = self.wTree.get_object('followredirects')
  1438. if target_entry.get_active() == False:
  1439. pass
  1440. else:
  1441. command.append("--follow-redirects")
  1442. # get FOLLOW-LIMIT
  1443. target_entry = self.wTree.get_object('follow-limit')
  1444. if target_entry.get_value() == 0:
  1445. pass
  1446. else:
  1447. command.append("--follow-limit")
  1448. command.append(str(int(target_entry.get_value())))
  1449. # get ISALIVE
  1450. target_entry = self.wTree.get_object('alive-limit')
  1451. if target_entry.get_value() == 0:
  1452. pass
  1453. else:
  1454. command.append("--alive")
  1455. command.append(str(int(target_entry.get_value())))
  1456. # get CHECK-AT-URL
  1457. target_entry = self.wTree.get_object('checkaturl')
  1458. check_method = self.wTree.get_object('combobox1')
  1459. check_data = self.wTree.get_object('checkatdata')
  1460. if target_entry.get_text() == "":
  1461. pass
  1462. else:
  1463. command.append("--checkaturl")
  1464. command.append(target_entry.get_text())
  1465. command.append("--checkmethod")
  1466. command.append(check_method.get_active_text())
  1467. if check_data.get_text() == "":
  1468. pass
  1469. else:
  1470. command.append("--checkatdata")
  1471. command.append(check_data.get_text())
  1472. # get THREADS
  1473. target_entry = self.wTree.get_object('threads')
  1474. if target_entry.get_value() == 0:
  1475. pass
  1476. else:
  1477. command.append("--threads")
  1478. command.append(str(int(target_entry.get_value())))
  1479. # get TIMEOUT
  1480. target_entry = self.wTree.get_object('timeout')
  1481. command.append("--timeout")
  1482. command.append(str(int(target_entry.get_value())))
  1483. # get RETRIES
  1484. target_entry = self.wTree.get_object('retries')
  1485. command.append("--retries")
  1486. command.append(str(int(target_entry.get_value())))
  1487. # get DELAY
  1488. target_entry = self.wTree.get_object('delay')
  1489. command.append("--delay")
  1490. command.append(str(int(target_entry.get_value())))
  1491. # get Extra Headers
  1492. target_entry = self.wTree.get_object('extra_headers')
  1493. if target_entry.get_text() == "":
  1494. pass
  1495. else:
  1496. command.append("--headers")
  1497. command.append(target_entry.get_text())
  1498. # get Payload
  1499. target_entry = self.wTree.get_object('enterpayload')
  1500. if target_entry.get_text() == "":
  1501. pass
  1502. else:
  1503. command.append("--payload")
  1504. command.append(target_entry.get_text())
  1505. # get Automatic Payload test
  1506. target_entry = self.wTree.get_object('automatic_payload')
  1507. if target_entry.get_active() == False:
  1508. pass
  1509. else:
  1510. command.append("--auto")
  1511. # get Bypasser: StringFromCharCode()
  1512. target_entry = self.wTree.get_object('by_sfcc')
  1513. if target_entry.get_active() == False:
  1514. pass
  1515. else:
  1516. command.append("--Str")
  1517. # get Bypasser: Unescape()
  1518. target_entry = self.wTree.get_object('by_unescape')
  1519. if target_entry.get_active() == False:
  1520. pass
  1521. else:
  1522. command.append("--Une")
  1523. # get Bypasser: Hexadecimal
  1524. target_entry = self.wTree.get_object('by_hex')
  1525. if target_entry.get_active() == False:
  1526. pass
  1527. else:
  1528. command.append("--Hex")
  1529. # get Bypasser: Hexadecimal with semicolons
  1530. target_entry = self.wTree.get_object('by_hes')
  1531. if target_entry.get_active() == False:
  1532. pass
  1533. else:
  1534. command.append("--Hes")
  1535. # get Bypasser: Dword
  1536. target_entry = self.wTree.get_object('by_dword')
  1537. if target_entry.get_active() == False:
  1538. pass
  1539. else:
  1540. command.append("--Dwo")
  1541. # get Bypasser: Octal
  1542. target_entry = self.wTree.get_object('by_octal')
  1543. if target_entry.get_active() == False:
  1544. pass
  1545. else:
  1546. command.append("--Doo")
  1547. # get Bypasser: Decimal
  1548. target_entry = self.wTree.get_object('by_decimal')
  1549. if target_entry.get_active() == False:
  1550. pass
  1551. else:
  1552. command.append("--Dec")
  1553. # get Bypasser: CEM
  1554. target_entry = self.wTree.get_object('enter_cem')
  1555. if target_entry.get_text() == "":
  1556. pass
  1557. else:
  1558. command.append("--Cem")
  1559. command.append(target_entry.get_text())
  1560. # get Technique: Cookie Injection
  1561. target_entry = self.wTree.get_object('cookie_injection')
  1562. if target_entry.get_active() == False:
  1563. pass
  1564. else:
  1565. command.append("--Coo")
  1566. # get Technique: Cross Site Agent Scripting
  1567. target_entry = self.wTree.get_object('xas')
  1568. if target_entry.get_active() == False:
  1569. pass
  1570. else:
  1571. command.append("--Xsa")
  1572. # get Technique: Cross Site Referer Scripting
  1573. target_entry = self.wTree.get_object('xsr')
  1574. if target_entry.get_active() == False:
  1575. pass
  1576. else:
  1577. command.append("--Xsr")
  1578. # get Technique: Document Object Model injections
  1579. target_entry = self.wTree.get_object('dom')
  1580. if target_entry.get_active() == False:
  1581. pass
  1582. else:
  1583. command.append("--Dom")
  1584. # get Technique: Data Control Protocol injections
  1585. target_entry = self.wTree.get_object('dcp')
  1586. if target_entry.get_active() == False:
  1587. pass
  1588. else:
  1589. command.append("--Dcp")
  1590. # get Technique: HTTP Response Splitting Induced code
  1591. target_entry = self.wTree.get_object('induced')
  1592. if target_entry.get_active() == False:
  1593. pass
  1594. else:
  1595. command.append("--Ind")
  1596. # get Technique: Use Anchor Stealth
  1597. target_entry = self.wTree.get_object('anchor')
  1598. if target_entry.get_active() == False:
  1599. pass
  1600. else:
  1601. command.append("--Anchor")
  1602. # get Technique: PHP IDS bug (0.6.5)
  1603. target_entry = self.wTree.get_object('phpids')
  1604. if target_entry.get_active() == False:
  1605. pass
  1606. else:
  1607. command.append("--Phpids0.6.5")
  1608. # get Technique: PHP IDS bug (0.7.0)
  1609. target_entry = self.wTree.get_object('phpids070')
  1610. if target_entry.get_active() == False:
  1611. pass
  1612. else:
  1613. command.append("--Phpids0.7")
  1614. # get Technique: Imperva
  1615. target_entry = self.wTree.get_object('imperva')
  1616. if target_entry.get_active() == False:
  1617. pass
  1618. else:
  1619. command.append("--Imperva")
  1620. # get Technique: WebKnight (4.1)
  1621. target_entry = self.wTree.get_object('webknight')
  1622. if target_entry.get_active() == False:
  1623. pass
  1624. else:
  1625. command.append("--Webknight")
  1626. # get Technique: F5 Big Ip
  1627. target_entry = self.wTree.get_object('f5bigip')
  1628. if target_entry.get_active() == False:
  1629. pass
  1630. else:
  1631. command.append("--F5bigip")
  1632. # get Technique: Barracuda
  1633. target_entry = self.wTree.get_object('barracuda')
  1634. if target_entry.get_active() == False:
  1635. pass
  1636. else:
  1637. command.append("--Barracuda")
  1638. # get Technique: Apache modsec
  1639. target_entry = self.wTree.get_object('modsec')
  1640. if target_entry.get_active() == False:
  1641. pass
  1642. else:
  1643. command.append("--Modsec")
  1644. # get Technique: QuickDefense
  1645. target_entry = self.wTree.get_object('quickdefense')
  1646. if target_entry.get_active() == False:
  1647. pass
  1648. else:
  1649. command.append("--Quickdefense")
  1650. # get Technique: Firefox
  1651. target_entry = self.wTree.get_object('firefox')
  1652. if target_entry.get_active() == False:
  1653. pass
  1654. else:
  1655. command.append("--Firefox")
  1656. # get Technique: Chrome
  1657. target_entry = self.wTree.get_object('chrome')
  1658. if target_entry.get_active() == False:
  1659. pass
  1660. else:
  1661. command.append("--Chrome")
  1662. # get Technique: IExplorer
  1663. target_entry = self.wTree.get_object('iexplorer')
  1664. if target_entry.get_active() == False:
  1665. pass
  1666. else:
  1667. command.append("--Iexplorer")
  1668. # get Technique: Opera
  1669. target_entry = self.wTree.get_object('opera')
  1670. if target_entry.get_active() == False:
  1671. pass
  1672. else:
  1673. command.append("--Opera")
  1674. # get Final code: Normal Payload
  1675. target_entry = self.wTree.get_object('normalfinal')
  1676. if target_entry.get_active() == False:
  1677. pass
  1678. else:
  1679. target_entry = self.wTree.get_object('payload_entry')
  1680. if target_entry.get_text() == "":
  1681. pass
  1682. else:
  1683. command.append("--Fp")
  1684. command.append(target_entry.get_text())
  1685. # get Final code: Remote Payload
  1686. target_entry = self.wTree.get_object('remotefinal')
  1687. if target_entry.get_active() == False:
  1688. pass
  1689. else:
  1690. target_entry = self.wTree.get_object('payload_entry')
  1691. if target_entry.get_text() == "":
  1692. pass
  1693. else:
  1694. command.append("--Fr")
  1695. command.append(target_entry.get_text())
  1696. # get Final code: DOS client side
  1697. target_entry = self.wTree.get_object('dosclient')
  1698. if target_entry.get_active() == False:
  1699. pass
  1700. else:
  1701. command.append("--Dos")
  1702. # get Final code: DOS Server side
  1703. target_entry = self.wTree.get_object('dosserver')
  1704. if target_entry.get_active() == False:
  1705. pass
  1706. else:
  1707. command.append("--Doss")
  1708. # get Final code: Base 64 POC
  1709. target_entry = self.wTree.get_object('b64')
  1710. if target_entry.get_active() == False:
  1711. pass
  1712. else:
  1713. command.append("--B64")
  1714. # get Final code: OnMouseMove event ()
  1715. target_entry = self.wTree.get_object('onmouse')
  1716. if target_entry.get_active() == False:
  1717. pass
  1718. else:
  1719. command.append("--Onm")
  1720. # get Final code: Iframe tag
  1721. target_entry = self.wTree.get_object('iframe')
  1722. if target_entry.get_active() == False:
  1723. pass
  1724. else:
  1725. command.append("--Ifr")
  1726. # get SAVE results option
  1727. target_entry = self.wTree.get_object('save')
  1728. if target_entry.get_active() == False:
  1729. pass
  1730. else:
  1731. command.append("--save")
  1732. # get Export xml option
  1733. target_entry = self.wTree.get_object('exportxml')
  1734. if target_entry.get_active() == False:
  1735. pass
  1736. else:
  1737. command.append("--xml")
  1738. command.append("xsser-test:" + str(datetime.datetime.now()) + ".xml")
  1739. # generate wizard commands
  1740. # step 1
  1741. if self.target_option != "":
  1742. command.append("-u")
  1743. command.append(self.target_option)
  1744. elif self.dork_option != "":
  1745. command.append("-d")
  1746. command.append(self.dork_option)
  1747. command.append("--De")
  1748. command.append(self.dorkengine_option)
  1749. # step 2
  1750. if self.combo_step2_choose == "1":
  1751. if self.payload_option != "":
  1752. command.append("-g")
  1753. command.append(self.payload_option)
  1754. elif self.combo_step2_choose == "2":
  1755. if self.payload_option != "":
  1756. command.append("-p")
  1757. command.append(self.payload_option)
  1758. elif self.combo_step2_choose == "3":
  1759. command.append("-c")
  1760. command.append("50")
  1761. command.append("--Cw")
  1762. command.append("3")
  1763. elif self.combo_step2_choose == "4":
  1764. command.append("-c")
  1765. command.append("20")
  1766. command.append("--Cw")
  1767. command.append("2")
  1768. command.append("--auto")
  1769. command.append("--Cl")
  1770. # step 3
  1771. step3_entry_proxy = self.wTree.get_object('step3_entry_proxy')
  1772. useragent = self.wTree.get_object('useragent')
  1773. if self.combo_step3_choose == "1":
  1774. command.append("--proxy")
  1775. command.append(step3_entry_proxy.get_text())
  1776. if useragent.get_text() == "Googlebot/2.1 (+http://www.google.com/bot.html)":
  1777. pass
  1778. else:
  1779. command.append("--user-agent")
  1780. command.append("Googlebot/2.1 (+http://www.google.com/bot.html)")
  1781. command.append("--referer")
  1782. command.append("http://127.0.0.1")
  1783. if self.combo_step3_choose == "2":
  1784. command.append("--proxy")
  1785. command.append("http://127.0.0.1:8118")
  1786. if self.combo_step3_choose == "3":
  1787. if useragent.get_text() == "Googlebot/2.1 (+http://www.google.com/bot.html)":
  1788. pass
  1789. else:
  1790. command.append("--user-agent")
  1791. command.append("Googlebot/2.1 (+http://www.google.com/bot.html)")
  1792. command.append("--referer")
  1793. command.append("http://127.0.0.1")
  1794. if self.combo_step3_choose == "4":
  1795. pass
  1796. # step 4
  1797. if self.combo_step4_choose == "1":
  1798. pass
  1799. if self.combo_step4_choose == "2":
  1800. command.append("--Hex")
  1801. if self.combo_step4_choose == "3":
  1802. command.append("--Mix")
  1803. if self.combo_step4_choose == "4":
  1804. command.append("--Cem")
  1805. command.append(self.cem_option)
  1806. if self.combo_step4_choose == "5":
  1807. command.append("--Str")
  1808. # step 5
  1809. if self.combo_step5_choose == "1":
  1810. pass
  1811. if self.combo_step5_choose == "2":
  1812. command.append("--payload")
  1813. command.append(self.scripts_option)
  1814. if self.combo_step5_choose == "3":
  1815. pass
  1816. # propagate the silent flag
  1817. if '--silent' in sys.argv:
  1818. command.append('--silent')
  1819. return command
  1820. def post(self, msg):
  1821. """
  1822. Callback called by xsser when it has output for the user
  1823. """
  1824. gtk.gdk.threads_enter()
  1825. self.post_ui(msg)
  1826. gtk.gdk.threads_leave()
  1827. def post_ui(self, msg):
  1828. """
  1829. Post a message to the interface in the interface thread
  1830. """
  1831. buffer = self.output.get_buffer()
  1832. iter = buffer.get_end_iter()
  1833. buffer.insert(iter, msg+'\n')
  1834. class XSSerThread(Thread):
  1835. def __init__ (self, cmd, mothership):
  1836. Thread.__init__(self)
  1837. self.app = xsser(mothership)
  1838. self._cmd = cmd
  1839. options = self.app.create_options(cmd)
  1840. self.app.set_options(options)
  1841. def set_webbrowser(self, browser):
  1842. self.app.set_webbrowser(browser)
  1843. def remove_reporter(self, reporter):
  1844. self.app.remove_reporter(reporter)
  1845. def add_reporter(self, reporter):
  1846. self.app.add_reporter(reporter)
  1847. def run(self):
  1848. self.app.run(self._cmd[1:])
  1849. if __name__ == "__main__":
  1850. uifile = "xsser.ui"
  1851. controller = Controller(uifile)
  1852. reactor.run()