Chattanooga
Unix
Gnu
Android
Linux
Users
Group

 

Hot Topics:

Sponsoring:

silly perl one liner to randomize passwords

From: flushy@flushy.net
------------------------------------------------------
I was bored yesterday and a FB status spawned this:

sudo cat /etc/shadow | perl -pe 'sub r{$l=shift;open(R,"base64  
/dev/urandom|")||die$!;sysread(R,$R,$l*4);close(R);$R=~s/[^\w]//g;substr($R,0,$l)}@P=split/:/;if($P[1]=~/\/){$s=&r(8);$p=&r(16);$P[1]=crypt($p,"\\$$s");$

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ Oh god, is that really a Perl script? ...I don't think I want to learn it anymore. :P " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA

=============================================================== From: AverageSecurityGuy ------------------------------------------------------ For the sake of your sanity DO NOT LEARN Perl. Learn Bash for simple = stuff an Python for complex stuff. Let Perl DIAF. -- Stephen Haywood Owner, ASG Consulting CISSP, OSCP 423.305.3700 asgconsulting.co On Mar 5, 2014, at 4:20 PM, Alex Smith (K4RNT) = wrote: censured, the first thought forbidden, the first freedom denied, chains = us all irrevocably.' Those words were uttered by Judge Aaron Satie as = wisdom and warning... The first time any man's freedom is trodden on = we=92re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star = Trek: TNG episode "The Drumhead" /dev/urandom|")||die$!;sysread(R,$R,$l*4);close(R);$R=3D~s/[^\w]//g;substr= ($R,0,$l)}@P=3Dsplit/:/;if($P[1]=3D~/\/){$s=3D&r(8);$p=3D&r(16);$P[1]=3D= crypt($p,"\\$$s");$

=============================================================== From: DaWorm ------------------------------------------------------ There is a reason I've never tried to learn Perl, or Python, or ... C and Object Pascal (Delphi / FPC) and Forth get me by pretty well (and Forth can be made to look like that, if you are evil). Jeff.

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ Agreed. I'm in the process of learning Python and Ruby. I also need to build my shell scripting up a little more. That and awk. awk saved me in the data center, especially when parsing 12+ hard disks SMART data on a single host to identify failed disks. " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA f , ll r($R,0,$l)}@P=3Dsplit/:/;if($P[1]=3D~/\/){$s=3D&r(8);$p=3D&r(16);$P[1]=3D= crypt($p,"\\$$s");$

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ I learned to program starting with Pascal in high school (we used Turbo Pascal), then moved to C++ (using Turbo C++). Of course, in elementary school we used Logo and a little bit of Commodore BASIC. Oh god, has it really been that long? Yes, I'm not terribly old (I'm only 30) but I still can feel nostalgic just like the next man. :) " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA

=============================================================== From: Benjamin Stewart ------------------------------------------------------ I'd find it interesting to see a snippet of practical Forth.

=============================================================== From: Rod ------------------------------------------------------ me too! On Wed, 05 Mar 2014 17:33:13 -0500, Benjamin Stewart wrote:

=============================================================== From: Mike Harrison ------------------------------------------------------ On Mar 5, 2014, at 4:47 PM, AverageSecurityGuy = wrote: stuff an Python for complex stuff. Let Perl DIAF. In the world of making sense out of garbage data, perl is one of the = best tools out there. It depends on what you need to do.=20 While I don=92t use it very often any more, when I do, it is an = incredible tool for the job.=20 Disclaimer: And while I had to study it, I actually kinda understood = that one liner and the regex=92s and pipes involved.=20

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ I've occasionally had the temptation to learn either Haskell or Erlang. Maybe I'll take up one. :) " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA On Wed, Mar 5, 2014 at 5:33 PM, Benjamin Stewart wrote:

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ Yeah, that's my problem. All the regular expressions do is give me headaches, but only if they're beyond mere simple ones. " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA redible

=============================================================== From: Rod ------------------------------------------------------ I remember the perl script to decode dvd's. It was a popular end tag on emails. damn perl is some black magic. On Wed, 05 Mar 2014 18:16:18 -0500, Mike Harrison wrote: -- Using Opera's mail client: http://www.opera.com/mail/

=============================================================== From: Dan Lyke ------------------------------------------------------ On Wed, 05 Mar 2014 18:46:07 -0500 Rod wrote: Not gonna deny that Perl is some black magic, but if you format it and unwrap the "-p": # Reads 4x the argument count as base 64 bytes, substitutes out any # non \w ([A-Za-z

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ I know that it can be condensed into one statement, but what you just posted takes a HUGE load off my brain. Thanks for putting that up. :) " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA

=============================================================== From: Benjamin Stewart ------------------------------------------------------ I once started picking up Haskell, via http://learnyouahaskell.com. It's very interesting, and a different way to think, for sure. It's also kind of telling that you don't get to "Hello World" until chapter 9... On Wed, Mar 5, 2014 at 6:30 PM, Alex Smith (K4RNT) wrote:

=============================================================== From: Billy ------------------------------------------------------ And some FYI why I made some of those decisions.

=============================================================== From: Billy ------------------------------------------------------ I have some old heavily modded DikuMud source from year ~2000 that I still t= inker with. I've considered recreating it in python. It's amazing code. Single threaded Non blocking IO Event based Internal obj pools Even some arcane rand() impls back when knowing your processor could save yo= u lots of processor time. It's truly amazing. Messy. But amazing. At its peak in 1994, it served 500+ users on 1994 hardware. Epic. Sent from my iPhone rote: ery interesting, and a different way to think, for sure.=20 r 9... he first thought forbidden, the first freedom denied, chains us all irrevoca= bly.' Those words were uttered by Judge Aaron Satie as wisdom and warning...= The first time any man's freedom is trodden on we=E2=80=99re all damaged." -= Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Dru= mhead" Forth can be made to look like that, if you are evil).

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ Thanks for the info on Perl. I'm going to star this thread on my Gmail so I can refer to it whenever I decide to learn the language. :) Now if I can only figure out the lesson on Codecademy I'm stuck on, working with lists and dictionaries in Python. :P " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA l d all d

=============================================================== From: Jonathan Calloway ------------------------------------------------------ Learn you some erlang...... http://shop.oreilly.com/product/9781593274351.do Jonathan Calloway Sent from my iPad rote: he first thought forbidden, the first freedom denied, chains us all irrevoca= bly.' Those words were uttered by Judge Aaron Satie as wisdom and warning...= The first time any man's freedom is trodden on we=E2=80=99re all damaged." -= Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Dru= mhead" Forth can be made to look like that, if you are evil).

=============================================================== From: Sean Brewer ------------------------------------------------------ I 100% agree. Perl is still really really good at processing data, the thing it was made to do (surprise). It should be in your toolbox. On the Erlang note, give Elixir a try: http://elixir-lang.org/ The *creator* of Erlang is very positive about it: http://joearms.github.io/2013/05/31/a-week-with-elixir.html

=============================================================== From: "Robert A. Kelly III" ------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I do like Bash and Python, but I actually find Perl interesting. I've used very little of it, but it can clearly be a very powerful tool in the right hands. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTK0b2AAoJEFJIfKV7IxD6MaMP+QEZSM9av3JMk1gChcDOm/Ex ZLHPzI+Uzc+2JfnNNCAy1Q4XngdjcvU34ydpge4ruxJzhuY+4wHWADT9Ljsg8qbJ bIfN7PKdz/JCmtWBC59iUQ3Fzba4Xd/kDBYth8dGtb0eKDAsswVvIqfjNjRmvID5 QvVayYJEfUKtFsu80ssNY5FL2wu9Uw6K4ruGGIEbt/0nVodpADGHhbYeIcnPYGxI +BUpkqH+0mkcbvIZYAgiEjuh+K+fwzBf1OwDOLbl/YAi+AI0biWXxtNu5MRVN32Y 4c6OMaxFK59wsUl5UvHrJiElBdihleOdJj6+bZ+zuV0IXYc0xdFOmnt+S1lGnv3W fVajHrb7Cf31ReZn234HUv/+es0ra74w1PTetb+4qnBNBFUsvi/7QrcibWrpRBcU Yo7kLnZIo7UohvqKymrj8eDA6BDLmBVjTAgjDk+ttfzULQfU6hyNATInfkA+UVGW Kg4tWbYcaUWFxWr5GTU2GallgyVf+RZx6Uv5Gj7Ulo7ntBAFavgtBk4LD9M3d8Uw TkaDYSiVMTVN/W4bs4qAxvQpiV+poh9cPFwrc/upuzIsrviOtdcavmGGSvfbCPfN uqqsql9f+23EzLCM7/obNXkcFKiOlc7UZMrv+ON08a+/i3kJ7REvSd4NTdEVsRIM xNQmZXOtL7CBTu7GEzG6 =MzNO -----END PGP SIGNATURE-----

=============================================================== From: "Robert A. Kelly III" ------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256

=============================================================== From: "Alex Smith (K4RNT)" ------------------------------------------------------ Sorry for misusing my terms, but HERE COME THE DRUMS! The drumming in my head that kicks in every time I get the thought to learn Perl. ;) " ' With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and warning... The first time any man's freedom is trodden on we=E2=80=99re all damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG episode "The Drumhead" - Alex Smith - Dulles Technology Corridor (Chantilly/Ashburn/Dulles), Virginia USA