Topic: "Linux Console" (page 1 of 2)

1 2 >
Author Post
theblacksheep
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Is there a way to copy text from/into the console?
I have some shellcode to execute and I don't want to write all that stuff.
Am I stupid?! It gotta be possible.

tns
private message EMail Website
quangntenemy
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Select the text, right click and copy/paste :D
It works for both KDE and GNOME
private message EMail Website
theblacksheep
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
I use Knoppix 3.4 and there it doesn't work.
So far i have tried all the normal stuff.
- Keyboard
- Mouse (left/right)

It is really anoying.
private message EMail Website
quangntenemy
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Hmm, weird, is it a live CD version? I'm pretty sure it uses KDE too. Have you tried this stuff from linkwikipedia:
QuoteQuote:
Left mouse button selects text, middle button pastes

To copy and paste text using a three button mouse:

1. Select the text that you want to copy and paste with the left mouse button, so that the text is highlighted.
2. Point to the place where you want the text to go.
3. Click the middle mouse button. The last selected text will be pasted from the X Window System's copy buffer into the place where you clicked.
private message EMail Website
michstreet
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
When you say you tried Mouse (left/right) you mean you selected some text and clicked on the console or wherever with both buttons at the same time?
If not, then try it. That is the way it works on my Linux :)
private message EMail
theblacksheep
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Thank you for your hints. I have changed back to Windows right now.
The next time I use Knoppix I am going to try that stuff.

tbs
private message EMail Website
belo
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Well if you want to test some linux stuff without leaving windows, you can try vmware player (virtual machine). It needs a virtual disk (a file actually) where you install linux. Then you can start the virtually machine and run linux.

You can create the startup file with vmxbuilder (http://petruska.stardock.net/software/vmware/). However, you will need a large ram to do it (doable with 512 .. 1Go is just fine)

Belo
private message
theblacksheep
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
It worked with the quangntenemy wiki method :piano:
I didn't realise that it is enough to select the text for copying it.

tbs
private message EMail Website
theblacksheep
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
I have another c / commandline question.
You can start a programm like this:

~>./programm `perl -e 'print "a"'`

This time the programm gets what it is handed to him by the
perl code.
Then I have started the same programm in a c file with:

execve("./programm", "programm", buf, NULL, env);

buf is: `perl -e 'print "a"'`
This time it seems like the programm deals with the perl stuff like
a normal string. Is there a way to get around that?
So that I can submit the perl stuff as buf and it is dealt with
as perl stuff.
private message EMail Website
belo
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
When you execute the program in the shell, it creates another shell to run the perl command and then append the result to the program command to start it. In the second example, you just give the print the string "perl -e ..".

If you want to run it the second way, you can use the popen system call (it launches a process a bind the output to a file descriptor you can read from).

So the program would look like this (i'm not sure of the order and arg ... just check man pages to be sure):

int file_desc = popen("perl -e ...");
read(file_desc, buf, 1024); // make a loop here to be sure you read all the output
execve("./programm", "programm", buf, NULL, env);

Belo

private message

Topic: "Linux Console" (page 1 of 2)

1 2 >