General :: Basic Shell Codes Using C Language
Mar 10, 2010I'm doing my project on shell designing, so can I know the basic shell (any shell in linux) codes using c language with few commands implemented on it.
View 2 RepliesI'm doing my project on shell designing, so can I know the basic shell (any shell in linux) codes using c language with few commands implemented on it.
View 2 RepliesI'd like to know some good resources, links, e-books to learn basic Linux system administration scripting. I know how to write very basic BASH shell scripts so I'm still at beginner level. There are so many docs out there that I'd like to narrow down people's opinion's on the best easy to understand resources that are available. Eventually I'd like to learn basic PERL as well.
View 3 Replies View RelatedI have written some shells scripts. They basically create ssh tunnels between a my box and numerous nodes on a cluster. Which then allows me send Linux commands and receive output from far away nodes on my cluster.
E.g. Script:
Code:
#linux_command="uname -a"
#Create tunnel
[code]....
I am learning exploit development and learning some stuff about shellcodes now! The shellcode is absolutely right and have tested it. I am using the following code...(created by me) to run my shellcode..
Code:
// #include<stdio.h> we will not be needing this as we are not using any functions from the C library...Just basic logic of Pointers..
char shellcode[] = "x31xc0xb0x01x31xdbxb3x07xcdx80"; // basic exit shellcode
int main()
{ int *ret; // a simple integer pointer pointing a address
ret = (int *)&ret + 2; // change the address pointed by
(*ret) = (int)shellcode; }
Compiling :-
Code:
aneesh@aneesh-laptop:~/articles/C$ gcc test.c -o test -fno-stack-protector
Compiling gives no errors as expected..
Now the problem I am facing is that As I run the program :-
Code:
aneesh@aneesh-laptop:~/articles/C$ ./test
Segmentation fault
Strace output :-
Code:
aneesh@aneesh-laptop:~/articles/C$ strace ./test
execve("./test", ["./test"], [/* 37 vars */]) = 0 .....
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78016c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xf5e000, 8192, PROT_READ) = 0
mprotect(0x8049000, 4096, PROT_READ) = 0
mprotect(0x15c000, 4096, PROT_READ) = 0
munmap(0xb7802000, 81274) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
I have some feeling that its because the program has no access to the memory containing the shellcode (May be???)..
I think I put this in the wrong place
View 1 Replies View RelatedI'm trying to create a super simple shell script, but I cant get a return line. The shell script looks like this (only the part that matters)
Code:
yes '' | ssh-keygen
The idea being it will put in a blank char. Then enter until the program finishes. The problem is, it only does the first time, the next 2 times I have to hit enter, it requires me to input it manually (which is exactly what I'm trying to avoid).
The full script (if you care):
Code:
#!/bin/sh
# Created by Omega
# First, program creates RSA key, named id_rsa and id_rsa.pub
# Second, program send the public code to requsted server.
echo 'Removing old id_rsa key (if applicable)'
rm -rf ~/.ssh/id_rsa.pub
rm -rf ~/.ssh/id_rsa
echo "Creating RSA key"
yes '' | ssh-keygen
# Checking if ssh-kkeygen created requested file
if [ -e ~/.ssh/id_rsa.pub ]
then
echo 'Done'
echo 'Username and Server in: me@server format'
read var1
echo 'Port Number? If standard put 22'
read var2
ssh-copy-id -i ~/.ssh/id_rsa.pub "-p $var2 $var"
else
echo ''
echo 'ERROR, ssh-keygen did not execute correctly'
echo 'Retrying...'
echo ''
echo 'Please leave all options default (just press enter)'
ssh-keygen
if [ -e ~/.ssh/id_rsa.pub ]
then
echo 'Done'
echo 'Username and Server in: me@server format'
read var1
echo 'Port Number? If standard put 22'
read var2
ssh-copy-id -i ~/.ssh/id_rsa.pub "-p $var2 $var1"
else
echo 'ERROR, ssh-keygen did not execute correctly'
echo 'Quitting'
exit
fi
fi
# End
I'm using openSUSE 11.1 I have to install downloaded zlib-1.2.5.tar.gz via Shell. First I have to unzip and then instal. Can anyone write here the sorted codes of Shell for installing?
View 1 Replies View Relatedi recently got a french msi wind U100x running on linux suse enterprise 10 sp1. (i am french and wanted a light netbook with french keyboard)i am totally new to linux and i believe that msi wind is not helping.because i am more used to english for settings, i set the main language to english, but it seems that it automatically reconfigures my keyboard mapping to english as well, so that azerty becomes qwerty.i reset it back to french, so now my keyboard is french, but so is the system.is there a way to differentiate keyboard from main user setting language?
View 3 Replies View Relatedi am looking for "shell script" book from basic to advance. since i am novice in linux i want to play around with it
View 4 Replies View Relatedi needed to implement leach protocol in ns2using linux redhat but i need the codes for leach protocol
View 2 Replies View RelatedI am interested to know solutions for ns2 problems.Basically i am doing mini project using ns2.
View 1 Replies View RelatedI'm trying to get this rather troublesome (and poorly made, I might add) game to work correctly, and right now it has frozen to a black screen with a frozen cursor. I can't figure out how to shutdown X, but while this game is frozen as it is, I might as well figure out what the process status SL+ means. If anyone has a link to a list of process status codes and their meanings
View 1 Replies View RelatedWhere can i find a list of cronjob return codes for linux/unix
View 1 Replies View RelatedWhere would i find the list of distribution codes.For example.Code:samba-32bit-3.4.2 -1.1.3.1.x8664.rpmIn above rpm file it is indicated that its release is 1.1.3.1 .The rpm is meant to be run for opensuse.Where would i get the linking of release number and In simple words How would i guess distribution by merely looking at rpm name?
View 2 Replies View RelatedI have some music in another language, but when I open the songs in Banshee, their song names just come up as weird characters (like μ).I went to [System --> Administration --> Language Support] and installed support for that language, but the songs still come up like μ. (But in Nautilus, their proper names show).
I know the solution is to change my whole system language to that language, but I don't want to do that, as I am not very fluent in it. Is there any way to enable support for that language while keeping English as the language used to display my desktop?
One computer .... three users .... three languages. How do you make that happen? User A speaks English and is happy with English. No problem. User B needs to use Chinese and would like the full system in Chinese. User C needs to use Thai and Chinese. They would prefer their menus to be in Thai and can use iBus for Chinese entry. How do you set up the system so that each user can select their system language when they login?
View 4 Replies View Relatedis there some way to change keyboard language to specific language by hotkey?
For example:
Shift+Alt+1 - English
Shift+Alt+2 - Russian
Shift+Alt+3 - Ukrainian
While installing Ubuntu 10.10 I chose the wrong language for my keyboard. I tried to fix this in keyboard preferences and it seemed to work. The correct one I need is USA (and don't know exactly the difference between USA and USA alternative international). But every time I boot my laptop I get the old language back (Dutch) while USA is above the others in my preferences.
View 1 Replies View RelatedWhen I boot the fedora system,disable the plymouth,the language of booting message showed is english.Can it change to other language,chinese?
View 2 Replies View RelatedMACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.
View 2 Replies View RelatedI took the simple approach and installed the gnome desktop, but I have read about KDE and Xfce and am curious. There may be a lot more that I just haven't heard about yet too. So the question is: Without doing a reinstall and messing up the downloads and settings I have now, how do I try a new desktop like Xfce or Kde? Also, what are the basic differences between the desktops?
View 9 Replies View RelatedBasic 256 starts up but after entering a few characters like print "hello" it stops responding. I have tried it on 3 machines, two running Ubuntu 10.04 and one 10.10.
View 3 Replies View Relatedwhat r the distribution terms of linuxwhat r the advantage of oprn sourcewhat r the bassic commands of linuxwhat r the directories of linuxwhat is file system in linux
View 5 Replies View RelatedI would like know when it is necessary or advisable to write a shell script instead of shell function ?
View 3 Replies View RelatedI am thinking in starting a CentOS based distribution for communication (call center) and collaboration (IM, email, calendar) tools. What I want to find is Where to get CentOS-only base packages?Any post related with creation of a CentOS based distribution?
View 1 Replies View RelatedWhat I have done wrong with my escaping here:
Code:
The original filename is:
Code:
I am planning to download/install latest Ubuntu Desktop version this week. How to install additional Applications in Ubuntu in case I will need some. BTW, the old HDD I will be using is pre-installed with Debian so I need to do a "Fresh_install". I know how to use RPM in RedHat but I think in Ubuntu its a different thing. Is there any particular website to download these additional Apps?
View 3 Replies View Relatedi donot know basic commands used in terminal as to install,, to remove a software etc
View 8 Replies View RelatedMy new VPS is running Debian 5.0 (bash 3.2.29), and some commands seems to be missing. For example the ps command is not here, neither is ls (but dir works). Is there a package missing or what's the deal?
:~# type ps
ps is hashed (/bin/ps)
:~# ps
[code]....
I am trying to write a basic script on a linux box to do the following:change the timezone to UTC. I will need to make sure /etc/sysconfig/clock only has the following:
HWCLOCK=-u
SYSTOHC=yes
TIMEZONE=UTC
[code]....