Fresh Grasshopper Seeking Knowledge on inputing awk scripts and working with them?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Fresh Grasshopper Seeking Knowledge on inputing awk scripts and working with them?
# 8  
Old 02-14-2019
You must receive your password at the output
Code:
awk 'BEGIN {RS="[[:space:]]+"; ORS="\n"}
/[[:punct:]]/ && /[[:digit:]]/ && /[[:lower:]]/ && /[[:upper:]]/ && /_/ {print}' story.txt

Without applying brute force, i.e. bruteforce

--- Post updated at 20:44 ---

This means that the password was created by a knowledgeable person in accordance with all security rules. And since the password is in the list of words in the story, we can find it by the presence of certain characters - "punctuation, upper and lower case characters, numbers and underscores"

Last edited by nezabudka; 02-14-2019 at 04:19 PM..
# 9  
Old 02-14-2019
Quote:
Originally Posted by sub terra
I have the username.
Wouldn't it have been nice to mention that in your introductory post? Plus the tool / command you use to connect to the server.

Quote:
I am not sure if I follow.
Nor do I.

Quote:
If your saying the code I posted will work then I am doing something wrong.
I'm sorry, I never said that. I didn't comment at all on your code as it was posted after me posting. Looking at it now, the second will print sort of a word list, but with duplicates and punctuation characters. Not sure what you want to do with it.



Let's start over. Please rephrase your request not in prose but in a concise, detailed, data supported, IT related specification. Like (let me try to paraphrase what I understood from your post #1):
  • Need to connect to a server using the (ssh / telnet / rlogin / ...) tool / protocol and a known username.
  • The password is hidden in a text file.
  • Create a deduplicated word list from that file and use this for repeated login attempts.
  • The server has these ... password restrictions (to eliminate improbable candidates)
  • The server will pause logins after ... failed login attempts.
  • On successful login, retrieve an e-mail address form ... file.
  • Logout
  • Mail success message to retrieved address before date / time


Correct, adapt, and complete to suit your needs, and post again. The we can discuss.


Quote:
Let me ask you what you put in. What is that?
If you're asking about the proposal I made in post #2 for getting a word list from a text file: The input to tr (man tr !) is redirected ( < , man bash or other shell) from a file "textfile".
As any other info on how to continue was missing in your post #1, that is where I had to stop.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Scripts imported from UNIX to Linux are not working

Hi, Recently we migrated our app from Unix to Linux platform. All our shell scripts which use to work in Unix platform are not working in Linux now. below is such sample script. I tried removing trailing spaces, but no luck. dear experts kindly help.. #############BEGIN############### split... (7 Replies)
Discussion started by: laxman_bly
7 Replies

2. Shell Programming and Scripting

Inputing info from a CSV file and filling a template file

Hi, I have a .csv file that contains a variety of fields for 60 clients: USERNAME, PASSWORD, and COMMENTS. I have a template file which contains a great deal of data for each client and has the fields USERNAME, PASSWORD, and COMMENTS that has to be filled with the values of USERNAME,... (1 Reply)
Discussion started by: mojoman
1 Replies

3. UNIX for Advanced & Expert Users

Awk expressions working & not working

Hi, Putting across a few awk expressions. Apart from the last, all of them are working. echo a/b/c | awk -F'/b/c$' '{print $1}' a echo a/b/c++ | awk -F'/b/c++' '{print $1}' a echo a/b/c++ | awk -F'/b/c++$' '{print $1}' a/b/c++ Request thoughts on why putting a '$' post double ++... (12 Replies)
Discussion started by: vibhor_agarwali
12 Replies

4. Shell Programming and Scripting

cron job is not working for two scripts

Hi Gurus, I have a test unix server in which currently some unix cronjob are running. I have written two script one is a shell script in which env variable are there (in that i am exporting those variables). I have also written a perl script . when i am running at the shell manually like... (5 Replies)
Discussion started by: sanjay.login
5 Replies

5. Shell Programming and Scripting

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (3 Replies)
Discussion started by: maxlee24
3 Replies

6. Red Hat

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (1 Reply)
Discussion started by: maxlee24
1 Replies

7. UNIX for Dummies Questions & Answers

alias not working in scripts

Hi All, PF below details, > cat run.sh #!/usr/bin/ksh alias ll="ls -l" > ./run.sh > ll ksh: ll: not found. Pls help on this? Thanks in Advance, Naga :cool: (2 Replies)
Discussion started by: Nagapandi
2 Replies

8. Shell Programming and Scripting

awk: seeking to bytes

can I seek to a particular byte in a file and replace it using awk? if so, how? (8 Replies)
Discussion started by: karyn1617
8 Replies

9. Shell Programming and Scripting

how to use ssh without inputing a password

hi, i am writing a script ssh root@192.168.0.200 ls -l , ssh always prompts me to enter a password, how to suppress it ,just like using rsh thanks (3 Replies)
Discussion started by: bugbugbug
3 Replies

10. Shell Programming and Scripting

Why passwd isnt working in shell scripts?

I had to write a script to change my login password, and the script wasnt working fine. When I searched through the previous postings in this forum, I got the solution (using 'expect' tool). But I would like to know why passwd command isnt working in scripts? (1 Reply)
Discussion started by: Deepa
1 Replies
Login or Register to Ask a Question