-
December 16th, 2004, 06:04 AM
#1
The first program I've ever written.
This is something I wrote without copying out of a book. I'm not a coder, I believe I've made that clear, but anyway, I think my program shows Slackware and Simplicity are good in coding.
I made this to test the chance that I might be able to make a checking tool that will go over and do a couple checks on my system, and so far:
SUCESS!
--------------------------------------
#!/usr/bin/perl
print
"Hi, a mail has been sent to user gore with an Nmap scan.\n";
system "nmap -sT 127.0.0.1 | mail gore";
----------------------------------------------
^ KISS
I'm using system rather than exec, because well I just learned about exec 10 minutes ago. Some of you may remember I bought a Perl book in the summer. Well I got to look at it for a whole day before school was back in and work, making it REALLY hard for me to learn it. So last night I picked the book back up and now I've been learning Perl for a total of 2 hours. That's including the hour and a half I did in the summer before school, and now a half hour last night.
I made it for proof of concept mainly, as in "Will it work if I do it?" And it does. This is the start of my next project. I can make it do an nmap scan and mail the results to me, so maybe next I'll make it use a password crack on my /etc/passwd file and see if I can make it scan my host and detect weak passwords. If I can keep adding to it maybe I'll have a simple check tool for use.
-
December 16th, 2004, 10:49 AM
#2
Since I'm just learning shell scripting with Bash I can say the same program would've worked really well as a .sh Don't ask me to write it right now though... too high.
/  \\

-
December 16th, 2004, 12:46 PM
#3
I don't really think that qualifies as a program, but hey. You have to start somewhere. Congrats.
I would personally say, you might want to read a little more up on system though.
That and look into `
It will make what you are doing easier.
-
December 16th, 2004, 12:49 PM
#4
it is nice to see you know very little about programming gore, otherwise i might have thought a comment from you on another thread about my C tutorials:
Written BY and FOR people who don't know ****
might have really meant something, but appearantly you don't know **** yourself
-
December 16th, 2004, 12:54 PM
#5
Let's see... no fancy 'hacks' or sanity checks
Code:
printf "Mail dispatched to gore with results of scan" && `nmap -sT 127.0.0.1 | mail gore`
I realize that maybe the ` aren't necessary but what the heck, just to make sure...
My nicest 'shell script' was a one line command...
Code:
root@inaequitas # rm -f `find / -empty .keep`
or something like that... [think it was something more though]
Sorry gore, not trying to take you away of the spotlight... I'm just excited about my study into shell scripting, that's all
/  \\

-
December 16th, 2004, 03:44 PM
#6
Re: The first program I've ever written.
Originally posted here by gore
This is something I wrote without copying out of a book. I'm not a coder, I believe I've made that clear, but anyway, I think my program shows Slackware and Simplicity are good in coding.
What does it have to do with Slackware??
Chris Shepherd
The Nelson-Shepherd cutoff: The point at which you realise someone is an idiot while trying to help them.
\"Well as far as the spelling, I speak fluently both your native languages. Do you even can try spell mine ?\" -- Failed Insult
Is your whole family retarded, or did they just catch it from you?
-
December 16th, 2004, 08:31 PM
#7
-
December 16th, 2004, 08:47 PM
#8
-
December 16th, 2004, 10:06 PM
#9
Originally posted here by gore
I skipped a lot of chapters until I came to the part on system and exec because well, that was what I wanted to do I guess. I'll go back to them after I play with these.
That's why I'm saying that you could use shell scripting for this, since it's mostly Bash commands [and well system commands but they get called through bash].
Although I used to do the same thing as you in C code since I was lazy to write batch file...
P.S. Please spell my name in lowercase 
P.P.S. Well enjoy code! There are some nifty things you can do with two lines of perl [well one if you like obfuscation], 10 lines of C or a screenfull of Java
/  \\

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|