Basic question: how to input non-printable hex values in GDB / NC? [duplicate]

This question already has an answer here:

  • Managing inputs for payload injection?

    1 answer

I’m working on a CTF challenge that is an introduction to smashing the stack. I have the binary working in GDB, and can overwrite the correct part of the stack with printable characters.

The challenge, however, is that the binary expects 0xdeadbeef in the correct stack location – and I’m a bit stumped on how to input that value. I’ve seen examples online where python is used to supply hex values as the argument to the binary – but this particular binary runs, prints a query message, THEN expects input, instead of just reading an argument.

What is the best way to handle this, initially in GDB to confirm my approach, and then using NC to receive the actual flag? I’m working on Ubuntu.

Apologies for asking a basic question, but this has been tripping me up.

Thank you!

All topic

Basic question: how to input non-printable hex values in GDB / NC?

I’m working on a CTF challenge that is an introduction to smashing the stack. I have the binary working in GDB, and can overwrite the correct part of the stack with printable characters.

The challenge, however, is that the binary expects 0xdeadbeef in the correct stack location – and I’m a bit stumped on how to input that value. I’ve seen examples online where python is used to supply hex values as the argument to the binary – but this particular binary runs, prints a query message, THEN expects input, instead of just reading an argument.

What is the best way to handle this, initially in GDB to confirm my approach, and then using NC to receive the actual flag? I’m working on Ubuntu.

Apologies for asking a basic question, but this has been tripping me up.

Thank you!

All topic

How to split an image into some parts in order to be printable on an A4 paper?

I would greatly appreciate if you could let me know how to enlarge the image printed on this pdf, split it into some parts and then, print it on A4 paper. It should be mentioned that each part should have it’s own page number when it is inserted to the word document.

Also, it should be noted that A4 paper margins are: Top: 3cm, Bottom: 3cm, Left: 3, and Right: 4.

All topic

Can I save image created in PowerPoint as a printable vector?

I was asked to create a logo to be printed on a large number of t-shirts for an event. I designed the logo in PowerPoint using text, shapes and a .png image. The people from the printing company said that they need it in vector format (corel, adobe illustrator or editable pdf). I exported the logo as a .emf / .pdf file, but they say the image is still bitmap and they need it in vector file. Is there a way to export the image from PowerPoint so that they can print it?

All topic

Printable case design for Rpi 3B+

I am looking for a proper paper printable case design for pi 3B+.

I’m talking about the latest 2018 model. Tried searching for it online, but I only got designs for older Rpi models.

All topic

printable case design for Rpi 3 b+

please link me to a proper paper printable case design for pi 3 b+

I’m talking about the latest 2018 model

Tried searching for it online, but I only got designs for older Rpi models.

Please help!

All topic

Print the ASCII printable character set

Challenge: Print the entire printable ASCII charset (not just a range!) in order.

[space]!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Of course, replace space with the actual space character.)

Rules: read closely

  • No other characters allowed in the output.

  • Program/function does not accept input.

  • Try not to hardcode/embed the output.

  • This is code golf, shortest answer wins.

All topic

Print the ASCII printable character set

Challenge: Print the entire printable ASCII charset (not just a range!) in order.

[space]!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Of course, replace space with the actual space character.)

Rules: read closely

  • No other characters allowed in the output.

  • Program/function does not accept input.

  • Try not to hardcode/embed the output.

  • This is code golf, shortest answer wins.

All topic

Dropping a table with a non-printable character in its name

I have a legacy table with a name containing non-printable characters (CHAR(31), to be specific).

The non-printable character is beside a underscore, and I’ve discovered that the shortcut CTRL+SHIFT+_ creates the CHAR(31) character (which means “US” – Unit Separator). The previous developer could have hit this combination by mistake, and created the table with this weird character in it.

When we issue a SELECT command against the table, it returns results. But when we try to issue any DDL against it (DROP, sp_rename, etc), the character causes a problem.

Examples:

DROP TABLE Table_Name;

Raises:

Msg 15225 – No item by the name of ‘Table_Name’ could be found in the current database ‘MyDB’, given that @itemtype was input as ‘(null)’.

EXEC sp_rename N'Table_Name', N'NewTableName'; 

Raises:

Msg 102 – Incorrect syntax near ‘_Name’.

I already duplicated the table with the correct name, and have corrected it on the dependent objects. The remaining step is just dropping it from the database.

Just an insight: when we copy+paste from SQL Server to Notepad++, it shows the hidden character (“US”) on the middle of the table name, beside the underscore:

Unit Separator (CHAR(31)) character

All topic

How do I quote an identifier in SQL Server with non-printable characters?

I have a legacy table with a name containing non-printable characters (CHAR(31), to be specific).

The non-printable character is beside a underscore, and I’ve discovered that the shortcut CTRL+SHIFT+_ creates the CHAR(31) character (which means “US” – Unit Separator). The previous developer could have hit this combination by mistake, and created the table with this weird character on it.

When we issue a SELECT command against the table, it returns results. But when we try to issue any DDL against it (DROP, sp_rename, etc), the character causes a problem.

Examples:

DROP TABLE Table_Name;

Raises:

Msg 15225 – No item by the name of ‘Table_Name’ could be found in the current database ‘MyDB’, given that @itemtype was input as ‘(null)’.

EXEC sp_rename N'Table_Name', N'NewTableName'; 

Raises

Msg 102 – Incorrect syntax near ‘_Name’.

I already duplicated the table with the correct name, and have corrected it on the dependent objects. The remaining step is just dropping it from the database.

Just an insight: when we copy+paste from SQL Server to Notepad++, it shows the hidden chacacter (“US”) on the middle of the table name, beside the underscore:

Unit Separator (CHAR(31)) character

All topic