EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
paswdgenBy: toast - Date Submitted: 2009-04-04 04:31:24 #!/bin/bash # random password generator by typedeaF # This program has no "real" value other than introducing some bash concepts and putting them to use. # to strip the comments: cat this.file | grep -v '^# ' # Sets the maximum size of the password the script will generate MAXSIZE=50 # Holds valid password characters. # Put the non alph-numeric in single quotes so the program knows that it is part of the array and not a seperate part of the program. # Example if the # is not in a set of single or double quotes it will comment out any part of the line after the # symbol and will not reconize the characters as part of the array. array0=( q w e r t y u i o p a s d f g h j k l z x c v b n m Q W E R T Y U I O P A S D F G H J K L Z X C V B N M 1 2 3 4 5 6 7 8 9 0 '!' '@' '$' '%' '^' '&' '#' '*' '(' ')' '+' '-' '=' '|' '/' '<' '>' '~' '`' ':' ';' '[' ']' '{' '}' '|' ',' '.' '?' '_') # Used in conjunction with modulus to keep random numbers in range of the array size MODNUM=${#array0[*]} # Keeps track of the number characters in the password we have generated pwd_len=0 # Bash's command substitution syntax to store the results of the tput command term_clear=$(tput clear) # Stores the number of lines or rows on the terminal display max_lines=$(tput lines) # Stores the number of columns on the terminal display max_cols=$(tput cols) # Finds the appropriate spot to indent for horizontally centered output indent=$(( ((max_cols / 2)) - ((MAXSIZE / 2)) )) # Finds the vertical center of the terminal. line_num=$(( max_lines / 2 )) # Clear the screen echo $term_clear # The outer while loop starts at 0 and loops till MAXSIZE, creating a passwd char each iteration. # The shells $RANDOM variable creates a semi-random unsigned number. This is our entropy. =x # x simply holds some random unsigned int that will be used to make the character scramble. # 500 was choosen for speed and nothing else. Leave out the mod 500 if you want or change it. # The inner loop displays the password characters. Tput keeps the cursor in the proper position. # Mod MODNUM keeps the random number inside the size of the array so it doesnt over index. while [ $pwd_len -lt $MAXSIZE ] do x=$(($RANDOM%500)) y=0 while [ $y -lt $x ] do ((y++)) index=$(($RANDOM%$MODNUM)) tput cup $line_num $(( indent + pwd_len )) echo -n "${array0[$index]}" done ((pwd_len++)) done # Place the cursor at the bottom of the screen --where is usually at. tput cup $max_lines 0 exit 0
|
| Return to
bash category list |
|
|
Who Visited EnigmaGroup Today?
1504 Guests, 297 Users (189 Spiders)
theanonymous21, Taireegaddita, mongrel88, Taicadine, alexelixir, c_a13, Abhinav2107, hizImmoli, scifics, slchill, spartanvedicrishi, KELATALFTUS, kynapse, Tonyui, Hackpad, Epilioptiop, VireekadiaFap, Mamorite, IodindDog, brunoriversyhn, Effomeidonize, ReottphoffBom, arktek, burgeoningneophyte, TradaGreant, SlayingDragons, Waldlyeps, Arsenal, CJ_Omaha, CreedoFiegree, Ryuske, thethird3y3, todayadvila, pwnpwnlolz, NeetaexomYgom, ookami-namikaze, dot_Cipher, Unotohumsmush, SaubymorRoyab, bivaEmilltite, loltyg, Ausome1, Rik, hrangel, cyber-guard, Meonkzt, mori, 31415926, optioniLele, intorerse, FlifobbyFloks, Ios, saraf, Røgue, cossyDrybrich, IvanDimitriev, havisham, KIKNWING, fitz, fleeloCycle, hackboy302, strudels, CootoDorbeeft, gymnediny, hustleman9tv, comando300, Ysri13, thatoneguy, Paran0id, whoami, Pitanteerve, r0z4, Reapon, cls777, myfabregas, Afrika, suetekh, somebody777, floontiny, Frudopvia, jasonbourne, zombiehack640, CloverCipher, spoosh, Fraubbova, rulebreaker, dncjor, obencefoozy, Fintyoptots, viRuleNt, NipPaineHainy, TheHarrisonW, Jamesgo, TheGanjator, psychomarine, 1421carter, tingle65, claudius, Feld Grau, Partisan, Gunslinger, gydeqqzpn, yshiau, Zaccarato, chromoSone, priovasashCor, ellisp, GothicLogic, keetone, M0rdak, UsedDeteKef, nhorton, archestraty, HatriteBeft, JC06dc5, alpha1, spg, dark_void, wakazi, mtroscheck, TheCheeseDemon, ach.n30, sahariar, hervelegeraf, Psiber_Syn, hackaday, Mod777, neompenly, pollolololo, SnoopSky, Cigmimifs, DrOptix, ProloG-Shaman, unicornrainbow, cheapnikeshoxog, bobsters, foofthoorgo, polemarchos, avacraft, spencerwilliams23, lotato, ryanjcrook, dollerolf, robintenboden, rospark, WexEmbet, BeefSupreme, Hessesian, whydoyoulook, cdpirate, DnA-Ender, CaNcEr, zheincnoob, Vengeance987, justforfun363, RawTeefecycle, Squissesk, aVoid, SaMTHG, neodude, Marion1p, Ops, ddxc, BlAd373, Klosse, khamhou, samsatHD80, PauffPubadvic, AnnaNoult, SexyCreerve, newb1, robster1977, Blizer, Dudleypagrove, Mr_KaLiMaN, FirewallPenetrator, GMo, Seasharp, mrchicken1, Zaxem, N4g4c3N, MaxMeier, Ian, sander.ashwin, Predatorc, lonely.connection, ElEnfermado, wavyd, dirkdanblue, cve916, drag0n, kalak55, a1los, jell0, Exclaw, veceattainc, Muselele, Mr Pacifist, stylish007, zach, litbk, closednetwork99, soroimmuror, memoryshot, PlaneReaction, Wamemanytex38, DieAble, d0seN_36b, jeremy.whitson, lol, nefeolnb, Noticon, statix, anandoump, RomeoG, advilapyday, snorapa, Gkjt, autotuneuser, beanulpinee, 2142, kiklopas, door51, Pizza, deepakkumar, makler2004, M4rcy, Xargos, bdkoenig, Blavatsky, m4f10, Huasca, itsme, xu_lain, Nikhil, ChewBigRed, samxoxo, incicaMaidits, toudioria, Chidokage, Jigoku, cesecyclelm, schn1ffl3r, sam20000, learning, kentora, San Marino, Nightraven, zanydouner, FrofErrodslot, FatalEror, wheaties, akki, AlexDiru, unclejos666, override101, blink_212, uncowstientee, lilkpoigogs, Innonaenupt607, Killshot, ZheIncKnight, ActictGlync, acarseflalk, ___, trashsporn, Memartent, Zoorsornaks, z3z3, heyhey123, Ghajnm, usaliaPels, Ordeptpen, pelly, quellense, Szuba, nmobin27, lamb, x1rt4m, ToutousaRulty, vipervince2002, mannavard1611, BinaryShinigami, Duchdund, afgnumgt, Anatissa, greatg, darkfire1515, bennyblanco5000, Mmmett50, ToryLogsEsoff, impalwinona, Kelsfednege, ensubbrut, ant0601, Alpha0mega, pbarwim |
| |
|
|
|
|
|