<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="2.0" xml:base="http://sysd.org/stas">
<channel>
 <title>stas&#039;den - console</title>
 <link>http://sysd.org/stas/taxonomy/term/14/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>&quot;keyboard injection&quot; under Linux</title>
 <link>http://sysd.org/stas/node/151</link>
 <description>&lt;p&gt;
What to do if you want to pass some data into STDIN of some process,
and it doesn&#039;t accepts it?! One of the most (un)famous example is &lt;code&gt;ssh&lt;/code&gt;;
who never tried to do a &lt;code&gt;&quot;echo password | ssh host&quot;&lt;/code&gt;?!
So,&amp;nbsp;you just want to inject characters as there were someone
typing them. Remember: &lt;b&gt;TIOCSTI&lt;/b&gt; ioctl() call is your
friend &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
Just &lt;a href=&quot;http://www.google.com/search?q=ioctl+TIOCSTI&quot;
 target=&quot;_blank&quot;&gt;google it&lt;/a&gt; to see what
it&amp;nbsp;does. And now, some actually working code:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;#!/usr/bin/perl -w&lt;br&gt;use strict;&lt;br&gt;use Fcntl;&lt;br&gt;use constant TIOCSTI =&amp;gt; 0x5412;&lt;br&gt;&lt;br&gt;unless (@ARGV &amp;gt;= 1) {&lt;br&gt; print &quot;usage: $0 [vt] &amp;lt;input&amp;gt;\n&quot;;&lt;br&gt; exit;&lt;br&gt;}&lt;br&gt;&lt;br&gt;my $vt = shift @ARGV;&lt;br&gt;my $buf = join &#039;&#039;, &amp;lt;&amp;gt;;&lt;br&gt;&amp;amp;writevt ($vt, $buf) || die &quot;can&#039;t write to $vt: $!\n&quot;;&lt;br&gt;exit;&lt;br&gt;&lt;br&gt;&lt;br&gt;sub writevt {&lt;br&gt; my ($vt, $buf) = @_;&lt;br&gt; sysopen (VT, $vt, O_RDONLY) || return 0;&lt;br&gt; for (my $i = 0; $i &amp;lt; length $buf; $i++) {&lt;br&gt; ioctl (VT, TIOCSTI, substr ($buf, $i, 1)) || return 0;&lt;br&gt; }&lt;br&gt; close (VT) || return 0;&lt;br&gt; return 1;&lt;br&gt;} &lt;br&gt;&lt;/pre&gt;
&lt;p&gt;
And this is how it works (Linux-specific!!!):
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;[stas@home stas]$ echo id | ./catvt.pl /dev/pts/0&lt;br&gt;id&lt;br&gt;[stas@home stas]$ id&lt;br&gt;uid=?????(stas) gid=?????(stas) groups=?????(stas)&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;
Kinda awesome &lt;img src=&quot;misc/smileys/lol.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; /&gt;
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <pubDate>Wed, 15 Aug 2007 21:20:27 -0300</pubDate>
</item>
<item>
 <title>ACFTools (for X-Plane)</title>
 <link>http://sysd.org/stas/node/46</link>
 <description>&lt;br&gt;


&lt;div align=&quot;center&quot;&gt;&lt;a href=&quot;http://sysd.org/stas/files/active/0/shot.png&quot;&gt;&lt;img alt=&quot;ACFTools screenshot&quot; src=&quot;http://sysd.org/stas/files/active/0/shot_t.jpg&quot; border=&quot;0&quot; height=&quot;480&quot; width=&quot;640&quot;&gt;&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;


&lt;br&gt;


The &lt;b&gt;Plane-Maker&lt;/b&gt; from &lt;a href=&quot;http://x-plane.com/&quot;&gt;X-Plane&lt;/a&gt;
v7.x is fun and easy to use... Although I found it a bit limited to
edit my planes&#039; fuselage. 20 cross-sections aren&#039;t enough, sometimes.
It would be nice to export the fuselage shape into any 3D-editor and
fine-tune it there... This is exactly what my ACFTools are supposed to
do. Please note that X-Plane v8.x is unsupported, unless you create &amp;amp; edit a v7
model and then import it to Plane-Maker v8. But I believe this isn&#039;t a
problem: X-Plane v8 is able to use OBJ format files (which can be
imported/exported by &lt;a href=&quot;http://scenery.x-plane.com/tools.php&quot;&gt;AC3D&lt;/a&gt; and &lt;a href=&quot;http://marginal.org.uk/x-planescenery/tools.html&quot;&gt;Blender&lt;/a&gt; plugins) as parts of an aircraft, thus, extremely weird shapes are perfectly possible without even touching the ACF file.&lt;br&gt;


Now, what exactly ACFTools does? It is able to process the file that
stores all the aircraft data (except the textures), in the binary ACF
format, and dump all the data in the human-readable TXT format. It is the
same format as for Tony Gondola&#039;s ACF2Text utility, which inspirited my
ACFTools. Then, ACFTools can extract the 3D model of the aircraft from
this data, and export it in the &lt;a href=&quot;http://www.ac3d.org&quot;&gt;AC3D&lt;/a&gt; format. After that you can edit the aircraft&#039;s shape as you want using AC3D and make the inverse process: from &lt;code&gt;.ac&lt;/code&gt; to &lt;code&gt;.txt&lt;/code&gt;, and then from &lt;code&gt;.txt&lt;/code&gt; to &lt;code&gt;.acf&lt;/code&gt;. Here comes the brief set of ACFTools features:&lt;br&gt;


&lt;ul&gt;


  &lt;li&gt;Convert from ACF (aircraft) &amp;amp; WPN (weapon) formats to TXT format and vice-versa.&lt;br&gt;
  &lt;/li&gt;
  &lt;li&gt;Extract AC3D model from TXT file, along with wings and propellers (using the real airfoils!).&lt;/li&gt;
  &lt;li&gt;Import AC3D model into TXT file (fuselage, nacelles, wheel fairings &amp;amp; external fuel tanks only)&lt;br&gt;
  &lt;/li&gt;
&lt;/ul&gt;


3D model extractor is also useful if you want to use X-Plane generated
aircrafts somewhere else; as in your own Computer Graphics compositions.&lt;br&gt;


ACFTools was written in &lt;a href=&quot;http://www.perl.org/get.html&quot;&gt;Perl&lt;/a&gt;,
thus it is able to work under Linux, MacOS &amp;amp; Windows. And it is
Open-Source &amp;amp; highly modular, so you can modify it as you want, or
use my functions for your own needs. When you start ACFTools, this is
what you get at your console:&lt;br&gt;


&lt;pre&gt;##############################################################################&lt;br&gt;[ACFTools v0.62a] Set of tools to play with ACF files outside of Plane-Maker&lt;br&gt;Perl script and modules coded by Stanislaw Pusep &lt;stas @sysd.org=&quot;&quot;&gt;&lt;br&gt;Site of this and another X-Plane projects of mine: http://xplane.sysd.org/&lt;br&gt;&lt;br&gt;Allows you to:&lt;br&gt; * export X-Plane (www.x-plane.com) aircraft data files to human-editable&lt;br&gt;   plaintext format and 3D mesh editable in AC3D modeler (www.ac3d.org).&lt;br&gt; * import plaintext/3D mesh back to ACF file.&lt;br&gt;##############################################################################&lt;br&gt;&lt;br&gt;Usage: acftools.exe &lt;commands&gt; [parameters]&lt;br&gt; o Commands:&lt;br&gt;	-extract [DEF]	: extract TXT from ACF (opt: using DEF definition)&lt;br&gt;        -generate       : generate ACF from TXT&lt;br&gt;        -merge          : merge body from AC3D file to TXT&lt;br&gt; o Parameters:&lt;br&gt;        -acffile FILE   : name of ACF file to process&lt;br&gt;        -txtfile FILE   : name of TXT file to process&lt;br&gt;        -ac3dfile FILE  : name of AC3D file to process&lt;br&gt;        -noorder        : DO NOT sort vertices while merging bodies&lt;br&gt;        -noac3d         : DO NOT generate AC3D&lt;br&gt;        -(min|max)body N: write all bodies in specified range to AC3D&lt;br&gt;        -force LIST     : force extraction of bodies LIST (comma-separated N)&lt;br&gt;        -normalize N    : normalize wings to N vert/surface (N&amp;gt;=2 or no wings!)&lt;br&gt; o Notes:&lt;br&gt;        * You can use abbreviations of commands/parameters (-gen or even -g&lt;br&gt;          instead of -generate).&lt;br&gt;        * The only required parameter for &quot;extract&quot; command is -acffile.&lt;br&gt;          Both -txtfile and -ac3dfile are derivated from it.&lt;br&gt;        * &quot;generate&quot; command and -txtfile has the same relation.&lt;br&gt;        * By default &quot;extract&quot; uses the latest DEF file.&lt;br&gt;        * &quot;generate&quot; doesn&#039;t need DEF at all (it is implicit in TXT)&lt;br&gt;        * If file to be created already exists backup is made automatically.&lt;br&gt; o Examples:&lt;br&gt;        acftools.exe --extract=ACF700 --acffile=&quot;F-22 Raptor.acf&quot;&lt;br&gt;        (extract &#039;F-22 Raptor.txt&#039; from &#039;F-22 Raptor.acf&#039;)&lt;br&gt;&lt;br&gt;        acftools.exe -e -acf &quot;F-22 Raptor.acf&quot;&lt;br&gt;        (same as above)&lt;br&gt;&lt;br&gt;        acftools.exe -me -ac3d ladar.ac -txt &quot;F-22 Raptor.txt&quot;&lt;br&gt;        (merge *single* 3D body from &#039;ladar.ac&#039; to &#039;F-22 Raptor.txt&#039;)&lt;br&gt;&lt;br&gt;        acftools.exe -g -txt &quot;F-22 Raptor.txt&quot;&lt;br&gt;        (reverse operation; generate &#039;F-22 Raptor.acf&#039; from &#039;F-22 Raptor.txt&#039;)&lt;br&gt;&lt;/commands&gt;&lt;/stas&gt;&lt;/pre&gt;


The most important thing you should know is that to convert from the
binary ACF format to TXT, ACFTools uses one of the files stored in the &lt;code&gt;defs&lt;/code&gt; directory. By default, it is a &lt;code&gt;ACF740.def&lt;/code&gt;,
which works for X-Plane v7.40 and later. You can specify any definition
file you want, as shown on the screen above. You can also write your
own definition files, if you have the structure specification. Note
that to convert TXT back to ACF, no definition is necessary, as the TXT
format itself holds all the data necessary to build the binary file.
The second thing is to specify the file that ACFTools should convert.
The name of the converted file and every of the intermediary files will
be generated from this name. When converting from ACF to AC3D formats,
TXT file is generated automatically. Please note that when you want to
put the edited aircraft part back into the &lt;code&gt;.acf&lt;/code&gt; file, you must save this part as a &lt;code&gt;.ac&lt;/code&gt;
separate file, then merge it into the TXT file, and after that convert
it into ACF! Yes, it would be nice to have a GUI to automate the entire
process, but I&#039;m too lazy to do that! Anyway, may the source be with you
&lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;br&gt;


I strongly recommend you to read the &lt;code&gt;docs\README.txt&lt;/code&gt; file contained in the ACFTools package before you start using it!&lt;br&gt;</description>
 <category domain="http://sysd.org/stas/taxonomy/term/9">addon</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/29">game</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/28">simulation</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/12">windows</category>
 <pubDate>Wed, 10 May 2006 01:09:12 -0300</pubDate>
</item>
<item>
 <title>I.E. &#039;hidden image&#039; maker</title>
 <link>http://sysd.org/stas/node/38</link>
 <description>&lt;p&gt;
&lt;center&gt;&lt;img alt=&quot;sample masked image&quot;
 src=&quot;http://sysd.org/stas/files/active/0/masked.jpg&quot;
 height=&quot;228&quot; width=&quot;320&quot;&gt;&lt;br&gt;
&lt;/center&gt;
&lt;/p&gt;
If you are using Internet Explorer (any version able to load this page
&lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;, just select the above image (or go to &lt;i&gt;&quot;Edit =&amp;gt;
Select All&quot;&lt;/i&gt;, or press &lt;code&gt;Ctrl-A&lt;/code&gt;). You
may see a watermark with white letters forming a word &quot;TEST&quot;. This &lt;b&gt;only&lt;/b&gt;
happens in IE, due to the specific way it masks the selected images to
show their selected state. &lt;a
 href=&quot;http://www.mozilla.org/products/firefox/&quot;&gt;Firefox&lt;/a&gt;,
for example, simply tints the image with bluish color. There are lots
of jokes one can make using this simple principle. For example, all
images on your homepage may have some &quot;subliminal&quot; messages. Adobe
PhotoShop is perfectly suitable to make such &#039;Hidden Images&#039; by hand;
in fact, my inspiration was a tutorial made by Matt Kment to do this.
But if you
are too lazy and/or do not have PhotoShop installed (UN*X users, for
example), you can use this small program I wrote in Perl to automate
the
&quot;steganographic&quot; process. I wrote it using &lt;a
 href=&quot;http://www.imagemagick.net/&quot;&gt;ImageMagick&lt;/a&gt;&lt;small&gt;&lt;sup&gt;TM&lt;/sup&gt;&lt;/small&gt;
library (so it&#039;s required to successfully run the program). It is a
command line program, but it is simple enough to use,
and it has an advantage to be integrable into your own scripts/programs
(you can even setup your server to embed your company logo into all
graphics of your site, but this will overload the server&#039;s CPU and RAM
too quickly). I called my program &quot;Internet Explorer Mask&#039;O&#039;Matic&quot;.
Take a look at it&#039;s startup screen:&lt;br&gt;
&lt;pre&gt;Internet Explorer Mask&#039;O&#039;Matic v1.0 by Stas &lt;stanis
 @linuxmail.org=&quot;&quot;&gt;&lt;br&gt;Grab yours at http://sysdlabs.hypermart.net/ &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;br&gt;&lt;br&gt;Inspirated by some mad stuff by Lem0nHead&lt;br&gt;Based on Photoshop &#039;Hidden Image&#039; Guide (http://www.atomicwienerdog.com/ot/)&lt;br&gt;made by Matt Kment &amp;amp; suggested to me by xfalmp&lt;br&gt;&lt;br&gt;&lt;br&gt;ERROR: please give us --visible&lt;br&gt;&lt;br&gt;&lt;br&gt; * Usage: MaskOMatic.pl &lt;options&gt;&lt;br&gt; * Options (note that you can use syntaxes like --vis= --hid -out -p):&lt;br&gt; --visible filename of image normally seen (required)&lt;br&gt; --hidden filename of image seen when selected in IE (required)&lt;br&gt; --output filename to write out, format is selected automatically&lt;br&gt; using suffix provided (required)&lt;br&gt; --percentage float value between 0 &amp;amp; 100; how much of hidden appears&lt;br&gt; (optional, defaults to 50%)&lt;br&gt; --quality JPEG/MIFF/PNG compression level (optional, DON&#039;T USE!)&lt;br&gt; --contrast flag, internal contrast reduction (optional)&lt;br&gt; --test filename to dump preview of selected image (optional)&lt;br&gt;&lt;br&gt; * Notes:&lt;br&gt; # Visible &amp;amp; hidden images doesn&#039;t need to have same size, when size&lt;br&gt; doesn&#039;t matches then hidden image is rescaled using Lanczos filter&lt;br&gt; # A huge set of image formats is supported (JPG, GIF, PNG for example)&lt;br&gt; but I strongly advice you to write output in loseless format *only*&lt;br&gt; (BMP, PNG, TGA) and *then* fine-tune contrast/brightness &amp;amp; save&lt;br&gt; compressed in your favourite image editor (like GIMP)&lt;br&gt;&lt;br&gt; * Example:&lt;br&gt; MaskOMatic.pl --vis bush.jpg --hid death.jpg --out sublim.bmp&lt;br&gt;&lt;/options&gt;&lt;/stanis&gt;&lt;/pre&gt;
Only 3 options are obligatory: &lt;code&gt;--visible&lt;/code&gt;, &lt;code&gt;--hidden&lt;/code&gt;
&amp;amp; &lt;code&gt;--output&lt;/code&gt;. You can abbreviate them
as &lt;code&gt;-v&lt;/code&gt;, &lt;code&gt;-h&lt;/code&gt; &amp;amp;
&lt;code&gt;-o&lt;/code&gt;,
respectively. &quot;Visible&quot; is an image that user sees by default.
&quot;Hidden&quot; is what user sees when he/she selects the image. And &quot;output&quot;
is the resulting image you can embed into your pages. It is also
possible to use the &lt;code&gt;&quot;--test&quot;&lt;/code&gt;
option to preview the selected state of the output image without
starting Internet Explorer. If it looks bad, you may play around with &lt;code&gt;&quot;--percentage&quot;&lt;/code&gt;
option, which specifies the &#039;weight&#039; of the hidden image. The higher
is this value, the greater is the hidden image visibility. If that&#039;s
not
enough to hide your image well (some things are pretty difficult to
hide!), you can try to tune the output image with &lt;code&gt;&quot;--contrast&quot;&lt;/code&gt;
option, but I suggest you to use some GUI program to do that as you get
the visual feedback instantly. I also suggest you to always save your
output in the non-compressed lossless format (like BMP, TGA, TIFF), and
then
fine-tune the compression in some program specialized in it (&lt;a
 href=&quot;http://www.gimp.org/&quot;&gt;GIMP&lt;/a&gt; has a nice
compressor with visual feedback).
&lt;p&gt;
&lt;h3&gt;Alternatives:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a
 href=&quot;http://www.n-sane.net/effects/hidden-image/index.php&quot; target=&quot;_blank&quot;&gt;Hidden
Image&lt;/a&gt; Photoshop tutorial&lt;/li&gt;
  &lt;li&gt;&lt;a
 href=&quot;http://www.codeproject.com/cs/media/magicimage.asp&quot; target=&quot;_blank&quot;&gt;Magic
Image Generator&lt;/a&gt; C#/VS.NET2003 program (with source) &lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/6">graphics</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/8">web</category>
 <pubDate>Fri, 05 May 2006 17:47:18 -0300</pubDate>
</item>
<item>
 <title>&quot;ps auwx&quot; faker</title>
 <link>http://sysd.org/stas/node/37</link>
 <description>&lt;p&gt;
&quot;Process Stack Faker&quot; (&lt;code&gt;psf&lt;/code&gt; for short) is able to hide the real executable name and it&#039;s parameters from the output of &lt;code&gt;&quot;ps auwx&quot;&lt;/code&gt;, &lt;code&gt;&quot;ps -ef&quot;&lt;/code&gt; &amp;amp; &lt;code&gt;&quot;top&quot;&lt;/code&gt;
(on UN*X machines), without any superuser privileges. Why should one
wish to hide the stuff he/she executes is a complete different topic &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
Let&#039;s take a look at the options that &lt;code&gt;psf&lt;/code&gt; itself accepts:&lt;br&gt;
&lt;pre&gt;$ ./psf&lt;br&gt;Process Stack Faker (a.k.a. Fucker) v0.03&lt;br&gt;Coded by Stas; (C)opyLeft by SysD Destructive Labs, 1997-2003&lt;br&gt;&lt;br&gt;Usage: psf [options] command arg1 arg2 ...&lt;br&gt;Where options can be:&lt;br&gt;-s string fake process name&lt;br&gt;-p filename file to write PID of spawned process - optional&lt;br&gt;-d try to start as daemon (in background, no tty) - optional&lt;br&gt;-l DO NOT exec through link (detectable by &#039;top&#039;!!!) - optional&lt;br&gt;-u uid[:gid] (format just like in chown(1)) reset UID/GID - optional&lt;br&gt;-n priority renice process - optional&lt;br&gt;&lt;br&gt;Example: psf -s &quot;pine -i&quot; -d -n 19 ./john -session:websrv&lt;br&gt;$&lt;br&gt;&lt;/pre&gt;
I hope this is self-explanatory. &lt;code&gt;psf&lt;/code&gt; will execute &lt;code&gt;&quot;command arg1 arg2&quot;&lt;/code&gt;, and it will appear to &lt;code&gt;&quot;ps&quot;&lt;/code&gt; &amp;amp; &lt;code&gt;&quot;top&quot;&lt;/code&gt; utilities as &lt;code&gt;&quot;string&quot;&lt;/code&gt;. All other options are... Uhm, optional! They are only useful to detach processes not designed to run as daemons. &lt;code&gt;&quot;-l&quot;&lt;/code&gt;
is a &#039;compatibility&#039; switch that disables the weird trick used to
override the detection of the real filename by some process listers
(notably &lt;code&gt;&quot;top&quot;&lt;/code&gt;). The default option may work unexpectingly on some systems (by the way, &lt;code&gt;psf&lt;/code&gt; works fine on FreeBSD 4.3, Linux 2.4, NetBSD 1.5 &amp;amp; Solaris 2.7). To test &lt;code&gt;psf&lt;/code&gt;, try this:&lt;br&gt;
&lt;pre&gt;$ psf -s &quot;pine -i&quot; sleep 30 &amp;amp;&lt;br&gt;[1] 440&lt;br&gt;$ ps auwx&lt;br&gt;...&lt;br&gt;stas 84 0.0 0.6 2012 1232 pts/0 S 19:12 0:00 bash -rcfile .bashrc&lt;br&gt;stas 440 0.0 0.1 1204 376 tty2 S 20:09 0:00 pine -i&lt;br&gt;&lt;br&gt;stas 450 0.0 0.4 2544 816 tty2 R 20:12 0:00 ps auwx&lt;br&gt;...&lt;br&gt;&lt;/pre&gt;
&lt;code&gt;
&quot;sleep 30&quot;&lt;/code&gt; process was spoofed as &lt;code&gt;&quot;pine -i&quot;&lt;/code&gt;. Please note the white line between PIDs 440 and 450. This occurs because &lt;code&gt;psf&lt;/code&gt; uses whitespace (0x20) characters to shift the original process arguments away from the visible area &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
To understand how does &lt;code&gt;psf&lt;/code&gt; works and learn how to compile it, just read the comments inside the source.&lt;/p&gt;</description>
 <category domain="http://sysd.org/stas/taxonomy/term/19">C</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Fri, 05 May 2006 01:57:41 -0300</pubDate>
</item>
<item>
 <title>ttysnoop for kernel 2.6</title>
 <link>http://sysd.org/stas/node/35</link>
 <description>&lt;i&gt;This project was made by a friend of mine, Vinicius Anselmo. He
discontinued it&#039;s development (as it showed to be incompatible with
later Linux kernels), so I proposed to host his work on my site.&lt;/i&gt;&lt;br&gt;
&lt;br&gt;

&lt;code&gt;ttysnoop&lt;/code&gt; is a small program made by Carl Declerck that allows an
administrator to snoop on login terminal through another. It worked until kernel 2.4 because they still with BSD-style &lt;code&gt;pty&lt;/code&gt;&#039;s
support. Here it is a solution for 2.6.&lt;br&gt;


&lt;br&gt;
&lt;h3&gt;Screenshot:&lt;/h3&gt;
&lt;center&gt;
&lt;img alt=&quot;ttysnoop usage screenshot&quot; src=&quot;http://sysd.org/stas/files/active/0/ttysnoop.jpg&quot; border=&quot;0&quot; height=&quot;480&quot; width=&quot;640&quot;&gt;
&lt;/center&gt;

&lt;br&gt;
&lt;h3&gt;SSH:&lt;/h3&gt;

Is ttysnoop compatible with &lt;code&gt;sshd&lt;/code&gt;? ttysnoop was created to work with &lt;code&gt;inetd&lt;/code&gt;, however,
there is a way to make it work with &lt;code&gt;sshd&lt;/code&gt;.&lt;br&gt;

First you will need the source code of the &lt;code&gt;sshd&lt;/code&gt;. Edit the file &lt;code&gt;configure&lt;/code&gt; and add these lines:&lt;br&gt;

&lt;pre&gt;LOGIN_PROGRAM=&quot;/sbin/ttysnoops&quot;&lt;br&gt;export LOGIN_PROGRAM&lt;br&gt;&lt;/pre&gt;

Now it is necessary to verify the paths, so that the new executable
uses the same configuration files of your system. For my system I solved making this modification in &lt;code&gt;pathnames.h&lt;/code&gt;:&lt;br&gt;

&lt;pre&gt;// #ifndef SSHDIR&lt;br&gt;#define SSHDIR	ETCDIR &quot;/ssh&quot;&lt;br&gt;// #endif&lt;br&gt;&lt;/pre&gt;

And executing the script configure specifying a null prefix:&lt;br&gt;

&lt;pre&gt;./configure --prefix=&lt;br&gt;&lt;/pre&gt;

Now compile the program. Make a backup copy of your &lt;code&gt;/usr/sbin/sshd&lt;/code&gt; and put your new &lt;code&gt;sshd&lt;/code&gt; in the
place. That should work. If you are using RedHat or Fedora Core you can try to use my
executable (&lt;a href=&quot;http://sysd.org/stas/node/35#attachments&quot;&gt;see below&lt;/a&gt;).&lt;br&gt;

&lt;br&gt;
&lt;h3&gt;Bugs:&lt;/h3&gt;

After log out, it doesn&#039;t remove the pseudo-terminal entry. Meaning
people showed up as still logged in when they weren&#039;t.&lt;br&gt;

I use: &lt;span style=&quot;font-style: italic;&quot;&gt;who -u | grep -v ?&lt;/span&gt;&lt;br&gt;

to see who really is on my system. I don&#039;t know how to solve it.&lt;br&gt;</description>
 <category domain="http://sysd.org/stas/taxonomy/term/19">C</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Thu, 04 May 2006 13:09:40 -0300</pubDate>
</item>
<item>
 <title>rockin&#039; PC speaker</title>
 <link>http://sysd.org/stas/node/23</link>
 <description>Well,
good old PC speaker is the only default hardware, easily available on
almost all PC systems, and virtually unmuteable (actually, one can
connect PC speaker output to his/her sound card instead of default
buzzer, but this rarely happens &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;. Thus, it is perfect for
communicating critical states. But the default system beep is quite
boring, and makes difficult to distinguish different events that are
being communicated. So, here&#039;s my humble attempt to make a highly
portable function that is able to play simple non-polyphonic music on
the PC speaker. I used it originally to advise when someone tried to
log in to my system through SSH daemon (thus the name &quot;daemoniac&quot; - &lt;code&gt;demoniac&lt;/code&gt; &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;. It was tested (and worked fine!) under:
&lt;ul&gt;

&lt;li&gt;DOS (DJGPP, Turbo C)&lt;/li&gt;
&lt;li&gt;Windows 9x/NT/2K/XP (Borland C, Microsoft Visual C, MinGW)&lt;/li&gt;
&lt;li&gt;Linux (gcc)&lt;/li&gt;
&lt;li&gt;FreeBSD (gcc)&lt;/li&gt;
&lt;/ul&gt;

By default, &lt;code&gt;demoniac&lt;/code&gt; will play &lt;i&gt;Iron Maiden - Fear Of The Dark&lt;/i&gt; beginning. You can also compile it to play the simple &quot;A#4 D#5 G5 A#5 G5 A#5&quot; melody. Note that on UN*X systems, &lt;code&gt;demoniac&lt;/code&gt; accesses hardware directly, and thus requires to run as &lt;code&gt;root&lt;/code&gt; user. It&#039;s safe, through: it
won&#039;t accept any command line arguments and neither process environment
variables, so, at least, it can&#039;t be exploited with some buffer
overflow technique. For detailed instructions about compiling &lt;code&gt;demoniac&lt;/code&gt; on
different compilers/systems, read the comments at the start of the
source. Note that my package provides all the binaries generated on
compilers/systems listed above.&lt;br&gt;</description>
 <category domain="http://sysd.org/stas/taxonomy/term/19">C</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/5">hardware</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/30">music</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/12">windows</category>
 <pubDate>Thu, 20 Apr 2006 02:06:04 -0300</pubDate>
</item>
<item>
 <title>ASCII code explorer</title>
 <link>http://sysd.org/stas/node/22</link>
 <description>&lt;p&gt;
Designed to be the freakin&#039; best ASCII table viewer for DOS platform, LOL!!!
&lt;/p&gt;
&lt;p&gt;
&lt;center&gt;&lt;img title=&quot;Looks like this on the good old MS-DOS ;)&quot; alt=&quot;ASC.EXE screenshot&quot; src=&quot;http://sysd.org/stas/files/active/0/asc.png&quot; style=&quot;width: 640px; height: 400px;&quot;&gt;&lt;/center&gt;
&lt;/p&gt;
&lt;p&gt;
It accesses the console font bitmaps directly from the BIOS and amplifies them 16 times (bitmaps in a hex form are shown, also). User can navigate the character map using his/her mouse or the cursor keys.&amp;nbsp; For every character, it&#039;s ASCII code in decimal, hexadecimal &amp;amp; binary formats is displayed. One can also build strings of ASCII characters, just like in Windows&#039; &quot;Character Map&quot;. Foreground/background colors for the character, magnified character &amp;amp; character string are also editable through the GUI (there are 16 colors available for background, instead of default 8 &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;. It&#039;s pretty useless today, but helped me a lot to develop my elder programs. By the way, this ASCII explorer was written using QBasic 4.5...
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/23">database</category>
 <category domain="http://sysd.org/stas/taxonomy/term/6">graphics</category>
 <category domain="http://sysd.org/stas/taxonomy/term/13">GUI</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Thu, 20 Apr 2006 01:52:32 -0300</pubDate>
</item>
<item>
 <title>ptBR nums2words()</title>
 <link>http://sysd.org/stas/node/20</link>
 <description>Uma função que programei para retornar &lt;i&gt;strings&lt;/i&gt; com números escritos por extenso. Por exemplo: &lt;code&gt;nums2words(2006)&lt;/code&gt; retorna &quot;dois mil e seis&quot;.&lt;br&gt;
Não que não exista mais nenhum algoritmo para isso; acontece que quis criar o meu próprio de tal forma que ele seja de fácil implementação em &lt;b&gt;C&lt;/b&gt;, e que seja portável para outras linguagens, no sentido mais extenso (tanto linguagens computacionais, como Perl, Java, PHP; como linguagens humanas, como inglês, espanhol, russo).&lt;br&gt;
Funciona da seguinte maneira: os números são &quot;decompostos&quot; em sub-unidades  maiores possíveis às quais nós, humanos, damos nomes. No exemplo do 2006, há 2 unidades: &quot;dois mil&quot; e &quot;seis&quot;. Essa operação é feita através do velho e bom resto da divisão, sem ter que converter o número em &lt;i&gt;string&lt;/i&gt; e processá-la dígito por dígito.&lt;br&gt;
Na realidade, comecei programando-o em Perl, depois traduzi para &lt;b&gt;C&lt;/b&gt;, refinei, otimizei, aí traduzi de volta para o Perl &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
Não sei se está gramaticalmente correto; porém está perfeitamente compreensível. Acredito que o mesmo algoritmo poderá ser reaproveitado para inglês e russo. Porém isso fica a cargo do leitor!&lt;br&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Thu, 20 Apr 2006 01:37:14 -0300</pubDate>
</item>
<item>
 <title>knuckle cracker</title>
 <link>http://sysd.org/stas/node/9</link>
 <description>&lt;p&gt;
This project is a response to the urge to make small changes to the big binary files. For text files, there are &lt;code&gt;diff/patch&lt;/code&gt; utilities; and for big changes, &lt;code&gt;rsync&lt;/code&gt;
is perfect. Now, if&amp;nbsp; you&#039;re sharing something like a game mod,
where you need to swap a single bit inside a huge data file (just like
in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Hot_coffee&quot; target=&quot;_blank&quot;&gt;Hot Coffee Mod&lt;/a&gt; for &lt;a href=&quot;http://en.wikipedia.org/wiki/Grand_Theft_Auto:_San_Andreas&quot; target=&quot;_blank&quot;&gt;GTA San Andreas&lt;/a&gt; &lt;code&gt;&lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;/code&gt;, you&#039;re frequently forced to share the entire file. By the other side, if you need to update some
firmware glitch, why should you rewrite the entire flash chip?! So, here&#039;s my proposal.&lt;br&gt;
&lt;code&gt;bin_diff&lt;/code&gt; utility will compare two binary files and output a human-readable (and writable &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; script file, just like this:&lt;br&gt;
&lt;pre&gt;[bb35cc23dda6737d181a63ea3203f0ff engine.dll]&lt;br&gt;50	&quot;This program must be run under Win32\xd\xa$&quot;&lt;br&gt;d60a	EB&lt;br&gt;d77b	90 90&lt;br&gt;da3f	E9&lt;br&gt;da41	1 0&lt;br&gt;ea44	90&lt;br&gt;# Patch length: 0000007A&lt;br&gt;&lt;/pre&gt;
First line contains a name of the file to be patched, and it&#039;s MD5
checksum value. Following lines start with a hex offset inside this
file, and the new byte(s) value. Note that strings with &lt;b&gt;C&lt;/b&gt;-like escaping style are supported! You may also comment each line, using the hash character (&lt;code&gt;#&lt;/code&gt;).
Several files may be patched by a single patch-script. The last string
in the last line is a hex value of the patch data length. It is useful
to make self-applicable patches.&lt;br&gt;
Then, &lt;code&gt;knuckle_cracker&lt;/code&gt; may be used to parse the
patch-script and apply modifications to the files. It will check the
MD5 checksum for each file automatically (and will refuse to patch unmatched files). You can also make the
self-applicable patches, concatenating the patch-script directly at the
end of the &lt;code&gt;knuckle_cracker&lt;/code&gt; executable (following example works on UN*X systems, for Windows box, use any hex editor, it works just the same):&lt;br&gt;
&lt;pre&gt;cat knuckle_cracker engine.bin_patch &amp;gt; engine_patcher&lt;br&gt;&lt;/pre&gt;
Both &lt;code&gt;bin_diff&lt;/code&gt; &amp;amp; &lt;code&gt;knuckle_cracker&lt;/code&gt; are very portable: I tested them on Linux, FreeBSD (gcc) &amp;amp; Win32 (Borland C/CYGWIN/MinGW/MSVC).
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;P.S. -&lt;/b&gt; all sources has DOS line endings (CRLF), use&lt;br&gt;
&lt;code&gt;&quot;unzip -aa knuckle_cracker.zip&quot;&lt;/code&gt; to extract on UN*X systems.
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/19">C</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/12">windows</category>
 <pubDate>Wed, 19 Apr 2006 02:42:33 -0300</pubDate>
</item>
</channel>
</rss>
