WHAT THE ERROR ON MY CODE???

31 views
Skip to first unread message

נתי שטרן

unread,
Jun 28, 2022, 11:29:59 AMJun 28
to
import requests
from requests.structures import CaseInsensitiveDict

url = "https://api.crowdstrike.com/oauth2/token"

headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Authorization"] = "Basic
YjMwMzcwODY3NTUzNDMwNTg5NzA2MjkyNDFmMDE1YWY6VjNKYTk2Y1F4RTFzeTdYbzRnbkt0a2k1djhscXUyU01oSE5VWUwwRg=="

data = "POST"


resp = requests.post(url, headers=headers, data=data)

print(resp.text)
print(resp.status_code)


import requests
from requests.structures import CaseInsensitiveDict

MYurl = "
https://api.crowdstrike.com/intel/combined/indicators/v1?q=123.123.123.123"

headersa = CaseInsensitiveDict()
headersa["Authorization"] = "Bearer "+resp.text

resp1 = requests.get(MYurl, headers=headersa)

print(resp1.status_code)

Chris Angelico

unread,
Jun 28, 2022, 11:42:16 AMJun 28
to
‪On Wed, 29 Jun 2022 at 01:37, ‫נתי שטרן‬‎ <nsh...@gmail.com> wrote:‬
> headers["Authorization"] = "Basic
> YjMwMzcwODY3NTUzNDMwNTg5NzA2MjkyNDFmMDE1YWY6VjNKYTk2Y1F4RTFzeTdYbzRnbkt0a2k1djhscXUyU01oSE5VWUwwRg=="
>

The error is that you just revealed your credentials to the whole
world. This is a public mailing list.

In fact, you just revealed your credentials to TWO mailing lists at once.

Good job.

ChrisA

David Lowry-Duda

unread,
Jun 28, 2022, 11:48:16 AMJun 28
to
Please don't use all caps in the subject line. It comes across as if
you're yelling at the list --- this doesn't make people want to be more
helpful.

Instead, use meaningful, specific subject headers. Also, please be
precise and informative about what your problem is. It's not clear what
you expect your code to do or what happens differently than you expect.

On Tue, Jun 28, 2022 at 04:35:22PM +0300, נתי שטרן wrote:
>import requests
>from requests.structures import CaseInsensitiveDict
>
>url = "https://api.crowdstrike.com/oauth2/token"

Further, testing your code makes random api calls to some website, which
I'm disinclined to do without proper context.

For more advice, I suggest reading "How to Ask Questions" at

http://www.catb.org/~esr/faqs/smart-questions.html

- DLD

De ongekruisigde

unread,
Jun 28, 2022, 2:54:30 PMJun 28
to
I think the term 'script kiddie' applies here.


> Good job.
>
> ChrisA


--
Without followers, evil cannot spread.
[Spock, "And The Children Shall Lead", stardate 5029.5]

נתי שטרן

unread,
Jun 29, 2022, 1:33:17 AMJun 29
to
Sorry but i forgor to delete this token data

בתאריך יום שלישי, 28 ביוני 2022, מאת De ongekruisigde <
ongekr...@news.eternal-september.org>:
> --
> https://mail.python.org/mailman/listinfo/python-list
>


--
<https://netanel.ml>

Calvin Spealman

unread,
Jun 29, 2022, 3:34:59 PMJun 29
to
You also forgot to include any information about an error or problem you
got in using this code.

We can't help you if you don't have an actual question to ask.

‪On Wed, Jun 29, 2022 at 1:36 AM ‫נתי שטרן‬‎ <nsh...@gmail.com> wrote:‬

> Sorry but i forgor to delete this token data
>
> בתאריך יום שלישי, 28 ביוני 2022, מאת De ongekruisigde <
> ongekr...@news.eternal-september.org>:
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin....@redhat.com M: +1.336.210.5107
[image: https://red.ht/sig] <https://red.ht/sig>
TRIED. TESTED. TRUSTED. <https://redhat.com/trusted>
Reply all
Reply to author
Forward
0 new messages