Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Your previous post talked about "writing to stdin". What does that mean, if I can ask?
If you run tac with no arguments, it takes its input from stdin.
no it does not first of all it does not output to screen meaning it does not write to stdout unlike cat but i also know it does not write to stdin for the following reason,
i am interested in pentesting and so i practice my hacking a small quirk of shells that are created out of exploited binary's is that they do not provide you with a way to input into them because of that a popular trick has developed where you execute your exploit and then call cat and then pipe it into the program you pass arguments to cat which passes them to stdin and then returns the programs output to stdout that looks something like this
Code:
(python exploit.py ; cat) | /whatever/vuln
however that trick does not work with
Code:
(python exploit.py ; tac) | /whatever/vuln
at first i thought it might just not write to stdout since it did not seem to do that normally either but i tried to create a directory out of the shell and it did not appear leading me to conclude it does not write to stdin or stdout sorry if this was a bit convoluted
DESCRIPTION
Write each FILE to standard output, last line first.
With no FILE, or when FILE is -, read standard input.
You should look at tac's source code to find out why it doesn't work the way you want it to for your hack.
The hack aside, please provide two commands, cat and tac-based, that anyone can run in their terminal and which illustrate your point as to the difference between the two.
In order to reverse the lines, tac must first read all its input and see EOF. I'm not sure what you expect your example to do. With that semicolon in the command line, neither cat nor tac is processing the output from "python exploit.py" -- it's reading from the terminal. Perhaps that's what you intended, but you have to type a ctrl-D to get any output from tac.
DESCRIPTION
Write each FILE to standard output, last line first.
With no FILE, or when FILE is -, read standard input.
You should look at tac's source code to find out why it doesn't work the way you want it to for your hack.
The hack aside, please provide two commands, cat and tac-based, that anyone can run in their terminal and which illustrate your point as to the difference between the two.
thanks for the feedback i added the second example
In order to reverse the lines, tac must first read all its input and see EOF. I'm not sure what you expect your example to do. With that semicolon in the command line, neither cat nor tac is processing the output from "python exploit.py" -- it's reading from the terminal. Perhaps that's what you intended, but you have to type a ctrl-D to get any output from tac.
yes that's what i meant just reading input from the script is not the point the point is to create a way to interact with the program by piping cat into it as to ^D i did not realise that you are correct
If I wanted to look at a file containing command history to find out what caused a crash, I would not be pleased if I had to wade through hours of old commands before I found the culprit, especially at 3 O'clock in the morning.
If I wanted to look at a file containing command history to find out what caused a crash, I would not be pleased if I had to wade through hours of old commands before I found the culprit, especially at 3 O'clock in the morning.
Oh yes? wait for megabytes of unnecessary data to be transmitted over the web!!
I would guess you have never had to do support from home!! Even on call out it is nice to have some clue as to what you are going to work for at that time of the morning.
Oh yes? wait for megabytes of unnecessary data to be transmitted over the web!!
I would guess you have never had to do support from home!! Even on call out it is nice to have some clue as to what you are going to work for at that time of the morning.
how slow is your internet connection ? i mean granted i have never read huge files of remote networks but its ssh for crying out loud
In real terms??
About 1 megabyte per second if I am extremely lucky.
No I do not live in the middle of nowhere; I just happen to be able to see two exchanges from my front door, but the nearest cabinet is just under a mile away and is overloaded since a new estate is being built without a new cabinet.
I did think about fibre, but I would have to pay for ftp to be installed since ftc would go to the same cabinet and not improve matters much above 1.7 megabyte per second.
I just happen to live in a street that was having the drains replaced when BT installed FTP in this area so it wasn't installed. I did look into buying a strip of land from the house behind mine that fronts onto a street that does have FTP, but they wanted a stupid price and would not grant access rights for fibre.
In real terms??
About 1 megabyte per second if I am extremely lucky.
No I do not live in the middle of nowhere; I just happen to be able to see two exchanges from my front door, but the nearest cabinet is just under a mile away and is overloaded since a new estate is being built without a new cabinet.
I did think about fibre, but I would have to pay for ftp to be installed since ftc would go to the same cabinet and not improve matters much above 1.7 megabyte per second.
I just happen to live in a street that was having the drains replaced when BT installed FTP in this area so it wasn't installed. I did look into buying a strip of land from the house behind mine that fronts onto a street that does have FTP, but they wanted a stupid price and would not grant access rights for fibre.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.