Sponsored Content
Top Forums Shell Programming and Scripting Printf or any other method to put long string of spec characters - passing passwords Post 303007258 by elxa1 on Tuesday 14th of November 2017 02:18:28 PM
Old 11-14-2017
Printf or any other method to put long string of spec characters - passing passwords

Hello,

I am looking for a method to use in my bash script which allows me to use long strings with all special characters.

I have found that printf method could be helpful for me but unfortunately, when I trying
Code:
root@machine:~# tevar=`printf "%s%c" "'``fF/0,g_V/Y)>^.(a0(,%<A.`8N:q*Rd|lCy0t9N'FDPs|S,$2(^$/*>5Ush*w87L#m@t~:[Ple+=Od633Z3m3xGV.zX+a-N%x1K=J7gOO=?1c$HZU78iVtJG1N[s@-eH#DwH]V5l}??XWI.YJ;4%:LmAEML9%4jm'Y6GXTc{DT7Iia$!+/[x.),b]5`iO3E,-+,44+9Fke45Z=m^ba.EP^)+GqZ.uQNF*sU9'Kxq6i19+ie*6rZjjCC.2`rSYVqlmHlHqeFBCapXXSxXROXUrljMWGsicEdCdPJuvbXnPXlENaBzpMBnRgtGsFtTYbHsyilugLrTSTMvGDGqSIhXhJISqnIuBwxfqr`'" ; echo $tevar
-bash: błąd składni przy nieoczekiwanym znaczniku `)'

I am getting error
Code:
-bash: błąd składni przy nieoczekiwanym znaczniku `)'

What is important - I need to pass different length strings, I don't know the length, and the positions of special characters.
This is a password from my password list and I need find working pass to archive.

What can I do to pass very long stream with any special character as a string and put it as variable in bash script?

Or - maybe I can make it outside the bash ? I am using 7 zip command line tool where I need to put the password as parameter like

7z t -pP@55w0rd!

where P@55w0rd! is my password.

What was my fault before (long time ago)- I have had used almost 5000 characters in passwords. I have lot of possible passes in my dictionary, and I am sure, that one of them will be correct.

Last edited by rbatte1; 11-15-2017 at 07:10 AM.. Reason: CODE tags and spelling corrections
 

8 More Discussions You Might Find Interesting

1. Programming

How i can read a long integer from standar input and a string with as many characters as specified..

how i can read a long integer from standar input and a string with as many characters as specified in the number? i thing that i must use the read command ofcourse.... (6 Replies)
Discussion started by: aintour
6 Replies

2. Shell Programming and Scripting

SSH - Passing Unix login passwords through shell scripts

Hi All , I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B. The runscript_B.sh in calls another script runscript_A on server A itself. it seend, i need to be connect from Server A to Server B using ssh. I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies

3. Shell Programming and Scripting

Need help with spec. characters.

Hi., I need transfer as parameter into shell script some spec. characters, for example " or ' or & or \ at the end of second parameter. (this parameter used as changed password). How I can transfer it into shell script. Thanks Staas,. (5 Replies)
Discussion started by: beckss
5 Replies

4. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies

5. Programming

Passing printf formatting parameters as variables

Hi, I haven't programed in C in a few years. I have been doing a lot of shell scripting, I.E. not really programming anything heavy. :o That said, I have a script that gives hourly usage statistics for our email server. It runs w-a-y to slow as a script for my impatience, and needs to... (7 Replies)
Discussion started by: mph
7 Replies

6. Shell Programming and Scripting

Align with printf or other method

below line is one by one print audio_play PASS boot_check FAIL ethernet_change_mac NIC_82574L PASS gps_ublox_neo FAIL storage_bonnie USB2 PASS storage_copy_big_file USB2 PASS I would like below format ... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

7. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

Hi, I am using awk here. Inside an awk script, I have a variable which contains a very long XML data in string format (500kb). I want to pass this data (as argument) to curl command using system function. But getting Too many arguments error due to length of string data(payloadBlock). I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

8. UNIX for Beginners Questions & Answers

How to put a 80 character limit on a long topic line in markdown?

I have a topic line in markdown that spans more than 80 characters that i need to add a line break. Markdown is simply treating the line break as a brand new line instead of continuing as a topic line. Eg: # This is a very long line Markdown interprets it as This is a very long line (4 Replies)
Discussion started by: dragonpoint
4 Replies
Alien::Package::Rpm(3pm)				User Contributed Perl Documentation				  Alien::Package::Rpm(3pm)

NAME
Alien::Package::Rpm - an object that represents a rpm package DESCRIPTION
This is an object class that represents a rpm package. It is derived from Alien::Package. FIELDS
prefixes Relocatable rpm packages have a prefixes field. METHODS
checkfile Detect rpm files by their extention. install Install a rpm. If RPMINSTALLOPT is set in the environement, the options in it are passed to rpm on its command line. scan Implement the scan method to read a rpm file. unpack Implement the unpack method to unpack a rpm file. This is a little nasty because it has to handle relocatable rpms and has to do a bit of permissions fixing as well. prep Prepare for package building by generating the spec file. cleantree Delete the spec file. build Build a rpm. If RPMBUILDOPT is set in the environement, the options in it are passed to rpm on its command line. An optional parameter, if passed, can be used to specify the program to use to build the rpm. It defaults to rpmbuild. version Set/get version. When retreiving the version, remove any dashes in it. postinst postrm preinst prerm Set/get script fields. When retrieving a value, we have to do some truely sick mangling. Since debian/slackware scripts can be anything -- perl programs or binary files -- and rpm is limited to only shell scripts, we need to encode the files and add a scrap of shell script to make it unextract and run on the fly. When setting a value, we do some mangling too. Rpm maintainer scripts are typically shell scripts, but often lack the leading shebang line. This can confuse dpkg, so add the shebang if it looks like there is no shebang magic already in place. Additionally, it's not uncommon for rpm maintainer scripts to contain bashisms, which can be triggered when they are ran on systems where /bin/sh is not bash. To work around this, the shebang line of the scripts is changed to use bash. Also, if the rpm is relocatable, the script could refer to RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by adding code to the script to set RPM_INSTALL_PREFIX. arch Set/get arch field. When the arch field is set, some sanitizing is done first to convert it to the debian format used internally. When it's retreived it's converted back to rpm form from the internal form. AUTHOR
Joey Hess <joey@kitenet.net> perl v5.12.3 2011-06-11 Alien::Package::Rpm(3pm)
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy