gtkcontroller.py 80 KB

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