Please Help friend on perl problem 
Author Message
 Please Help friend on perl problem

Can any of you guys tell me why this program wont work.
It's a simple news poster allowing header hacking.
  It seems to work, but no posts show up on usenet.
 I redirected output to a text file and it looked good. I
then used netcat to send the info in that text file to the
news server and it worked. I even typed in the commands from
that file in telnet, that worked also.
  It would seem im using the right posting commands.
It's connecting ok to the server, and quitting ok.
i added 3 seconds of sleep time after every command
to the server in case i needed some wait time.
i changed post commands to caps/no caps.
                   still nothing!
 Can anybody figure this out??

#!/usr/bin/perl
#perl news-poster
#
##################################################################
#                                                                #

#                                                                #
##################################################################


$server = 'news-server';                                        # change
this
$port   = 119;
$win    = 1;                                                              #
enter zero for unix/linux

# anything else for windows


    # cut and paste references
    # here if replying to a thread.

if ($win) {
    $win="Z";
  } else {
    $win="D";
  }
print "\n\n  Enter group to post to: \n\n";
 $group=<STDIN>;
 chop($group);
print "\n\n   Enter a subject for the post: \n\n\n";
 $subj=<STDIN>;
 chop($subj);
print "\n\n\n   Enter your message now:\n\n";
print "          Type \^$win on a by itself and press enter when done:
\n\n:";
print "    BE SURE TO NOT LEAVE ANY BLANK LINES AT THE END OF YOUR MESSAGE.
\n\n\n";

print "\n\n\n   Now add any headers you like on its own line,\n\n";
print "        Type ^$win on a line by itself and press enter when done:
\n\n\n";

print "\n\nAttempting to connect to server, please wait\n\n";

use Socket;
$iaddr  = inet_aton($server)                || die "no host reachable at:
$server";
$proto  = getprotobyname('tcp');
$paddr  = sockaddr_in($port, $iaddr);
socket(SOCK, PF_INET, SOCK_STREAM, $proto)  || die "socket: $!";
connect(SOCK, $paddr)                       || die "connect: $!";

print SOCK "post\n";

print SOCK "From: $from\n";
print SOCK "Newsgroups: $group\n";
print SOCK "References: $refer\n";

############ add permanent headers here#####################
print SOCK "Organization: Sons of Liberty\n";
print SOCK "{*filter*} CABAL\n";
print SOCK "{*filter*} NANAU\n";
############################################################
print SOCK "Subject: $subj\n";
print SOCK "\n";

print SOCK "\n.\n";

close(SOCK)                                 || die "close: $!";
exit;



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem

Quote:
>Can any of you guys tell me why this program wont work.
>It's a simple news poster allowing header hacking.

you forgot to

   use Net::NNTP;

--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem
could you rewrite it so it is right?need it badly thanx
velocity


Quote:


> >Can any of you guys tell me why this program wont work.
> >It's a simple news poster allowing header hacking.

> you forgot to

>    use Net::NNTP;

> --
> brian d foy
> Perl Mongers <URI:http://www.perl.org>
> CGI MetaFAQ
>   <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem

Quote:





> > >Can any of you guys tell me why this program wont work.
> > >It's a simple news poster allowing header hacking.

> > you forgot to

> >    use Net::NNTP;

> could you rewrite it so it is right?need it badly thanx
> velocity

He did rewrite if for you.  Just put the line he showed near the top of
your script.

--
Jeff



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem

Quote:

>could you rewrite it so it is right?need it badly thanx

                                     ^^^^^^^^^^^^^

As soon as your check clears.

Come to clp.misc to get _help_ writing programs.

Go to a newsgroup with "jobs" in its name  to hire someone
to _write_ code for you.

--
    Tad McClellan                          SGML Consulting

    Fort Worth, Texas



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem

Quote:

> ############ add permanent headers here#####################
> print SOCK "Organization: Sons of Liberty\n";
> print SOCK "{*filter*} CABAL\n";
> print SOCK "{*filter*} NANAU\n";
> ############################################################
> print SOCK "Subject: $subj\n";

You appear to have some non header items in your header there.

If you had used Net::NNTP you wouldnt have had this problem.

/J\
--
You tried your best and you failed miserably. The lesson is 'never try'.
--
fortune oscar homer



Wed, 18 Jun 1902 08:00:00 GMT  
 Please Help friend on perl problem

Quote:


> >could you rewrite it so it is right?need it badly thanx
>                                      ^^^^^^^^^^^^^
> As soon as your check clears.

So you would accept payment to write a tool for a Usenet spammer?

Quote:
> Come to clp.misc to get _help_ writing programs.

And if the purpose of the program is to perform unethical acts you
probably should try to conceal this fact.

Quote:
> Go to a newsgroup with "jobs" in its name  to hire someone
> to _write_ code for you.

Actually under the circumstances this is bad advice.  The OP would be
looking for someone who is prepred to work for a spammer.  Clearly the
simplest way to reach lots of people _and_ pre-filter out all the ones
whose ethics would prevent them working for a spammer is to spam the
job ad.  It will{*filter*}of thousands of people and get the OP booted off
any reputable ISP but that's not an issue to a spammer.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. HELP: "Email to friend" script

2. Dear friends, help in locking *.db databases

3. HELP: (please help, wizards) Memory problems

4. Problem with Perl CGI please help

5. CGI PERL problem..please help

6. Perl Magick make test problem - please help

7. ** Newbie has production Perl problem, please help **

8. Problem moving OS/2-Perl, please help

9. Problems with ActiveState Perl, please help.

10. Perl module problem, please help!!

11. Perl module problem, please help!!

12. problem with making perl - please help

 

 
Powered by phpBB® Forum Software