ctf | Stats , writeups , code snippets | Hacking library
kandi X-RAY | ctf Summary
kandi X-RAY | ctf Summary
My CTF journey since 2015. Stats, writeups, code snippets, notes, challenges.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ctf
ctf Key Features
ctf Examples and Code Snippets
Community Discussions
Trending Discussions on ctf
QUESTION
I am currently working through the Narnia CTF. I am on level 1. In level 1, we have a program that calls an environmental variable. We are allowed to change this environmental variable. When I try to set the environmental variable to some hex-code like so, the program throws a seg-fault.
...ANSWER
Answered 2021-Jun-14 at 00:14export EGG="\xeb\x11...
doesn't actually interpret the escape sequences. You're setting EGG
to a string with literal backslashes and hex characters.
When you use export EGG=$(python -c 'print "\xeb\x11...
, Python's only job is to interpret the escape sequences. Python receives an input with literal backslashes and hex characters, and performs Python string literal parsing, producing a string with the actual bytes you wanted.
Note that this code relies on using Python 2; Python 3 string handling is very different.
QUESTION
The problem I am doing requires me to send requests to a website and check whether a specific password is correct. It is somewhat similar to a CTF problem, but I use brute force to generate the correct password key, as the site gives feedback whether a specific key is on the right track. In order for a key to be considered "almost-valid," it must be a substring of the correct key.
I have implemented this naively, but the intended solution uses simple parallelism to speed up the process. How would I accomplish this in Java?
...ANSWER
Answered 2021-May-12 at 14:52Hi please use RecursiveTask,ForkJoinPool for parallelism. Below code is not final modify on your own way.
QUESTION
I participated in DawgCTF 2 days ago. And I was about to solve RSA problem but I couldn't solve.
DawgCTF's RSA problem was given n, e, c.
so, I factorized n using factordb, and the result of n was the square of only one prime.(That is, n=p^2)
I've never seen a case where p and q are the same in RSA Crypto.
Anyway, I let phi be (p-1)(q-1) and wrote the code as below. (phi means Euler's phi)
ANSWER
Answered 2021-May-10 at 17:21The first equal sign in phi(p * q) = phi(p) * phi(q) = (p - 1) * (q - 1)
assumes that p
and q
are coprime (see [1]), while the second equal sign assumes that p
and q
are prime (see [2], k = 1
). p = q
violates the first condition, which is why this relation is not valid for p = q
.
On the other hand, for k = 2
, it follows from [2] phi(p * p) = p * (p - 1)
, i.e. the relation used in the CTF solution for p = q
.
For RSA in practice, however, p != q
is a prerequisite, see [3] and [4] (otherwise p
and q
could be determined quickly: p = q = sqrt(N)
).
QUESTION
newbie here
I apologize for the cryptic title, I'm new to Laravel and PHP.
I'm building a CTF application using Laravel Jetstream with LiveWire as part of a university project.
Users will submit flags they've found, and I want that data to be compared with a database entry. If they flag is correct, I want this to be shown:
...ANSWER
Answered 2021-May-05 at 19:02first of all, if you want to get data by id, use: Flag::find($id);
And in your code, you check not user data, you check data from the database with this: OBR{1FA528F41E8945C}
If you want to check data from user with your database data, your code should be something like that:
QUESTION
I have 6 columns named as TOTAL_STOCK_VALUE,VALUE_UNRESTRICTED,fiscal_year,fiscal_period,plant,storage_location.I want to create a new column with percentage increase value from column TOTAL_STOCK_VALUE,VALUE_UNRESTRICTED.
...ANSWER
Answered 2021-Apr-17 at 17:27based on your desired output, seems like you just wanna do this :
QUESTION
I have a php code like this:
...ANSWER
Answered 2021-Apr-14 at 16:58Yes, that's what that means.
QUESTION
Out of the blue, my python installation seems to have broken. When trying to run a python script, I get the following...
...ANSWER
Answered 2021-Apr-12 at 21:21I was able to update six by doing a wget https://raw.githubusercontent.com/benjaminp/six/master/six.py
in ~/.local/lib/python3.9/site-packages
. This solved the problem.
QUESTION
Title basically says it all. My friend gave me this as a challenge he solved in some CTF he is doing. I have thought about it for a while and can not figure it out. Also, INFINITY isn't a valid answer. Thanks.
...ANSWER
Answered 2021-Apr-04 at 00:12The only way this happens in C is:
x
is an infinity (+∞ or −∞) (equivalently,HUGE_VAL
or-HUGE_VAL
in implementations that do not support infinities).x
is a NaN and the C implementation uses non-IEEE-754 behavior for NaNs.x
is adjacent to an infinity in the floating-point representation and a suitable directed rounding mode is used.x+1
andx*2
overflow and the resulting behavior not defined by the C standard happens to report the comparisons as true.x
is uninitialized and hence indeterminate and takes on different values in the two appearances ofx
inx+1 == x
such that the comparison is true and, inx*2 == x
either similarly takes on different values or takes on the value zero.x
is uninitialized and has automatic storage duration and its address is not taken, and hence the behavior is not defined by the C standard, and the resulting behavior happens to report the comparisons as true.
Proof:
Other than infinity, the statements are mathematically false in real numbers, and therefore this cannot arise from real-number behavior. So it must arise from some non-real-number behavior such as overflow, wrapping, rounding, indeterminate values (which may be different in each use of an object) or uninitialized values. Since *
is constrained to have arithmetic operands, we only need to consider arithmetic types. (In C++, one could define a class to make the comparisons true.)
For signed integers, non-real-number behavior with fully defined values occurs for +
and *
only when there is overflow, so that is a possibility.
For unsigned integers, non-real-number behavior with fully defined values occurs for +
and *
only when there is wrapping. Then, with wrapping modulo M, we would have x+1 = x+kM for some integer k, so 1 = kM, which is not possible for any M used in wrapping.
For the _Bool
type, exhaustive testing of the possible values eliminates them.
For floating-point numbers, non-real-number behavior with fully defined values occurs for +
and *
only with rounding, underflow, and overflow and with NaNs. NaNs never compare as equal by IEEE-754 rules, so they cannot satisfy this, except for the fact that the C standard does not require IEEE-754 conformance, so an implementation could choose to make the comparisons true.
x*2
will not underflow, since it increases the magnitude. x+1
can be made to underflow in a perverse floating-point format with smaller exponent range than precision, but this will not produce x+1 == x
. x+1 == x
can be satisfied by rounding for sufficiently large x
, but then x*2
must produce a value other than x
.
That leaves overflow. If x
is the greatest representable finite number (and hence the greatest representable number less than infinity), and the rounding mode is downward (toward −∞) or toward zero, then x+1
will yield x
and x*2
will yield x
, so the comparisons yield true. Similarly, the greatest negative representable finite number will satisfy the comparisons with rounding upward (toward +∞) or toward zero.
QUESTION
I have one line of code that selects multiple cell ranges as follows:
...ANSWER
Answered 2021-Mar-18 at 10:55Splitting the selection seems to work...
QUESTION
I am writing an R package and one of its functions download and unzips a file from a link (it is not exported to the user, though):
...ANSWER
Answered 2021-Mar-12 at 15:23The download fails because libcurl tries to verify the webservers certificate, but can't.
I can reproduce this on my system:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ctf
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page