Intro
I was at home watching some youtube videos and I came up to the Cicada 3301 challenge. I was particularly intrigued that the book was not decrypted. I started to do some trivial verifications first.
I was at home watching some youtube videos and I came up to the Cicada 3301 challenge. I was particularly intrigued that the book was not decrypted. I started to do some trivial verifications first.
Script to find string in file
To run in a directory:
fdemeloj@fdemeloj directory]$ for f in *; do python python_string.py $f; done
import sys
def find(file, string_search):
with open(file) as myfile:
if string_search in myfile.read():
return True
return Falsedef find_line(file, string_search):
print(“XXXX”)
import re
errors = []
linenum = 0
pattern = re.compile(r””+string_search)
with open (file, ‘rt’) as myfile:
for line in myfile:
linenum += 1
if pattern.search(line) != None: # If pattern search finds a match,
errors.append((linenum, line.rstrip(‘\n’)))
for err in errors:
print(“Line “, str(err[0]), “: ” + err[1])file_name = sys.argv[1]
string_name = “string”print “This is the name of the script: “, sys.argv[0]
print “This is the file: “, sys.argv[1]
if len(sys.argv) > 2:
print “This is the string to find: “, sys.argv[2]
string_name = str(sys.argv[2])
print “This is the name of the string: “, string_name#Main:
is_there = find(file_name, string_name)
print(is_there)
if is_there is True:
find_line(file_name, string_name)
Intro
Curl is an excelent to test http responses. Interesting that since it’s open source you can see where the could might fail, for example:
Code
if(!stream->bodystarted) {
failf(data, “HTTP/2 stream %d was closed cleanly, but before getting “” all response header fields, treated as error”,stream->stream_id);*err = CURLE_HTTP2_STREAM;return -1;
}
Therefore in case you see HTTP/2 stream %d was closed cleanly, but before getting you would know that the header is coming broke or the body of the request is absent.
java.lang.ClassNotFoundException org.bouncycastle.jce.provider.BouncyCastleProvider
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
<type>jar</type>
</dependency>
</dependencies>
Stackoverflow can be source of great knowledge ~ with some reading. I was doing some tests with thread dumps in EAP JBoss, analyzing some here and there. Then I came to this tool: lscpu.
Lscpu man page displays the information about the CPU, as below:
~~~ [fdemeloj@fdemeloj home]$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 142 Model name: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz Stepping: 10 CPU MHz: 797.497 CPU max MHz: 4200.0000 CPU min MHz: 400.0000 BogoMIPS: 4224.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 8192K NUMA node0 CPU(s): 0-7 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 ibpb ibrs stibp dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp spec_ctrl intel_stibp ~~~
CPU The logical CPU number of a CPU as used by the Linux kernel.
CORE The logical core number. A core can contain several CPUs.
SOCKET The logical socket number. A socket can contain several cores.
BOOK The logical book number. A book can contain several sockets.
NODE The logical NUMA node number. A node may contain several books.
CACHE Information about how caches are shared between CPUs.
ADDRESS The physical address of a CPU.
ONLINE Indicator that shows whether the Linux instance currently makes use of the CPU.
~ rngd is this tool to change the Random number generator, which is related to several other tools/mechanisms for example: SSH keys, random PIDs for processes, TCP sequence numbers, and UUIDs.
This daemon feeds data from a random number generator to the kernel’s random number entropy pool, after first checking the data to ensure that it is properly random.
Installing:
yum install rng-tools
Testing
rngd -f
Can I read the content from an application using the cli command? Yes.
[standalone@localhost:9990 /] /deployment=hibernate.war:read-content(path=index.html)
{
"outcome" => "success",
"result" => {"uuid" => "06519ccf-24d4-4b6f-9be1-aa859f98a538"},
"response-headers" => {"attached-streams" => [{
"uuid" => "06519ccf-24d4-4b6f-9be1-aa859f98a538",
"mime-type" => "text/html"
}]}
}
attachment display --operation=/deployment=hibernate.war:read-content(path=index.html)
The content will be shown as:
<!-- Plain HTML page that kicks us into the app -->
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=index.jsf">
</head>
Only recently I started to contribute to Stackoverflow. Although I have my account for about a year or so, only recently I found myself in a position to actually help people on their queries. It’s very good to be helpful actually.
https://stackoverflow.com/users/9727376/francisco-melo-junior
In java bin directory, there is a javascript engine, jjs.
The usage is pretty simple: Just go to the JDK instalatoin and run JJS ~ this was removed on OpenJDK 11 actually:
#jdk1.8.0_191/bin/jjs
jjs> print(‘Hello World!’);
Hello World!