Some very interesting programming code snippets.

Posted: August 23, 2017. At: 7:47 AM. This was 6 months ago. Post ID: 11239
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

This perl script is an old piece of code that will create a Windows version text string. I am sure someone might find this useful.

use warnings;
@t = localtime(time());
$yr = ($t[5] + 1900) -1;
$sr = int(( $t [4]/4) + 1);
$v = int("$t[7]$t[2]$t[1]$t[0]"*((rand(rand(10) + 1 ))));
print "Win$yr\\SR$sr . $v\n";

This is the output you get.

[ jason@4.10.0-19-generic x86_64 ]
[ Jobs 0. PWD: ~/Documents. bash 4.4.5. ] [ 5-:$ ]
-> ./ 
Win2016\SR2 . 972456184

Some interesting programming tricks.

Useful tricks and tips when programming in C.

This code that I found: can run on a Linux machine and open a port invisibly. This allows access to a Linux server without the process showing in process manager and on a port scan of the machine. This might be controversial thing to post on a Linux focused website, but this might be interesting to someone that is in to network security and penetration testing of a Linux server. This would be an interesting challenge. Defeating this code would be a good way to secure a Linux server. I am not sure if NSA Selinux can guard against this code but this is a good example of stealth code. There will be no open port shown in a scan as there is no service listening. But the system will respond to certain SYN packets transmitted to the target system and then the port(s) will be open as required. This code could be detected on a machine, but naming the binary to something innocuous like ‘top’ would make it pass a casual inspection. This is used on Windows to run malicious code without the user seeing it as something unwanted running as a process.

So, check this code out and see how you get on testing this program.

No comments have been made. Use this form to start the conversation :)

Leave a Reply