LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-05-2010, 09:23 PM   #16
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653

Looks like a change in function somewhere along the way .. it works on 2.5.2 but not on 2.6.3

(I think) I managed to get it filtering correctly, please change line 381 in sendphish to:

Code:
for abnetwaddr in `whois -h whois.abuse.net $targethost | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g ` ;
I haven't tested it thoroughly so if anyone can see anything wrong with the regex please speak up

cheers
 
Old 10-05-2010, 09:53 PM   #17
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Made the change, the below was logged into /tmp/sendEmail

Code:
Oct 05 21:42:22 cpollock sendEmail[13043]: DEBUG => Assigned $opt{} key/value: tls => auto
Oct 05 21:42:22 cpollock sendEmail[13043]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
Oct 05 21:42:22 cpollock sendEmail[13043]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.11566
Oct 05 21:42:22 cpollock sendEmail[13043]:[*] kbp_debug (to): current address: "info@kickme.to"
Oct 05 21:42:22 cpollock sendEmail[13043]:[*] kbp_debug (to): current address: "(for"
Oct 05 21:42:22 cpollock sendEmail[13043]: ERROR => Can't use improperly formatted email address: (for
Oct 05 21:42:22 cpollock sendEmail[13043]: HINT => Try viewing the extended help on addressing with "--help addressing"
The above was with this URL -

http://zyngabonus-gift-luckywinner.8bit.at/

however, another URL has no problems -

http://64.15.147.205/~onlinep2//Cent...enturyLink.htm
 
Old 10-05-2010, 11:35 PM   #18
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Would you mind redoing the test with the new line, it works with grep-2.6.3

Code:
cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
 
Old 10-06-2010, 06:13 AM   #19
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
I put the line in place of line 381 and get:

Code:
[chris@localhost ~]$ sendphish http://zyngabonus-gift-luckywinner.8bit.at/
/usr/local/bin/sendphish: line 384: syntax error near unexpected token `do'
/usr/local/bin/sendphish: line 384: `do'
This is how I put the line:

Code:
cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
actually did a copy/paste -
 
Old 10-06-2010, 11:27 PM   #20
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
No .. please replace with the line I posted before:

Code:
for abnetwaddr in `whois -h whois.abuse.net $targethost | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g ` ;
When I said please retry the test, that command was meant to be run at the command line like so:

Code:
cat <<'EOF'> /tmp/test.txt
blah1
info@kickme.to (for kickme.to)
blah3
EOF

cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
.. got it ?
 
Old 10-07-2010, 05:31 PM   #21
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Got it now,ran

Code:
# cat <<'EOF'> /tmp/test.txt
> blah1
> info@kickme.to (for kickme.to)
> blah3
> EOF
Then

Code:
# cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
and got

blah1,info@kickme.to,blah3
 
Old 10-07-2010, 06:16 PM   #22
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Perfect .. that's what we want, then as mentioned in post #16, please replace what was originally line 381 in sendphish with:

Quote:
for abnetwaddr in `whois -h whois.abuse.net $targethost | grep -v -e "default" | grep -o -E -e "^[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g ` ;
Note: the line probably won't be at 381 any more due to the debugging lines I asked you to add.

The only difference from the original line is the extra '^'

<edit> You may find it easier to grab a fresh copy of sendphish and modify that instead</edit>

cheers

Last edited by kbp; 10-07-2010 at 06:18 PM.
 
1 members found this post helpful.
Old 10-07-2010, 07:06 PM   #23
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
So far so good, I took my backup copy I'd made of sendphish and made the modification. I appreciate your help on this, I never would have figured it out. I'll keep an eye on the output as I go along but hopefully I won't see anymore addressing issues.

Chris
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run a shell script/cronjob when any email arrive to specific email address ikillu Linux - General 3 05-30-2009 08:18 AM
Very Newbie question, My system generated email are not being formatted in HTML dcarnold56 Linux - Server 1 01-20-2009 12:25 PM
Outgoing email improperly marked as spam by yahoo/msn terataz Linux - Server 6 08-22-2008 11:09 AM
Can I email (formatted) directly to a printer? ayhopkins Linux - Newbie 4 02-25-2008 02:58 PM
usb hard disk has 57% usage after formatted... sugar2 Linux - Hardware 2 08-10-2007 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration