self - hosted usenet poster with python

2020-01-14 Thread aa
#!/usr/bin/envpython3
#   torsocks

import nntplib
s= nntplib.NNTP( 'news.samoylyk.net')
hh   = nntplib.decode_header("=?ISO-8859-15?Q?D=E9buter_Py?=")
print(hh)

#resp, count, first, last, name = s.group( 'free.willey')
#print('Group', name, 'has', count, 
'articles, range', first, 'to', last)

#resp, overviews = s.over((last - 3, last))
#for   id, over in overviews:
#   pass
#   print(id, nntplib.decode_header(over['subject']))  #
comp.lang.python.narkive.com.

x =f = open('usenet_post.txt', 'rb')   # all relevant headers set   
groups.google.com/forum/#!forum/comp.lang.python
e = s.post(f)

#resp,  descs = s.descriptions('alt.*')
#print   (  len(descs))
#print   (  descs.popitem()   ) # 
'alt..fred-hall-is-a-piece-of-shit', 'Fred Hall is a piece of shit'

s.quit()
'''
the file   usenet_post.txt with these headers originally:

Path:
From: aa 
Subject: self - hosted usenet poster with python
Newsgroups: comp.lang.python
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=ISO-8859-1
Date: Mon, 13 Jan 2020 01:00:00 GMT
Lines: 25
Organization: pythonista.org
X-Newsreader: python 3
X-No-Archive: no
X-User-Key:   py
X-User-Signature: python spam now comes to comp lang py as well

'''
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: self - hosted usenet poster with python

2020-01-14 Thread Chris Angelico
On Tue, Jan 14, 2020 at 7:01 PM aa  wrote:
> Content-Type: text/plain; charset=ISO-8859-1

Why?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem using pip

2020-01-14 Thread Julie
 not allowed to
> install webbrowsing and OS module it show the error that it does not found
> any matching distributor and does not fount the version which can fulfill
> the requirement. 


usually the py2 and py3 repos get mixed up

make sure you know whether u handle py2 or py3 case

retry until it works

like


   python3 -m pip install --upgrade SOME_LIB  --user
-- 
https://mail.python.org/mailman/listinfo/python-list


self - hosted usenet poster py script - pretty cool, 20 lines only

2020-01-14 Thread aa
#!/usr/bin/envpython3
#   torsocks

import nntplib
s= nntplib.NNTP( 'news.samoylyk.net')
hh   = nntplib.decode_header("=?ISO-8859-15?Q?D=E9buter_Py?=")
print(hh)

#resp, count, first, last, name = s.group( 'free.willey')
#print('Group', name, 'has', count, 
'articles, range', first, 'to', last)

#resp, overviews = s.over((last - 3, last))
#for   id, over in overviews:
#   pass
#   print(id, nntplib.decode_header(over['subject']))  #
comp.lang.python.narkive.com.

x =f = open('usenet_post.txt', 'rb')   # all relevant headers set   
groups.google.com/forum/#!forum/comp.lang.python
e = s.post(f)

#resp,  descs = s.descriptions('alt.*')
#print   (  len(descs))
#print   (  descs.popitem()   ) # 
'alt..fred-hall-is-a-piece-of-shit', 'Fred Hall is a piece of shit'

s.quit()
'''
the file   usenet_post.txt with these headers originally:

Path:
From: aa 
Subject: self - hosted usenet poster with python
Newsgroups: comp.lang.python
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
Date: Mon, 13 Jan 2020 01:00:00 GMT
Lines: 25
Organization: pythonista.org
X-Newsreader: python 3
X-No-Archive: no
X-User-Key:   py
X-User-Signature: python spam now comes to comp lang py as well

'''
-- 
https://mail.python.org/mailman/listinfo/python-list


self - hosted usenet poster py script - pretty cool, 20 lines only

2020-01-14 Thread aa
#!/usr/bin/envpython3
#   torsocks

import nntplib
s= nntplib.NNTP( 'news.samoylyk.net')
hh   = nntplib.decode_header("=?ISO-8859-15?Q?D=E9buter_Py?=")
print(hh)

#resp, count, first, last, name = s.group( 'free.willey')
#print('Group', name, 'has', count, 
'articles, range', first, 'to', last)

#resp, overviews = s.over((last - 3, last))
#for   id, over in overviews:
#   pass
#   print(id, nntplib.decode_header(over['subject']))  #
comp.lang.python.narkive.com.

x =f = open('usenet_post.txt', 'rb')   # all relevant headers set   
groups.google.com/forum/#!forum/comp.lang.python
e = s.post(f)

#resp,  descs = s.descriptions('alt.*')
#print   (  len(descs))
#print   (  descs.popitem()   ) # 
'alt..fred-hall-is-a-piece-of-shit', 'Fred Hall is a piece of shit'

s.quit()
'''
the file   usenet_post.txt with these headers originally:

Path:
From: aa 
Subject: self - hosted usenet poster with python
Newsgroups: comp.lang.python
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
Date: Mon, 13 Jan 2020 01:00:00 GMT
Lines: 25
Organization: pythonista.org
X-Newsreader: python 3
X-No-Archive: no
X-User-Key:   py
X-User-Signature: python spam now comes to comp lang py as well

'''
-- 
https://mail.python.org/mailman/listinfo/python-list


self - hosted usenet poster py script - pretty cool, 20 lines only

2020-01-14 Thread aa
#!/usr/bin/envpython3
#   torsocks

import nntplib
s= nntplib.NNTP( 'news.samoylyk.net')
hh   = nntplib.decode_header("=?ISO-8859-15?Q?D=E9buter_Py?=")
print(hh)

#resp, count, first, last, name = s.group( 'free.willey')
#print('Group', name, 'has', count, 
'articles, range', first, 'to', last)

#resp, overviews = s.over((last - 3, last))
#for   id, over in overviews:
#   pass
#   print(id, nntplib.decode_header(over['subject']))  #
comp.lang.python.narkive.com.

x =f = open('usenet_post.txt', 'rb')   # all relevant headers set   
groups.google.com/forum/#!forum/comp.lang.python
e = s.post(f)

#resp,  descs = s.descriptions('alt.*')
#print   (  len(descs))
#print   (  descs.popitem()   ) # 
'alt..fred-hall-is-a-piece-of-shit', 'Fred Hall is a piece of shit'

s.quit()
'''
the file   usenet_post.txt with these headers originally:

Path:
From: aa 
Subject: self - hosted usenet poster with python
Newsgroups: comp.lang.python
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
Date: Mon, 13 Jan 2020 01:00:00 GMT
Lines: 25
Organization: pythonista.org
X-Newsreader: python 3
X-No-Archive: no
X-User-Key:   py
X-User-Signature: python spam now comes to comp lang py as well

'''
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: self - hosted usenet poster py script - pretty cool, 20 lines only

2020-01-14 Thread Chris Angelico
On Tue, Jan 14, 2020 at 7:31 PM aa  wrote:
> X-User-Signature: python spam now comes to comp lang py as well
>

Can you post to a test newsgroup instead? Please?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: NNTPlib apps work like a charm

2020-01-14 Thread 황병희
Julie  writes:

> why is anybody using anything else than Py for usenet ?

Only i use Python3 making Message-ID within Gnus.
https://gitlab.com/soyeomul/Gnus/raw/master/thanks-mid.py

Sincerely,

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: self - hosted usenet poster py script - pretty cool, 20 lines only

2020-01-14 Thread 황병희
Chris Angelico  writes:

> On Tue, Jan 14, 2020 at 7:31 PM aa  wrote:
>> X-User-Signature: python spam now comes to comp lang py as well
>>
>
> Can you post to a test newsgroup instead? Please?

By the way, he is trying new experimental thing.
Actually i like his trying and NNTP.

Sincerely, NNTP fan Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Pieter van Oostrum
[email protected] writes:

> I have a wordpress 5.3 websites which sell a software with license key.
>
> The license key is encrypted and stored in Mysql table. there are 2 columns 
> "license" and "hash":
>
> license_key   
> def50200352f5dc4bd8181a9daebbf4f9177fe725111a5a479d64636d01c2a10074e0c645abe898dea18210af563a5334288420551ab61c18ca4506cd03aa5d2bdd40933ddf7ca4d4b61b1c0f58a3830cbe0891cf4ff526311d5d637a55a574eca2c3a1b487b56
>
> hash
> 9498cbf8bf00d6c55e31f98ba6d8294afa3127a84f31aa622c4158ac7377c6dd
>
Slightly off-topic:

Why would you store *both* an encrypted key and a hash?
If you have the encrypted key in the database and the encryption key on your 
site (presumably in the Python code) and your site is hacked, all the license 
keys are potentially in the open.
And if your key is on the site you can as well encrypt the entered license key 
and compare it to the stored encrypted key.

end off-topic

> My python program get an input for user (the license key in string
> without any encrypton) and need to compare it with the official license
> key stored in Mysql database of our Wordpress website.
>
> I read a lot of hashlib python, functions and methods. But I didn't find
> anywhere how could I "hash" the string input typed by user with some
> hash values from the table, in order to compare both values (the input
> license and the license stored in mysql table).

This supposes Python 3:

Let's assume the entered key is in ASCII and stored in the variable 'key'.

from hashlib import sha256
key = bytes(key, 'ascii')
hash = sha256(key).hexdigest()

Now you can compare hash with the stored hash in the database. Of course this 
only works if that stored hash has been calculated in the same way from the 
same key.

On Python 2 (which you shouldn't use) you can leave out the "key = bytes(key, 
'ascii')" part.

You can of course make it more sophisticated, for example by using a salt. 
Unless your keys are extremely valuable, I wouldn't bother with that.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem using pip

2020-01-14 Thread Jerry Hill
On Tue, Jan 14, 2020 at 2:18 AM proplayer raj
 wrote:
>
> dear team
> I have encountered a problem while using pip , that it did not allowed to
> install webbrowsing and OS module it show the error that it does not found
> any matching distributor and does not fount the version which can fulfill
> the requirement.

Can you be specific about which modules you are trying to install?  I
don't see any sign of a python package called 'webbrowsing' anywhere
on the internet, for instance.  Are you possibly looking for the
'webbrowser' module?  If so, it's not installed via pip, it's part of
the python standard library (see docs here:
https://docs.python.org/3/library/webbrowser.html).  There's also an
'os' module in the standard library
(https://docs.python.org/3/library/os.html). Are those the modules you
were looking for?

-- 
Jerry
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem using pip

2020-01-14 Thread proplayer raj
Yes, that's it. Thanks for your help

On Tue, Jan 14, 2020, 7:47 PM Jerry Hill  wrote:

> On Tue, Jan 14, 2020 at 2:18 AM proplayer raj
>  wrote:
> >
> > dear team
> > I have encountered a problem while using pip , that it did not allowed to
> > install webbrowsing and OS module it show the error that it does not
> found
> > any matching distributor and does not fount the version which can fulfill
> > the requirement.
>
> Can you be specific about which modules you are trying to install?  I
> don't see any sign of a python package called 'webbrowsing' anywhere
> on the internet, for instance.  Are you possibly looking for the
> 'webbrowser' module?  If so, it's not installed via pip, it's part of
> the python standard library (see docs here:
> https://docs.python.org/3/library/webbrowser.html).  There's also an
> 'os' module in the standard library
> (https://docs.python.org/3/library/os.html). Are those the modules you
> were looking for?
>
> --
> Jerry
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread dieter
[email protected] writes:
> I have a wordpress 5.3 websites which sell a software with license key.
>
> The license key is encrypted and stored in Mysql table. there are 2 columns 
> "license" and "hash":
>
> license_key   
> def50200352f5dc4bd8181a9daebbf4f9177fe725111a5a479d64636d01c2a10074e0c645abe898dea18210af563a5334288420551ab61c18ca4506cd03aa5d2bdd40933ddf7ca4d4b61b1c0f58a3830cbe0891cf4ff526311d5d637a55a574eca2c3a1b487b56
>
> hash
> 9498cbf8bf00d6c55e31f98ba6d8294afa3127a84f31aa622c4158ac7377c6dd
>
>
> My python program get an input for user (the license key in string without 
> any encrypton) and need to compare it with the official license key stored in 
> Mysql database of our Wordpress website.
>
> I read a lot of hashlib python, functions and methods. But I didn't find 
> anywhere how could I "hash" the string input typed by user with some hash 
> values from the table, in order to compare both values (the input license and 
> the license stored in mysql table).

Contact the person responsible for the data in your database.
Ask him which hashing algorithm should be used to verify the
license info provided by a user against the database info.

Note: there are many different hashing functions (e.g. "md5", "sha1",
"sha256", ...) and often their use involves an additionl secret
(besides the hashed data). Best get those details from a
knowledgable person than from us.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Growth Hacking Formation

Thanks for your help.

Litle details,

the license key is goldQ3T8-1QRD-5QBI-9F22

and it is stored in database already encrypted.
License key is not saved in database with clear text. It is already encrypted. 
I am not sure what is this hash column for?

License key =>
def50200962018b6bbed50fc53abca6bb076eb2947fc379e69bd38dcea9f8fbe29eedd43f1148e721d5f6657d8d0152356f5a7ba566dde545a9a354c7b42af88fe4ea7775a4e2ee1a26d8b8f7e3272cf5a8bbe38197fdf19e1726d5e2d769bae408cd511706388abad5a75

hash =>
25138e045e9f50022331340a26d0eecbd0d7ca6bfefee0275749025c4f56c3a8
see screenshot:
http://prntscr.com/qnhz8h

I thought the "hash" column was the key to encrypt or decrypt the license 
stored in column "license_key".


So I run your code for testing with appropriate licese key:
Python Code: 
1
2
3
4
5
6   from hashlib import md5, sha256, sha512
 
key = 'goldQ3T8-1QRD-5QBI-9F22'
 
for hash_func in (md5, sha256, sha512):
print(hash_func(key.encode()).hexdigest())
and it give this outpu:
Output:
ecc58b55c33fe6dfe3b49d6d63aad65b
f67e701240fbd964aa9a0eb81e2f549b8e3dd97e1aa3b1f5796fd12cd9b14005
8288f635fbab6d6511fc5aa63caf153fa434b3d351612cdf48dcf6abea4275cde5f0d6fffda2e7c6fd42350483603cf6959dd62c946eea2b75eca9f60a5cf5b7

Process finished with exit code 0
As you can see, here the code doesn't give same result than database.

===

Regarding wordpress login, I didn't find any python library which can can 
handle this authentification process.

I contacted the developper, and he replied me this message:



Hello @formationgrowthhacking,
thank you for your message and for using my plugin.
For license key hashing, I implemented the PHP native method hash_hmac(), using 
the sha256 algorithm.
You can check out the class which is responsible for encryption, decryption, 
and hashing here:
https://plugins.trac.wordpress.org/browser/license-manager-for-woocommerce/trunk/includes/Crypto.php
Let me know if this helped!
###

But he may not know python. I need help of python expert.

Does this update help for better understanding my issue?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 1 line demo

2020-01-14 Thread songbird
Sam Olyk wrote:

...

  while all of this is interesting to a point please
use a suitable nntp test group available instead of 
spamming this group.

  optimally the best would be to set up your own
local server and then test using that.

  thanks


  songbird
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Chris Angelico
On Wed, Jan 15, 2020 at 10:54 AM Dennis Lee Bieber
 wrote:
>
> On Tue, 14 Jan 2020 10:02:08 -0800 (PST), Growth Hacking Formation
>  declaimed the following:
>
>
> >
> >Hello @formationgrowthhacking,
> >thank you for your message and for using my plugin.
> >For license key hashing, I implemented the PHP native method hash_hmac(), 
> >using the sha256 algorithm.
> >You can check out the class which is responsible for encryption, decryption, 
> >and hashing here:
> >https://plugins.trac.wordpress.org/browser/license-manager-for-woocommerce/trunk/includes/Crypto.php
> >Let me know if this helped!
> >###
> >
>
> https://www.php.net/manual/en/function.hash-hmac.php
> """
>  key
>
> Shared secret key used for generating the HMAC variant of the message
> digest.
> """
> ... Which implies that one needs to know another key to generate the hash
> of the input data. I suspect the author of your database system will not
> reveal that key (check the source code referenced by the author and see if
> you can find a key for use in the hash function).
>

I had a squiz at the linked-to source code, and it looks like the
corresponding key is stored in a file. Whether that actually
constitutes an improvement in security, I can't say. But to be
compatible, you would have to read the same file.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


pretty cool way of posting

2020-01-14 Thread me

30 lines of bash with 1 py3 line.

all u need for usenet !
   



-- 
https://mail.python.org/mailman/listinfo/python-list


pretty cool way of posting 2

2020-01-14 Thread me

30 lines  of bash with 1 py3 line.

all u need   for usenet !
   



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 1 line demo

2020-01-14 Thread 황병희
> suitable nntp test group available ...

There is one suitable group: gmane.test

Plus somebody already know. Gmane NNTP address changed since 2020-01-06.

news.gmane.org ===> news.gmane.io [*]

Sincerely, NNTP fan Byung-Hee

[*]
https://lars.ingebrigtsen.no/2020/01/06/whatever-happened-to-news-gmane-org/

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


Help

2020-01-14 Thread kiran chawan
Whenever Iam trying to run this 'New  latest version python software 3.8.4
python ' but it doesn't show any install option and it say ' modify set up
' So tell what to do sir plz help me out.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help

2020-01-14 Thread Igor Korot
Hi,

On Tue, Jan 14, 2020 at 10:46 PM kiran chawan  wrote:
>
> Whenever Iam trying to run this 'New  latest version python software 3.8.4
> python ' but it doesn't show any install option and it say ' modify set up
> ' So tell what to do sir plz help me out.

Please explain why are you trying to install python second time?

Thank you.

> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Growth Hacking Formation
Thanks for helping. That is what I thought.
Lets say it is the case and I get the key. We know it uses sha256 and it apply 
to the ascii code.
What should be the python code in this scenario?
I am novice and the hash python module is a bit too complex for me. I read the 
doc.

Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Chris Angelico
On Wed, Jan 15, 2020 at 5:41 PM Growth Hacking Formation
 wrote:
>
> Thanks for helping. That is what I thought.
> Lets say it is the case and I get the key. We know it uses sha256 and it 
> apply to the ascii code.
> What should be the python code in this scenario?
> I am novice and the hash python module is a bit too complex for me. I read 
> the doc.
>
> Thanks.

Look at the source code for the PHP module. Find the parts you need.
My guess is that every hash-related function they call will have a
direct equivalent in Python.

Welcome to the wonderful world of porting code that you don't truly
comprehend :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list