Results 1 to 9 of 9

Thread: The first program I've ever written.

  1. #1
    Senior Member gore's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    7,177

    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.

  2. #2
    Senior Member
    Join Date
    Jul 2003
    Posts
    813
    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.
    /\\

  3. #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.

  4. #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

  5. #5
    Senior Member
    Join Date
    Jul 2003
    Posts
    813
    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
    /\\

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,255

    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?

  7. #7
    Senior Member gore's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    7,177
    Originally posted here by White Scorpion
    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:

    might have really meant something, but appearantly you don't know **** yourself
    Oh come on you HAD to know I was joking by now.

    Hyrponix, no big deal.



    Chsh, nothing much, but it was written on the Slackbox And, seriously, do they get more simple than mine That's like a whole line or so lol. Next step is for making it use crack.

    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.

  8. #8
    Originally posted here by gore
    Oh come on you HAD to know I was joking by now.

    of course i knew, i just waited for my oppertunity to get back at you, and here it is

  9. #9
    Senior Member
    Join Date
    Jul 2003
    Posts
    813
    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
  •