Barcode_World
CAUTION : this is not a retired challenge so I cannot post all the whole spiral into madness step by step as much as I want to. that is going into a text post and will be posted along w the script when the challenge IS retired.
for scripts visit github at https://github.com/dakshita-joshi/BarcodeReader/tree/main
alright so this is a challenge I had begun before my laptop began dying a slow slow death and I lost everything like a londoner in 1666 (too soon?). the challenge said how much do you know about the history of barcodes and I, LIKE A FOOL began to research everything about the history of barcodes, who invented them and why (without even LOOKING at what was in the zip file. hello?)
When I did look I saw the barcode and the number at the bottom and the empty spaces and obviously these were ASCII numbers. i charted out the first few and it begin to spell something (again, cant say more :( it is very ANNOYINGG). this is about when God decided to smite me and humble me and destroy my laptop from the inside out. herefromnowonforth, I will begin again. (YES GRAMMARLY ADD THAT TO THE DICTIONARY)
so I use the old script I made to tesseract words out of my CTF I did in august.
did a trial test of one png and it isn't reading the number at the bottom. >:( is it too small? how far can I take the dpi value?
took a brief break to do a couple btlo challenges but I'm back at it again at krispy kreme's.
back again after a not so brief break.
this tesseract is very obviously failing. i think the image is too small and even after convert, resizing, psm 12(whatever that means) it either doesnt read anything or keeps returning empty page. i have two ideas at this point. i either find a way to make this work thru tesseract, resize, crop, filter the image or some other manipulations so only the number has to be read and not the barcode, or i rlly have to get into making a barcode scanner. which, i found a website that does it and says this is code128. so if i could get the source code of this online app, or write a bash script which uploads the png files on the app and downloads the result and concatenates them into a file (YEUGH)
right, preparing a script from scratch. using pyzbar and opencv. thank you internet for the help.
wow made the script. not even 20 minutes? i postponed this for a month????
ok that printed out all the numbers. ok so i know it works
ok those are NOT the right numbers. hmmm
let me take out 10 numbers and put them in another folder and run the script on these and see whats wrong
so its reading right but the order was wrong. so its a glob issue
so what it SHOULD read is
65 32 98
123456789
but its reading
6589 32
31287645
so. glob is a wrapper around os.listdir. I did ls to find out what the order shown is and it wasnt in a direct numerical order. so that is the problem. stackoverflow said to use sorted with glob so let me try that
so i used sort with ls and that didnt give me the right order either sort -V did so???? hm
lemme try sorted with glob and then see next
YES THAT WORKED
mm now to implement it in the full file
nope, not working yet
so i wc -l the output and its 18748 which is twice the number of pictures 9374 so why is it outputting twice??
it didnt output twice when i separated into another folder AAAUGH
stack overflow says glob isnt meant to work with such high ranges and to implement your own filtering but let me try with [] bracket ranges first and then see if that works.
no, that only read the first 9 files lol.
what i could do, instead of writing my own list dir function, i could write a bash script that calls these files by ls | sort -V, passes the image to the script, reads the barcode and then converts it to ascii, sends it back to the bash script which appends it to the text file. that is a heavy ass script tho, ew
so alot of all that and a lot of errors and debugging later(that i didnt even write down because honestly i was screaming) i have managed to successfully have a txt file that writes the ascii characters for the sample 9 png files, i still get the annoying b' thing and decoding to utf doesnt work because the spaces also go away and honestly im too tired to figure it out. im just gonna get that txt file, remove the b' and put it into cyberchef to get the flag. if i had more time id just have it convert to ascii in the code and figure out where flag is and print only the flag but not right now. with my scattered focus it could take me a month to do that lol. anyway.
so now let me port this shell script and python script to the big daddy folder.
pray for me
A barcode (also spelled bar code) is a method of r
PARTIAL SUCCESS BAYBEYY
ok now gotta do it for like 9000 pngs wow this will take years on this raggedy ass laptop
A barcode (also spelled bar code) is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by var
ooooooh
when i tell you this sat on my laptop for months and i didnt do this and it only took like half a day
A barcode (also spelled bar code) is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by varying the widths and spacings of parallel lines. These barcodes, now commonly refe
this is like watching one of those discovery channel nature videos of an elephant being born.
aiyyo this is huge i should have only extracted flag :(
A barcode (also spelled bar code) is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by varying the widths and spacings of parallel lines. These barcodes, now commonly referred to as linear or one-dimensional (1D), can be scanned by special optical scanners, called barcode readers. Later, two-dimensional (2D) variants were developed, using rectangles, dots, hexagons and other geometric patterns, called matrix codes or 2D barcodes, although they do not use bars as such. 2D barcodes can be read or d
how big is this going to be my laptop is heating up
this just wont end????
ok so this is just ripped off of wikiversity
ugh
what if i converted the wikiversity article to ascii and then just compared what was off
no, but that would still need the script to run fully so whats the point.
i will have to ice this laptop if this doesnt finish soon
EVEN THE BATTERY'S DYING!!!!
quicklyyyyyyyyy
all this to only have the flag be like WEL0V3BTL0 or something :/
i havent posted the text in a while have i
A barcode (also spelled bar code) is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by varying the widths and spacings of parallel lines. These barcodes, now commonly referred to as linear or one-dimensional (1D), can be scanned by special optical scanners, called barcode readers. Later, two-dimensional (2D) variants were developed, using rectangles, dots, hexagons and other geometric patterns, called matrix codes or 2D barcodes, although they do not use bars as such. 2D barcodes can be read or deconstructed using application software on mobile devices with inbuilt cameras, such as smartphones. The barcode was invented by Norman Joseph Woodland and Bernard Silver and patented in the US in 1951 (US Patent 2,612,994). The invention was based on Morse code[1] that was extended to thin and thick bars. However, it took over twenty years before this invention became commercially successful. An early use of one type of barcode in an industrial context was sponsored by the Association of American Railroads in the late 1960s. Developed by General Telephone and Electronics (GTE) and called KarTrak ACI (Automatic Car Identification), this scheme involved placing colored stripes in various combinations on steel plates which were affixed to the sides of railroad rolling stock. Two plates were used per car, one on each side, with the arrangement of the colored stripes encoding information such as ownership, type of equipment, and identification number.[2] The plates were read by a trackside scanner, located for instance, at the entrance to a classification yard, while the car was moving past.[3] This is the flag - #############(I wont post the answer here because I don't think this is a retired challenge). The project was abandon
oh shit the flags here
lol i wouldnt have noticed otherwise
well
should i let it go on? or should i ctrl + C and go to sleep?
ill let it go on till i answer the question and then ill sleep
OKAYYY!!
this was how long i let it go
A barcode (also spelled bar code) is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by varying the widths and spacings of parallel lines. These barcodes, now commonly referred to as linear or one-dimensional (1D), can be scanned by special optical scanners, called barcode readers. Later, two-dimensional (2D) variants were developed, using rectangles, dots, hexagons and other geometric patterns, called matrix codes or 2D barcodes, although they do not use bars as such. 2D barcodes can be read or deconstructed using application software on mobile devices with inbuilt cameras, such as smartphones. The barcode was invented by Norman Joseph Woodland and Bernard Silver and patented in the US in 1951 (US Patent 2,612,994). The invention was based on Morse code[1] that was extended to thin and thick bars. However, it took over twenty years before this invention became commercially successful. An early use of one type of barcode in an industrial context was sponsored by the Association of American Railroads in the late 1960s. Developed by General Telephone and Electronics (GTE) and called KarTrak ACI (Automatic Car Identification), this scheme involved placing colored stripes in various combinations on steel plates which were affixed to the sides of railroad rolling stock. Two plates were used per car, one on each side, with the arrangement of the colored stripes encoding information such as ownership, type of equipment, and identification number.[2] The plates were read by a trackside scanner, located for instance, at the entrance to a classification yard, while the car was moving past.[3] This is the flag - ###############. The project was abandoned after about ten years because the system proved unreliable after long-term use.[2] Barcodes became commercially successful when they were used to automate supermarket checkout systems, a
ok good night

Comments
Post a Comment