#programming
1 messages Β· Page 35 of 1
You are correct
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
/* shouldn't it be this? */
header .top-bar {
/* no style */
list-style: none;
.
.
.
}
/* use a custom string */
header .top-bar::before {
content: "$>";
}
What's the html code for that list?
unfortunately it still doesnt work
Sorry, I ain't familiar with that wp_* functions
Could you provide the .html file from the browser?
/* remove the dots */
header .menu > li {
list-style: none;
}
/* remove the spacing from the start */
header .menu {
padding-left: 0;
}
Is this what you are looking for?
i dont think so...
i did not fix my problem
would you like to hop in vc so that you get more info ?
Didn't it remove dots and remove the padding at the left?
nope
What do you mean by centered?
It did work for me in Firefox π
but you dont have all these php files
and css and all this stuff
it might be a bug
What was causing the issue?
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
anyone here who's starting THM course from basic?
?
ok?
ai for tetris
lit
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?
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
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
Usually the leading zero nibbles are dropped when converting to hex
But that's just a convention for readibility I think
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
#!/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
im trying to bruteforce a local binary with bash script, but I can't get my head around that if block, why is it executing the else block if var53 == access denied?
btw full var is ```Please enter your PIN code:
12341000
8
Checking PIN...
Access denied.
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
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
Python has a nice csv module with functions like reader()
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
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
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
fair
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.....
Hey, does try hack me have bash scripting tutorial?
.
Thxπ¬
no rep, LoL.

+rep
Gave +1 Rep to @tropic minnow
-rep
Hi everyone what is a great python book to start with?
usually good advice π
Thanks infloop ill check it out mateπ π
I've actually done the course with python on coursera,
really good stuff
I use the docsπ
What is the best use of C in modern day?
pic micro controller programming, the linux kernel is still written in C
Where expertise and deep knowledge of program execution is needed
Hello, some people to can help me in visual basic ?
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)
Just ask your question, you don't need permission π
I get data of a db, I create a csv and I write a xlsx, I want a label which increases for each line writed
Sorry for my bad english...
So its need to be dynamic
but idk how to do that
Best approach would be to break down each section you need and then check out stackoverflow for people who have done it before you
Why no modify the CSV?
LABEL, foo, bar
0, ...
1, ...
2, ...
...
yes I know but idk how make the question to stack overflow xD
when I said label, its the graphical text
in vb
You don't ask a question on stack overflow, everything you need has already been done
just in smaller sections
yes, but the question to google to get the answer xD

"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
I write this but its with a button not a function
legit you may want to take a look at a vb tutorial or something
If I go to discord its bcs I already go on google
it's literally <labelname>.text = "INSERT WHAT YOU WANT HERE
ok so each line you write
yes
label.text = label.txt + 1
but if I do that
just increment it
Wait so you wanna just print out the final "x lines wrote?"
no
Do you even know what you want?
Tryhackme #programming channel
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.
Locations related to the variable (num) the cursor is at?
Many IDEs will color code in the scroll bar for errors, warnings, or add a color dependent on where the cursor currently is. It's really helpful, for example, if one is refactoring and forgets to use the refactor tool
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
There's GitHub.dev/code spaces where it's all happening in a remote machine/your browser but not sure if it was additionally paid outside of just browsing the code
It basically is vscode in a browser synced with GitHub repo and additionally a cloud instance
Ctrl + ., is that it?
But they won't be able to run those projects, will they?π€
yes, or only "." on any repo. but as you said, the downside is you can't run it. only good if you want to change something minor like a typo, otherwise a rather useless feature tbh
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 too
We could run the tests, but mehπ
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
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?
You need to have your projects as repositories on GitHub.
Then you can access them from a different machine by cloning it - git clone <remote-url>
So, you will have to upload them to the cloud (GitHub)
yes, look into git cli
not directly from vscode but from a command line
Anyone code's in c language 
Just started with C, currently learning pointers in it
@hazy hedge That's great bro 
@hazy hedge We'll I Code C some time, and other languages to
Sure, why not π
π
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?
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.
private repo for my cpp projects
That's exactly what you said the first time. If you aren't willing to disclose what kind of repo, nothing we can say will make any kind of sense for your use case.
Eh a github repo?
i mean its not a secret lol i just want to keep my cpp projects from class in there π
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?
priv repo on github
and the actual git docs on submodules
I think, they are talking about CP (Programming) projects
A repo containing the directory of each project should be enough π
okay cool ill check that out, i have them in folders for now but i assume the submodules are better
yea c++ programs
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
because for example, a project can have some files it reads from so i dont want it to get conused
What you're saying doesn't make any sense.
i have multiple programs, each with their own respective files they read from
So they are opening and reading files from disk to perform some kind of processing?
sure
It's really bad practice to include static config files or data files as part of your repo.
i submit my work externally so it doesn't really matter
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
Something like in/testcase-1.txt, out/correct-1.txt
Yes, I doπ
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?
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?
If the file is open in the program, why would it get mixed with other running programs?
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
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
Hey anyone have any experience in app development?
(please just ask your question instead of something so vague and general that noone will answer)
luv this: https://dontasktoask.com
Maybe that was the question π€·ββοΈ
Lol that was the question I was just curious
the answer is very likely then
Lol I donβt know nothing about programming and this is hard
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 ^^
Gave +1 Rep to @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
Gave +1 Rep to @magic falcon
I love this programming world but I donβt know almost anything .How can I start learning the basic things?
Get an idea for a project. Pick a language. Start solving the problems.
Hey guys, here's my 2 cent on programming language and cybersecurity in general
I hope you like it, and I appreciate any constructive criticism β€οΈ
https://link.medium.com/WLfWUW5ymob
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; }
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
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
Oh, yeah. Make it static
which one ?
I gotta test itπ
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;
}
Could you please write it properly? π
Or perhaps, share you solution.c
sure i will take a screenshot now
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 ^^
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
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
you'll probably want to look at tcp sockets
yes it's ok about this, I just want to see if people as already do this, and give source
it should be pretty close to a one-liner
Here's one, not a one-liner though - https://gist.github.com/yougg/b47f4910767a74fcfe1077d21568070e
I'm a fan of Freecodecamp. I learned fullstack web dev thru them. I would use their python program, especially completing the projects. I learned lots doing the javascript and react projects for front end and microservices.
Between the 3 python program chosing "scientific computing" is the correct one right?
Xctβs xc is like the most overkill version of what youβre asking for https://github.com/xct/xc
data analysis and machine learning are the other 2. I think machine learning is like robotic so thats probably not it ^^
Yes, with Dr. Chuck. He's really good. @cunning path
I did python2 (years ago) taught by him.
ah cool : ) ye i think i have "enough" to start. I have the book to look at and the freecodecamp series
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.
thanks !
Gave +1 Rep to @plucky helm
Thanks for the advice @waxen lotus π
Gave +1 Rep to @waxen lotus
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 .
please put your code in the ``` tags please
#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
the only other single digit ones would be 5 and 6 I think
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
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";
}```
that's a poorly written solution and/or the coder was attempting to be clever...
I can't differentiate but I'm certain that it's better than my code
yeah but I like to have the braces even though they aren't strictly necessary, it makes things clearer
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?
https://doc.rust-lang.org/reference/expressions/closure-expr.html I think it's a closure?
Ok, now I get a bit of it. Thanks. Is it just me or Rust does have some really weird and cumbersome syntax?
I don't know rust, I just know google π
|&i| is a closure parameter. It specifies that we just want to take reference ( as there is & ) of value and use it by variable name i. And then inside the closure, we can do processing on i.
In simpler words, you can think closure as a anonymous function and &i as a parameter passed to that function.
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 
rust has an odd syntax for sure
anyone here knows about the Openssl (c) lib?
I know that compiling it is hell.
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
The api docs are awful, i agree.
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
Response headers or request headers?
request in this case
Are you making a Client, Server or both?
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
How are you checking if it's encrypted?
How large is it?
it's small atm
Mind sending it in a DM? I just don't want to clutter the channel haha
I need some advice on a college project i am making.. I am trying to build a website. The workflow is
- User enter an IP address
- I use nmap lib in python for a port scan
- And then provide CVE ids as an output to the user, the target is vulnerable to..
Is it possible to implement the third step?
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.
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..
As a heads up: this is not an easy project. I did something similar last year. The scanning is very easy. Connecting to an external DB to deal with CVEs is very hard.
nmap --script-vuln is easy though
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
True
Btw can i just use nrich command line tool by Shodan using os Library
?
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
Nmap has XML output, not sure if it does for the scripts.
os.system() is awful practice, but yes. I would be more worried about the fact that Shodan can only do public IPs myself
https://gitlab.com/shodan-public/nrich
Check this out once and can you please advise if its a viable option
I am still in the learning stages of python. I am well versed with socket scripting and newbie exploit writing. os.system() is something off the top of my head
It's, uh, not recommended
I first thought of using Metasploit pro api key but that's 15K dollars a year lol
Could you suggest me something better? Frankly I just need to get this done so i Don't fail the semester due to this project
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
I can't back out as i am the only one person in the team as noone in my college is interested in Cybersecurity studies. I am the only one trying to do a Cybersecurity subject
Well, why not choose a different cybersec project?
Or keep it as a port scanner. That's still useful
Could you suggest one? I can't go keylogger because some people in my class already ripped off this project from the internet. I tried to do something different and now on the verge to fail this semester
What's the project specification?
Nothing. They are just asking us to make a project which is presentable. We were allowed to choose subjects in the 2nd year (a year ago) and now asked to present it to our professors
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
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
Yes exactly. I can change the project and present an entirely different project.
Could you suggest something?
I was thinking about this but failed eventually because i didn't know it'd be this complex
When's your deadline to have this one?
15-20 days from now
That's really pushing it for a moderately difficult but clearly defined project.
I am lost as of this moment. I need to figure out something better than this i guess
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
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.
Alright.. I'll try my best. Thanks for the support π
Gave +1 Rep to @magic falcon
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
I know, I'm kidding π
agreed on that. I've only gone more when I had very clearly defined goals and a week thinking about it
and no major integration issues...
...and I don't decide to try to do something stupid like homebrew my own DI
Or have to re-write the db schema to make the api work....
luckily I don't have to worry about directly attacking my DB, because $VENDOR did that for me...poorly mind you, but still
brutal
it's a bad scene in development when the db schema is part of the agile practice
I don't want to know what the actual schema looks like, but I'm betting it's autogenned
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
that's what migration scripts are for...
damnit Juun, you'd be fun to drag along to a pub I think π
lol
You are making the assumption that migration scripts work past the initial one-off use case
wait they don't?
damnit
Nah, I'm just bad at migrating the data
oh ok
my usual strategy is dump to CSV, run a couple ETLs to get the data into the new expected format, and re-ingest
Hello
I suppose that works
Does someone know HTML here?
Okay so, I wanted to move an image NOT a text in the file (index.html) not style.css, does someone know how?
What exactly do you mean by that?
Look for base64 encoded image src attributes
you were able to parse that? hats off...
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!
@lunar ember Just ask your question! Several of us have CS backgrounds
I'm enjoying the Bash Scripting Room.
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?
No, you can't use it like that.
It scans the internet
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?
VPS?
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
DO would be a VPS effectively
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?
Very true, I think I just needed to get an external opinion. DO looks like it's probably the best solution
It scans public IPs.
Our ISP does assign us a public IP no? That's how we are able to access the internet. Am i right?
I think you need to do a lot of reading about NAT and IP addressing before carrying on with this project
I have done it thoroughly! But i am just thinking silly doubts lol. Ignore me π
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!
Source ID -10ef60f0-3c9f-4b45-8e15-08da1318f608
hi there can you guys/gals suggest some tools to find vulnerabilities in source code (C#)
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,
@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
Do you currently work in a security or software testing role?
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? 
What category of tool would this scan fall under?
rather what category of activity?
Ok... but what is the name of this activity?
assignment 3 ;-;
There's a formal name used in industry that refers specifically to this kind of source code review
should i post the source code file?
No
okie
It's for an assignment, distributing the source code beyond your class may be considered cheating or a violation of the student ethics code
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
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
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.
oh i just need info about the tools
id find the answers myself
if that seems reasonable
ohky ill try it
Just use this instead... https://security-code-scan.github.io/
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?
let me try to look if he mention anything about the category
how do i know if its C#
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.
i literally have 0 knowledge about programming but i know we use #include in c++
That question was rhetorical. You really should ask your professor first.
well to be honest i tried couple of times but he mad about it ;-; that we dont know this basic thing
can i send you a screenshot about a school class slide about this
Nope
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
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.
welll i dont enjoy the class becuase the professor just comes in the class gives a Youtube playlist of study material 80% to review and when we have some doubts about something we have to email to ask and its sometimes takes days to get the answer
80% of the times**
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
whats a good website/ way to learn python with
i dont like books too much
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
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 .
While there may be legitimate used for RATs, most aren't, and as such we cannot condone such actions
also you don't have an insertion sort there
yes its the insert function
at least it's not a classic insertion sort
the next section implements the insertion sort
it's a very strange function though that needs foreknowledge of the item's place in the array
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
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
Just ask your question π
Thereβs a lot of factors that come into how long it will take to learn
So itβs really hard to say
Do I have to pay to learn
Nope
Youtube
Ahh I see thanks alot .I,ll probably put in 30hours weekly lol
Just try not to burn out, learning a new skill is fun but tiring
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
Took two weeks one week of basic and one week of intense training π And also constant practice
Thanks π π
Gave +1 Rep to @dreamy dirge
@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.
Actually doing a lesson on it rn.thanks alot π
π
https://www.freecodecamp.org/
https://www.codewars.com/
are 2 popular ones that can help on the resource front
merci
no problem
just had to checks the bookmarks shadow stores in the browser to send those links
How long do I learn
Forever. You never stop learning.
yeah i know but basic instruction is difficult
Practice. Practice. Cry. Practice.
I agree with @lilac holly
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
Sloddervos is gonna help you
This is RIGHT up my alley
An angular alley
Lmao
So, when you were usijg matTableSource, were talking about extending the abstract DataSource class provided by material, no?
Like, I have this. But how do I use that service URL to get the data? Do I use a string?
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.
OK, let's take a step back. I see you have some cards and now you're trying to populate them with data?
Yeap
Have you built a service that makes use of the HttpClient yet?
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.
Well yes, I do have added a dataSource while adding the data to a table
Yes
Ah, you need to display cumulative values of the values displayed in the table in the green boxes?
DataSource was used to display data into a table once. I am guesiing I cannot use it again?
Since the card logic is diff?
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.
Yeah but the backend is giving me the data values and I am req to just use that URL to just display...
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.
I did that actuallyπ¦ and I just had the doubt that should I make use of a property to get the data into a string or.....
Well then, I'll try and let you know.
Hold on, I'm writing you a simple example
Ok
// 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
I see, so no need to call a method to use a datasource
Nah, not unless you want to display that table tbh
Hello
A datasource would make sense if you need to display/filter/sort/aggregate lists.
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?
You already have that, right? A service that performs an http GET call
no wuzzas
Hi friends. I need help with Python. Can anyone help
Just ask away friend, there is 125129 Users in the server, x amount of people is bound to know how to help π
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
Maybe its due to the regex, its not finding anything so the len is 0
that's possible
I didn't understand exactly what to do, sorry
I'm out of my mind
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 π
Thank you for your help. I'll try all I can and give feedback
Gave +1 Rep to @tulip sail
and thank to you

guys what is the best book to study C language ?
The C book is probably the best start?
nice I will look up on it right now
gm kings
Richie&Kernigan is one of the best reference books to have, as it was written by the original authors of the C language.
K&R yeah, though be aware that the language has evolved since it was written
Yeah
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
π
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
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
ah, I thought I saw an article using it for SAST as well - that may have just been to enable sanitizers?
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 π
hey anyone hear with machine learning /hnsw/vector database/GAN experience i can ask some niche questions from? :)
First time seeing this!
Mozilla MDN is the best
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.
Yeah, redesign is somewhat recent but it's really nice
Definitely!
Tutorials, Free Online Tutorials, Javatpoint provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.
wow that made i much bigger image than i was exlecting
lol
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.
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
for example https://cse.google.com/cse?cx=3c57a8a175c6d0bcc
cool stuff thanks
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
oh that's cool
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}
https://rayiiksolutions.github.io (another example) it fully supports iframe embedding << see example π
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 .
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
Rust is a memory-safe compiled programming language for building high-performance systems. It has the simplicity of high-level languages (Go, Python), but the control of low-level languages (C, Cpp) https://github.com/fireship-io/rust-in-100
#programming #rust #100SecondsOfCode
π Resources
Rust Docs https://www.rust-lang.org/learn
Rust Book h...
do y'all study SQL for hacking into databases
It's good to understand SQL for SQL Injection
yep, and it's easy to learn
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?
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
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
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)```
The error message described what's wrong!
how to do the range check, sorry if its a silly question.
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
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)
your quotes are borked
Its very strange, cause when I replace str(os.popen("ls").read()) with str(4)
The output will be Hellohacker4
So the first output just prints the first item in ls, but not the rest
You are drastically misusing the os.popen() API. Please go read the docs on it, and the reason why you are getting that error should be apparent.
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
Maybe try to trim the output before assigning to user
Btw, doing eval isn't good, as anyone can just spawn a shell from it!
EZ RCE
I think that is the point
Should I go for c# or python for making desktop application like (tools for keylogger and reverse shell with gui interface ) for college project
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?
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
this is the other project i made for help files thought might be interesting to share https://asciinema.org/a/YDZFj1CxZUiwNqjwo5iocxPUw
reboot
oops*
@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).
I don't do visual studio
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
Juun that wasn't the question, it was more about how compilers go from code to binary and when the actual binary is created
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
π yea looking for deeper understanding of the process rather than an answer to a problem π ohh ill check that out
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
https://isaaccomputerscience.org/concepts/sys_trans_stages?examBoard=all&stage=all this is a very high level view, taken from UK A level (16-18 education) computer science
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
it's also probably massive overkill for most people
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
Oh, definitely. I love the topic, and i'm almost a total neophyte to it
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)
and thanks its going to take me some hours to go through this but great resources π
quick followup mps meta programming system?
It's a tool by jetbrainz, acronym sounds about right
kk yea the one i was looking at ;_
Pointer
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("*");
}
}
Is this homework?
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
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]);
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 :
character pointer. It's a pointer that points to the char data type
A char star π
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
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
Itβs so easy to translate into python that instead Iβd suggest you take the money that youβre going to cash app and spend it on a beginners python course
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..
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?
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...
Info gathering technique?
yea. never heard of info gathering, first step of the methodologies of hacking
I think you need to link and verify your account
!docs verify
To share images
Thanks bud.
@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.
is it ironic if a program for creating cross platform java apps does not itself come as a cross platform app?
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
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`);
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
I have the following code for ECMAScript 6 template literals:
let person = {name: 'John Smith'};
let tpl = My name is ${person.name}.;
let MyVar = "My name is " + person.name + ".&...
Ah you're a star
So yeah tl;dr it's basically the same but there's added features
So from what I understand is:
- readability
- don't have to escape characters if you're using things like "
"" and "'" in the string - linebreaks / multiline
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates - this also?
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
Does anyone have any challenges on python or js?
There's a lot of stuff in this channels pinned messages :)
Sorry but how can I get to it?
At the top right of this page there's a pin icon
Thank you I saw it
Template literals are better imo
@tropic minnow i imagine its pinned but incase its not https://www.hackerrank.com/challenges/challenges/problem
Recursively using + annoys a lot so i think second one is fine.
Concatenation is slower than templating iirc
At least there are usually more allocations done for each intermediate string
Quick question: why do some THM modules have 'View Site' while others are in a VM?
This isn't really programming related.
The content with "view site" is interactive content that uses static webpages to teach. The VMs are real linux or windows machines.
okay - thanks! Wasn't sure where this question fell in the channels.
Gave +1 Rep to @onyx merlin
hi, do you know any site that teaches how to make a site for free?... ik this is a random question hahahaha
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));
}
}
}
alternatively, have you tried just reading what you wrote and following the exact logic as opposed to what you think should happen?
No just for me
Not all hackers are programmers, but all programmers are hackers...
what the heck are you saying!
isPrime seems odd
Thanks I already solved it
your are right patly
partly
@glossy parrot https://w3school.com
https://w3docs https://w3docs.com
https://developer.mozilla.org/en-US/docs/Web
are a good start π
Stupid ass saying
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"
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
thank you for your answer i appreciate it
with is the way 
Hi everyone, I heard that C++ is way better than Python because Python would be to dependant, what does it mean ?
what they meant is that python requires the the language runtime to be installed for it to be able to run, whereas c++ by default can be compiled into something that already has required libraries on the system
@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
Python is an interpreted language. "Compiling" it basically involves packaging the scripts up alongside a copy of the interpreter and calling it a binary -- i.e. it's extremely hacky, massive, and very inefficient.
Python is a wonderful language, but it is very definitely not for compiling.
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
https://stackoverflow.com/questions/2998215/if-python-is-interpreted-what-are-pyc-files python bytecode go brr
I was just about to link some pyc docs π
By reading that, it looks like the ecosystem is lovely and fragmented
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
i was more hinting at cython
That's for interfacing python and c, is it not?
its supposted tk be a half step between the two is my understanding
Embedding c/cpp in python
not cpython
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
but that also means you can have a lot more compatibility issues if you are trying to port code across architectures... which breaks python
Yes those screenshots are from the homepage
ya sry saw that
Cpython is the reference implementation of python
but the slogan is python at the speed of c
Is there a typo there?
no dont think so but i just woke up so
It's C programs that can talk to python programs
It's not fast python, it's C that is basically wrapped by python
cython is a super set of python that alkows compilation of python to c code and c code to Python modules
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.
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. It is extensions to python that allow it to integrate with C and Cpp code. Where are you getting claims that you can compile python to C?
Where is that taken from? Where in the page is your claim?
Ok, and where in the page is the compilation of Python code to C code?
This is what it relates to https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/ which again is not compiling python to C, it's for the python interfacing bits
At the end of the process it spits out a module that can be imported from python so the end result is compiled C as a library. An extension to python. https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html
I really encourage you to take some time learning how it works and how you can use it
yes you seem to think were arguing but that's what I said python compiled to c
I think you're misinterpreting the goal of the project
And this has moved the goalposts entirely from the initial statements about compiled python
Nuikta doesn't do this.. I thought it did
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
python exclusively based on the fact of dependencies Not even that. You haven't disproved that though.
It's talking about the intepreter. The Cython code still needs to run in the Cpython VM and in fact the docs say this.
It doesn't remove the dependency of the cpython interpretere/env required
yes but is that reason enough to say that c++ is a better progamming language to learn exclusively on that one condition?
No, but that's not what I wanted to disprove.
well thats what my comment was adressing
Except it was incorrect
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
You said it could be compiled and that doesn't, at least via cython, address the fact you still need the interpreter.
There's many reasons to learn C++, building actual binaries at the end rather than shipping code+interpreter is one of them.
ok but even so if thats not reason enough to chose c++ then it is still a weak argument
That's not my argument to justify.
im not saying theyre arnt but on that one factor it is not enough to say that you should ignore Python and chose c++
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?
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
No, it runs in the python virtual machine. Specifically the cpython environment.
It requires it.
Saying "it all ends up as machine code" is ignoring the whole fundamental divide between compiled and interpreted languages
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.
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.
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?
I'm not interested in continuing it.
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.
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.
Cython doesn't work like this the cython code gets transpiled into C but the C code includes python bindings which can be used from python you can't use cython, compile a .so and then use C to interface with it
You are reinforcing the part about 'misunderstanding difference between a compiler and an interpreter'. Python isn't compiled to C, compile has a very specific meaning which does not apply in this case.
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
Hey what is ctx in discord.py?
@onyx merlin i did googling but was unable to understand.
Context is key to understanding how a variable is used
In this case, context is doubly key
Thanks!
Gave +1 Rep to @magic falcon
Thanks!
That's not a helpful statement from me btw
It was a joke because ctx means context as the first link says
And, I made a largely-unhelpful pun about reading and understanding code.
@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
Gave +1 Rep to @onyx merlin
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
You can provide a command for SSH to run as a parameter, not sure if you can access the output there though
yeah, that's my issue :(
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?
@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 π
Does anyone program in Rust? If yes, what resources did you use for learning?
Rusts' official book!
Loved it!
Yt, stackoverflow, geeks for geeks...........
Could you give me a link?
Thanks!
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?
Does anyone know how to display nmap output on a webpage using flask?
I'm quite good in python.. any advice on a useful programming language to learn for this field?
for automation, python. for windows, C#. For everything, C.
Thanks
Start by deriving context and renaming variables this will make it a lot easier e.g. local_30 is canary, pnVar4 is pointer to backdoor encoded buffer
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!
Use the pynmap module to get results in JSON, parse then in Jinja2
GrayHatPython
And blackhatpython
thank you so much! i fixed the issue though lol, but still could use your help
Gave +1 Rep to @lyric eagle
I'm 2 days late but you can use subprocess.run(["command", "-arg1", "-arg2"], capture_output=True)
And store that in a variable
You can then access the output stream through variable.stdout and the error stream through variable.stderr
I'll be online soon,, probably around for a while π
@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
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?
its because you have to specify if the file should be handled as binary or text mode
at first i used 'rb' but i am getting passwords in b'pass' format, i want pass without b
decode to utf-8?
encode before you put your "passwords" into b64encode as it expects bytes
b64encode also returns bytes, so if you want to print it as a string, you'll need to .decode() it back
i want the encoded value
yes i know
yeah
but b64encode returns bytes
so if you want to print it without the "b''" as you said
you have to convert it back to a string
then you need to .decode() it
so decode to utf-8 format
szy bb
nah, you know how I am with python
im currently making a C++ string encoder anyway π
Try freecodecamp on youtube
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```
Try this
Search it on stackoverflow
Not that, I have the right package installed and have no problem creating the Int
I found nothingπ’
@crystal light check this one
It must be something related to expressions as far as I know
One sec, I'll try it with my code
It's running, I'll update when it finishes haha
Ok cool
The calculation was too much
It just ran for the past 2 hours and didn't work so I quit it
If u just need to find x, depending on your knowledge of num theory, you could end up just running a self defined loop
Very well could be, Iβll need to debug it and see what it does, I assume it isnβt infinite because Z3 is pretty smart, but it might be Z3 reducing the numbers over and over by too little and so it doesnβt work properly.
That's probably not the case when your numbers are as big as 10^100, a number that satisfies 3 conditions could be really big or maybe non-existent(this is very easy to check), so i would guess that z3 tries to narrow it down ti a smaller range by combining conditions, e.g. x** 3 should have the form a*N1 + c
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
Can anyone help me with programming in C++
The numbers are probably smaller, and the condition can 100% be met as it is RSA and my calculations are good there haha
I might have gotten a completely wrong idea though, Iβll have to check it out later
The numbers should be that big, but are you certain that your calculations are correct?( I am supposing that u know all N a and C
If this is true^
The problem narrows down to calculating lcm(N1,N2,N3)
There are 3 Ns, 1C and I know 3 Ms that are possible.
And C is the same for all 3 Ns
Somehow
Plaintext
Yeah
Ok
So in order to do this
I also guessed E
You should factor the integers, which is particularly difficult
I don't know whether you need to
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
error: ```
<class 'Exception'>, AttributeError("'BlindSQLi' object has no attribute 'payload_types'")
so confused as to why i'm getting this
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
python.
do someone have mastering go book in pdf
This would be book piracy and very very very much against the rules here
if you have to ask that then maybe you have bigger issues than learning how to program..lol.
ah yeah that was it, not sure how i didn't catch that. thanks!
Gave +1 Rep to @stoic badger
Pretty tricky to notice imo
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
@cursive orchid I believe https://stackoverflow.com/a/60049504 should help
oh wait
noob #programming message
I should read things
top 0.0773 pog
I suppose if you're experienced you could slay the scoreboard
Not fair 
"I'm a Golden Glove prize fighter" π *fights children π₯

mood
Do anybody know if it is possible to run a movie(shrek) on a calculator?
yes it is if you try hard enough
@peak warren how hard?
Depends what you expect to get, audio is possible on some calculators with a good amount of modifying, and video will be really low quality but getting pixels to do it is possible.
@crystal light I have find a mission in life
what he said
Good luck haha



